:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --card: #fffdf9;
  --ink: #192a23;
  --muted: #575f54;
  --line: #dfdbce;
  --soft: #efede4;
  --brass: #76571f;
  --gold: #e8d1a1;
  --danger: #8e392c;
  --green: #244635;
  --serif: Georgia, 'Times New Roman', serif;
  --shadow: 0 16px 48px #26352b0b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 system-ui, sans-serif; }
a { color: inherit; }
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
:focus-visible { outline: 3px solid #926b2c; outline-offset: 3px; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; }
h2 { font-size: clamp(2.1rem, 5vw, 3.15rem); letter-spacing: -.05em; }
h3 { font-size: 1.6rem; letter-spacing: -.035em; }
h4 { font-size: 1rem; }
section[id] { scroll-margin-top: 1rem; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

.shell { width: min(840px, calc(100% - 3rem)); margin-inline: auto; }
.masthead { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; white-space: nowrap; font: 1.55rem var(--serif); letter-spacing: -.045em; }
nav { display: flex; align-items: center; gap: .3rem; }
nav a { position: relative; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: .45rem; padding: .5rem .75rem; border-radius: 11px; text-decoration: none; font-size: .86rem; font-weight: 650; color: var(--muted); }
nav a[aria-current], nav a:hover { background: #e8eee7; color: var(--green); }
nav svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-count { min-width: 1.05rem; padding: .05rem .25rem; border-radius: 1rem; background: #ece1cc; color: #583d12; text-align: center; font-size: .65rem; }
.eyebrow { margin-bottom: .35rem; color: var(--brass); font-size: .71rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
main { padding-block: clamp(1.15rem, 4vw, 2.6rem); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: clamp(1.1rem, 4vw, 2rem); box-shadow: var(--shadow); min-width: 0; }
.section-head { display: flex; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.3rem; }
.medallion, .counter { flex: 0 0 auto; display: grid; place-items: center; min-width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--brass); }
.medallion svg { width: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.counter { padding: 0 .5rem; font: 1.22rem var(--serif); }
label { display: block; font-weight: 650; font-size: .87rem; }
input:not([type=checkbox]), select { display: block; width: 100%; min-height: 46px; padding: .55rem .75rem; border: 1px solid #c9bead; border-radius: 9px; background: var(--card); color: var(--ink); }
label + input, label + select { margin-top: .3rem; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; margin: 0; flex: 0 0 auto; accent-color: var(--green); }
.help { color: var(--muted); font-size: .86rem; }
select + .help { margin-top: .45rem; }
.button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; padding: .52rem .84rem; border: 1px solid transparent; border-radius: 9px; font-size: .89rem; font-weight: 670; text-align: center; text-decoration: none; }
.primary { background: var(--green); color: #fffdf8; }
.primary:hover:not(:disabled) { background: #315840; }
.outline { border-color: #c9bead; background: var(--card); color: var(--ink); }
.outline:hover:not(:disabled) { background: var(--soft); }
.text-button { background: transparent; color: var(--brass); padding-inline: .45rem; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.capture-card { position: relative; isolation: isolate; overflow: hidden; margin-top: .9rem; padding: clamp(1rem, 4vw, 1.55rem); border-radius: 16px; background: #1e352a; color: var(--card); }
.capture-card::after { content: ""; position: absolute; z-index: -1; inset: -6rem -3rem auto auto; width: 16rem; height: 16rem; border: 1px solid #dfc28c3a; border-radius: 50%; box-shadow: 0 0 0 1.15rem #dfc28c16, 0 0 0 2.3rem #dfc28c0d; pointer-events: none; }
.capture-card .eyebrow { color: var(--gold); }
.capture-card h3 { margin-block: .45rem; font-size: clamp(1.55rem, 4vw, 2.1rem); }
.capture-card > p:not(.eyebrow) { max-width: 27rem; color: #e5e9df; font-size: .88rem; }
.capture-card .primary { background: #f8f0dd; color: #203b2b; }
.capture-card .primary:hover:not(:disabled) { background: #ecdab5; }
.capture-card .outline { color: #fffdf8; background: transparent; border-color: #b4baa9; }
.capture-card .outline:hover:not(:disabled) { background: #ffffff18; }
.capture-card :focus-visible { outline-color: var(--gold); }
.photo-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .95rem; }
.photo-picker .button { flex: 1 1 auto; }
.manual-link { margin: .35rem 0 0 -.45rem; }
.privacy { padding-top: .7rem; border-top: 1px solid var(--line); }
.message { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.message:not(:empty) { margin-block: .5rem; }
.message.error { color: var(--danger); }
#photo-preview { margin-top: .9rem; border-radius: 12px; overflow: hidden; background: var(--soft); }
#photo-preview img { display: block; width: 100%; height: min(46vw, 310px); min-height: 160px; object-fit: contain; }
.empty { border: 1px dashed #cfc3b0; border-radius: 11px; padding: .85rem; background: #faf7ef; color: var(--muted); font-size: .89rem; }
.zone-group + .zone-group { margin-top: .85rem; }
.zone-group h3 { margin-bottom: .25rem; font: 700 .75rem/1.35 system-ui, sans-serif; letter-spacing: .075em; text-transform: uppercase; color: var(--brass); }
.item-list { list-style: none; padding: 0; margin: 0; }
.item-list li { border-top: 1px solid var(--line); padding: .5rem 0; }
.item-list li:first-child { border-top: 0; }
.item-name { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-weight: 650; overflow-wrap: anywhere; }
.item-quantity { font-size: .79rem; font-weight: 550; color: var(--muted); text-align: right; }
.item-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.item-actions .button { font-size: .8rem; }
.reserve-note { margin-block: .3rem; padding: .35rem .55rem; border-radius: 6px; background: #f3ebd9; color: #624615; font-size: .82rem; }
.manual { border-top: 1px solid var(--line); margin-top: .9rem; }
summary { min-height: 44px; padding: .58rem 0; font-size: .88rem; font-weight: 650; color: var(--brass); }
#manual-form label, #manual-form .button { margin-top: .7rem; }
.checkline { display: flex; align-items: center; gap: .55rem; min-height: 44px; cursor: pointer; }
.review { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.review-head { margin-bottom: .5rem; }
.review-list { display: grid; gap: .55rem; margin-block: .65rem; }
.review-item { min-width: 0; border: 1px solid var(--line); border-radius: 11px; padding: .65rem; background: #fcfaf4; }
.review-item .checkline { font-size: .83rem; }
.review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .32rem; }
.badge { font-size: .72rem; font-weight: 700; border-radius: 100px; padding: .15rem .52rem; color: var(--brass); background: #f1e8d6; }
.badge.present, .badge.yes { color: #315641; background: #e7eee5; }
.badge.no { color: #883d2e; background: #f6e5de; }
.review-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6.25rem, .35fr); gap: .5rem; margin-top: .25rem; }
.review-edit input { background: var(--card); }
.review-detail { margin-top: .4rem; }
.missing-group { margin-top: 1.1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.apply-bar { margin-top: .8rem; }
.apply-bar .button { margin-top: .3rem; width: 100%; }
#recipes-content { margin-top: .8rem; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.recipe { background: #faf7ef; border: 1px solid var(--line); padding: .7rem .8rem; border-radius: 11px; min-width: 0; }
.recipe summary { color: var(--ink); font: 1.18rem/1.2 var(--serif); }
.recipe summary .eyebrow { display: block; font-family: system-ui, sans-serif; }
.recipe ol { padding-inline-start: 1.2rem; margin: .55rem 0 0; font-size: .86rem; }
.recipe li + li { margin-top: .25rem; }
.notice { padding-block: 1.5rem; }
.install-link { margin: 1.05rem .2rem 0; color: var(--muted); font-size: .82rem; }
.install-link a { text-underline-offset: .2rem; }
.login-panel { max-width: 460px; margin: clamp(.4rem, 5vh, 2rem) auto; }
.login-panel h1 { font-size: 2.2rem; margin-bottom: .65rem; }
.login-panel form { margin-top: 1rem; }
.login-panel .button { margin-top: .65rem; }
dialog { width: min(420px, calc(100% - 2rem)); border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; background: var(--card); color: var(--ink); box-shadow: 0 15px 60px #17130d40; }
dialog::backdrop { background: #201d18a0; }
dialog h2 { margin-bottom: .6rem; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .4rem; margin-top: 1rem; }
.toast { z-index: 2; position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2rem); padding: .7rem 1rem; border-radius: 10px; background: var(--ink); color: var(--card); box-shadow: 0 5px 25px #26231e35; font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 680px) {
  .shell { width: calc(100% - 1.5rem); }
  .header-inner { min-height: 65px; }
  main { padding-bottom: calc(6.15rem + env(safe-area-inset-bottom)); }
  nav { position: fixed; z-index: 3; inset: auto 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .15rem; padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
  nav a { min-height: 56px; flex-direction: column; gap: .22rem; padding: .35rem .1rem; font-size: .75rem; }
  nav a:focus-visible { outline-offset: -2px; }
  nav svg { width: 22px; height: 22px; }
  .nav-count { position: absolute; top: .25rem; left: calc(50% + .6rem); }
  .panel { border-radius: 18px; }
  .recipe-grid { grid-template-columns: minmax(0, 1fr); }
  .toast { bottom: calc(5rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .review-edit { grid-template-columns: minmax(0, 1fr); }
}
