/* Spagbol: "sunrise set". The last set as the sun comes up: a soft peach-to-lilac sky (light) or a plum glow on near-black (dark),
   with one sharp colour for actions: black buttons on the sunrise, cream buttons at night. Editorial serif, hairlines, tiles. */
:root {
  --bg: #F6E7E1; /* the sky's middle tone, used wherever a flat background is needed */
  --sky: linear-gradient(170deg, #F8E9DC 0%, #F2DDE3 50%, #E6DEF2 100%);
  --surface: #FCF8F6;
  --ink: #17120F;
  --ink-2: #57494A;
  --muted: #8C7C7B;
  --line: #EADBD7;
  --accent: #17120F;
  --accent-ink: #F8EFEA;
  --ok: #6A4E8E; /* "good" (diet labels, shared ingredients, spending less): dusk lilac */
  --red: #b3372b;
  --ease-out: cubic-bezier(.22, 1, .36, 1); /* quick start, long soft landing */
  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 64px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  /* tonal tile palette */
  --t0: #efdccf; --t1: #e3e3d3; --t2: #efd6d6; --t3: #dcdde8; --t4: #f0e0c6; --t5: #e4d9ec;
  --t0i: #7b5a44; --t1i: #5f6448; --t2i: #8a4f55; --t3i: #4f5a7c; --t4i: #84682f; --t5i: #6a527c;
  /* the logo's turned square */
  --logo-ink: #14110F; --logo-accent: #E39572;
}
/* Dark colours: follow the phone (Auto), unless Me > Appearance picked Light or Dark. */
:root {
  color-scheme: light dark; --warn-ink: #a35a10; --soon-ink: #8a6a10;
  /* --brand fills buttons; --brand-strong is for thin lines and dots; --brand-text for small accent text. */
  --brand: #14110F; --brand-ink: #F8EFEA; --brand-strong: #14110F; --brand-text: #3A2E2A;
  --brand-soft: color-mix(in srgb, #14110F 7%, transparent);
  --red: #8E4A3E; /* "careful" (delete, errors): a quiet clay, not an alarm */
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #120C0E; --sky: radial-gradient(130% 75% at 50% -5%, #4A2430 0%, #24141C 45%, #0E0A0C 100%);
    --surface: #1E1519; --ink: #F5ECE6; --ink-2: #CDBFB9; --muted: #9A8986; --line: #34252B;
    --accent: #F5ECE6; --accent-ink: #120C0E; --ok: #C7B2F0; --red: #ee8479;
    --t0: #2E1F1C; --t1: #25261E; --t2: #2F1C20; --t3: #1F2130; --t4: #2E2618; --t5: #2A1E2E;
    --t0i: #d6ae92; --t1i: #b5b98f; --t2i: #e0a0a8; --t3i: #a3acd6; --t4i: #d9bb78; --t5i: #c9a9e0;
    --warn-ink: #f0a960; --soon-ink: #e3c66a;
    --brand: #F4E6D8; --brand-ink: #14110F; --brand-strong: #F0B9A0; --brand-text: #F0C2AE; --brand-soft: color-mix(in srgb, #F0B9A0 14%, transparent); --red: #E39A8C;
    --logo-ink: #F1ECE4; --logo-accent: #F0B9A0;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #120C0E; --sky: radial-gradient(130% 75% at 50% -5%, #4A2430 0%, #24141C 45%, #0E0A0C 100%);
  --surface: #1E1519; --ink: #F5ECE6; --ink-2: #CDBFB9; --muted: #9A8986; --line: #34252B;
  --accent: #F5ECE6; --accent-ink: #120C0E; --ok: #C7B2F0; --red: #ee8479;
  --t0: #2E1F1C; --t1: #25261E; --t2: #2F1C20; --t3: #1F2130; --t4: #2E2618; --t5: #2A1E2E;
  --t0i: #d6ae92; --t1i: #b5b98f; --t2i: #e0a0a8; --t3i: #a3acd6; --t4i: #d9bb78; --t5i: #c9a9e0;
  --warn-ink: #f0a960; --soon-ink: #e3c66a;
  --brand: #F4E6D8; --brand-ink: #14110F; --brand-strong: #F0B9A0; --brand-text: #F0C2AE; --brand-soft: color-mix(in srgb, #F0B9A0 14%, transparent); --red: #E39A8C;
  --logo-ink: #F1ECE4; --logo-accent: #F0B9A0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { background: var(--bg); }
body {
  margin: 0; background: transparent; color: var(--ink); font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
/* The sky stays put while the page scrolls over it (a fixed layer works on iPhone, unlike background-attachment: fixed). */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--sky); pointer-events: none; }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding: 0 20px calc(var(--nav-h) + 48px + env(safe-area-inset-bottom)); }
#app.no-nav { padding-bottom: 40px; }

h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-family: var(--serif); font-weight: 500; font-size: 40px; letter-spacing: -.025em; }
h2 { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* header */
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: calc(34px + env(safe-area-inset-top)) 0 22px; }
.topbar .sub { color: var(--muted); font-size: 14px; margin-top: 8px; }
.weeknav { display: flex; gap: 6px; }

/* controls */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 550; text-decoration: none; color: var(--ink);
  transition: transform .12s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 24px rgba(20, 17, 15, .18); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.big { min-height: 56px; width: 100%; font-size: 16px; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 14.5px; }
.btn.danger { color: var(--red); border-color: var(--line); background: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 0;
}
.iconbtn:hover { color: var(--ink); }
.iconbtn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.iconbtn.bare { border-color: transparent; background: transparent; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-size: 16px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 18px 0 8px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.callout { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 14.5px; }
.callout.warn { border-color: color-mix(in srgb, #c98a2b 45%, var(--line)); }
.callout.error { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); color: var(--red); }

/* options */
details.opts { margin: 18px 0 4px; }
details.opts summary { cursor: pointer; list-style: none; color: var(--muted); font-size: 14px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
details.opts summary::-webkit-details-marker { display: none; }
details.opts summary::after { content: "+"; font-size: 18px; line-height: 1; }
details.opts[open] summary::after { content: "–"; }
.opts-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
.opts-grid label { margin-top: 14px; }
.opts-grid select { padding: 10px 8px; font-size: 15px; }
.check { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-weight: 450; color: var(--ink-2); font-size: 14.5px; }
.check input { margin: 0; }

/* tiles (plan + recipes) */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.tile .cover {
  display: flex; align-items: flex-end; justify-content: flex-start; aspect-ratio: 1 / 1.05; width: 100%; border: 0; padding: 14px 16px; text-align: left;
  background: var(--tb, var(--t0)); color: var(--ti, var(--t0i)); position: relative;
}
.tile .cover .big { font-family: var(--serif); font-size: 76px; line-height: .8; letter-spacing: -.04em; font-weight: 500; opacity: .95; }
.tile .cover .time { position: absolute; top: 14px; left: 16px; font-size: 12.5px; font-weight: 600; display: inline-flex; gap: 5px; align-items: center; opacity: .85; }
.tile .cover .time svg { width: 14px; height: 14px; }
.tile .meta { padding: 12px 14px 14px; }
.tile .meta h3 { font-size: 15.5px; overflow-wrap: anywhere; }
.tile .meta p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile .tools { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; }
.tile .tools .iconbtn { width: 34px; height: 34px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(8px); border-color: transparent; }
.tile .tools .iconbtn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.tile .tools svg { width: 16px; height: 16px; }
.tile.locked { border-color: var(--ink); }
.tile.add { display: flex; align-items: center; justify-content: center; border-style: dashed; background: transparent; min-height: 140px; color: var(--muted); }
.tile.add select { border: 0; background: transparent; text-align: center; text-align-last: center; color: var(--muted); font-weight: 550; cursor: pointer; height: 100%; min-height: 140px; }

.summary-line { margin-top: 18px; color: var(--ink-2); font-size: 14.5px; display: flex; gap: 8px; align-items: baseline; }
.summary-line b { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--ink); }

.cta { position: sticky; bottom: calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); margin-top: 24px; z-index: 5; }
.cta .btn { box-shadow: 0 8px 24px rgba(27,26,24,.18); }

/* list */
.progress { height: 3px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress > i { display: block; height: 100%; background: var(--brand-strong); transition: width .25s; }
.list { border-top: 1px solid var(--line); }
.list-item { display: flex; gap: 16px; align-items: center; padding: 16px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item label { margin: 0; font-size: 16.5px; font-weight: 500; color: var(--ink); flex: 1; cursor: pointer; }
.list-item input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0; border-radius: 50%; border: 1.5px solid var(--muted); background: transparent;
  display: grid; place-content: center; flex: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.list-item input[type=checkbox]::after { content: ""; width: 12px; height: 7px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg) translate(1px,-1px) scale(0); transition: transform .12s; }
.list-item input[type=checkbox]:checked { background: var(--ink); border-color: var(--ink); }
.list-item input[type=checkbox]:checked::after { transform: rotate(-45deg) translate(1px,-1px) scale(1); }
.list-item.done label .t { text-decoration: line-through; color: var(--muted); }
.list-item .src { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.list-item .src.shared { color: var(--ok); font-weight: 550; }
.sectionhead { margin: 30px 0 4px; }
.checkbox-plain { appearance: auto; }
input[type=checkbox].plain { width: 22px; height: 22px; accent-color: var(--ink); }

/* recipe page */
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
ul.ing { margin: 12px 0 0; padding: 0; list-style: none; }
ul.ing li { padding: 11px 0; border-bottom: 1px solid var(--line); }
ul.ing li:last-child { border-bottom: 0; }
.hero { border-radius: var(--radius); background: var(--tb, var(--t0)); color: var(--ti, var(--t0i)); padding: 22px; aspect-ratio: 16 / 9; display: flex; align-items: flex-end; margin-bottom: 18px; }
.hero .big { font-family: var(--serif); font-size: 110px; line-height: .75; letter-spacing: -.04em; font-weight: 500; }
.links { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 16px; font-size: 14.5px; }

.seg { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.seg button { min-height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 46px; border-radius: 999px; }

.empty { text-align: center; padding: 56px 12px; color: var(--muted); }
.empty h2 { font-family: var(--serif); font-size: 26px; text-transform: none; letter-spacing: -.01em; color: var(--ink); font-weight: 500; margin-bottom: 8px; }

/* nav */
.auth { padding-top: calc(88px + env(safe-area-inset-top)); }
.auth h1 { font-size: 56px; }
.auth .tagline { color: var(--ink-2); margin: 14px 0 34px; font-size: 18px; max-width: 24ch; }

#toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translate(-50%, -14px); opacity: 0; visibility: hidden;
  width: max-content; max-width: min(calc(100vw - 32px), 420px); padding: 12px 16px; border-radius: 18px; text-align: left;
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); font-size: 14.5px; font-weight: 500; line-height: 1.4;
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
  transition: opacity .25s var(--ease-out), transform .4s var(--ease-out), visibility .25s; pointer-events: none; z-index: 40; }
#toast.show { opacity: 1; transform: translate(-50%, 0); visibility: visible; }
#toast.error { padding-left: 32px; }
#toast.error::before { content: ""; position: absolute; left: 15px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* An explanation shown in place (e.g. a link that couldn't be read), with what to do next. */
.notice { margin-top: 16px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  animation: rise-in .45s var(--ease-out) both; }
.notice-head { display: flex; align-items: center; gap: 10px; }
.notice-head strong { font-size: 16px; font-weight: 600; color: var(--ink); }
.notice-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.notice-ic svg { width: 17px; height: 17px; }
.notice p { margin: 8px 0 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.notice-actions .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.notice-actions .btn svg { width: 17px; height: 17px; }
@media (prefers-reduced-motion: reduce) { .notice { animation: none; } }

.spinner { text-align: center; color: var(--muted); padding: 60px 0; }
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- sign in with Google / Apple ---------- */
.social { display: flex; flex-direction: column; gap: 10px; }
.social:empty { display: none; }
.btn.provider { gap: 10px; }
.provider-logo { width: 20px; height: 20px; flex: none; }
.btn.apple { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.apple .provider-logo { fill: currentColor; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13.5px; margin: 14px 0 4px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 14px 16px; }
.stat .n { font-size: 30px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
h3.section { margin: 26px 0 10px; }
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 550; font-size: 13px; }
table.data tr:last-child td { border-bottom: 0; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* ---------- recipe photos ---------- */
.tile .cover, .hero { overflow: hidden; }
.hero { position: relative; }
.cover .photo, .hero .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* Keep the cook-time badge readable on top of a photo. */
.tile .cover.has-photo .time {
  z-index: 1; color: #fff; opacity: 1; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px);
  padding: 4px 9px; border-radius: 999px; top: 10px; left: 10px;
}
.photo-field { margin-bottom: 6px; }
.photo-pick { margin-bottom: 0; aspect-ratio: 16 / 10; }
.photo-empty {
  display: flex; align-items: center; gap: 14px; padding: 18px; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-2);
}
.photo-empty:hover { border-color: var(--ink-2); }
.photo-empty .ic { width: 26px; height: 26px; flex: none; }
.photo-empty > span { display: flex; flex-direction: column; line-height: 1.3; }
.photo-empty strong { color: var(--ink); font-weight: 600; }
.photo-field label.btn { cursor: pointer; }
.photo-field label[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.photo-field > .small { display: block; margin-top: 8px; }

/* ---------- floating glass menu ---------- */
.glass {
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7);
  border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .14), 0 1px 0 rgba(255, 255, 255, .5) inset;
}
.nav {
  position: fixed; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 10;
  display: flex; justify-content: center; align-items: center; gap: 10px; pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav a { text-decoration: none; }
.nav-pill { display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; height: var(--nav-h); }
.nav-pill a {
  width: 52px; height: 100%; display: grid; place-items: center; border-radius: 999px;
  color: var(--muted); transition: color .15s, background .15s;
}
.nav-pill a svg { width: 23px; height: 23px; }
.nav-pill a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.nav-pill a[aria-current="page"] svg { stroke-width: 2.2; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13.5px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #5aa58a 0%, #4f86b8 55%, #8a6bb8 100%);
  box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s;
}
.nav-pill a.me[aria-current="page"] { background: transparent; }
.nav-pill a.me[aria-current="page"] .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.nav-add {
  width: var(--nav-h); height: var(--nav-h); border-radius: 50%; display: grid; place-items: center;
  color: var(--ink); transition: transform .45s var(--ease-out), background .2s;
}
.nav-add:active { transform: scale(.92); }
.nav-add svg { width: 26px; height: 26px; stroke-width: 2; transition: transform .45s var(--ease-out); }
.nav-add[aria-current="page"] { background: color-mix(in srgb, var(--ink) 10%, var(--surface)); }
/* While the add sheet is open the + turns into a ×, and sits above the blur. */
.sheet-open .nav { z-index: 31; }
.sheet-open .nav-pill { opacity: 0; transform: translateY(8px) scale(.97); pointer-events: none; }
.nav-pill { transition: opacity .3s var(--ease-out), transform .45s var(--ease-out); }
.sheet-open .nav-add svg { transform: rotate(135deg); }

/* ---------- add sheet (the + menu) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 16px calc(var(--nav-h) + 34px + env(safe-area-inset-bottom)); }
.scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); opacity: 0;
  transition: opacity .35s var(--ease-out), backdrop-filter .45s var(--ease-out), -webkit-backdrop-filter .45s var(--ease-out); }
.sheet-wrap.in .scrim { opacity: 1; backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
.sheet { position: relative; width: 100%; max-width: 440px; margin: 0 auto; }
.sheet h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; text-transform: none; color: var(--ink); line-height: 1.05; letter-spacing: -.02em; margin: 0 4px 18px;
  opacity: 0; transform: translateY(14px); transition: opacity .4s var(--ease-out), transform .55s var(--ease-out); }
.sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sheet-list li { opacity: 0; transform: translateY(18px) scale(.98);
  transition: opacity .35s var(--ease-out), transform .55s var(--ease-out); transition-delay: calc(60ms + var(--i) * 45ms); }
.sheet-wrap.in .sheet h2, .sheet-wrap.in .sheet-list li { opacity: 1; transform: none; }
/* Leaving: everything goes at once, quicker than it arrived. */
.sheet-wrap:not(.in) .sheet-list li, .sheet-wrap:not(.in) .sheet h2 { transition-duration: .2s; transition-delay: 0s; }
.sheet-item { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 14px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .06); color: var(--ink); font: inherit; cursor: pointer; transition: transform .2s var(--ease-out), background .2s; }
.sheet-item:hover { background: var(--surface); }
.sheet-item:active { transform: scale(.98); }
.sheet-item strong { display: block; font-weight: 600; font-size: 16px; }
.sheet-item small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.sheet-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-text); }
.sheet-ic svg { width: 21px; height: 21px; }

/* ---------- moving between pages ---------- */
main.enter { animation: page-in .5s var(--ease-out) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
main.enter .grid > * { animation: rise-in .55s var(--ease-out) both; }
main.enter .grid > :nth-child(2) { animation-delay: 40ms; } main.enter .grid > :nth-child(3) { animation-delay: 80ms; }
main.enter .grid > :nth-child(4) { animation-delay: 120ms; } main.enter .grid > :nth-child(5) { animation-delay: 160ms; }
main.enter .grid > :nth-child(n+6) { animation-delay: 200ms; }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@media (prefers-reduced-motion: reduce) {
  main.enter, main.enter .grid > * { animation: none; }
  .sheet h2, .sheet-list li, .scrim, .nav-add svg, .nav-pill { transition: opacity .15s !important; transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) { .glass { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* ---------- sign in ---------- */
.brand { font-family: var(--serif); font-size: 22px; letter-spacing: -.02em; }
.auth-top { display: flex; align-items: center; gap: 12px; margin: -60px 0 36px; }
.auth-top .logo-mark { margin-left: 4px; margin-right: -4px; }
.auth-mark { margin: 0 0 22px -3px; }
/* Logo colours come from the theme (--logo-ink, --logo-accent). */
.lm-ink { fill: var(--logo-ink); } .lm-accent { fill: var(--logo-accent); }
.auth.sub-page h1 { font-size: 40px; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--ink-2); font-weight: 550; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.auth form .linkbtn { margin-top: 10px; }

/* ---------- grid / list switch ---------- */
.viewtoggle { display: flex; gap: 4px; }
.viewtoggle .iconbtn { width: 38px; height: 38px; }
.grid.as-list { grid-template-columns: 1fr; gap: 8px; }
.as-list .tile { display: flex; align-items: center; min-height: 78px; }
.as-list .tile .cover { width: 78px; height: 78px; aspect-ratio: auto; flex: none; padding: 0; justify-content: center; align-items: center; }
.as-list .tile .cover .big { font-size: 38px; }
.as-list .tile .cover .time { display: none; }
.as-list .tile .meta { flex: 1; min-width: 0; padding: 10px 14px; }
.as-list .tile .meta h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-list .tile .tools { position: static; flex-direction: row; padding-right: 10px; order: 3; }
.as-list .tile .tools .iconbtn { background: transparent; }
.as-list .tile.add { min-height: 60px; }
.as-list .tile.add select { min-height: 60px; }
.tile .meta .lt { display: none; }
.as-list .tile .meta .lt { display: inline; }

/* ---------- shared-ingredient slider ---------- */
.slider-field { margin-top: 18px; }
.slider-field b { font-size: 14px; }
.slider-field #sh-desc { margin-top: 4px; min-height: 20px; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 8px 0 2px; background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--brand-strong) var(--fill, 0%), var(--line) var(--fill, 0%));
}
input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--brand-strong); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
input[type=range]:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 8px; }

/* ---------- past weeks ---------- */
h2.section-h { margin: 24px 0 10px; }
.stack + h2.section-h { margin-top: 28px; }
.week-card { padding: 12px; }
.week-open { display: flex; gap: 14px; align-items: center; width: 100%; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 68px; height: 68px; flex: none; border-radius: var(--radius-sm); overflow: hidden; }
.thumb { position: relative; overflow: hidden; display: grid; place-items: center; background: var(--tb, var(--t0)); color: var(--ti, var(--t0i)); }
.thumbs .thumb:only-child { grid-column: span 2; grid-row: span 2; }
.thumb .big { font-family: var(--serif); font-size: 16px; }
.thumbs .thumb:only-child .big { font-size: 32px; }
.thumb .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.week-meta { min-width: 0; }
.week-meta p { color: var(--muted); font-size: 14px; margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.week-card > .btn { margin-top: 12px; width: 100%; min-height: 42px; }

/* ---------- household ---------- */
.members { list-style: none; margin: 10px 0 0; padding: 0; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; overflow-wrap: anywhere; }
.members li:last-child { border-bottom: 0; }

/* ---------- plan options: one row per setting ---------- */
.opt-rows { margin-top: 10px; border-top: 1px solid var(--line); }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.opt-row label { margin: 0; font-size: 15px; font-weight: 550; color: var(--ink); flex: 1; min-width: 0; }
.opt-row select { width: auto; min-width: 150px; min-height: 42px; padding: 8px 34px 8px 14px; font-size: 15px; flex: none; }

/* ---------- pantry ---------- */
.add-pantry { padding: 0 16px; margin-bottom: 8px; }
.add-pantry summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 16px 0; font-weight: 600; }
.add-pantry summary::-webkit-details-marker { display: none; }
.add-pantry summary .ic { width: 20px; height: 20px; }
.add-pantry[open] summary { border-bottom: 1px solid var(--line); }
.pantry-form { padding-bottom: 16px; }
.pantry-form label:first-child { margin-top: 14px; }
.seg.seg-sm { margin-bottom: 0; }
.seg.seg-sm button { min-height: 38px; padding: 0 16px; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 550; cursor: pointer;
}
.chip .ic { width: 15px; height: 15px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pantry-form input[type=date] { width: auto; min-height: 40px; padding: 6px 12px; font-size: 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.p-list { padding: 0 6px 0 14px; }
.p-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.p-row:last-child { border-bottom: 0; }
.p-row > .pantry-form { flex: 1 1 100%; padding-right: 8px; }
.p-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; background: none; border: 0; padding: 4px 0; color: inherit; cursor: pointer; }
.p-name { font-size: 16px; font-weight: 550; overflow-wrap: anywhere; }
.p-sub { font-size: 13.5px; color: var(--muted); }
.p-sub:empty { display: none; }
.badge { flex: none; font-size: 12.5px; font-weight: 650; padding: 4px 9px; border-radius: 999px; white-space: nowrap; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.badge.gone { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); border-color: transparent; }
.badge.now { background: color-mix(in srgb, #d9822b 20%, transparent); color: var(--warn-ink); border-color: transparent; }
.badge.soon { background: color-mix(in srgb, #d9a62b 18%, transparent); color: var(--soon-ink); border-color: transparent; }
.p-row.st { gap: 8px; }
.p-row.st .p-main { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; cursor: default; flex-basis: 100%; }
.p-row.st input { flex: 1; min-width: 0; min-height: 38px; padding: 6px 12px; font-size: 15px; }
.p-row.st.gone .p-name { text-decoration: line-through; color: var(--muted); }
.p-row.st.gone input { opacity: .4; }
.usesoon { display: block; text-decoration: none; color: var(--ink); margin-bottom: 14px; border-color: color-mix(in srgb, #d9822b 45%, var(--line)); }
.tile .meta p.uses { display: flex; align-items: center; gap: 5px; color: var(--ink-2); font-weight: 550; font-size: 12.5px; margin-top: 4px; }
.tile .meta p.uses .ic { width: 13px; height: 13px; flex: none; }
.list-item .have { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ok, #3d7a4f); margin-top: 3px; }
.list-item .have.gone { color: var(--red); }
.list-item .have .ic { width: 13px; height: 13px; }
.list-item label { display: flex; flex-direction: column; align-items: flex-start; }

/* ---------- avatars ---------- */
.avatar { object-fit: cover; flex: none; letter-spacing: -.02em; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.big { width: 72px; height: 72px; font-size: 26px; }
.avatar-pick { position: relative; display: block; margin: 0; cursor: pointer; border-radius: 50%; }
.avatar-pick .cam {
  position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.avatar-pick .cam .ic { width: 14px; height: 14px; }
.profile label.linkbtn { display: inline; font-size: 14px; color: var(--ink-2); }
.members li > .row { flex: 1; }

/* ---------- shopping list: meals strip, already have, carry over ---------- */
.meals-strip { margin: 18px 0 16px; }
.meal-chip[aria-pressed="false"] { text-decoration: line-through; color: var(--muted); background: transparent; border-style: dashed; }
.meal-chip[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); }
.meal-chip[aria-pressed="true"] .ic { color: var(--ok); }
.have-btn { flex: none; font-size: 13.5px; padding: 6px 2px; }
.list-item.done .have-btn { visibility: hidden; }
.have-check { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.have-check .btn { flex: none; min-height: 40px; }
details.got-it { margin-top: 18px; }
details.got-it summary { cursor: pointer; list-style: none; color: var(--muted); font-weight: 600; font-size: 14.5px; padding: 8px 0; }
details.got-it summary::before { content: '+ '; }
details.got-it[open] summary::before { content: '– '; }
.carry h3 { font-size: 16px; }

/* ---------- offline ---------- */
.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 550; text-align: center;
}

/* ---------- recipe form: times + labels ---------- */
.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
.times input { text-align: center; }
.chip.suggested { border-style: dashed; border-color: color-mix(in srgb, var(--ok) 60%, var(--line)); color: var(--ok); }
.badge.diet { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border-color: transparent; }
.diet-mini:not(:first-child) { margin-left: 6px; }
.diet-mini { font-weight: 650; font-size: 11.5px; letter-spacing: .04em; color: var(--ok); }

/* ---------- nights ---------- */
.nights-row { align-items: center; }
.nights { display: flex; gap: 5px; flex: none; }
.night {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-weight: 650; font-size: 13.5px; cursor: pointer; padding: 0;
}
.night[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
@media (max-width: 380px) { .night { width: 30px; height: 30px; font-size: 12.5px; } .nights { gap: 3px; } }

.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 20px; }
.ws-day {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); color: var(--muted); text-decoration: none; background: transparent;
}
.ws-day.has { background: var(--surface); color: var(--ink); }
.ws-name { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; }
.ws-date { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ws-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; margin-top: 2px; }
.ws-day.has .ws-dot { background: var(--brand-strong); }

.tile .meta .daypick {
  appearance: none; -webkit-appearance: none; border: 0; background: none; padding: 0; margin: 0 0 2px; min-height: 0; width: auto;
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); cursor: pointer;
}
.tile .meta .daypick:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* ---------- plan header, slim ---------- */
.daydots { display: flex; gap: 4px; margin: 10px 0 0 -6px; }
.daydots .dd { width: 26px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 0;
  font-size: 12.5px; font-weight: 650; letter-spacing: .04em; color: var(--muted); text-decoration: none; border-radius: 8px; }
.daydots .dd i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.daydots .dd.has { color: var(--ink); }
.daydots .dd.has i { background: var(--brand-strong); }
.usesoon-line { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0 0 12px; padding: 10px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; text-decoration: none; }
.usesoon-line .dot { width: 8px; height: 8px; border-radius: 50%; background: #C98A2B; flex: none; }
.usesoon-line b { color: var(--ink); font-weight: 600; flex: none; }
.usesoon-line .names { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usesoon-line .go { color: var(--muted); flex: none; }
.shuffle-row { display: flex; gap: 8px; align-items: center; }
.shuffle-row > .btn.big { flex: 1; margin: 0; }
.iconbtn.big { width: 52px; height: 52px; flex: none; }
.iconbtn.big svg { width: 22px; height: 22px; }

/* Sheets that hold settings (rather than the + menu): a solid panel from the bottom, scrolls if tall. */
.sheet-wrap.plain { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
.sheet-wrap.plain .sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px 18px 18px;
  max-height: calc(100dvh - 40px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .18); opacity: 0; transform: translateY(40px);
  transition: opacity .3s var(--ease-out), transform .5s var(--ease-out); }
.sheet-wrap.plain.in .sheet { opacity: 1; transform: none; }
.sheet-wrap.plain:not(.in) .sheet { transition-duration: .2s; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.sheet-wrap.plain .sheet-head h2 { font-size: 26px; margin: 0; opacity: 1; transform: none; }
.sheet .opts { margin: 0; }
@media (prefers-reduced-motion: reduce) { .sheet-wrap.plain .sheet { transform: none !important; transition: opacity .15s !important; } }
.nights-row .small { white-space: nowrap; }

/* ---------- launch animation ---------- */
#sb-splash {
  --sb-ink: var(--logo-ink); --sb-turned: var(--logo-accent); --sb-loop: 2.6s;
  position: fixed; inset: 0; z-index: 9999; background: var(--bg) var(--sky);
  display: flex; align-items: center; justify-content: center; transition: opacity .45s ease;
}
#sb-splash.sb-out { opacity: 0; pointer-events: none; }
#sb-splash .sb-mark { width: 132px; height: 132px; overflow: visible; }
#sb-splash .sb-s { fill: var(--sb-ink); transform-box: fill-box; transform-origin: center;
  animation-duration: var(--sb-loop); animation-iteration-count: infinite; animation-fill-mode: both; }
#sb-splash .sb-square { fill: var(--sb-turned); }
#sb-splash .sb-circle { animation-name: sb-circle; }
#sb-splash .sb-half { animation-name: sb-half; }
#sb-splash .sb-quarter { animation-name: sb-quarter; }
#sb-splash .sb-square { animation-name: sb-square; }
#sb-splash.sb-hold .sb-s { animation-play-state: paused; }
#sb-splash .sb-name {
  position: absolute; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom));
  text-align: center; color: var(--sb-ink); font-family: var(--serif); font-size: 34px; line-height: 1; letter-spacing: -.01em;
  animation: sb-name .8s ease .1s both;
}
/* A spring that overshoots a touch when the shapes open and swap. */
@keyframes sb-circle {
  0%, 12%  { transform: translate(42px, 42px) scale(.24); animation-timing-function: cubic-bezier(.3, 1.45, .5, 1); }
  28%, 42% { transform: translate(0, 0) scale(1); animation-timing-function: cubic-bezier(.3, 1.35, .5, 1); }
  54%, 64% { transform: translate(84px, 4px) scale(1); animation-timing-function: cubic-bezier(.3, 1.35, .5, 1); }
  76%      { transform: translate(0, 0) scale(1); animation-timing-function: cubic-bezier(.6, 0, .4, 1); }
  90%, 100% { transform: translate(42px, 42px) scale(.24); }
}
@keyframes sb-half {
  0%, 12%  { transform: translate(-42px, 38px) scale(.24); opacity: 0; animation-timing-function: cubic-bezier(.3, 1.45, .5, 1); }
  28%, 42% { transform: translate(0, 0) scale(1); opacity: 1; animation-timing-function: cubic-bezier(.3, 1.35, .5, 1); }
  54%, 64% { transform: translate(0, 80px) scale(1); opacity: 1; animation-timing-function: cubic-bezier(.3, 1.35, .5, 1); }
  76%      { transform: translate(0, 0) scale(1); opacity: 1; animation-timing-function: cubic-bezier(.6, 0, .4, 1); }
  88%      { opacity: 1; }
  90%, 100% { transform: translate(-42px, 38px) scale(.24); opacity: 0; }
}
@keyframes sb-quarter {
  0%, 12%  { transform: translate(42px, -42px) scale(.24); opacity: 0; animation-timing-function: cubic-bezier(.3, 1.45, .5, 1); }
  28%, 42% { transform: translate(0, 0) scale(1); opacity: 1; animation-timing-function: cubic-bezier(.3, 1.35, .5, 1); }
  54%, 64% { transform: translate(0, -84px) scale(1); opacity: 1; animation-timing-function: cubic-bezier(.3, 1.35, .5, 1); }
  76%      { transform: translate(0, 0) scale(1); opacity: 1; animation-timing-function: cubic-bezier(.6, 0, .4, 1); }
  88%      { opacity: 1; }
  90%, 100% { transform: translate(42px, -42px) scale(.24); opacity: 0; }
}
@keyframes sb-square {
  0%, 12%  { transform: translate(-42px, -42px) scale(.24) rotate(0); opacity: 0; animation-timing-function: cubic-bezier(.3, 1.45, .5, 1); }
  28%, 42% { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; animation-timing-function: cubic-bezier(.3, 1.35, .5, 1); }
  54%, 64% { transform: translate(-84px, 0) scale(1) rotate(90deg); opacity: 1; animation-timing-function: cubic-bezier(.3, 1.35, .5, 1); }
  76%      { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; animation-timing-function: cubic-bezier(.6, 0, .4, 1); }
  88%      { opacity: 1; }
  90%, 100% { transform: translate(-42px, -42px) scale(.24) rotate(0); opacity: 0; }
}
@keyframes sb-name { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #sb-splash .sb-s, #sb-splash .sb-name { animation: none; } }

/* ---------- spend tracker ---------- */
.shoptabs { margin: -6px 0 18px; }
.eyebrow { display: block; font-size: 12.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.spend-head .eyebrow { margin-top: 0; }
.spend-total { font-family: var(--serif); font-size: 56px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.spend-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.spend-stats b { color: var(--ink); font-weight: 650; }
.spend-stats .down { color: var(--ok); } .spend-stats .up { color: var(--red); }
.store-bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; margin: 4px 0 4px; }
.store-bar i { display: block; min-width: 4px; }
.store-rows, .shop-list { border-top: 1px solid var(--line); margin-top: 10px; }
.store-row, .shop-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.shop-row { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.store-row .sw, .shop-row .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.store-row .n, .shop-row .n { flex: 1; min-width: 0; font-size: 15.5px; }
.store-row .n small, .shop-row .n small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.store-row .a, .shop-row .a { font-weight: 650; font-variant-numeric: tabular-nums; }
.spend-weeks { margin-top: 18px; padding: 16px; }
.spend-weeks h3 { margin: 0; font-size: 16px; }
.wk-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; margin-top: 12px; }
.wk { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.wk i { display: block; width: 100%; max-width: 34px; border-radius: 8px 8px 3px 3px; background: color-mix(in srgb, var(--ok) 32%, var(--surface));
  transform-origin: bottom; animation: bar-up .6s var(--ease-out) both; }
.wk.now i { background: var(--brand); }
.wk.none i { background: var(--line); }
.wk .amt { font-size: 11.5px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk.none .amt { color: var(--muted); font-weight: 500; }
.wk .lbl { font-size: 11px; color: var(--muted); white-space: nowrap; }
.wk:nth-child(2) i { animation-delay: 30ms; } .wk:nth-child(3) i { animation-delay: 60ms; } .wk:nth-child(4) i { animation-delay: 90ms; }
.wk:nth-child(5) i { animation-delay: 120ms; } .wk:nth-child(6) i { animation-delay: 150ms; } .wk:nth-child(7) i { animation-delay: 180ms; } .wk:nth-child(8) i { animation-delay: 210ms; }
@keyframes bar-up { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) { .wk i { animation: none; } }
.shop-form .chips { gap: 8px; }
.shop-form .chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.shop-other { margin-top: 10px; }
.amount-field { display: flex; align-items: baseline; gap: 4px; border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.amount-field:focus-within { border-color: var(--brand-strong); }
.amount-field span { font-family: var(--serif); font-size: 34px; color: var(--muted); }
.amount-field input { border: 0; background: transparent; padding: 0; min-height: 0; font-family: var(--serif); font-size: 52px; letter-spacing: -.02em;
  color: var(--ink); width: 100%; outline: none; box-shadow: none; }
.week-spend { float: right; margin-left: 10px; font-family: var(--sans); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.week-spend small { font-weight: 500; color: var(--muted); font-size: 12.5px; }

/* Spend: weeks you can tap to fill in */
.wk { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; border-radius: 8px; }
.wk:active i { filter: brightness(.92); }
.week-list { margin-top: 10px; border-top: 1px solid var(--line); }
.week-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 0; background: none; border: 0; border-bottom: 1px solid var(--line);
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.week-row .n { flex: 1; min-width: 0; font-size: 15px; }
.week-row .n small { display: block; color: var(--muted); font-size: 12.5px; }
.week-row .a { font-weight: 650; font-variant-numeric: tabular-nums; }
.week-row .add { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--brand-text); }
.week-row .add svg { width: 15px; height: 15px; }
.week-row .go { color: var(--muted); }
.small-total { font-size: 40px; margin: 6px 0 4px; }
.week-step { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.week-step .btn svg { width: 16px; height: 16px; }

.import-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 22px 0 6px; }
.import-row .btn svg, .empty .btn svg { width: 17px; height: 17px; }
.import-sheet .store-rows { margin-top: 14px; }

/* Shops: editable rows, double-up flags */
.shop-row-wrap { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.shop-row-wrap .shop-row { border-bottom: 0; flex: 1; min-width: 0; }
.shop-row .edit { color: var(--muted); display: grid; place-items: center; width: 28px; }
.shop-row .edit svg { width: 15px; height: 15px; }
.shop-row-wrap.double .shop-row .a { color: var(--red); }
.shop-row .dbl { font-style: normal; color: var(--red); font-weight: 600; }
.shop-row-wrap .rm { width: 34px; height: 34px; flex: none; color: var(--red); }
.shop-row-wrap .rm svg { width: 16px; height: 16px; }
.notice.doubles { margin: 0 0 6px; }
.section-h.row { margin: 24px 0 10px; }
