:root {
  color-scheme: light;
  --page: #f5f6f1;
  --surface: #fff;
  --surface-soft: #eef2ec;
  --surface-green: #e5f0e8;
  --ink: #1a2c25;
  --ink-soft: #42564d;
  --muted: #637168;
  --line: #e2e8e1;
  --green: #276b59;
  --green-deep: #1b5547;
  --green-tint: #d9e9df;
  --mint: #b9d8c3;
  --coral: #c75b47;
  --coral-bg: #fff0ec;
  --amber: #aa6b16;
  --amber-bg: #fff4df;
  --blue: #3d6689;
  --blue-bg: #e9f2f8;
  --shadow-sm: 0 3px 12px rgb(30 56 44 / 5%);
  --shadow-md: 0 14px 42px rgb(30 56 44 / 10%);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: hidden; background: var(--page); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: var(--page); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #72a995; outline-offset: 3px; }
::selection { color: var(--green-deep); background: #c5e4d2; }
.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; padding: 12px 16px; transform: translateY(-160%); border-radius: 10px; background: var(--ink); color: #fff; }
.skip-link:focus { transform: translateY(0); }
.app-frame { width: min(100%, 1120px); min-height: 100vh; min-height: 100dvh; margin-inline: auto; padding: 0 22px calc(94px + var(--safe-bottom)); }
.app-header { position: sticky; z-index: 20; top: 0; display: flex; height: 76px; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: var(--green); }
.brand-mark svg { width: 29px; fill: none; stroke: #f5f6f1; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.brand-name { font-family: Manrope, 'DM Sans', sans-serif; font-size: 19px; font-weight: 800; letter-spacing: -.7px; }
.brand-name span { color: var(--green); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.offline-pill { display: inline-flex; min-height: 32px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink-soft); font-size: 11px; font-weight: 600; white-space: nowrap; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: #42946f; box-shadow: 0 0 0 3px #e4f2e9; }
.offline-pill.is-offline .connection-dot { background: #c18b35; box-shadow: 0 0 0 3px #fcf0da; }
.icon-button { display: inline-grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.install-button:not([hidden]) { display: inline-grid; }
.main-content { min-height: calc(100dvh - 176px); padding-top: 10px; outline: none; }
.mobile-break { display: initial; }
.mobile-only { display: inline; }
.desktop-only { display: none; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 21px 0 24px; }
.page-heading h1 { margin: 5px 0 0; font-family: Manrope, sans-serif; font-size: clamp(26px, 7vw, 34px); line-height: 1.13; letter-spacing: -1.4px; font-weight: 800; }
.page-heading p { max-width: 550px; margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.heading-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hero-card { position: relative; overflow: hidden; display: grid; min-height: 228px; grid-template-columns: 1fr minmax(120px, 31%); align-items: center; gap: 10px; padding: 27px 25px; border-radius: var(--radius-lg); background: var(--green); color: #fff; box-shadow: 0 12px 30px rgb(39 107 89 / 16%); }
.hero-card::before, .hero-card::after { position: absolute; z-index: 0; content: ''; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; pointer-events: none; }
.hero-card::before { top: -124px; right: -88px; width: 315px; height: 315px; }
.hero-card::after { top: -74px; right: -38px; width: 215px; height: 215px; }
.hero-copy { position: relative; z-index: 1; max-width: 520px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 11px; color: #d5e9dc; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.hero-kicker::before { width: 7px; height: 7px; border-radius: 50%; background: #e0a54c; content: ''; }
.hero-card h2 { max-width: 470px; margin: 0; font-family: Manrope, sans-serif; font-size: clamp(23px, 6vw, 32px); line-height: 1.15; letter-spacing: -1px; }
.hero-card p { max-width: 430px; margin: 10px 0 18px; color: #dceae2; font-size: 13px; line-height: 1.55; }
.hero-card .button { background: #fff; color: var(--green-deep); }
.hero-art { position: relative; z-index: 1; justify-self: center; width: min(100%, 160px); aspect-ratio: 1; }
.hero-art svg { width: 100%; height: 100%; overflow: visible; }
.hero-art-orbit { fill: #fff; opacity: .08; }
.hero-art-jar { fill: #e7bd72; stroke: #f8ead0; stroke-linejoin: round; stroke-width: 4; }
.hero-art-cap { fill: #c79247; }
.hero-art-label { fill: #fff9ee; }
.hero-art-mark { fill: none; stroke: #397761; stroke-linecap: round; stroke-linejoin: round; stroke-width: 5; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 17px 0 30px; }
.stat-card { min-height: 100px; padding: 16px 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-icon { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--surface-soft); color: var(--green); }
.stat-icon svg { width: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.stat-card.is-alert .stat-icon { background: var(--coral-bg); color: var(--coral); }
.stat-card.is-warm .stat-icon { background: var(--amber-bg); color: var(--amber); }
.stat-value { margin-top: 10px; font-family: Manrope, sans-serif; font-size: 27px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat-caption { margin-top: 5px; color: var(--muted); font-size: 11px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 24px 0 13px; }
.section-heading h2 { margin: 0; font-family: Manrope, sans-serif; font-size: 18px; font-weight: 800; letter-spacing: -.55px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.text-button { display: inline-flex; min-height: 40px; align-items: center; gap: 5px; padding: 0 4px; border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.text-button svg { width: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.product-list { display: grid; gap: 10px; }
.product-card { display: grid; min-width: 0; grid-template-columns: 45px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.product-card:hover { transform: translateY(-1px); border-color: #c9d7cc; box-shadow: var(--shadow-md); }
.product-art { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 14px; background: var(--surface-green); font-size: 22px; }
.product-art.is-expired { background: var(--coral-bg); }
.product-art.is-soon { background: var(--amber-bg); }
.product-art.is-cold { background: var(--blue-bg); }
.product-main { min-width: 0; }
.product-title-button { display: block; max-width: 100%; overflow: hidden; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.product-subtitle { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.product-due { text-align: right; }
.due-badge { display: inline-flex; min-height: 26px; align-items: center; justify-content: center; padding: 0 9px; border-radius: 10px; background: var(--surface-green); color: var(--green-deep); font-size: 10px; font-weight: 700; white-space: nowrap; }
.due-badge.is-expired { background: var(--coral-bg); color: var(--coral); }
.due-badge.is-today, .due-badge.is-soon { background: var(--amber-bg); color: var(--amber); }
.product-quantity { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.product-controls { display: none; grid-column: 2 / -1; justify-content: flex-end; gap: 6px; margin-top: -2px; }
.product-card:hover .product-controls, .product-card:focus-within .product-controls { display: flex; }
.mini-action { display: inline-flex; min-height: 40px; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-soft); font-size: 11px; font-weight: 600; cursor: pointer; }
.mini-action svg { width: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.mini-action:hover { background: var(--surface-soft); }
.mini-action.is-archive { color: var(--green); }
.quick-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 20px 0 2px; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border: 1px solid transparent; border-radius: 14px; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.button:active { transform: scale(.98); }
.button svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 5px 14px rgb(39 107 89 / 18%); }
.button-primary:hover { background: var(--green-deep); }
.button-soft { border-color: #dfe9df; background: #edf3ed; color: var(--green-deep); }
.button-soft:hover { background: #e3eee5; }
.button-quiet { border-color: var(--line); background: var(--surface); color: var(--ink-soft); }
.button-quiet:hover { background: var(--surface-soft); }
.button-small { min-height: 39px; padding-inline: 12px; border-radius: 12px; font-size: 11px; white-space: nowrap; }
.button-danger { border-color: #f2d7d2; background: var(--coral-bg); color: var(--coral); }
.empty-state { display: grid; min-height: 235px; place-items: center; padding: 28px 22px; border: 1px dashed #cdd8cf; border-radius: var(--radius-md); background: rgb(255 255 255 / 45%); text-align: center; }
.empty-illustration { display: grid; width: 62px; height: 62px; place-items: center; margin-bottom: 12px; border-radius: 21px; background: var(--surface-green); color: var(--green); }
.empty-illustration svg { width: 30px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.empty-state h3 { margin: 0; font-family: Manrope, sans-serif; font-size: 16px; letter-spacing: -.4px; }
.empty-state p { max-width: 300px; margin: 7px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.empty-state .button { min-height: 40px; }
.shelf-toolbar { display: grid; gap: 12px; margin: 20px 0 16px; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; top: 50%; left: 14px; width: 19px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; pointer-events: none; }
.search-input { width: 100%; min-height: 49px; padding: 0 15px 0 43px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--ink); font-size: 16px; box-shadow: var(--shadow-sm); }
.search-input::placeholder { color: #9aa49c; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; padding: 1px 1px 5px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { display: inline-flex; min-height: 40px; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 600; cursor: pointer; }
.filter-chip.is-active { border-color: var(--green); background: var(--green); color: #fff; }
.filter-count { display: inline-grid; min-width: 18px; height: 18px; place-items: center; padding: 0 4px; border-radius: 9px; background: rgb(255 255 255 / 22%); font-size: 9px; }
.shelf-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 1px 11px; color: var(--muted); font-size: 11px; }
.sort-select { max-width: 170px; min-height: 42px; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-soft); font-size: 16px; }
.shelf-group + .shelf-group { margin-top: 22px; }
.shelf-group-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.section-count { font-weight: 500; letter-spacing: 0; text-transform: none; }
.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.insight-card { min-height: 134px; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.insight-card .stat-icon { width: 33px; height: 33px; }
.insight-card strong { display: block; margin-top: 13px; font-family: Manrope, sans-serif; font-size: 25px; font-weight: 800; letter-spacing: -.8px; }
.insight-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.insight-card.is-green { background: var(--surface-green); border-color: transparent; }
.insight-card.is-warm { background: var(--amber-bg); border-color: transparent; }
.progress-list { display: grid; gap: 14px; }
.progress-list-padded { padding: 17px; }
.progress-item { display: grid; grid-template-columns: minmax(78px, 96px) 1fr 30px; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 11px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 6px; background: var(--surface-soft); }
.progress-fill { height: 100%; border-radius: inherit; background: var(--green); }
.progress-fill-0 { width: 0%; }
.progress-fill-10 { width: 10%; }
.progress-fill-20 { width: 20%; }
.progress-fill-30 { width: 30%; }
.progress-fill-40 { width: 40%; }
.progress-fill-50 { width: 50%; }
.progress-fill-60 { width: 60%; }
.progress-fill-70 { width: 70%; }
.progress-fill-80 { width: 80%; }
.progress-fill-90 { width: 90%; }
.progress-fill-100 { width: 100%; }
.progress-count { color: var(--muted); text-align: right; }
.history-list { display: grid; gap: 8px; }
.history-row { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 14px; background: var(--surface); }
.history-row .product-art { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; }
.history-main { min-width: 0; flex: 1; }
.history-main strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-main span, .history-date { color: var(--muted); font-size: 11px; }
.history-date { text-align: right; white-space: nowrap; }
.settings-section { overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.settings-data { margin-top: 16px; }
.settings-section > h2 { margin: 0; padding: 15px 17px 9px; font-family: Manrope, sans-serif; font-size: 14px; letter-spacing: -.2px; }
.setting-row { display: flex; min-height: 62px; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.setting-icon { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--surface-soft); color: var(--green); }
.setting-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.setting-copy { min-width: 0; flex: 1; }
.setting-copy strong { display: block; font-size: 12px; font-weight: 700; }
.setting-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.setting-row > .button, .setting-row > select { flex: 0 0 auto; }
.setting-select { min-height: 42px; max-width: 130px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-soft); font-size: 16px; }
.toggle-switch { position: relative; display: inline-flex; width: 46px; height: 28px; flex: 0 0 auto; align-items: center; border: 0; border-radius: 18px; background: #c7d0c9; cursor: pointer; transition: background .2s ease; }
.toggle-switch::after { position: absolute; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 18%); content: ''; transition: transform .2s ease; }
.toggle-switch[aria-checked="true"] { background: var(--green); }
.toggle-switch[aria-checked="true"]::after { transform: translateX(18px); }
.notice-card { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border-radius: 15px; background: var(--blue-bg); color: #315b7a; }
.notice-card > svg { width: 19px; flex: 0 0 auto; margin-top: 1px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.notice-card strong { display: block; font-size: 12px; }
.notice-card p { margin: 4px 0 0; font-size: 12px; line-height: 1.55; }
.notice-card.is-warm { background: var(--amber-bg); color: #805518; }
.privacy-card { margin: 18px 0 8px; padding: 16px; border-radius: 17px; background: var(--surface-green); }
.privacy-card h3 { margin: 0; font-family: Manrope, sans-serif; font-size: 13px; }
.privacy-card p { margin: 6px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.privacy-footnote { margin: 12px 0 23px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.setting-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 16px; border-top: 1px solid var(--line); }
.details-dialog { max-height: min(88vh, 760px); max-height: min(88dvh, 760px); overflow: auto; }
.history-close { margin-top: 16px; }
.detail-body { padding: 23px 20px 19px; text-align: left; }
.detail-hero { display: flex; align-items: center; gap: 13px; text-align: left; }
.detail-hero .product-art { width: 54px; height: 54px; flex: 0 0 auto; font-size: 25px; }
.detail-hero h2 { margin: 3px 0 2px; overflow-wrap: anywhere; }
.detail-hero p:last-child { margin: 4px 0 0; font-size: 10px; }
.detail-due { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; color: var(--muted); font-size: 10px; }
.detail-list { margin: 0; border-top: 1px solid var(--line); }
.detail-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { max-width: 65%; margin: 0; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.detail-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.detail-close { width: 100%; min-height: 42px; margin-top: 8px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.help-body { max-height: min(85dvh, 640px); overflow: auto; }
.help-body ol { margin: 17px 0 12px; padding-left: 22px; color: var(--ink-soft); font-size: 12px; line-height: 1.75; text-align: left; }
.help-body li + li { margin-top: 7px; }
.help-body > p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.theme-contrast { --page: #fff; --surface: #fff; --surface-soft: #f2f2f2; --surface-green: #eef8f0; --ink: #0b1811; --ink-soft: #23352a; --muted: #4e6155; --line: #8a9a8f; --green: #14513e; --green-deep: #103e30; --green-tint: #daeddf; --coral: #a03524; --coral-bg: #fff0ec; --amber: #71420b; --amber-bg: #fff4df; --blue: #244f70; --blue-bg: #e9f2f8; }
.theme-contrast .hero-card { background: #124c3b; }
.theme-contrast .button-primary, .theme-contrast .filter-chip.is-active, .theme-contrast .check-chip input:checked + span { background: #124c3b; color: white; }
.file-input { display: none; }
.toast-region { position: fixed; z-index: 120; right: 18px; bottom: calc(88px + var(--safe-bottom)); left: 18px; display: grid; justify-items: center; pointer-events: none; }
.toast { display: flex; max-width: min(500px, 100%); min-height: 50px; align-items: center; gap: 11px; padding: 9px 10px 9px 15px; border-radius: 15px; background: #213d32; color: #fff; box-shadow: 0 10px 28px rgb(15 35 25 / 26%); font-size: 12px; animation: toast-in .22s ease both; pointer-events: auto; }
.toast-message { flex: 1; }
.toast-action { min-height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: #fff; color: var(--green-deep); font-size: 11px; font-weight: 700; cursor: pointer; }
.toast-close { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: #dceae2; font-size: 17px; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.sheet-dialog { position: fixed; inset: auto 0 0; width: min(100%, 720px); max-width: none; max-height: min(94vh, 940px); max-height: min(94dvh, 940px); margin: 0 auto; padding: 0; overflow: hidden; border: 0; border-radius: 27px 27px 0 0; background: var(--page); color: var(--ink); box-shadow: 0 -12px 50px rgb(23 45 35 / 19%); }
.sheet-dialog::backdrop, .small-dialog::backdrop { background: rgb(16 31 24 / 42%); backdrop-filter: blur(3px); }
.sheet-dialog[open] { animation: sheet-up .23s ease-out both; }
@keyframes sheet-up { from { transform: translateY(22px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }
.dialog-topline { display: flex; justify-content: center; padding: 10px 0 5px; }
.dialog-grabber { width: 34px; height: 4px; border-radius: 4px; background: #cbd4cc; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 21px 13px; }
.dialog-header .eyebrow { margin-bottom: 4px; font-size: 9px; }
.dialog-header h2 { margin: 0; font-family: Manrope, sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -.8px; }
.form-scroll { max-height: calc(94vh - 153px); max-height: calc(94dvh - 153px); overflow: auto; padding: 0 20px 24px; overscroll-behavior: contain; }
.scan-panel { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #dce7de; border-radius: 16px; background: var(--surface-green); }
.scan-icon { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #fff; color: var(--green); }
.scan-icon svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.scan-copy { min-width: 0; flex: 1; }
.scan-copy strong { display: block; font-size: 11px; }
.scan-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.scan-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.scan-actions .button { min-height: 38px; padding-inline: 9px; font-size: 10px; }
.scan-progress { margin-top: 9px; padding: 10px 12px; border-radius: 11px; background: var(--surface); color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.scan-progress[hidden] { display: none; }
.scan-progress.has-error { background: var(--coral-bg); color: #973e30; }
.scan-progress p { margin: 5px 0 0; color: inherit; font-size: 10px; line-height: 1.5; opacity: .86; }
.scan-result-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; color: var(--ink-soft); font-size: 10px; }
.scan-result-line strong { color: var(--green-deep); }
.scan-sample { display: block; overflow-wrap: anywhere; margin-top: 8px; color: var(--muted); font-size: 9px; }
.scan-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.scan-suggestions .button { min-height: 35px; }
.scanner-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: max(12px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); overflow: auto; border: 0; background: var(--page); color: var(--ink); }
.scanner-dialog[open] { display: grid; place-items: center; }
.scanner-dialog::backdrop { background: #101b16; }
.scanner-shell { display: grid; width: min(100%, 560px); max-height: 100%; align-content: center; gap: 12px; margin: auto; overflow: auto; }
.scanner-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scanner-header .eyebrow { margin: 0 0 3px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.scanner-header h2 { margin: 0; font-family: Manrope, sans-serif; font-size: clamp(19px, 5vw, 24px); font-weight: 800; letter-spacing: -.55px; }
.scanner-preview { position: relative; width: min(100%, 420px); aspect-ratio: 3 / 4; max-height: min(55dvh, 570px); margin: 0 auto; overflow: hidden; border-radius: 22px; background: #101813; }
.scanner-preview video { display: block; width: 100%; height: 100%; object-fit: cover; }
.scanner-reticle { position: absolute; inset: 37% 6%; border: 2px solid #d2f27d; border-radius: 14px; box-shadow: 0 0 0 100vmax rgb(9 19 14 / 23%); pointer-events: none; }
.scanner-reticle span { position: absolute; top: -30px; left: 50%; max-width: calc(100% - 10px); padding: 5px 9px; transform: translateX(-50%); border-radius: 8px; background: #d2f27d; color: #192419; font-size: 10px; font-weight: 800; white-space: nowrap; }
.scanner-code-badge { position: absolute; top: 12px; left: 50%; padding: 7px 11px; transform: translateX(-50%); border: 1px solid rgb(255 255 255 / 45%); border-radius: 20px; background: rgb(21 55 43 / 88%); color: white; font-size: 10px; font-weight: 700; white-space: nowrap; }
.scanner-code-badge[hidden] { display: none; }
.scanner-live-status { min-height: 34px; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; text-align: center; }
.scanner-camera-tools { display: flex; min-height: 38px; align-items: center; justify-content: center; gap: 20px; }
.scanner-camera-tools [hidden] { display: none; }
.camera-zoom { display: flex; min-width: min(250px, 65vw); align-items: center; gap: 9px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.camera-zoom input { width: 100%; min-height: 36px; accent-color: var(--green); }
.camera-zoom output { min-width: 35px; font-variant-numeric: tabular-nums; text-align: right; }
.scanner-actions { display: grid; justify-items: center; gap: 4px; }
.scanner-shutter { width: min(100%, 360px); min-height: 54px; border-radius: 18px; font-size: 15px; }
.scanner-shutter:disabled { cursor: wait; opacity: .72; }
.scanner-privacy { margin: 0; color: var(--muted); font-size: 10px; text-align: center; }
.theme-dark .scanner-dialog { background: var(--page); color: var(--ink); }
.form-section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 11px; font-size: 12px; font-weight: 700; }
.required-note { color: var(--muted); font-size: 11px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.field { display: grid; min-width: 0; align-content: start; gap: 6px; }
.field > span:first-child { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.field > span b { color: var(--coral); }
.field input, .field select, .field textarea, .inline-fields select, .inline-fields input { width: 100%; min-width: 0; min-height: 45px; padding: 0 11px; border: 1px solid #dce4dd; border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 16px; }
.field input::placeholder, .field textarea::placeholder { color: #a0aaa2; }
.field textarea { min-height: 81px; padding: 10px 11px; resize: vertical; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.45; }
.field-error { min-height: 0; color: var(--coral); font-size: 12px; line-height: 1.4; }
.field-error:not(:empty) { min-height: 12px; }
.field.has-error input, .field.has-error select { border-color: var(--coral); }
.field-wide, .notes-field { grid-column: 1 / -1; }
.inline-fields { display: flex; gap: 6px; }
.inline-fields input { flex: 1; }
.inline-fields select { max-width: 111px; padding-inline: 8px; font-size: 16px; }
.reminder-form-section { margin-top: 3px; }
.reminder-form-section .form-section-title { margin-bottom: 10px; }
.reminder-choice-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.check-chip { position: relative; cursor: pointer; }
.check-chip input { position: absolute; opacity: 0; }
.check-chip span { display: inline-flex; min-height: 40px; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 600; transition: background .15s ease, color .15s ease; }
.check-chip input:checked + span { border-color: var(--green); background: var(--green); color: #fff; }
.check-chip input:focus-visible + span { outline: 3px solid #72a995; outline-offset: 2px; }
.reminder-time-field { max-width: 150px; margin-top: 12px; }
.dialog-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 12px 20px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--page) 94%, transparent); backdrop-filter: blur(12px); }
.dialog-footer .button { min-height: 44px; }
.small-dialog { width: min(calc(100% - 34px), 390px); padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-md); }
.small-dialog-body { padding: 25px 22px 20px; text-align: center; }
.confirm-mark { display: grid; width: 50px; height: 50px; place-items: center; margin: 0 auto 13px; border-radius: 17px; background: var(--surface-green); color: var(--green); }
.confirm-mark svg { width: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.small-dialog h2 { margin: 0; font-family: Manrope, sans-serif; font-size: 19px; letter-spacing: -.55px; }
.small-dialog p { margin: 8px auto 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: center; gap: 8px; }
.confirm-actions .button { min-height: 42px; padding-inline: 13px; font-size: 11px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; clip-path: inset(50%) !important; border: 0 !important; }
.loading-state { display: grid; min-height: 60vh; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.loading-orbit { width: 30px; height: 30px; border: 3px solid #d7e1d9; border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 78px; border-radius: 16px; background: linear-gradient(90deg, #eff2ed 25%, #f8f9f6 50%, #eff2ed 75%); background-size: 200% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.bottom-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; width: min(100%, 620px); grid-template-columns: repeat(5, 1fr); margin-inline: auto; padding: 8px 12px calc(8px + var(--safe-bottom)); border-top: 1px solid rgb(222 230 222 / 90%); background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 -5px 24px rgb(34 61 46 / 6%); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.nav-item { position: relative; display: grid; min-height: 57px; align-content: center; justify-items: center; gap: 4px; padding: 2px; border: 0; border-radius: 13px; background: transparent; color: #66736b; font-size: 11px; font-weight: 600; cursor: pointer; }
.nav-item > svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.nav-item.is-active { color: var(--green); }
.nav-item.is-active::before { position: absolute; top: -8px; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--green); content: ''; }
.nav-add { color: var(--green); }
.nav-add-icon { display: grid; width: 35px; height: 35px; place-items: center; margin-top: -14px; border: 4px solid var(--surface); border-radius: 50%; background: var(--green); color: #fff; box-sizing: content-box; }
.nav-add-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
.theme-dark { color-scheme: dark; --page: #13211b; --surface: #1c2c24; --surface-soft: #25372e; --surface-green: #213a2d; --ink: #eef4ed; --ink-soft: #c3d0c5; --muted: #96a69a; --line: #34483b; --green: #76ba98; --green-deep: #b2dec1; --green-tint: #284b38; --coral: #f48a75; --coral-bg: #422a26; --amber: #f0bd68; --amber-bg: #3c3222; --blue: #8bbadd; --blue-bg: #243541; --shadow-sm: 0 3px 12px rgb(0 0 0 / 12%); --shadow-md: 0 14px 42px rgb(0 0 0 / 22%); }
.theme-dark .app-header { background: color-mix(in srgb, var(--page) 92%, transparent); }
.theme-dark .hero-card { background: #255747; }
.theme-dark .hero-art-label { fill: #fff9ee; }
.theme-dark .offline-pill { background: var(--surface); }
.theme-dark .brand-mark { background: #326d58; }
.theme-dark .stat-icon { background: var(--surface-soft); }
.theme-dark .stat-card.is-alert .stat-icon { background: var(--coral-bg); }
.theme-dark .stat-card.is-warm .stat-icon { background: var(--amber-bg); }
.theme-dark .due-badge.is-expired { color: #ffb4a5; }
.theme-dark .due-badge.is-today, .theme-dark .due-badge.is-soon { color: #f6cd84; }
.theme-dark .product-art { background: #253e31; }
.theme-dark .product-art.is-expired { background: var(--coral-bg); }
.theme-dark .product-art.is-soon { background: var(--amber-bg); }
.theme-dark .product-art.is-cold { background: var(--blue-bg); }
.theme-dark .sheet-dialog, .theme-dark .small-dialog { background: var(--page); }
.theme-dark .dialog-footer { background: color-mix(in srgb, var(--page) 94%, transparent); }
.theme-dark .button-primary { color: #14392c; }
.theme-dark .button-soft { border-color: #3b5848; background: #294437; color: #d3ebda; }
.theme-dark .hero-card .button { color: #1a483a; }
.theme-dark .notice-card { color: #c5d9e6; }
.theme-dark .notice-card.is-warm { color: #f0c980; }
.theme-dark .button-danger { border-color: #69443d; }
.theme-dark .filter-chip.is-active { color: #15372c; }
.theme-dark .check-chip input:checked + span { color: #15372c; }
.theme-dark .nav-item:not(.is-active) { color: var(--muted); }
.theme-contrast .nav-item:not(.is-active) { color: var(--ink-soft); }
@media (min-width: 700px) {
  .app-frame { padding-inline: 38px; padding-bottom: 34px; }
  .app-header { height: 82px; }
  .main-content { padding-top: 3px; }
  .page-heading { margin-top: 22px; margin-bottom: 27px; }
  .mobile-break { display: none; }
  .mobile-only { display: none; }
  .desktop-only { display: inline; }
  .hero-card { min-height: 245px; padding: 32px 38px; }
  .hero-art { width: 182px; }
  .stats-grid { gap: 16px; margin-top: 20px; margin-bottom: 36px; }
  .stat-card { min-height: 114px; padding: 18px 19px; }
  .product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shelf-toolbar { grid-template-columns: minmax(220px, 1fr); }
  .filter-row { flex-wrap: wrap; overflow: visible; }
  .insight-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bottom-nav { position: static; width: auto; grid-template-columns: repeat(5, auto); justify-content: center; gap: 8px; margin: 24px auto 0; padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
  .nav-item { min-width: 90px; min-height: 53px; grid-auto-flow: column; align-content: center; justify-content: center; gap: 8px; padding-inline: 13px; font-size: 11px; }
  .nav-item.is-active::before { top: auto; bottom: -8px; width: 28px; }
  .nav-add { display: inline-flex; align-items: center; justify-content: center; }
  .nav-add-icon { width: 24px; height: 24px; margin: 0; border: 0; background: transparent; color: currentColor; }
  .nav-add-icon svg { width: 20px; }
  .toast-region { bottom: 26px; }
}
@media (min-width: 980px) {
  .app-frame { padding-inline: 48px; }
  .hero-card { grid-template-columns: 1fr 230px; }
  .hero-art { width: 205px; }
  .product-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-heading h1 { font-size: 38px; }
}
@media (max-width: 380px) {
  .app-frame { padding-inline: 15px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .hero-card { min-height: 213px; grid-template-columns: 1fr 86px; padding: 21px 17px; }
  .hero-art { width: 90px; }
  .hero-card p { font-size: 12px; }
  .stats-grid { gap: 7px; }
  .stat-card { padding: 12px 10px; }
  .stat-card-top { font-size: 10px; }
  .stat-value { font-size: 24px; }
  .dialog-header { padding-inline: 16px; }
  .form-scroll { padding-inline: 15px; }
  .dialog-footer { padding-inline: 15px; }
  .dialog-footer .button { padding-inline: 12px; font-size: 11px; }
  .scan-actions { gap: 2px; }
  .scan-actions .button { padding-inline: 7px; font-size: 9px; }
  .scanner-dialog { padding-right: 12px; padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
