:root {
  color-scheme: light;
  --background: #fff9f1;
  --surface: #fff;
  --ink: #354b37;
  --muted: #6c7565;
  --green: #617d51;
  --green-dark: #526d45;
  --green-light: #e3ecd5;
  --blue-light: #dfe9ed;
  --beige: #f2eee2;
  --expiry-urgent: #92551f;
  --expiry-urgent-bg: #fbe7d2;
  --expiry-expired: #a94f47;
  --expiry-expired-ink: #92463f;
  --expiry-expired-bg: #f7ddda;
  --line: #e8e3da;
  --surface-warm: #fffcf7;
  --control-line: #d8d3c7;
  --green-hover: #465f3a;
  --primary-bg: var(--green-dark);
  --on-primary: var(--surface);
  --blue-ink: #4c6e79;
  --beige-ink: #74644d;
  --danger-fill: var(--expiry-expired-ink);
  --on-danger: var(--surface);
  --notification-bg: var(--ink);
  --notification-ink: var(--surface);
  --dialog-shadow: #354b3719;
  --floating-shadow: #354b3722;
  --dialog-backdrop: #25362761;
  --radius: 20px;
  --footer-space: calc(78px + env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans CJK KR", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
  scroll-padding-bottom: var(--footer-space);
  -webkit-text-size-adjust: 100%;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #181d19;
  --surface: #252d27;
  --ink: #e8ede2;
  --muted: #afbba8;
  --green: #9ab68b;
  --green-dark: #a9c398;
  --green-light: #344936;
  --blue-light: #30434c;
  --beige: #493e34;
  --expiry-urgent: #e8ba83;
  --expiry-urgent-bg: #493826;
  --expiry-expired: #f0a9a1;
  --expiry-expired-ink: #f0a9a1;
  --expiry-expired-bg: #4a3030;
  --line: #39453b;
  --surface-warm: #202822;
  --control-line: #69796a;
  --green-hover: #aac39d;
  --primary-bg: #9ab68b;
  --on-primary: #182219;
  --blue-ink: #bdd7df;
  --beige-ink: #e3cdb6;
  --danger-fill: #f0a9a1;
  --on-danger: #332326;
  --notification-bg: #344936;
  --notification-ink: #e8ede2;
  --dialog-shadow: #0b100c4d;
  --floating-shadow: #0b100c42;
  --dialog-backdrop: #0b100c9e;
  scrollbar-color: #69796a var(--background);
}

[data-theme="dark"] .overview-art,
[data-theme="dark"] .shopping-art,
[data-theme="dark"] .empty-art,
[data-theme="dark"] .place-illustration img { filter: brightness(.86) saturate(.9); }

[data-theme="dark"] .place-card[data-type="all"] .place-illustration img { display: none; }
[data-theme="dark"] .place-card[data-type="all"] .place-illustration::before {
  content: "";
  width: 20px;
  height: 20px;
  background: var(--green-dark);
  -webkit-mask: url('../assets/grid.png') center / contain no-repeat;
  mask: url('../assets/grid.png') center / contain no-repeat;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .68; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.page-width {
  --page-left: max(16px, env(safe-area-inset-left));
  --page-right: max(16px, env(safe-area-inset-right));
  width: min(100%, calc(1080px + var(--page-left) + var(--page-right)));
  margin-inline: auto;
  padding-left: var(--page-left);
  padding-right: var(--page-right);
}

.site-header { padding-top: env(safe-area-inset-top); background: var(--surface-warm); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 65px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.0625rem; font-weight: 750; letter-spacing: -.045em; }
.brand-mark { display: grid; place-items: center; flex: none; border-radius: 12px; width: 38px; height: 38px; background: var(--primary-bg); color: var(--on-primary); }
.brand-mark .icon { width: 23px; height: 23px; }
.version { padding: 5px 9px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: .8125rem; font-weight: 650; }

.main { padding-block: 30px calc(var(--footer-space) + 26px); }
.pwa-offline, .pwa-update { margin-bottom: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px; font-size: .875rem; }
.pwa-offline { background: var(--surface-warm); color: var(--muted); }
.pwa-update { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; background: var(--green-light); color: var(--ink); }
.pwa-settings-card { margin-top: 8px; }
.pwa-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pwa-settings-actions:not(:has(button:not([hidden]))) { display: none; }
#pwa-install-button { margin-top: 8px; }
#pwa-install svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-heading h1 { font-size: clamp(1.625rem, 4.6vw, 1.875rem); letter-spacing: -.045em; font-weight: 780; line-height: 1.25; }
.page-heading h1:focus { outline: none; }
.greeting { margin-bottom: 4px; color: var(--green-dark); font-weight: 660; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 11px; }
.section-heading h2, .settings-group h2 { font-size: clamp(1.1875rem, 3.6vw, 1.3125rem); letter-spacing: -.04em; font-weight: 750; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 14px; min-height: 48px; max-width: 100%; padding: 10px 15px; font-weight: 700; line-height: 1.25; text-align: center; }
.primary { background: var(--primary-bg); color: var(--on-primary); }
.secondary { background: var(--surface); color: var(--green-dark); border-color: var(--control-line); }
.compact { min-height: 44px; padding-inline: 11px; font-size: .9375rem; }
.button .icon { width: 19px; height: 19px; }
.icon-button { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border: 0; border-radius: 13px; background: var(--beige); color: var(--ink); }
@media (hover: hover) {
  .primary:hover { background: var(--green-hover); }
  .secondary:hover, .icon-button:hover { background: var(--green-light); }
}

.overview { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); gap: 12px; }
.overview-stat { position: relative; min-width: 0; text-align: left; color: var(--ink); border: 1px solid transparent; border-radius: var(--radius); font-weight: 690; }
.overview-stat[aria-pressed="true"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.overview-total { display: grid; justify-items: start; align-content: center; gap: 5px; min-height: 192px; padding: 18px 48% 18px 27px; background: var(--green-light); }
.overview-total > span { position: relative; z-index: 1; }
#overview-scope { color: var(--green-dark); font-size: .875rem; overflow-wrap: anywhere; }
.overview-label { font-size: 1rem; font-weight: 740; word-break: keep-all; }
.overview-count { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px; line-height: 1.04; }
.overview-count strong { font-size: 1.875rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.overview-total .overview-count { margin-top: 2px; }
.overview-total .overview-count strong { font-size: clamp(2.375rem, 8vw, 3.75rem); letter-spacing: -.055em; }
.overview-art { position: absolute; inset: 0 9px 0 auto; width: 52%; height: 100%; object-fit: contain; object-position: center; pointer-events: none; }
.overview-alerts { display: grid; gap: 10px; grid-template-rows: repeat(2, minmax(0, 1fr)); }
.overview-alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 68px; padding: 12px; }
.overview-alert[data-expiry="urgent"] { color: var(--expiry-urgent); background: var(--expiry-urgent-bg); }
.overview-alert[data-expiry="expired"] { color: var(--expiry-expired-ink); background: var(--expiry-expired-bg); }
.overview-alert[data-expiry="expired"] .overview-status-icon { color: var(--expiry-expired); }
.overview-status-icon { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid currentColor; border-radius: 50%; }
.overview-status-icon svg { width: 23px; height: 23px; }
@media (hover: hover) { .overview-stat:hover { border-color: currentColor; } }

.fridge-search { margin-block: 16px 23px; }
.search-field { position: relative; min-width: 0; }
.search-field input { width: 100%; min-height: 50px; padding: 9px 52px 9px 47px; border: 1px solid var(--control-line); border-radius: 14px; background: var(--surface); color: var(--ink); font-size: 1rem; }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.search-field input::-webkit-search-cancel-button { appearance: none; }
.search-field .icon-button { position: absolute; inset: 2px 3px auto auto; background: transparent; }
.search-icon { position: absolute; inset: 14px auto auto 15px; width: 22px; height: 22px; color: var(--green-dark); pointer-events: none; }

.fridge-workspace { display: grid; grid-template-columns: minmax(240px, .82fr) minmax(0, 1.65fr); gap: 22px; align-items: start; }
.storage-section, .inventory-section { min-width: 0; }
.place-cards { display: grid; gap: 7px; margin-bottom: 9px; }
.place-card { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 64px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-align: left; }
.place-card[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); }
.place-illustration { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 13px; background: var(--green-light); }
.place-illustration img { width: 34px; height: 34px; }
.place-card[data-type="all"] img { width: 20px; height: 20px; }
.place-card[data-type="all"][aria-pressed="true"] .place-illustration { background: var(--surface-warm); }
.place-card[data-type="freezer"] .place-illustration { background: var(--blue-light); }
.place-card[data-type="pantry"] .place-illustration, .place-card[data-type="other"] .place-illustration, .place-card[data-type="kimchi"] .place-illustration { background: var(--beige); }
.place-card-copy { display: grid; flex: 1; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.place-card-name { line-height: 1.25; }
.place-card-zones, .place-card-count, .filter-count, .list-count { color: var(--muted); font-size: .875rem; line-height: 1.35; }
.place-card-count { flex: none; font-weight: 720; font-variant-numeric: tabular-nums; }

.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-bottom: 10px; }
.filter { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 48px; padding: 7px 4px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.filter[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); }
.filter .category-icon { width: 25px; height: 25px; border-radius: 8px; }
.filter .icon { width: 16px; height: 16px; }
.filter-text { display: grid; gap: 2px; line-height: 1.15; }
.filter-text strong { font-size: .9375rem; font-weight: 750; }
.category-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; }
.tone-all, .tone-fridge { background: var(--green-light); color: var(--green-dark); }
.tone-freezer { background: var(--blue-light); color: var(--blue-ink); }
.tone-pantry { background: var(--beige); color: var(--beige-ink); }
.list-options { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.list-options select, .place-filter select { background: var(--surface); }
.filter-note { margin-bottom: 9px; color: var(--muted); font-size: .9375rem; }
.storage-help { margin-block: 6px; color: var(--muted); font-size: .9375rem; line-height: 1.5; }

.items { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.upcoming-section { padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-warm); }
.upcoming-section h3 { margin-bottom: 8px; font-size: 1.0625rem; letter-spacing: -.025em; }
.upcoming-section .items { gap: 5px; }
.upcoming-item { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; width: 100%; min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); text-align: left; overflow-wrap: anywhere; }
.upcoming-item > span:first-child { display: grid; flex: 1; min-width: 100px; gap: 2px; }
.upcoming-location { color: var(--muted); font-size: .875rem; }
.item-button { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--ink); text-align: left; }
.item-body { display: grid; flex: 1; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
.item-title { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.item-name { min-width: 0; font-size: 1.0625rem; font-weight: 740; overflow-wrap: anywhere; }
.expiry-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 8px; background: var(--beige); color: var(--muted); font-size: .875rem; font-weight: 740; font-variant-numeric: tabular-nums; }
.expiry-badge[data-status="urgent"] { background: var(--expiry-urgent-bg); color: var(--expiry-urgent); }
.expiry-badge[data-status="expired"] { background: var(--expiry-expired-bg); color: var(--expiry-expired-ink); }
.expiry-badge[data-status="later"] { background: var(--green-light); color: var(--green-dark); }
.expiry-badge[data-status="urgent"]::before, .expiry-badge[data-status="expired"]::before { content: "!"; display: grid; place-items: center; width: 12px; height: 12px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; line-height: 1; }
.item-meta, .item-placement, .item-dates, .item-notes { line-height: 1.4; font-size: .875rem; color: var(--muted); }
.item-placement { color: var(--green-dark); font-weight: 650; }
.item-notes { white-space: pre-wrap; }
.item-edit { display: grid; place-items: center; align-self: center; flex: none; width: 32px; height: 32px; border-radius: 9px; color: var(--green-dark); }
@media (hover: hover) {
  .filter:hover, .item-button:hover, .upcoming-item:hover, .place-card:hover { border-color: var(--green); }
  .item-button:hover .item-edit, .row-main:hover { background: var(--green-light); }
}

.empty-state { display: grid; justify-items: center; text-align: center; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.empty-art { width: 145px; height: 90px; object-fit: contain; margin-bottom: 5px; }
.empty-state h2, .empty-state h3 { font-size: 1.1875rem; letter-spacing: -.03em; line-height: 1.4; word-break: keep-all; }
.empty-state p { margin-top: 5px; color: var(--muted); line-height: 1.5; word-break: keep-all; }
.empty-state .button { margin-top: 12px; }

.shopping-progress { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, 32%); align-items: center; gap: 12px; padding: 18px 24px; border-radius: var(--radius); background: var(--green-light); color: var(--ink); }
.shopping-progress-content { min-width: 0; }
.shopping-progress .section-heading { margin-bottom: 9px; }
#shopping-percent { font-size: 1.625rem; font-variant-numeric: tabular-nums; }
#shopping-progress-bar { display: block; width: 100%; height: 11px; border: 0; border-radius: 8px; background: var(--surface-warm); accent-color: var(--green); overflow: hidden; }
#shopping-progress-bar::-webkit-progress-bar { background: var(--surface-warm); }
#shopping-progress-bar::-webkit-progress-value { background: var(--green-dark); border-radius: 8px; }
#shopping-progress-bar::-moz-progress-bar { background: var(--green-dark); border-radius: 8px; }
#shopping-progress-text { margin-top: 9px; color: var(--ink); font-size: .9375rem; font-weight: 650; }
.shopping-art { width: 100%; height: min(150px, 22vw); min-height: 74px; object-fit: contain; }
.shopping-section, #shopping-error { margin-top: 20px; }
.shopping-item { border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.shopping-item-top { display: flex; align-items: center; gap: 4px; padding-inline-end: 12px; }
.shopping-check { display: flex; align-items: center; flex: 1; min-width: 0; min-height: 66px; gap: 12px; padding: 11px 8px 11px 16px; cursor: pointer; }
.shopping-check input, .delete-shopping-option input { flex: none; width: 27px; height: 27px; margin: 0; accent-color: var(--green-dark); cursor: pointer; }
.shopping-item.purchased { background: var(--green-light); transition: background-color .15s ease; }
.shopping-item.purchased .item-name { color: var(--green-dark); text-decoration: line-through; }
.shopping-edit { background: var(--surface-warm); }
.shopping-item-actions { display: flex; justify-content: flex-end; padding: 0 12px 11px; }
.shopping-transfer { background: var(--surface-warm); }
#shopping-confirm-text { line-height: 1.55; overflow-wrap: anywhere; }

.settings-brand { display: flex; align-items: center; gap: 15px; padding: 20px; border-radius: var(--radius); background: var(--green-light); }
.settings-brand .brand-mark { width: 54px; height: 54px; border-radius: 16px; }
.settings-brand .brand-mark .icon { width: 32px; height: 32px; }
.settings-brand strong { font-size: 1.25rem; }
.settings-brand p { margin-top: 4px; color: var(--green-dark); font-size: .875rem; font-weight: 650; }
.settings-group { margin-top: 21px; }
.settings-group h2 { margin-bottom: 8px; }
.settings-row, .settings-guide { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.settings-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px; }
.settings-row p, .settings-guide-body p { margin-top: 4px; color: var(--muted); line-height: 1.5; }
.settings-guide summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; font-weight: 700; cursor: pointer; list-style: none; }
.settings-guide summary::-webkit-details-marker { display: none; }
.settings-guide summary::after { content: ""; width: 8px; height: 8px; margin-inline-start: auto; border: solid var(--green-dark); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.settings-guide[open] summary::after { transform: rotate(225deg); }
.settings-guide-body { margin: 0 16px 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.theme-options { display: grid; gap: 7px; }
.theme-choice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 64px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; }
.theme-choice:has(input:checked) { background: var(--green-light); border-color: var(--green); }
.theme-choice:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 2px; }
.theme-choice small { display: block; margin-top: 3px; color: var(--muted); font-size: .875rem; line-height: 1.4; }
.theme-choice svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-choice input { width: 23px; height: 23px; margin: 0; accent-color: var(--primary-bg); }
#theme-error { margin-top: 8px; }
.data-card { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.data-intro { display: flex; align-items: center; gap: 12px; }
.data-intro p, .recovery-panel p, .data-danger p { margin-top: 4px; color: var(--muted); line-height: 1.5; }
.data-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
.data-totals > div { display: grid; grid-template-rows: 1fr auto; gap: 5px; min-width: 0; padding: 9px 7px; border-radius: 12px; background: var(--beige); text-align: center; }
.data-totals dt { color: var(--muted); font-size: .875rem; line-height: 1.35; word-break: keep-all; }
.data-totals dd { margin: 0; color: var(--ink); font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.backup-date { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; padding-top: 11px; border-top: 1px solid var(--line); }
#last-backup-date { color: var(--muted); }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.data-actions .button { flex: 1 1 125px; }
.recovery-panel { padding: 13px; border-radius: 13px; background: var(--blue-light); }
.recovery-panel .button { margin-top: 9px; }
.data-danger { border-color: var(--expiry-expired-bg); background: var(--surface-warm); }
.data-danger .button { justify-self: start; }
.backup-filename { padding: 10px; border-radius: 10px; background: var(--beige); overflow-wrap: anywhere; }
#backup-download { text-decoration: none; }

.site-nav { position: fixed; z-index: 2; inset: auto 0 0; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--surface-warm); }
.nav-inner { display: grid; grid-template-columns: repeat(3, 1fr); width: min(100%, 450px); margin-inline: auto; padding: 5px 8px; }
.site-nav a { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 55px; border-radius: 14px; color: var(--muted); font-size: .875rem; font-weight: 700; text-decoration: none; }
.nav-icon { display: grid; place-items: center; width: 58px; height: 29px; border-radius: 12px; }
.site-nav [aria-current="page"] { color: var(--green-dark); }
.site-nav [aria-current="page"] .nav-icon { background: var(--green-light); }
@media (hover: hover) { .site-nav a:hover .nav-icon { background: var(--green-light); } }
dialog { width: min(100% - 24px, 520px); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface-warm); color: var(--ink); box-shadow: 0 12px 28px var(--dialog-shadow); }
dialog::backdrop { background: var(--dialog-backdrop); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px 9px; }
.dialog-heading h2 { font-size: 1.3125rem; letter-spacing: -.035em; }
.form-fields { display: grid; gap: 12px; padding: 6px 17px 15px; }
.form-fields label { display: grid; gap: 5px; min-width: 0; font-weight: 650; }
.form-fields small { color: var(--muted); font-size: .8125rem; font-weight: 550; }
.form-fields input, .form-fields textarea, .select-field select { width: 100%; min-width: 0; min-height: 46px; padding: 9px 10px; border: 1px solid var(--control-line); border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 1rem; font-weight: 500; }
.form-fields input::placeholder, .form-fields textarea::placeholder { color: var(--muted); opacity: 1; }
.select-field { position: relative; min-width: 0; }
.select-field select { appearance: none; padding-inline-end: 31px; }
.select-field::after { content: ""; position: absolute; inset-inline-end: 14px; bottom: 20px; width: 7px; height: 7px; border: solid var(--green-dark); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
.form-fields textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.editor-groups { background: var(--background); padding-block: 9px 13px; }
.editor-card { display: grid; gap: 9px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.editor-card h3 { font-size: 1.125rem; letter-spacing: -.025em; }
.editor-card input, .editor-card select, .editor-card textarea { background: var(--surface-warm); }
.editor-card textarea { min-height: 92px; }
.dialog-actions { position: sticky; z-index: 1; bottom: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; padding: 10px 17px 13px; border-top: 1px solid var(--line); background: var(--surface-warm); }
#editor[open], #ingredient-form { display: flex; flex-direction: column; }
#ingredient-form { min-height: 0; }
#ingredient-form > .dialog-heading, #ingredient-form > .dialog-actions { flex: none; }
#ingredient-form > .editor-groups { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 9px; }
#ingredient-form > .dialog-actions { position: static; }
.save-button { min-width: 97px; margin-inline-start: auto; }
.danger-text { color: var(--expiry-expired-ink); background: var(--expiry-expired-bg); }
.danger { background: var(--danger-fill); color: var(--on-danger); }
#delete-dialog > p { margin: 5px 17px 12px; line-height: 1.5; overflow-wrap: anywhere; }
.notice { display: flex; align-items: flex-start; gap: 8px; padding: 11px; border: 1px solid var(--expiry-expired-bg); border-radius: 12px; background: var(--expiry-expired-bg); color: var(--expiry-expired-ink); line-height: 1.45; overflow-wrap: anywhere; }
.notice::before { content: "!"; display: grid; place-items: center; flex: none; width: 18px; height: 18px; margin-top: 2px; border: 1px solid currentColor; border-radius: 50%; line-height: 1; font-weight: 750; }
#storage-error { margin-bottom: 14px; }
.notification { position: fixed; z-index: 3; inset: auto auto var(--footer-space) 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 10px 15px; border-radius: 12px; background: var(--notification-bg); color: var(--notification-ink); pointer-events: none; }
.notification:empty { clip-path: inset(50%); }
.form-message { padding: 11px 12px; border-radius: 11px; background: var(--green-light); color: var(--ink); }
.delete-shopping-option { display: flex; align-items: center; min-height: 48px; gap: 9px; margin: 0 17px 10px; font-weight: 650; cursor: pointer; }

.manager-content { padding: 8px 17px 17px; }
.manager-content > .button { margin-bottom: 10px; }
.manager-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.manager-list + .notice { margin-top: 8px; }
.manager-row { display: flex; align-items: center; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.manager-row .row-main { display: grid; flex: 1; min-width: 0; min-height: 46px; gap: 3px; padding: 8px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; overflow-wrap: anywhere; }
.row-main span { color: var(--muted); font-size: .875rem; line-height: 1.35; }
.manager-row .icon-button { font-size: 1.125rem; border-radius: 9px; }
.manager-row .icon-button:disabled { opacity: .4; }
.place-actions { position: static; }
.zones-section { padding-top: 12px; border-top: 1px solid var(--line); }
.zones-section h3 { font-size: 1.125rem; }
#delete-area-message { line-height: 1.5; overflow-wrap: anywhere; }

.icon { display: inline-block; flex: none; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.i-fridge { --icon: url('../assets/fridge.png'); }
.i-snow { --icon: url('../assets/snow.png'); }
.i-pantry { --icon: url('../assets/pantry.png'); }
.i-grid { --icon: url('../assets/grid.png'); }
.i-cart { --icon: url('../assets/cart.png'); }
.i-settings { --icon: url('../assets/settings.png'); }
.i-plus { --icon: url('../assets/plus.png'); }
.i-close { --icon: url('../assets/close.png'); }
.i-edit { --icon: url('../assets/edit.png'); }

@keyframes view-arrive { from { opacity: .84; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  [data-page]:not([hidden]) { animation: view-arrive .16s ease-out; }
  .shopping-check input:active { transform: scale(.92); }
  .shopping-check input { transition: transform .13s ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  .shopping-item.purchased { transition: none; }
}
@media (max-width: 720px) {
  :root { scroll-padding-bottom: calc(var(--footer-space) + 68px); }
  .header-inner { min-height: 56px; }
  .main { padding-block: 19px calc(var(--footer-space) + 76px); }
  .page-heading { margin-bottom: 14px; }
  .page-add { position: fixed; z-index: 2; inset: auto max(16px, env(safe-area-inset-right)) calc(74px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); width: auto; min-height: 51px; font-size: 1.0625rem; box-shadow: 0 3px 10px var(--floating-shadow); }
  .overview { grid-template-columns: 1fr; gap: 8px; }
  .overview-total { min-height: 142px; padding: 14px 48% 14px 17px; }
  .overview-art { inset-inline-end: 3px; }
  .overview-alerts { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; gap: 8px; }
  .overview-alert { gap: 4px; min-height: 61px; padding: 7px; border-radius: 16px; }
  .overview-alert .overview-label { font-size: .875rem; }
  .overview-alert .overview-count strong { font-size: 1.4375rem; }
  .overview-alert .overview-count { font-size: .875rem; gap: 2px; }
  .overview-status-icon { width: 28px; height: 28px; }
  .overview-status-icon svg { width: 16px; height: 16px; }
  .fridge-search { margin-block: 12px 17px; }
  .fridge-workspace { grid-template-columns: minmax(0, 1fr); gap: 19px; }
  .place-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .place-card { gap: 7px; min-height: 62px; padding: 7px; }
  .place-illustration { width: 34px; height: 34px; border-radius: 10px; }
  .place-illustration img { width: 28px; height: 28px; }
  .place-card-name { font-size: .9375rem; }
  .place-card-zones, .place-card-count { font-size: .8125rem; }
  .place-card-count { align-self: flex-start; margin-top: 3px; }
  .empty-state [data-add] { display: none; }
  .notification { bottom: calc(var(--footer-space) + 57px); }
  .shopping-progress { padding: 13px 14px; grid-template-columns: minmax(0, 1fr) minmax(78px, 31%); gap: 6px; }
}
@media (max-width: 405px) {
  .date-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 365px) {
  .overview-alert { grid-template-columns: auto minmax(0, 1fr); }
  .overview-alert .overview-count { grid-column: 2; }
  .filter { gap: 2px; }
  .filter .category-icon { width: 21px; height: 21px; }
  .place-cards, .place-fields { grid-template-columns: minmax(0, 1fr); }
  .settings-row { grid-template-columns: auto minmax(0, 1fr); }
  .settings-row button { grid-column: 2; justify-self: start; }
}
