/* Layout: one 980px column. Masthead with a too-fast disclaimer ticker, a tab bar, then the active view.
   Med cards borrow the pharmacy-sticker look; the fine print borrows the FDA Drug Facts panel. */
:root {
  --bg: #F2F4F2;
  --surface: #FFFFFF;
  --sunk: #E7EBE8;
  --ink: #141716;
  --muted: #58605C;
  --rule: #CBD2CE;
  --amber: #B0560A;          /* prescription-bottle amber */
  --amber-ink: #FFFFFF;
  --amber-soft: #FAE8D4;
  --danger: #B3261E;
  --danger-soft: #FAE1DE;
  --caution: #8A5A00;
  --caution-soft: #F6ECD2;
  --ok: #2D6A4D;
  --ok-soft: #DDEFE4;
  --hl: #FFEC4D;             /* highlighter on the insert */
  --hl-ink: #141716;
  --ticker-bg: #141716;
  --ticker-ink: #F2F4F2;

  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.4rem;
  --step-3: 1.9rem;
  --step-4: 2.8rem;

  --radius: 4px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111413; --surface: #1A1E1C; --sunk: #232826; --ink: #E9EDEA; --muted: #9AA39E; --rule: #323936;
    --amber: #EE9A4A; --amber-ink: #1A1206; --amber-soft: #3A2814;
    --danger: #FF8A7F; --danger-soft: #3D1D1A; --caution: #E9BC5A; --caution-soft: #362B12;
    --ok: #7CC7A0; --ok-soft: #173126; --hl: #6E6200; --hl-ink: #FFF8C2;
    --ticker-bg: #E9EDEA; --ticker-ink: #111413;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111413; --surface: #1A1E1C; --sunk: #232826; --ink: #E9EDEA; --muted: #9AA39E; --rule: #323936;
  --amber: #EE9A4A; --amber-ink: #1A1206; --amber-soft: #3A2814;
  --danger: #FF8A7F; --danger-soft: #3D1D1A; --caution: #E9BC5A; --caution-soft: #362B12;
  --ok: #7CC7A0; --ok-soft: #173126; --hl: #6E6200; --hl-ink: #FFF8C2;
  --ticker-bg: #E9EDEA; --ticker-ink: #111413;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--f-body);
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- masthead ---------- */
.masthead { padding-block: 22px 14px; }
.masthead .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand h1 {
  margin: 0;
  font-family: var(--f-display);
  font-stretch: 68%;
  font-weight: 900;
  font-size: var(--step-4);
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.brand h1 .asterisk { color: var(--amber); }
.brand p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.brand p em { font-style: normal; font-family: var(--f-display); font-stretch: 62%; font-size: 0.75em; letter-spacing: 0.02em; }

.ticker {
  background: var(--ticker-bg);
  color: var(--ticker-ink);
  overflow: hidden;
  position: relative;
  border-block: 1px solid var(--ticker-bg);
}
.ticker-row { display: flex; align-items: stretch; }
.ticker-track { flex: 1; overflow: hidden; min-width: 0; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-text {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--f-display);
  font-stretch: 62%;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding-block: 6px;
  padding-left: 100%;
  animation: crawl var(--crawl, 30s) linear infinite;
}
.ticker.slow .ticker-text { font-size: 0.95rem; font-stretch: 85%; letter-spacing: 0.01em; padding-block: 8px; }
@keyframes crawl { to { transform: translateX(-100%); } }
.ticker button {
  flex: none;
  border: 0;
  background: var(--amber);
  color: var(--amber-ink);
  font-family: var(--f-display);
  font-stretch: 75%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  padding: 0 14px;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .ticker-text { animation: none; padding-left: 12px; }
}

/* ---------- tabs ---------- */
.tabs { border-bottom: 1px solid var(--rule); background: var(--bg); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.tabs .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  flex: none;
  text-decoration: none;
  padding: 12px 14px 10px;
  font-family: var(--f-display);
  font-stretch: 80%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--step--1);
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--amber); }
.tabs a:hover { color: var(--ink); }
.tabs .count { font-family: var(--f-mono); font-weight: 500; font-stretch: 100%; margin-left: 4px; color: var(--muted); }

main { padding-block: 24px 48px; }

/* ---------- type & generic pieces ---------- */
h2, h3, h4 { font-family: var(--f-display); text-wrap: balance; margin: 0; }
h2 { font-stretch: 75%; font-weight: 800; font-size: var(--step-3); line-height: 1.05; text-transform: uppercase; }
h3 { font-stretch: 85%; font-weight: 800; font-size: var(--step-1); line-height: 1.2; }
h4 { font-stretch: 85%; font-weight: 700; font-size: var(--step-0); }
.eyebrow { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.section-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.section-head p { margin: 0; color: var(--muted); max-width: 62ch; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-weight: 600;
  font-size: var(--step--1);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--muted); border-color: var(--muted); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger[data-armed="1"] { background: var(--danger); color: var(--surface); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 0.78rem; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--sunk);
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
}
.chip.box { background: var(--ink); color: var(--bg); border-radius: 2px; text-transform: uppercase; letter-spacing: 0.04em; font-family: var(--f-display); font-stretch: 80%; }
.chip.red { background: var(--danger-soft); color: var(--danger); }
.chip.yellow { background: var(--caution-soft); color: var(--caution); }
.chip.green { background: var(--ok-soft); color: var(--ok); }
.chip.hl { background: var(--hl); color: var(--hl-ink); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
button.chip { border: 0; cursor: pointer; }

mark { background: var(--hl); color: var(--hl-ink); padding: 0 1px; border-radius: 2px; }
mark.mk-med { background: var(--amber-soft); color: var(--ink); box-shadow: inset 0 -2px 0 var(--amber); }

.notice {
  border: 1.5px solid var(--rule);
  background: var(--surface);
  padding: 12px 14px;
  border-radius: var(--radius);
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.notice p { margin: 0; max-width: 70ch; }
.notice.example { border-style: dashed; border-color: var(--amber); background: var(--amber-soft); }
.notice.urgent { border-color: var(--danger); background: var(--danger-soft); color: var(--ink); }
.notice.urgent strong { color: var(--danger); }

/* ---------- summary strip ---------- */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid var(--ink); background: var(--surface); border-radius: var(--radius); }
.summary > div { padding: 12px 14px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.summary > div:first-child { border-left: 0; }
.summary b { font-family: var(--f-display); font-stretch: 75%; font-weight: 800; font-size: var(--step-3); line-height: 1; font-variant-numeric: tabular-nums; }
.summary b.red { color: var(--danger); }
.summary b.yellow { color: var(--caution); }
.summary span { font-size: var(--step--1); color: var(--muted); }
@media (max-width: 620px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary > div:nth-child(3) { border-left: 0; }
  .summary > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ---------- med cards: pharmacy sticker ---------- */
.meds { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.med {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  min-width: 0;
}
.med.is-example { border-style: dashed; }
.med-top { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--rule); font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.med-top .rx { color: var(--amber); font-weight: 500; }
.med-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.med-name { font-family: var(--f-display); font-stretch: 70%; font-weight: 900; font-size: var(--step-3); line-height: 0.95; text-transform: uppercase; overflow-wrap: anywhere; }
.med-generic { color: var(--muted); font-size: var(--step--1); margin-top: -2px; text-transform: lowercase; }
.med-sig { font-family: var(--f-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.02em; border-top: 1px dashed var(--rule); border-bottom: 1px dashed var(--rule); padding-block: 6px; }
.med-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.med-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.med-foot .small { font-variant-numeric: tabular-nums; }
.med-loading { font-size: var(--step--1); color: var(--muted); font-style: italic; }
.add-card {
  border: 1.5px dashed var(--rule); border-radius: var(--radius); background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 220px; padding: 20px; text-align: center; color: var(--muted); text-decoration: none; cursor: pointer;
}
.add-card:hover { border-color: var(--amber); color: var(--ink); }
.add-card b { font-family: var(--f-display); font-stretch: 75%; font-size: var(--step-2); text-transform: uppercase; color: var(--ink); }

/* ---------- forms ---------- */
.panel { background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: var(--step--1); font-weight: 600; min-width: 0; }
label.field .hint { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="date"], input[type="datetime-local"], input[type="search"], textarea, select {
  width: 100%;
  border: 1.5px solid var(--rule);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 9px 11px;
  font-size: var(--step-0);
  min-width: 0;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; }
textarea { resize: vertical; min-height: 64px; }
.big-input { font-size: var(--step-1) !important; font-weight: 600; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 8px 14px; font-size: var(--step--1); font-weight: 600; cursor: pointer; border-left: 1px solid var(--rule); }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; }

.candidates { display: flex; flex-direction: column; gap: 8px; }
.cand { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; background: var(--bg); }
.cand:hover { border-color: var(--muted); }
.cand input { margin-top: 5px; accent-color: var(--amber); }
.cand.on { border-color: var(--ink); background: var(--surface); }
.cand-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cand-name { font-weight: 700; }
.cand-meta { font-size: var(--step--1); color: var(--muted); }

/* ---------- med detail ---------- */
.back { font-size: var(--step--1); color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.detail-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; margin-bottom: 18px; }
@media (max-width: 620px) { .detail-head { grid-template-columns: minmax(0, 1fr); } }
.detail-head .med-name { font-size: var(--step-4); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 820px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Drug Facts panel */
.facts { border: 2px solid var(--ink); background: var(--surface); border-radius: 2px; }
.facts-title { font-family: var(--f-display); font-stretch: 80%; font-weight: 900; font-size: var(--step-2); padding: 8px 12px 4px; border-bottom: 6px solid var(--ink); line-height: 1.1; }
.facts-row { padding: 10px 12px; border-bottom: 1px solid var(--ink); display: flex; flex-direction: column; gap: 4px; }
.facts-row:last-child { border-bottom: 0; }
.facts-row h4 { font-stretch: 85%; font-weight: 800; font-size: var(--step-0); }
.facts-row p { margin: 0; }
.facts-row.thick { border-bottom-width: 3px; }

.boxed {
  border: 4px solid var(--ink);
  background: var(--surface);
  padding: 14px 16px;
}
.boxed h3 { font-stretch: 80%; text-transform: uppercase; letter-spacing: 0.01em; margin-bottom: 8px; }
.boxed .lead { color: var(--muted); font-size: var(--step--1); margin: 0 0 8px; }

.fp-section { background: var(--surface); border: 1.5px solid var(--rule); border-radius: var(--radius); }
.fp-section > summary {
  list-style: none; cursor: pointer;
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.fp-section > summary::-webkit-details-marker { display: none; }
.fp-section > summary .t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fp-section > summary .t span { font-size: var(--step--1); color: var(--muted); }
.fp-section > summary .caret { font-family: var(--f-mono); color: var(--muted); flex: none; transition: transform .15s; }
.fp-section[open] > summary .caret { transform: rotate(90deg); }
.fp-section[open] > summary { border-bottom: 1px solid var(--rule); }
.fp-body { padding: 4px 16px 14px; max-width: 72ch; }
.fp-body p { margin: 10px 0 0; }
.fp-body ul { margin: 6px 0 0; padding-left: 20px; }
.fp-body li { margin: 4px 0; }
.lblock { position: relative; }
.lnum { font-family: var(--f-mono); font-size: 0.7rem; color: var(--muted); display: block; margin-top: 14px; }
.lnum + p { margin-top: 2px; }
.source { font-size: 0.75rem; color: var(--muted); }

/* reports chart */
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: var(--step--1); }
.bar .name { min-width: 0; overflow-wrap: anywhere; }
.bar .name small { color: var(--muted); }
.bar .n { font-family: var(--f-mono); font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.75rem; }
.bar .track { grid-column: 1 / -1; height: 8px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--muted); border-radius: 2px; }
.bar.match .fill { background: var(--amber); }
.bar.match .name { font-weight: 700; }

.speak { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.speak .btn[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }

/* ---------- symptoms ---------- */
.log { display: flex; flex-direction: column; gap: 0; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
.entry { padding: 14px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 4px 14px; }
.entry:first-child { border-top: 0; }
.entry.is-example { background: repeating-linear-gradient(135deg, transparent 0 10px, var(--amber-soft) 10px 11px); }
.entry-when { font-family: var(--f-mono); font-size: 0.75rem; color: var(--muted); line-height: 1.35; font-variant-numeric: tabular-nums; }
.entry-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.entry-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.entry-title b { font-size: var(--step-1); font-family: var(--f-display); font-stretch: 85%; }
.entry-notes { color: var(--muted); font-size: var(--step--1); margin: 0; }
.hits { display: flex; flex-direction: column; gap: 6px; }
.hit { font-size: var(--step--1); border-left: 3px solid var(--rule); padding-left: 10px; }
.hit.strong { border-left-color: var(--amber); }
.hit.weak { opacity: 0.8; }
.hit q { display: block; color: var(--muted); margin-top: 2px; quotes: "\201C" "\201D"; }
@media (max-width: 620px) {
  .entry { grid-template-columns: minmax(0, 1fr) auto; }
  .entry-when { grid-column: 1 / -1; }
}

/* ---------- mix ---------- */
.pairs { display: flex; flex-direction: column; gap: 12px; }
.pair { background: var(--surface); border: 1.5px solid var(--rule); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.pair.sev-3 { border-color: var(--danger); }
.pair.sev-2 { border-color: var(--caution); }
.pair-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pair-title h3 { font-stretch: 75%; text-transform: uppercase; font-size: var(--step-2); }
.pair-title h3 .plus { color: var(--muted); font-weight: 400; padding: 0 4px; }
.excerpt { font-size: var(--step--1); border-left: 3px solid var(--rule); padding-left: 10px; margin: 0; }
.excerpt .source { display: block; margin-top: 2px; }
.everyday { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.everyday th, .everyday td { border-bottom: 1px solid var(--rule); padding: 8px 10px; text-align: left; vertical-align: top; }
.everyday th { font-family: var(--f-mono); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius); }
.quiet-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: var(--step--1); }

/* ---------- doctor visit sheet ---------- */
.sheet { background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 22px; }
.sheet table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.sheet th, .sheet td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sheet th { font-family: var(--f-mono); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sheet ol { margin: 0; padding-left: 20px; }
.sheet ol li { margin: 6px 0; }
.sheet h3 { border-bottom: 2px solid var(--ink); padding-bottom: 4px; margin-bottom: 8px; text-transform: uppercase; font-stretch: 75%; }

footer.legal { border-top: 1px solid var(--rule); padding-block: 22px 40px; color: var(--muted); font-size: var(--step--1); }
footer.legal .wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
footer.legal p { margin: 0 0 6px; max-width: 68ch; }
footer.legal .lines { font-family: var(--f-mono); font-size: 0.75rem; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 620px) { footer.legal .wrap { grid-template-columns: minmax(0, 1fr); } }

.empty { border: 1.5px dashed var(--rule); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 10px; align-items: center; }

#toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius);
  font-size: var(--step--1); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  .masthead, .ticker, .tabs, footer.legal, .no-print, #toast { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
  .sheet { border: 0; padding: 0; }
}
