:root {
  --bg: #f6f2e9; --card: #fffdf9; --ink: #1c2822; --muted: #76827a; --line: #e8e1d2; --line-soft: rgba(28,40,34,.07);
  --accent: #2c6a4f; --accent-deep: #1f4f3b; --accent-ink: #fff; --soft: #e6efe8; --ok: #2c6a4f; --gold: #e8a63a;
  --r: 18px; --r-sm: 12px;
  --sh1: 0 1px 2px rgba(28,40,34,.05), 0 3px 10px rgba(28,40,34,.05);
  --sh2: 0 14px 34px -14px rgba(28,40,34,.35);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif; --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --glass: rgba(255,253,249,.93); --glass-bg: rgba(246,242,233,.86);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #101612; --card: #19211c; --ink: #eef1ea; --muted: #97a39a; --line: #2a362d; --line-soft: rgba(255,255,255,.07); --soft: #213228; --accent: #5cb98f; --accent-deep: #8ad3b0; --accent-ink: #0c1a12;
          --sh1: 0 1px 2px rgba(0,0,0,.35); --sh2: 0 14px 34px -14px rgba(0,0,0,.7); --glass: rgba(25,33,28,.82); --glass-bg: rgba(16,22,18,.86); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); letter-spacing: -.003em; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
#app { max-width: 760px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.7rem; margin: 20px 0 12px; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }

input[type=text], input[type=url], input[type=email], input[type=number], input[type=password], input[type=search], textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 12px 0 4px; }

.btn { border: 1px solid var(--line); background: var(--card); padding: 10px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: #c0392b; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .5; }
.icon-btn { border: 0; background: none; font-size: 1.3rem; cursor: pointer; padding: 6px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); cursor: pointer; position: relative; }
.card .img { aspect-ratio: 4/3; background: var(--soft) center/cover; display: grid; place-items: center; font-size: 2rem; }
.card .body { padding: 10px 12px 12px; }
.card .title { font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .fav { position: absolute; top: 6px; right: 8px; font-size: 1.2rem; text-shadow: 0 1px 3px rgba(0,0,0,.4); }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chip { flex: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tag { display: inline-block; font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: var(--soft); margin-right: 4px; }

.hero { width: calc(100% + 32px); margin: 0 -16px; aspect-ratio: 16/10; background: var(--soft) center/cover; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.meta { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0; }
.meta b { display: block; font-size: 1.05rem; }
.meta span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.stepper button { border: 0; background: none; width: 34px; height: 34px; font-size: 1.2rem; cursor: pointer; }

.ing { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; cursor: pointer; }
.ing.done { opacity: .4; text-decoration: line-through; }
.ing .q { min-width: 4.2em; font-weight: 650; }
.ing-group { font-weight: 700; margin: 16px 0 2px; color: var(--accent); font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.step { display: flex; gap: 12px; padding: 12px 0; }
.step .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .85rem; margin-top: 2px; }
.cook .step { font-size: 1.2rem; }

nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
nav.tabs a { flex: 1; max-width: 200px; text-align: center; padding: 9px 0 7px; text-decoration: none; color: var(--muted); font-size: .72rem; }
nav.tabs a.on { color: var(--accent); }
nav.tabs a i { display: block; font-style: normal; font-size: 1.35rem; }
.fab { position: fixed; right: 18px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 2rem; box-shadow: 0 6px 18px rgba(0,0,0,.28); cursor: pointer; z-index: 9; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--bg); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; }
@media (min-width: 620px) { .modal-bg { align-items: center; } .modal { border-radius: 20px; } }
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin: 8px 0 4px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 4px; border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.aisle { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 20px 0 4px; }
.gitem { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.gitem input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.gitem.done .t { text-decoration: line-through; opacity: .4; }
.gitem small { display: block; color: var(--muted); font-size: .75rem; }

.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px; }
.day.today { border-color: var(--accent); }
.day h3 { margin: 0 0 6px; font-size: .95rem; }
.meal { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.meal .thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--soft) center/cover; flex: none; }
.meal .slot { font-size: .7rem; text-transform: uppercase; color: var(--muted); }
.pick { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }

.ed-ing { display: grid; grid-template-columns: 62px 70px 1fr 28px; gap: 6px; margin-bottom: 6px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 3rem; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #222; color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; z-index: 40; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.login { max-width: 340px; margin: 18vh auto 0; text-align: center; }
@media print { nav.tabs, .fab, .topbar .row, .no-print { display: none !important; } }

.selbar { position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); padding: 12px 16px; z-index: 9; box-shadow: 0 -6px 18px rgba(0,0,0,.12); }
.selbar[hidden] { display: none; }

.timer { border: 1px solid var(--accent); background: var(--soft); color: var(--accent); border-radius: 999px; padding: 1px 10px; font-weight: 650; cursor: pointer; font-size: .9em; }
#timers { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 12; display: flex; gap: 8px; padding: 8px 16px; flex-wrap: wrap; justify-content: center; pointer-events: none; }
#timers .tm { pointer-events: auto; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 8px 14px; font-weight: 650; display: flex; gap: 10px; align-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
#timers .tm.done { background: var(--gold); color: #1f2a24; animation: pulse 1s infinite; }
#timers .tm button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 1rem; }
@keyframes pulse { 50% { transform: scale(1.05); } }
.stars button { background: none; border: 0; font-size: 1.6rem; cursor: pointer; padding: 0 2px; color: var(--gold); }
.nutri { display: flex; gap: 8px; margin: 8px 0; }
.nutri div { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; text-align: center; }
.nutri b { display: block; font-size: 1.1rem; }
.nutri span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ask { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-top: 8px; }
.ask .ans { white-space: pre-wrap; margin-top: 10px; padding: 10px 12px; background: var(--soft); border-radius: 10px; }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); }

.gitem { flex-wrap: wrap; }
.gitem .stepper button { width: 30px; height: 30px; }

.ingref { border-bottom: 2px dotted var(--accent); cursor: pointer; }
.ingpop { position: fixed; z-index: 30; max-width: 270px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.35); font-size: .95rem; line-height: 1.35; }
.ingpop mark { background: var(--gold); color: #1f2a24; padding: 0 5px; border-radius: 4px; font-weight: 700; }

#offline { display: flex; align-items: center; gap: 8px; background: var(--gold); color: #1f2a24; font-size: .85rem; font-weight: 600; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; }
#offline[hidden] { display: none; }
#offline span { flex: 1; }
#offline button { border: 0; background: rgba(0,0,0,.12); color: inherit; border-radius: 999px; padding: 3px 10px; font-weight: 700; cursor: pointer; }

#toast.actionable { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
#toast button { background: none; border: 0; color: var(--gold); font-weight: 700; font-size: 1rem; cursor: pointer; padding: 0; }
.sect { border-top: 1px solid var(--line); margin-top: 14px; }
.sect > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; padding: 12px 0; font-weight: 700; font-size: 1.1rem; }
.sect > summary::-webkit-details-marker { display: none; }
.sect > summary::after { content: "▾"; color: var(--muted); }
.sect[open] > summary::after { content: "▴"; }
.sect .teaser { margin-left: auto; font-weight: 400; font-size: .8rem; color: var(--muted); text-align: right; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sect-body { padding-bottom: 6px; }
@media print { .sect:not([open]) > .sect-body { display: block; } }

.cookmode { position: fixed; inset: 0; z-index: 11; background: var(--bg); display: flex; flex-direction: column; padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom); }
.cm-top { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.cm-bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.cm-bar > i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.cm-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; padding: 8px 2px; }
.cm-text { font-size: 1.55rem; line-height: 1.5; }
.cm-text .timer { font-size: 1.1rem; padding: 4px 14px; }
.cm-next { margin-top: 24px; color: var(--muted); font-size: .95rem; }
.cm-nav { display: flex; gap: 12px; padding: 12px 0 16px; }
.cm-nav .btn { flex: 1; font-size: 1.1rem; padding: 14px; }
body.cooking { overflow: hidden; }
body.cooking #timers { bottom: calc(92px + env(safe-area-inset-bottom)); }
.avoid-warn{background:#fff3e0;border:1px solid #f2b04a;color:#5a3a00;border-radius:10px;padding:8px 10px;margin:8px 0;font-size:.9rem}
@media (prefers-color-scheme:dark){.avoid-warn{background:#3a2b10;color:#ffd9a0;border-color:#8a6420}}
@media print {
  body { background: #fff !important; color: #000 !important; }
  .topbar, nav.tabs, .fab, .meta + .row, .stars, .toast, .avoid-warn, details.sect:not([data-sect="notes"]):not([data-sect="nutrition"]) { display: none !important; }
  .hero { height: 160px; background-size: cover; border-radius: 0; }
  .ing { break-inside: avoid; } .step { break-inside: avoid; }
  .ing.done { text-decoration: none !important; opacity: 1 !important; }
  a { color: inherit; text-decoration: none; }
}

/* ===================== premium layer: type, surfaces, motion ===================== */
h1, h2, .card .title, .boot-title, .sect > summary, .nutri b, .meta b, .login h1 { font-family: var(--serif); }
h1 { font-size: 2.05rem; font-weight: 600; line-height: 1.12; letter-spacing: -.025em; margin: 22px 0 14px; }
h2 { font-size: 1.3rem; font-weight: 600; letter-spacing: -.015em; margin: 28px 0 10px; }
h3 { font-weight: 600; letter-spacing: -.01em; }
a { text-underline-offset: 3px; }
label { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

input[type=text], input[type=url], input[type=email], input[type=number], input[type=password], input[type=search], textarea, select {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--card); transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; border: 1px solid var(--line); background: var(--card); padding: 11px 20px; border-radius: 999px; font-weight: 600; letter-spacing: -.005em;
  box-shadow: var(--sh1); transition: transform .12s, box-shadow .15s, background .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:active { background: var(--accent-deep); }
.btn.small { padding: 7px 14px; font-size: .85rem; }
.btn.danger { color: #b3382b; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; border-radius: 50%; padding: 0; transition: background .15s; color: var(--ink); }
.icon-btn:active { background: var(--line-soft); }

.grid { gap: 14px; }
.card { border: 0; border-radius: 20px; box-shadow: var(--sh1); transition: transform .18s, box-shadow .18s; background: var(--card); }
.card:active { transform: scale(.985); }
@media (hover: hover) { .card:hover { transform: translateY(-3px); box-shadow: var(--sh2); } }
.card .img { aspect-ratio: 1 / 1; font-size: 1rem; color: color-mix(in srgb, var(--accent) 45%, transparent); }
.card .img .ic { width: 2.4rem; height: 2.4rem; }
.card .body { padding: 12px 14px 14px; }
.card .title { font-size: 1.02rem; font-weight: 600; line-height: 1.22; letter-spacing: -.012em; margin-bottom: 4px; }
.card .fav { top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,253,249,.88); color: var(--gold); text-shadow: none; font-size: 1.1rem !important; padding: 0 !important; box-shadow: 0 2px 8px rgba(0,0,0,.15); backdrop-filter: blur(6px); }
.card .muted { font-size: .78rem !important; }

.chips { gap: 8px; padding: 6px 0 12px; }
.chip { padding: 7px 14px; font-size: .84rem; font-weight: 500; border-color: var(--line); box-shadow: none; transition: background .15s, color .15s; }
.chip.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tag { padding: 3px 11px; font-size: .75rem; font-weight: 500; background: var(--soft); color: var(--accent-deep); }

.topbar { background: var(--glass-bg); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); margin: 0 -16px; padding: 8px 12px; }
.hero { border-radius: 0 0 28px 28px; aspect-ratio: 4 / 3; margin-top: -4px; }
.meta { gap: 0; margin: 14px 0; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--card); box-shadow: var(--sh1); overflow: hidden; }
.meta > div { flex: 1; padding: 12px 8px; text-align: center; border-right: 1px solid var(--line-soft); }
.meta > div:last-child { border-right: 0; }
.meta b { font-size: 1.15rem; font-weight: 600; }
.meta span { font-size: .66rem; letter-spacing: .09em; }
.stepper { box-shadow: var(--sh1); border-color: var(--line-soft); }

.ing { padding: 12px 2px; border-bottom: 1px solid var(--line-soft); }
.ing .q { color: var(--accent-deep); font-weight: 600; font-variant-numeric: tabular-nums; }
.ing-group { font-family: var(--serif); font-style: italic; font-size: 1.02rem; text-transform: none; letter-spacing: 0; color: var(--accent-deep); margin: 20px 0 4px; }
.step { padding: 14px 0; gap: 14px; }
.step .n { width: 30px; height: 30px; font-family: var(--serif); font-weight: 600; font-size: .95rem; background: transparent; color: var(--accent-deep); border: 1.5px solid var(--accent); }
.cook .step { font-size: 1.15rem; line-height: 1.6; }

nav.tabs { left: 14px; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: 540px; margin: 0 auto; border: 1px solid var(--line-soft); border-radius: 26px; background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); box-shadow: 0 12px 34px -10px rgba(28,40,34,.35); padding: 6px; gap: 4px; }
nav.tabs a { max-width: none; border-radius: 20px; padding: 8px 0 6px; font-size: .68rem; font-weight: 600; letter-spacing: .02em; transition: background .18s, color .18s; }
nav.tabs a i { margin-bottom: 2px; font-size: 1.2rem; }
nav.tabs a i .ic { width: 1.35rem; height: 1.35rem; display: block; margin: 0 auto; }
nav.tabs a.on { background: var(--soft); color: var(--accent-deep); }
.fab { bottom: calc(92px + env(safe-area-inset-bottom)); width: 58px; height: 58px; font-size: 1.8rem; font-weight: 300; box-shadow: 0 14px 28px -8px color-mix(in srgb, var(--accent) 80%, black); transition: transform .15s; }
.fab:active { transform: scale(.92); }
.selbar { bottom: calc(86px + env(safe-area-inset-bottom)); border-radius: 20px; margin: 0 14px; border: 1px solid var(--line-soft); }

.modal-bg { background: rgba(14,22,17,.5); backdrop-filter: blur(3px); animation: fadein .2s; }
.modal { border-radius: 28px 28px 0 0; padding-top: 26px; position: relative; box-shadow: 0 -20px 50px -20px rgba(0,0,0,.4); animation: sheet .28s cubic-bezier(.2,.8,.2,1); }
.modal::before { content: ""; position: absolute; top: 9px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line); }
@media (min-width: 620px) { .modal { border-radius: 28px; } .modal::before { display: none; } }
@keyframes sheet { from { transform: translateY(30px); opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }
.seg { box-shadow: var(--sh1); border-color: var(--line-soft); }
.pick { padding: 13px 4px; border-bottom: 1px solid var(--line-soft); line-height: 1.35; transition: background .12s; }
.pick:active { background: var(--line-soft); }
.pick b { font-weight: 600; }

.aisle { font-size: .72rem; letter-spacing: .12em; color: var(--accent-deep); margin: 26px 0 6px; }
.gitem { padding: 13px 2px; border-bottom: 1px solid var(--line-soft); }
.gitem input { width: 24px; height: 24px; }
.day { border: 0; box-shadow: var(--sh1); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.day.today { box-shadow: 0 0 0 1.5px var(--accent), var(--sh1); }
.day h3 { font-family: var(--serif); font-size: 1.05rem; }
.meal .thumb { width: 50px; height: 50px; border-radius: 12px; }
.meal .slot { font-size: .66rem; letter-spacing: .1em; font-weight: 600; }
.week-nav b { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }

.nutri div { border: 0; box-shadow: var(--sh1); border-radius: 14px; padding: 12px 4px; }
.nutri b { font-weight: 600; font-size: 1.2rem; }
.nutri span { font-size: .64rem; letter-spacing: .09em; }
.ask { border: 0; box-shadow: var(--sh1); border-radius: var(--r); }
.sect { border-top: 1px solid var(--line-soft); margin-top: 18px; }
.sect > summary { font-size: 1.15rem; font-weight: 600; padding: 15px 0; letter-spacing: -.01em; }
.sect > summary::after { content: ""; width: 9px; height: 9px; border-right: 1.7px solid var(--muted); border-bottom: 1.7px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .2s; flex: none; margin-left: 6px; }
.sect[open] > summary::after { content: ""; transform: rotate(-135deg) translateY(-2px); }
.sect .teaser { font-family: var(--sans); font-size: .78rem; }
.bar { height: 7px; }
.stars button { font-size: 1.5rem; }
.avoid-warn { border-radius: var(--r-sm); border-width: 1px; padding: 10px 12px; }
.timer { border-radius: 999px; background: var(--soft); border-color: transparent; padding: 2px 11px; }

.cm-text { font-family: var(--serif); font-size: 1.7rem; line-height: 1.45; letter-spacing: -.01em; }
.cm-top .icon-btn { border: 1px solid var(--line-soft); background: var(--card); }
.cm-nav .btn { padding: 16px; font-size: 1.05rem; }

.login { margin-top: 16vh; }
.login h1 { font-size: 2.4rem; margin: 6px 0 4px; }
.login .ic { width: 3rem; height: 3rem; color: var(--accent); }
.empty { padding: 60px 24px; }
.empty .big { color: color-mix(in srgb, var(--accent) 40%, transparent); line-height: 1; }
.empty .big .ic { width: 3.4rem; height: 3.4rem; }
.empty p { font-family: var(--serif); font-size: 1.1rem; color: var(--muted); }
#toast { background: var(--ink); color: var(--bg); box-shadow: var(--sh2); font-weight: 500; bottom: calc(96px + env(safe-area-inset-bottom)); }
#timers { bottom: calc(86px + env(safe-area-inset-bottom)); }
.spinner { border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; }
#app > * { animation: rise .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation: none !important; transition: none !important; } }

.btn { white-space: nowrap; }
#sort { width: auto; max-width: 128px; padding-right: 8px; }
.stars { white-space: nowrap; } .stars button { font-size: 1.3rem; padding: 0 1px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 14px; }
@media (min-width: 480px) { .actions { grid-template-columns: repeat(6, 1fr); } }
.actions button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border: 0; border-radius: 16px; background: var(--card); box-shadow: var(--sh1); color: var(--ink); cursor: pointer; font-size: 1.25rem; transition: transform .12s; }
.actions button:active { transform: scale(.96); }
.actions button .ic { color: var(--accent-deep); width: 1.35rem; height: 1.35rem; }
.actions button span { font-size: .72rem; font-weight: 600; letter-spacing: .01em; color: var(--muted); }
.row.spread.no-print { gap: 6px; }
.day b { font-weight: 600; }

.topbar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar .icon-btn { background: var(--glass); box-shadow: var(--sh1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar .row { gap: 8px; }
.topbar + .hero { margin-top: -58px; }
.hero { box-shadow: 0 16px 30px -22px rgba(28,40,34,.5); }
.row.spread.no-print { flex-wrap: wrap; }
.stp { display: inline-flex; align-items: center; gap: 10px; }
.stp button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--soft); color: var(--accent-deep); font-size: 1.05rem; line-height: 1; cursor: pointer; padding: 0; }
.row.no-print > .btn { min-width: 0; }
.welcome-title, .day > .row.spread > b { font-family: var(--serif); }
.pick:has(> .ic:first-child) { display: grid !important; grid-template-columns: 26px 1fr; column-gap: 14px; row-gap: 1px; align-items: center; padding: 14px 4px; }
.pick:has(> .ic:first-child) > .ic { grid-row: 1 / span 2; width: 1.35rem; height: 1.35rem; color: var(--accent-deep); }
.pick:has(> .ic:first-child) > :not(.ic) { grid-column: 2; }
.gitem .icon-btn { color: var(--muted); min-width: 34px; height: 34px; }
.gitem .icon-btn .ic { width: 1.05rem; height: 1.05rem; }
.topbar .icon-btn { background: var(--card); }
.login h1 { margin-bottom: 20px; }
.login .btn.primary { min-width: 140px; }
@media print { .actions, .stp button { display: none !important; } }
.tonight { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--r); box-shadow: var(--sh1); padding: 10px 12px; margin: 4px 0 14px; }
.tonight .thumb { width: 58px; height: 58px; border-radius: 14px; background: var(--soft) center/cover; flex: none; cursor: pointer; }
.tonight .eyebrow { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-deep); }
.tonight .tt { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; line-height: 1.2; }
.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(8,12,10,.96); display: flex; flex-direction: column; animation: fadein .2s; }
.viewer #vx { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 2; color: #fff; background: rgba(255,255,255,.14); }
.viewer .vimg { flex: 1; background: center/contain no-repeat; margin: calc(56px + env(safe-area-inset-top)) 0 0; }
.viewer .vnav { display: flex; justify-content: center; align-items: center; gap: 20px; color: #fff; padding: 14px 0 calc(18px + env(safe-area-inset-bottom)); }
.viewer .vnav .icon-btn { color: #fff; background: rgba(255,255,255,.14); }
.ing .sc { display: inline-flex; gap: 6px; flex: none; margin-left: auto; animation: fadein .2s; }
.ing .sc button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--soft); color: var(--accent-deep); font-size: 1.15rem; line-height: 1; cursor: pointer; padding: 0; }
.ing .sc button:active { background: var(--accent); color: var(--accent-ink); }
@media print { .ing .sc { display: none !important; } }
label .btn { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: .85rem; }
.row.spread:has(> h2) { flex-wrap: wrap; row-gap: 4px; }
.row.spread:has(> h2) > .row { flex-wrap: nowrap; margin-left: auto; }
.ing .grow { min-width: 0; }
label.btn { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: .85rem; line-height: 1.35; }

/* Cookbooks tab */
.hometabs { margin: 6px 0 12px; }
.books { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 14px; margin-top: 6px; }
@media (min-width: 620px) { .books { grid-template-columns: repeat(3, 1fr); } }
.book { cursor: pointer; transition: transform .15s; }
.book:active { transform: scale(.97); }
.book .mosaic { aspect-ratio: 1 / 1; border-radius: 22px; overflow: hidden; display: grid; gap: 2px; background: var(--card); box-shadow: var(--sh1); }
.mosaic i { background: var(--soft) center/cover; display: block; }
.mosaic.m1 { grid-template: 1fr / 1fr; }
.mosaic.m2 { grid-template: 1fr / 1fr 1fr; }
.mosaic.m3 { grid-template: 1fr 1fr / 1fr 1fr; } .mosaic.m3 i:first-child { grid-row: 1 / span 2; }
.mosaic.m4 { grid-template: 1fr 1fr / 1fr 1fr; }
.mosaic .empty-m { display: grid; place-items: center; font-style: normal; font-size: 2.2rem; color: color-mix(in srgb, var(--accent) 45%, transparent); }
.book .bt { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; letter-spacing: -.012em; margin: 10px 2px 0; line-height: 1.2; }
.book .bn { font-size: .85rem; margin: 2px 2px 0; }
.newbook .mosaic { background: transparent; border: 2px dashed var(--line); box-shadow: none; }
.newbook .empty-m { background: transparent; font-size: 2.6rem; }

/* illustrated stand-in for recipes without a photo */
.ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(150deg, hsl(var(--h) 42% 90%), hsl(var(--h) 38% 79%)); }
.ph .ic { width: 38%; height: 38%; color: hsl(var(--h) 34% 36%); opacity: .85; }
.card .img { position: relative; }
.mosaic i.phm { position: relative; } .mosaic .phm .ic { width: 45%; height: 45%; }
@media (prefers-color-scheme: dark) {
  .ph { background: linear-gradient(150deg, hsl(var(--h) 22% 24%), hsl(var(--h) 20% 17%)); }
  .ph .ic { color: hsl(var(--h) 40% 70%); }
}
.photo-ask { display: flex; align-items: center; gap: 12px; background: var(--card); box-shadow: var(--sh1); border-radius: var(--r); padding: 12px 14px; margin: 54px 0 4px; }
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pcell { aspect-ratio: 4 / 3; border: 0; border-radius: 14px; background: var(--soft) center/cover; cursor: pointer; padding: 0; transition: transform .12s; }
.pcell:active { transform: scale(.97); } .pcell.busy { opacity: .5; }
.rv { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.rvt { font-family: var(--serif); font-weight: 600; margin-bottom: 8px; }
.rvg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rvc { position: relative; aspect-ratio: 1 / 1; border: 0; border-radius: 12px; background: var(--soft) center/cover; cursor: pointer; padding: 0; opacity: .75; transition: opacity .12s, transform .12s; }
.rvc.sel { opacity: 1; box-shadow: 0 0 0 3px var(--accent); transform: scale(.97); }
.rvb { position: absolute; left: 4px; bottom: 4px; background: rgba(255,253,249,.92); color: var(--accent-deep); font-size: .62rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.rvbar { position: sticky; bottom: -1px; padding: 10px 0 2px; background: linear-gradient(transparent, var(--bg) 30%); }
.hero { position: relative; }
.hero-edit { position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(255,253,249,.92); color: var(--ink); font-weight: 600; font-size: .82rem; box-shadow: 0 4px 14px rgba(0,0,0,.25); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; }
.hero-edit:active { transform: scale(.96); }
@media (prefers-color-scheme: dark) { .hero-edit { background: rgba(25,33,28,.92); } }
@media print { .hero-edit { display: none !important; } }
label.pick { text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 400; color: var(--ink); margin: 0; }
.logrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.logimg { width: 56px; height: 56px; border-radius: 12px; background: var(--soft) center/cover; flex: none; cursor: zoom-in; }
.shelf-h { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; margin: 6px 0 8px; }
.shelf { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.shelf-i { flex: none; width: 104px; cursor: pointer; }
.shelf-img { position: relative; width: 104px; height: 104px; border-radius: 18px; background: var(--soft) center/cover; overflow: hidden; box-shadow: var(--sh1); }
.shelf-t { font-size: .82rem; font-weight: 600; line-height: 1.2; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta[hidden] { display: none; }
label.btn { white-space: normal; text-align: center; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 400; color: var(--ink); margin: 0; }
.mrow input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.ingl { flex: none; border: 0; background: none; color: var(--muted); opacity: .55; padding: 4px 6px; cursor: pointer; border-radius: 8px; font-size: .95rem; }
.ingl:active { background: var(--line-soft); opacity: 1; }
.ing-link { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--soft); color: var(--accent-deep); font-size: .78rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
@media print { .ingl { display: none !important; } }
/* grocery picker rows: amounts on the left, the item name gets the rest of the width */
#gp .gitem { flex-wrap: wrap; }
#gp .gitem input[type=number] { width: 58px !important; padding: 10px 8px; }
#gp .gitem input[type=text]:not(.grow) { width: 66px !important; padding: 10px 8px; }
#gp .gitem input.grow { flex: 1 1 100%; width: auto; min-width: 0; margin-left: 36px; }
/* inside the iPhone app the page runs under the status bar and Dynamic Island: keep content clear of it */
#app { padding-top: env(safe-area-inset-top); }
.topbar { top: env(safe-area-inset-top); }
.cookmode { padding-top: calc(env(safe-area-inset-top) + 4px); }
