/* Layout: one calm column, lists on paper-white sheets, one floating add button in thumb reach. */
:root {
  /* Evergreen for actions and done states, peach only for moments of delight (baby size, celebrations). */
  --bg: #f5f5f1;
  --surface: #ffffff;
  --surface-2: #ecede7;
  --ink: #1b2420;
  --muted: #5d6862;
  --line: #e1e3dc;
  --accent: #2e5e52;
  --accent-ink: #ffffff;
  --accent-soft: #e2ece7;
  --warm: #b8673f;
  --warm-soft: #f8e7da;
  --ok: #2e5e52;
  --ok-soft: #e2ece7;
  --warn: #946414;
  --warn-soft: #f6ecd6;
  --danger: #ad3a2c;
  --danger-soft: #f7e0db;
  --p1: #2e5e52;
  --p2: #8a5a1c;
  --font-display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --shadow-float: 0 6px 24px rgba(27, 36, 32, .16);
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111513; --surface: #1a1f1c; --surface-2: #232a26; --ink: #ebe6dd; --muted: #9ba39d; --line: #2c3430;
    --accent: #8fc9b6; --accent-ink: #0f1412; --accent-soft: #1f2f29; --warm: #e3a782; --warm-soft: #33261e;
    --ok: #8fc9b6; --ok-soft: #1f2f29; --warn: #e0b05c; --warn-soft: #362c1a; --danger: #ec8b78; --danger-soft: #3a221e;
    --p1: #8fc9b6; --p2: #e3b26e; --shadow-float: 0 6px 24px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111513; --surface: #1a1f1c; --surface-2: #232a26; --ink: #ebe6dd; --muted: #9ba39d; --line: #2c3430;
  --accent: #8fc9b6; --accent-ink: #0f1412; --accent-soft: #1f2f29; --warm: #e3a782; --warm-soft: #33261e;
  --ok: #8fc9b6; --ok-soft: #1f2f29; --warn: #e0b05c; --warn-soft: #362c1a; --danger: #ec8b78; --danger-soft: #3a221e;
  --p1: #8fc9b6; --p2: #e3b26e; --shadow-float: 0 6px 24px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
.loading { padding: 40vh 0 0; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar h1 { margin: 0; font: 400 26px/1.15 var(--font-display); letter-spacing: -.005em; }
main { padding: 4px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 96px); max-width: 640px; margin: 0 auto; }
.topbar { max-width: 640px; margin: 0 auto; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex;
  padding: 6px 4px calc(env(safe-area-inset-bottom) + 4px); background: var(--surface); border-top: 1px solid var(--line);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 500; }
.tab .ic { width: 22px; height: 22px; }
.tab .ic { padding: 2px 14px; box-sizing: content-box; border-radius: 999px; }
.tab.active { color: var(--accent); font-weight: 650; }
.tab.active .ic { background: var(--accent-soft); }

.demo-banner { background: var(--surface-2); color: var(--muted); font-size: 13px; text-align: center; padding: calc(env(safe-area-inset-top) + 6px) 12px 6px; }
.demo-banner + .topbar { padding-top: 10px; }
.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; font-size: inherit; }

/* ---------- Icons & buttons ---------- */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface-2); color: var(--ink); flex: none; text-decoration: none; }
.icon-btn.subtle { background: none; color: var(--muted); width: 36px; height: 36px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none;
}
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: var(--surface); flex: 1; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }

/* ---------- Hero ---------- */
.hero { margin: 6px 2px 4px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--accent); }
.hero-title { font: 400 36px/1.1 var(--font-display); letter-spacing: -.01em; margin: 4px 0 6px; text-wrap: balance; }
.hero-sub { color: var(--muted); }
.hero-due { margin-top: 8px; font-size: 14px; color: var(--ink); }
.progress { margin-top: 14px; }
.progress-track { position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); }
.progress-ticks { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Sections & lists ---------- */
.section { margin-top: 30px; }
.section h2, .collapsible summary { font-size: 18px; font-weight: 650; letter-spacing: -.005em; color: var(--ink); margin: 0 0 10px; }
.collapsible summary { font-size: 15px; color: var(--muted); }
.collapsible summary { cursor: pointer; list-style: none; padding: 4px 0; }
.collapsible summary::before { content: '▸ '; }
.collapsible[open] summary::before { content: '▾ '; }
.list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.stack { display: grid; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px 10px 14px;
  border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left;
}
.list > .row:last-child { border-bottom: 0; }
.row .grow { cursor: pointer; }
.grow { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { color: var(--muted); font-size: 14px; margin-top: 1px; overflow-wrap: anywhere; }
.row.done .row-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.row.late .row-sub { color: var(--danger); font-weight: 600; }
.row.warn { background: var(--warn-soft); }
.row.warn > .ic { color: var(--warn); }
.link-row { margin-top: 12px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); border: 0; cursor: pointer; }
.link-row .ic { color: var(--accent); }

.check {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface);
  display: grid; place-items: center; flex: none; padding: 0; color: var(--accent-ink);
}
.check.on { background: var(--ok); border-color: var(--ok); }
.check .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.row.late .check { border-color: var(--danger); }

.badge { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); flex: none; }
.badge.route-injection { background: var(--warm-soft); color: var(--warm); }
.pill-line { margin-top: 6px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }

.card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; background: var(--surface); border: 0; border-radius: var(--radius); border: 1px solid var(--line); text-align: left; }
.card > .ic { color: var(--muted); }
.card.done { opacity: .7; }
.date-chip { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); flex: none; line-height: 1; }
.date-chip b { font-size: 17px; }
.date-chip span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.date-chip.big { width: 52px; height: 52px; background: var(--accent-soft); }
.date-chip.big b { font-size: 20px; color: var(--accent); }
.empty { padding: 18px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.empty p { margin: 0 0 8px; }
.empty p:last-child { margin: 0; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 2px; }
.note { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; margin: 0 0 12px; }
.answer { margin-top: 4px; padding: 6px 10px; border-left: 3px solid var(--ok); background: var(--ok-soft); border-radius: 6px; font-size: 14px; white-space: pre-wrap; }

/* ---------- Segmented, chips, quick add, search ---------- */
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin: 4px 0 12px; }
.segmented button { flex: 1; min-height: 36px; border: 0; border-radius: 9px; background: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.chip.now { border-color: var(--accent); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .count { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 6px; }
.quick { display: flex; gap: 8px; margin: 4px 0 12px; }
.quick input { flex: 1; }
.quick .btn { flex: none; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.search .ic { color: var(--muted); }
.search input { border: 0; background: none; padding: 12px 0; flex: 1; min-width: 0; }
.search input:focus { outline: none; }

input, select, textarea {
  width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 16px;
}
textarea { resize: vertical; min-height: 80px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--ok); }

/* ---------- Forms & sheets ---------- */
.form { display: grid; gap: 12px; }
.form label, .login label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.two label { min-width: 0; display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.times { display: grid; gap: 6px; margin: 4px 0 8px; }
.time-row { display: flex; gap: 6px; align-items: center; }
.toggle { display: flex !important; align-items: center; gap: 10px; color: var(--ink) !important; font-size: 16px !important; margin-top: 12px; }
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.scrim { position: absolute; inset: 0; background: rgba(10, 16, 13, .45); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-float); transform: translateY(100%); transition: transform .22s ease-out; max-width: 640px; margin: 0 auto;
}
.sheet-wrap.open .scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; }
.sheet-head h2 { margin: 0; font: 400 22px/1.2 var(--font-display); }
.sheet-body { overflow-y: auto; overflow-x: hidden; padding: 6px 16px calc(env(safe-area-inset-bottom) + 20px); display: grid; gap: 12px; align-content: start; }
.sheet-body h3 { margin: 12px 0 0; font-size: 16px; font-weight: 650; color: var(--ink); }
.sheet-body > p { margin: 0; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.sheet-actions .btn.primary { flex: 1; }
.site-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.site { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; }
.site.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.error { color: var(--danger); margin: 0; }

/* ---------- Food ---------- */
.weeknav { display: flex; align-items: center; justify-content: space-between; text-align: center; margin-bottom: 12px; }
.day { flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 12px 8px; }
.day.today { outline: 2px solid var(--accent); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.slot { display: flex; gap: 10px; align-items: baseline; text-align: left; border: 0; background: none; padding: 8px 0; border-top: 1px solid var(--line); min-height: 40px; }
.slot-label { width: 78px; flex: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.slot-text { flex: 1; white-space: pre-wrap; }
.slot.blank .slot-text { color: var(--muted); }
.status { flex: none; width: 70px; text-align: center; font-size: 12px; font-weight: 700; padding: 4px 0; border-radius: 8px; align-self: flex-start; margin-top: 2px; }
.status.avoid { background: var(--danger-soft); color: var(--danger); }
.status.limit { background: var(--warn-soft); color: var(--warn); }
.status.careful { background: var(--accent-soft); color: var(--accent); }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.row.food { align-items: flex-start; }
.warn-link { border: 0; background: none; padding: 0; text-align: left; font-weight: 600; }
.warn-link.avoid { color: var(--danger); }
.warn-link.limit { color: var(--warn); }
.warn-link.careful { color: var(--accent); }
.sources { margin-top: 20px; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.sources p { margin: 0 0 4px; }

/* ---------- Shop ---------- */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary > div { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: 12px; display: grid; gap: 2px; }
.summary b { font-size: 20px; font-variant-numeric: tabular-nums; }
.summary span { font-size: 12px; color: var(--muted); }


/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: 8px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 0 4px; }
.cal-day { aspect-ratio: 1 / 1.05; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 6px 0 0; border: 0; border-radius: 10px; background: none; font-variant-numeric: tabular-nums; }
.cal-day.out .cal-num { color: var(--muted); opacity: .55; }
.cal-num { font-size: 15px; font-weight: 600; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.sel .cal-num { background: var(--ink); color: var(--bg); box-shadow: none; }
.cal-dots { display: flex; gap: 3px; min-height: 6px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.big { width: 10px; height: 10px; }
.dot.k-appt { background: var(--accent); }
.dot.k-med { background: var(--warm); }
.dot.k-todo, .dot.k-decide { background: var(--muted); }
.dot.k-milestone { background: var(--ink); }
.dot.k-expected { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 2px 0; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.row.ev { cursor: pointer; }
.row.ev.k-expected .row-title { font-weight: 500; }
.row.ev:disabled { cursor: default; color: inherit; opacity: 1; }

/* ---------- Login & toast ---------- */
.login { max-width: 380px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12vh) 24px 40px; display: grid; gap: 14px; text-align: center; }
.login h1 { margin: 0; font: 400 32px/1.15 var(--font-display); }
.login p { margin: 0; }
.login form { display: grid; gap: 12px; text-align: left; margin-top: 8px; }
.login-mark { width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.login-mark .ic { width: 32px; height: 32px; }
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 30; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.link.small { font-size: 13px; }

/* ---------- Phase caption & legend ---------- */
.phase-caption { margin: -2px 2px 10px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.phase-caption .pill { margin-left: 6px; vertical-align: 1px; }
.phase-caption b { color: var(--ink); }
.phase-legend { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; margin: 0; padding: 14px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); font-size: 14px; }
.phase-legend dt { font-weight: 700; font-size: 13px; min-width: 44px; text-align: center; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); align-self: start; }
.phase-legend dt.now { border-color: var(--accent); color: var(--accent); }
.phase-legend dd { margin: 0; min-width: 0; }

/* ---------- Shop options ---------- */
.options { display: grid; gap: 10px; }
.option-add { display: grid; gap: 8px; padding: 12px; background: var(--surface-2); border-radius: var(--radius); }
.option-add .quick { margin: 0; }
.row.option.picked { background: var(--ok-soft); }
.row.option .price { white-space: nowrap; margin-left: 8px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.icon-btn.heart.on { color: var(--accent); }
.icon-btn.heart.on .ic { fill: currentColor; }
.picked-line { color: var(--ok); font-weight: 600; }

/* ---------- Shop categories ---------- */
details.cat { margin-top: 10px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
details.cat summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; cursor: pointer; }
details.cat summary::-webkit-details-marker { display: none; }
details.cat summary .cat-name { flex: 1; font-weight: 700; }
details.cat summary .cat-meta { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
details.cat summary .ic { color: var(--muted); transition: transform .15s; }
details.cat[open] summary .ic { transform: rotate(90deg); }
details.cat[open] summary { border-bottom: 1px solid var(--line); }
details.cat .list { box-shadow: none; border-radius: 0; }
@media (prefers-reduced-motion: reduce) { details.cat summary .ic { transition: none; } }

/* ---------- Baby size ---------- */
.size-card { display: flex; align-items: center; gap: 16px; width: 100%; margin-top: 12px; padding: 16px; border: 0; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-align: left; color: var(--ink); }
.size-art { width: 88px; height: 88px; flex: none; border-radius: 50%; background: var(--warm-soft); display: grid; place-items: center; }
.size-art.sm { width: 40px; height: 40px; }
.size-emoji { font-size: 26px; line-height: 1; }
.size-emoji.big { font-size: 52px; }
.size-dot-wrap { display: grid; place-items: center; }
.size-dot { display: block; border-radius: 50%; background: var(--warm); }
.size-lead { font-size: 14px; color: var(--muted); margin-top: 2px; }
.size-name { font: 400 26px/1.15 var(--font-display); text-transform: capitalize; }
.size-next { margin-top: 6px; font-size: 13px; color: var(--muted); }
.size-row .size-wk { width: 24px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
.size-row .row-title { text-transform: capitalize; }
.size-row .pill { margin-left: 8px; text-transform: none; }
.size-row.current { background: var(--warm-soft); }
.size-row.past { opacity: .6; }

/* ---------- People ---------- */
.avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; color: var(--bg); background: var(--p1); flex: none; vertical-align: -5px; }
.avatar.p2 { background: var(--p2); }
.avatar.both { background: var(--surface-2); color: var(--muted); width: auto; padding: 0 7px; border-radius: 999px; }
.who { display: inline-flex; gap: 2px; margin-right: 6px; }

/* ---------- Quick add ---------- */
.fab {
  position: fixed; right: max(16px, calc((100vw - 640px) / 2 + 16px)); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); z-index: 7;
  width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: var(--shadow-float);
}
.fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-tile { display: grid; gap: 8px; justify-items: start; padding: 14px; min-height: 92px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; font-weight: 600; }
.quick-tile .ic { width: 24px; height: 24px; color: var(--accent); }
.quick-tile span { font-size: 13px; font-weight: 400; color: var(--muted); }
#toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 84px); }

/* ---------- Must-reads ---------- */
.flag-line { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--warm); }
.flag-line .ic { width: 16px; height: 16px; margin-top: 2px; }
.flag-line.sent { color: var(--muted); font-weight: 500; }
.flag-line.read { color: var(--accent); }
.row.flagged { background: var(--warm-soft); }
.flag-btn.on { color: var(--warm); }
.flag-btn.on .ic { fill: currentColor; }
.tab-icon { position: relative; display: inline-grid; }
.tab-badge { position: absolute; top: -2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--warm); color: var(--bg); font: 700 11px/18px var(--font-body); font-style: normal; text-align: center; }
.flag-add { margin-top: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--warm-soft); }
.flag-add .toggle { margin-top: 0; font-weight: 600; }
.flag-add .toggle .ic { width: 18px; height: 18px; color: var(--warm); }
.flag-add textarea { margin-top: 10px; }
.oster { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2, rgba(0,0,0,.035)); font-size: 14px; line-height: 1.4; color: var(--ink); }
.oster.differs { background: var(--warm-soft); }
.oster-who { font-weight: 700; color: var(--warm); }
.oster:not(.differs) .oster-who { color: var(--muted); }
.oster a { color: var(--accent); font-weight: 600; }
