/* ============================================================
   The Interaction Atlas — Consumer screens (Deep Ocean)
   Scoped design-token layer + screen primitives.

   Every consumer screen wraps its content in `.tcx`, which (re)defines
   the handoff's Deep Ocean tokens in true oklch — the exact values from
   design_handoff_tia_consumer/design/tokens.css. This extends the existing
   --cmp-* Deep Ocean namespace with the perceptual six-tier risk scale and
   keeps the palette identical to the design handoff without disturbing the
   rest of the app.
   ============================================================ */
.tcx {
  /* ── Brand: Deep Ocean ─────────────────────────────────── */
  --ink-950: oklch(0.14 0.035 250);
  --ink-900: oklch(0.21 0.042 250);
  --ink-800: oklch(0.30 0.058 245);
  --ink-700: oklch(0.40 0.072 240);
  --ink-600: oklch(0.47 0.065 238);
  --ink-500: oklch(0.55 0.055 235);
  --ink-300: oklch(0.78 0.025 235);
  --ink-200: oklch(0.88 0.018 235);
  --ink-100: oklch(0.94 0.012 235);
  --ink-50:  oklch(0.975 0.008 235);

  /* ── Surfaces: Warm Paper ──────────────────────────────── */
  --paper: oklch(0.985 0.006 85);
  --bone:  oklch(0.965 0.012 85);
  --ash:   oklch(0.92 0.012 85);

  /* ── Tier scale (perceptually graded green→magenta) ────── */
  --t0: oklch(0.65 0.14 150);
  --t1: oklch(0.72 0.14 95);
  --t2: oklch(0.69 0.16 65);
  --t3: oklch(0.64 0.18 45);
  --t4: oklch(0.56 0.21 25);
  --t5: oklch(0.38 0.16 330);
  --t0-soft: oklch(0.95 0.04 150);
  --t1-soft: oklch(0.96 0.05 95);
  --t2-soft: oklch(0.95 0.05 65);
  --t3-soft: oklch(0.95 0.06 45);
  --t4-soft: oklch(0.95 0.05 25);
  --t5-soft: oklch(0.93 0.04 330);

  /* ── Accent + emergency ────────────────────────────────── */
  --accent: oklch(0.58 0.12 215);
  --accent-soft: oklch(0.95 0.025 215);
  --emergency: oklch(0.50 0.22 25);
  --emergency-deep: oklch(0.32 0.18 25);

  /* ── Type ──────────────────────────────────────────────── */
  --f-display: "Instrument Serif", "Times New Roman", Georgia, serif;
  --f-sans: "Geist", -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Geist Mono", "SF Mono", ui-monospace, "JetBrains Mono", monospace;

  /* ── Radii ─────────────────────────────────────────────── */
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 9999px;

  /* ── Shadows ───────────────────────────────────────────── */
  --sh-1: 0 1px 0 rgb(11 31 54 / 0.04), 0 1px 2px rgb(11 31 54 / 0.05);
  --sh-2: 0 2px 4px rgb(11 31 54 / 0.06), 0 8px 16px -4px rgb(11 31 54 / 0.08);
  --sh-3: 0 6px 12px rgb(11 31 54 / 0.10), 0 20px 40px -8px rgb(11 31 54 / 0.16);
  --sh-press: inset 0 2px 4px rgb(11 31 54 / 0.20);

  /* ── Motion ────────────────────────────────────────────── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 140ms; --t-base: 240ms; --t-slow: 480ms;

  font-family: var(--f-sans);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Map the existing --cmp-* Deep Ocean namespace onto the true oklch tokens so
   any --cmp-* usage inside a consumer screen matches the handoff exactly. */
.tcx {
  --cmp-ink-950: var(--ink-950); --cmp-ink-900: var(--ink-900);
  --cmp-ink-800: var(--ink-800); --cmp-ink-700: var(--ink-700);
  --cmp-ink-600: var(--ink-600); --cmp-ink-500: var(--ink-500);
  --cmp-ink-300: var(--ink-300); --cmp-ink-200: var(--ink-200);
  --cmp-ink-100: var(--ink-100); --cmp-ink-50: var(--ink-50);
  --cmp-paper: var(--paper); --cmp-bone: var(--bone); --cmp-ash: var(--ash);
  --cmp-accent: var(--accent);
}

.tcx *, .tcx *::before, .tcx *::after { box-sizing: border-box; }

/* ── Eyebrow ─────────────────────────────────────────────── */
.tcx-eyebrow {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
}

/* ── Chip ────────────────────────────────────────────────── */
.tcx-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  font: 600 13.5px/1 var(--f-sans);
  color: var(--ink-800); background: var(--paper);
  border: 1px solid var(--ink-200); border-radius: var(--r-pill);
  white-space: nowrap; cursor: default;
}
button.tcx-chip { cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
button.tcx-chip:hover { border-color: var(--ink-300); }
.tcx-chip--removable { padding: 0 8px 0 14px; }
.tcx-chip.is-active { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.tcx-chip--accent { background: var(--accent-soft); color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 30%, transparent); }
.tcx-chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: var(--ink-100); color: inherit; border: 0; cursor: pointer;
  padding: 0; opacity: 0.85;
}
.tcx-chip.is-active .tcx-chip-x { background: rgba(255,255,255,0.18); }
.tcx-chip-x:hover { opacity: 1; }
.tcx-chip-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Risk dot ────────────────────────────────────────────── */
.tcx-riskdot {
  display: inline-block; flex-shrink: 0;
  width: var(--tcx-dot-size, 10px); height: var(--tcx-dot-size, 10px);
  border-radius: 50%; background: var(--tc, var(--t0));
  box-shadow: 0 0 0 3px var(--tc-soft, var(--t0-soft));
}

/* ── Tier chip ───────────────────────────────────────────── */
.tcx-tierchip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  font: 700 11px/1 var(--f-sans); letter-spacing: 0.01em;
  color: var(--tc, var(--t0)); background: var(--tc-soft, var(--t0-soft));
  border: 1px solid color-mix(in oklch, var(--tc, var(--t0)) 22%, transparent);
  border-radius: var(--r-pill); white-space: nowrap;
}
.tcx-tierchip.is-big { height: 30px; padding: 0 12px; font-size: 12.5px; }
.tcx-tierchip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tc, var(--t0)); flex: none; }

/* ── Card ────────────────────────────────────────────────── */
.tcx-card {
  background: var(--paper); border: 1px solid var(--ink-200);
  border-radius: var(--r-md); padding: 20px;
}
.tcx-card--dark {
  background: color-mix(in oklch, #fff 6%, transparent);
  border-color: rgba(255,255,255,0.10);
}

/* ── RefLine ─────────────────────────────────────────────── */
.tcx-refline { display: inline-flex; align-items: center; gap: 7px; }
.tcx-refline-text {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.03em;
  color: var(--ink-500); line-height: 1.35;
}

/* ── EvidenceTag ─────────────────────────────────────────── */
.tcx-evidence { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tcx-evidence-grade {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  font: 600 10.5px/1 var(--f-mono); color: var(--ink-700);
  background: var(--ink-100); border-radius: var(--r-pill);
}
.tcx-evidence-src {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  font: 600 10.5px/1 var(--f-sans); color: var(--accent);
  background: var(--accent-soft); border-radius: var(--r-pill);
}

/* ── RouteToCare ─────────────────────────────────────────── */
.tcx-route {
  padding: 13px 15px; background: var(--ink-50);
  border: 1px solid var(--ink-200); border-radius: var(--r-md);
}
.tcx-route.is-compact { padding: 11px 13px; }
.tcx-route-head {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-500); margin-bottom: 9px;
}
.tcx-route-items { display: flex; gap: 8px; flex-wrap: wrap; }
.tcx-route-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 13px;
  font: 600 12.5px/1 var(--f-sans); color: var(--ink-800);
  background: var(--paper); border: 1px solid var(--ink-200);
  border-radius: var(--r-pill); box-shadow: var(--sh-1);
}

/* ── Pill glyph ──────────────────────────────────────────── */
.tcx-pill-glyph {
  display: inline-grid; place-items: center;
  width: var(--pg-size, 34px); height: var(--pg-size, 34px); flex: none;
}

/* ── Standing reference disclaimer ───────────────────────── */
.tcx-disclaimer {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--accent-soft);
  border: 1px solid color-mix(in oklch, var(--accent) 22%, transparent);
  border-radius: var(--r-sm); color: var(--ink-700);
  font-size: 11.5px; line-height: 1.4;
}
.tcx-disclaimer svg { flex: none; }

/* ── Shared screen scaffold ──────────────────────────────── */
.tcx-screen { padding: 28px 32px 96px; max-width: 1100px; margin: 0 auto; }
.tcx-page-head { margin-bottom: 28px; }
.tcx-page-title {
  font-family: var(--f-display); font-weight: 400; font-size: 44px;
  line-height: 1.04; letter-spacing: -0.01em; color: var(--ink-900); margin: 6px 0 10px;
}
.tcx-page-lede {
  font-size: 16px; line-height: 1.55; color: var(--ink-700);
  max-width: 620px; text-wrap: pretty;
}
.tcx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--r-pill);
  font: 600 14px/1 var(--f-sans); cursor: pointer; border: 1px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.tcx-btn:active { transform: translateY(1px); }
.tcx-btn--primary { background: var(--ink-900); color: #fff; }
.tcx-btn--primary:hover { background: var(--ink-800); }
.tcx-btn--ghost { background: var(--paper); color: var(--ink-800); border-color: var(--ink-200); }
.tcx-btn--ghost:hover { border-color: var(--ink-300); }
.tcx-btn--accent { background: var(--accent); color: #fff; }
.tcx-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 720px) {
  .tcx-screen { padding: 16px 16px 96px; }
  .tcx-page-title { font-size: 34px; }
}

/* ============================================================
   Atlas — Ask (Direction A)
   ============================================================ */
.ask-screen { padding: 28px 34px 96px; max-width: 1180px; margin: 0 auto; }
.ask-layout { display: grid; grid-template-columns: 248px 1fr; gap: 28px; align-items: start; }

.ask-rail { display: flex; flex-direction: column; gap: 12px; }
.ask-rail-threads { display: flex; flex-direction: column; gap: 8px; }
.ask-thread {
  text-align: left; width: 100%; cursor: pointer;
  padding: 11px 13px; background: var(--paper);
  border: 1px solid var(--ink-200); border-radius: var(--r-sm); box-shadow: var(--sh-1);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.ask-thread:hover { border-color: var(--ink-300); transform: translateY(-1px); }
.ask-thread:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ask-thread-q { font-size: 13px; font-weight: 500; color: var(--ink-800); line-height: 1.35; }
.ask-thread-t { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-500); margin-top: 5px; }
.ask-rail-note {
  margin-top: 6px; padding: 13px 14px; background: var(--accent-soft);
  border: 1px solid color-mix(in oklch, var(--accent) 22%, transparent);
  border-radius: var(--r-sm); font-size: 12px; color: var(--ink-700); line-height: 1.45;
}

.ask-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ask-head-title {
  font-family: var(--f-display); font-size: 40px; font-weight: 400;
  margin: 0; letter-spacing: -0.02em; line-height: 1.04;
}
.ask-head-sub { font-size: 14.5px; color: var(--ink-700); margin: 8px 0 0; }

.ask-bar {
  display: flex; align-items: center; gap: 12px; height: 58px;
  padding: 0 10px 0 20px; background: var(--paper);
  border: 1.5px solid var(--ink-900); border-radius: var(--r-pill); box-shadow: var(--sh-2);
}
.ask-bar input {
  flex: 1; border: 0; background: transparent; font: 500 16.5px var(--f-sans);
  color: var(--ink-900); min-width: 0;
}
.ask-bar input::placeholder { color: var(--ink-500); }
.ask-bar input:focus { outline: none; }
.ask-bar-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 18px;
  background: var(--ink-900); color: #fff; border: 0; border-radius: var(--r-pill);
  font: 600 14.5px var(--f-sans); cursor: pointer;
}
.ask-bar-btn:hover { background: var(--ink-800); }
.ask-bar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Answer card */
.answer-card {
  background: var(--paper); border: 1px solid var(--ink-200);
  border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden;
}
.answer-head {
  display: flex; align-items: center; gap: 14px; padding: 18px 22px;
  background: var(--tc-soft, var(--t4-soft));
  border-bottom: 1px solid color-mix(in oklch, var(--tc, var(--t4)) 22%, transparent);
}
.answer-icon {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--tc, var(--t4));
}
.answer-kicker {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--tc, var(--t4)); font-weight: 600;
}
.answer-title {
  font-family: var(--f-display); font-size: 24px; letter-spacing: -0.01em;
  margin-top: 2px; color: var(--ink-900); line-height: 1.12;
}
.answer-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.answer-body p { font-size: 14.5px; line-height: 1.55; color: var(--ink-800); margin: 0; text-wrap: pretty; }
.answer-alt {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px;
  background: var(--t0-soft); border-radius: var(--r-sm);
  border: 1px solid color-mix(in oklch, var(--t0) 25%, transparent);
}
.answer-alt svg { margin-top: 1px; flex-shrink: 0; }
.answer-alt-h { font-size: 12.5px; font-weight: 700; color: var(--ink-900); }
.answer-alt-b { font-size: 13px; color: var(--ink-700); margin-top: 2px; line-height: 1.45; }
.answer-alt-b strong { color: var(--ink-900); }

.ask-next-label {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-500); margin-bottom: 10px;
}
.ask-next-chips { display: flex; gap: 9px; flex-wrap: wrap; }
.ask-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px;
  font: 500 13.5px var(--f-sans); color: var(--ink-800); background: var(--paper);
  border: 1px solid var(--ink-200); border-radius: var(--r-pill); box-shadow: var(--sh-1);
  cursor: pointer; transition: border-color var(--t-fast), transform var(--t-fast);
}
.ask-chip:hover { border-color: var(--ink-300); transform: translateY(-1px); }
.ask-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ask-mobile-only { display: none; }

@media (max-width: 860px) {
  .ask-screen { padding: 16px 16px 96px; }
  .ask-layout { grid-template-columns: 1fr; gap: 18px; }
  .ask-rail { order: 2; }
  .ask-head-title { font-size: 30px; }
  .ask-bar { height: 52px; padding: 0 8px 0 16px; }
  .ask-bar input { font-size: 15px; }
  .answer-title { font-size: 20px; }
  .ask-desktop-only { display: none; }
  .ask-mobile-only { display: block; }
}

/* ============================================================
   My Medicines — the persistent on-device shelf
   ============================================================ */
.shelf-screen { padding: 28px 34px 96px; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.shelf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.shelf-title { font-family: var(--f-display); font-size: 42px; font-weight: 400; margin: 8px 0 0; letter-spacing: -0.015em; line-height: 1.02; color: var(--ink-900); }
.shelf-lede { font-size: 14.5px; color: var(--ink-700); margin: 8px 0 0; max-width: 540px; text-wrap: pretty; }
.shelf-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* summary strip */
.shelf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.shelf-stat { padding: 14px 16px; background: var(--paper); border: 1px solid var(--ink-200); border-radius: var(--r-sm); box-shadow: var(--sh-1); }
.shelf-stat-top { display: flex; align-items: center; gap: 8px; }
.shelf-stat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 0 3px var(--tc-soft); flex: none; }
.shelf-stat-k { font-size: 24px; font-weight: 600; font-family: var(--f-display); color: var(--ink-900); letter-spacing: -0.01em; }
.shelf-stat-k.is-accent { color: var(--accent); }
.shelf-stat-l { font-size: 12px; color: var(--ink-600); margin-top: 3px; }

/* day-timeline ribbon (desktop) */
.shelf-ribbon { display: flex; align-items: stretch; gap: 0; padding: 16px 22px; background: var(--ink-900); border-radius: var(--r-md); color: #fff; }
.shelf-ribbon-band { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.shelf-ribbon-band.has-divider { border-left: 1px solid rgb(255 255 255 / 0.12); padding-left: 22px; margin-left: 22px; }
.shelf-ribbon-head { display: flex; align-items: center; gap: 8px; color: rgb(255 255 255 / 0.92); }
.shelf-ribbon-label { font-size: 13.5px; font-weight: 600; }
.shelf-ribbon-time { font-family: var(--f-mono); font-size: 11px; color: rgb(255 255 255 / 0.5); }
.shelf-ribbon-next { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-900); background: #fff; border-radius: 4px; padding: 2px 6px; }
.shelf-ribbon-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.shelf-ribbon-empty { font-size: 12px; color: rgb(255 255 255 / 0.4); }

/* band columns (desktop) */
.shelf-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.shelf-col { display: flex; flex-direction: column; gap: 11px; }
.shelf-col-head { display: flex; align-items: center; gap: 9px; }
.shelf-col-glyph { display: inline-flex; }
.shelf-col-label { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.shelf-col-time { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--ink-500); }
.shelf-col-body { display: flex; flex-direction: column; gap: 10px; }
.shelf-asneeded-note { font-size: 12.5px; color: var(--ink-500); padding: 10px 14px; border: 1px dashed var(--ink-300); border-radius: var(--r-sm); line-height: 1.4; }
.shelf-empty { font-size: 12.5px; color: var(--ink-500); padding: 10px 2px; }

/* medicine card */
.shelf-med { display: flex; flex-direction: row; gap: 12px; align-items: flex-start; padding: 14px 15px; background: var(--paper); border: 1px solid var(--ink-200); border-radius: var(--r-sm); box-shadow: var(--sh-1); }
.shelf-med.is-compact { padding: 12px 13px; }
.med-pill { padding-top: 2px; flex: none; }
.med-main { min-width: 0; flex: 1; }
.med-line { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.med-brand { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-900); }
.med-generic { font-size: 12px; color: var(--ink-500); font-family: var(--f-mono); }
.med-use { font-size: 13.5px; color: var(--ink-700); margin-top: 3px; }
.med-tags { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.med-tag { height: 22px; padding: 0 9px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; color: var(--ink-600); background: var(--ink-100); border-radius: var(--r-pill); letter-spacing: 0.01em; }
.med-note { height: 22px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--tc); background: var(--tc-soft); border-radius: var(--r-pill); border: 1px solid color-mix(in oklch, var(--tc) 22%, transparent); cursor: pointer; }
.med-note:hover { filter: brightness(0.97); }
.med-note:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.med-remove { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; border-radius: var(--r-xs); cursor: pointer; opacity: 0.55; transition: opacity var(--t-fast), background var(--t-fast); }
.med-remove:hover { opacity: 1; background: var(--ink-100); }
.med-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; opacity: 1; }

/* two-tone capsule glyph */
.pill2 { display: inline-flex; overflow: hidden; box-shadow: var(--sh-1); flex: none; }
.pill2-half { width: 50%; }

/* mobile next-dose hero + list */
.shelf-hero { background: var(--ink-900); border-radius: var(--r-md); padding: 16px 17px; color: #fff; }
.shelf-hero-kicker { display: flex; align-items: center; gap: 8px; color: rgb(255 255 255 / 0.6); font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.shelf-hero-med { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.shelf-hero-name { font-size: 17px; font-weight: 600; }
.shelf-hero-generic { font-family: var(--f-mono); font-size: 12px; font-weight: 400; color: rgb(255 255 255 / 0.6); margin-left: 6px; }
.shelf-hero-use { font-size: 13px; color: rgb(255 255 255 / 0.8); margin-top: 2px; }
.shelf-mobile-list { display: flex; flex-direction: column; gap: 14px; }
.shelf-mobile-band { display: flex; flex-direction: column; gap: 9px; }

.shelf-disclaimer { margin-top: 4px; }

.shelf-mobile-only { display: none; }

/* add-medicine form */
.tcx-form { display: flex; flex-direction: column; gap: 12px; }
.tcx-form-row { display: flex; flex-direction: column; gap: 5px; }
.tcx-form-label { font-size: 12.5px; font-weight: 600; color: var(--ink-700); }
.tcx-field { height: 40px; padding: 0 12px; font: 500 14px var(--f-sans); color: var(--ink-900); background: var(--paper); border: 1px solid var(--ink-300); border-radius: var(--r-sm); }
.tcx-field:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.tcx-form-note { font-size: 11.5px; color: var(--ink-500); margin: 2px 0 0; line-height: 1.4; }

@media (max-width: 860px) {
  .shelf-screen { padding: 16px 16px 96px; gap: 14px; }
  .shelf-title { font-size: 30px; }
  .shelf-actions { width: 100%; }
  .shelf-actions .tcx-btn { flex: 1; }
  .shelf-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .shelf-stat:nth-child(3) { display: none; }
  .shelf-desktop-only { display: none; }
  .shelf-mobile-only { display: flex; }
  .shelf-hero { display: block; }
}

/* ============================================================
   Missed-dose guidance
   ============================================================ */
.md-screen { padding: 28px 34px 96px; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.md-title { font-family: var(--f-display); font-size: 40px; font-weight: 400; margin: 8px 0 0; letter-spacing: -0.015em; line-height: 1.04; color: var(--ink-900); }

.md-selectors { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; }
.md-medchip { display: flex; align-items: center; gap: 11px; padding: 12px 16px; background: var(--paper); border: 1px solid var(--ink-200); border-radius: var(--r-sm); box-shadow: var(--sh-1); }
.md-medchip-name { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.md-medchip-sub { font-size: 11.5px; color: var(--ink-500); font-family: var(--f-mono); }
.md-sits { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.md-sit { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; font: 600 13.5px var(--f-sans); border-radius: var(--r-pill); color: var(--ink-700); background: var(--paper); border: 1px solid var(--ink-200); cursor: pointer; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.md-sit:hover { border-color: var(--ink-300); }
.md-sit.is-on { color: #fff; background: var(--ink-900); border-color: var(--ink-900); box-shadow: var(--sh-2); }
.md-sit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.md-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: start; }
.md-answer { display: flex; flex-direction: column; gap: 16px; }
.md-headline-card { padding: 20px 22px; background: var(--ink-900); color: #fff; border-radius: var(--r-md); }
.md-headline-kicker { display: flex; align-items: center; gap: 9px; color: rgb(255 255 255 / 0.6); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.md-headline-text { font-family: var(--f-display); font-size: 27px; line-height: 1.16; margin-top: 10px; letter-spacing: -0.01em; text-wrap: pretty; }
.md-branches-label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-600); }
.md-branch { display: flex; gap: 13px; padding: 15px 16px; background: var(--paper); border: 1px solid var(--ink-200); border-radius: var(--r-sm); box-shadow: var(--sh-1); }
.md-branch-ic { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--tc-soft); color: var(--tc); }
.md-branch-cond { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 4px; }
.md-branch-action { font-size: 14.5px; font-weight: 600; color: var(--ink-900); line-height: 1.4; }

.md-sidebar { display: flex; flex-direction: column; gap: 14px; }
.md-card { padding: 16px 18px; background: var(--paper); border: 1px solid var(--ink-200); border-radius: var(--r-md); box-shadow: var(--sh-1); }
.md-card-head { font-size: 12.5px; font-weight: 600; color: var(--ink-700); margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.md-why { padding: 15px 17px; background: var(--accent-soft); border: 1px solid color-mix(in oklch, var(--accent) 22%, transparent); border-radius: var(--r-md); }
.md-why-head { font-size: 13px; font-weight: 600; color: var(--ink-900); margin-bottom: 5px; display: flex; align-items: center; gap: 7px; }
.md-why-body { font-size: 13px; line-height: 1.5; color: var(--ink-700); margin: 0; text-wrap: pretty; }
.md-route { margin-top: 2px; }

/* timeline */
.md-tl { padding: 8px 6px 4px; }
.md-tl-track { position: relative; height: 56px; }
.md-tl-line { position: absolute; top: 22px; left: 0; right: 0; height: 3px; background: var(--ink-200); border-radius: 2px; }
.md-tl-fill { position: absolute; top: 22px; left: 0; height: 3px; background: var(--ink-700); border-radius: 2px; }
.md-tl-pt { position: absolute; top: 0; transform: translateX(-50%); text-align: center; }
.md-tl-dot { display: grid; place-items: center; margin: 13px auto 0; border-radius: 50%; width: 20px; height: 20px; }
.md-tl-dot.is-taken { background: var(--t0); border: 2.5px solid var(--t0); }
.md-tl-dot.is-missed { background: var(--tc-soft); border: 2.5px solid var(--tc); }
.md-tl-dot.is-now { width: 14px; height: 14px; margin-top: 18px; background: var(--ink-900); border: 2.5px solid var(--ink-900); }
.md-tl-label { font-family: var(--f-mono); font-size: 10px; color: var(--ink-500); margin-top: 6px; }
.md-tl-label.is-now { font-weight: 700; color: var(--ink-900); }
.md-tl-label.is-missed { color: var(--t2); }

@media (max-width: 860px) {
  .md-screen { padding: 16px 16px 96px; gap: 14px; }
  .md-title { font-size: 28px; }
  .md-grid { grid-template-columns: 1fr; gap: 16px; }
  .md-headline-text { font-size: 21px; }
}

/* ============================================================
   Supplements & food
   ============================================================ */
.supp-screen { padding: 28px 34px 96px; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.supp-title { font-family: var(--f-display); font-size: 40px; font-weight: 400; margin: 8px 0 0; letter-spacing: -0.015em; line-height: 1.04; color: var(--ink-900); }
.supp-lede { font-size: 14.5px; color: var(--ink-700); margin: 8px 0 10px; max-width: 560px; text-wrap: pretty; }

.supp-selector { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.supp-selector-label { font-size: 13px; color: var(--ink-500); font-family: var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.supp-medchip { display: inline-flex; align-items: center; gap: 11px; padding: 10px 16px; background: var(--ink-900); color: #fff; border-radius: var(--r-pill); box-shadow: var(--sh-2); }
.supp-medchip-name { font-size: 14.5px; font-weight: 600; }
.supp-counts { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.supp-count { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-600); }

.supp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.supp-item { text-align: left; padding: 15px 16px; background: var(--paper); border: 1px solid var(--ink-200); border-radius: var(--r-md); box-shadow: var(--sh-1); cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.supp-item:hover { border-color: var(--ink-300); }
.supp-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.supp-item.is-open { border-color: color-mix(in oklch, var(--tc) 35%, transparent); box-shadow: var(--sh-2); }
.supp-item-head { display: flex; align-items: center; gap: 12px; }
.supp-item-ic { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--tc-soft); color: var(--tc); }
.supp-item-meta { min-width: 0; flex: 1; }
.supp-item-name { font-size: 15px; font-weight: 600; color: var(--ink-900); }
.supp-item-cat { font-family: var(--f-mono); font-size: 11px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.04em; }
.supp-item-body { font-size: 13px; line-height: 1.5; color: var(--ink-700); margin: 11px 0 0; text-wrap: pretty; }

.supp-banner { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--accent-soft); border: 1px solid color-mix(in oklch, var(--accent) 22%, transparent); border-radius: var(--r-md); cursor: pointer; }
.supp-banner:hover { border-color: color-mix(in oklch, var(--accent) 40%, transparent); }
.supp-banner:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.supp-banner-text { font-size: 13px; color: var(--ink-700); }
.supp-banner-text strong { color: var(--ink-900); }
.supp-banner-cta { color: var(--accent); font-weight: 600; }
.supp-disclaimer { margin-top: 2px; }

@media (max-width: 1024px) { .supp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .supp-screen { padding: 16px 16px 96px; }
  .supp-title { font-size: 28px; }
  .supp-counts { margin-left: 0; width: 100%; gap: 12px; }
  .supp-grid { grid-template-columns: 1fr; }
}

/* ── In-place reskin of live screens (Scenario / GP Prep / Pill ID) ─────────
   These screens consume the central --c-* theme via semantic classes (no
   inline tokens). Toggling `.tcx-reskin` on #app (see app.js RESKIN_ROUTES)
   remaps those tokens to Deep Ocean — zero markup change, full engine wiring
   preserved. The six legacy 1-indexed tiers map onto the 0-indexed T0..T5. */
.tcx-reskin {
  --c-bg: var(--bone);
  --c-surface: var(--paper);
  --c-surface-2: var(--bone);
  --c-border: var(--ink-200);
  --c-border-strong: var(--ink-300);
  --c-text: var(--ink-900);
  --c-text-muted: var(--ink-600);
  --c-text-soft: var(--ink-500);
  --c-brand: var(--ink-900);
  --c-brand-2: var(--ink-700);
  --c-brand-soft: var(--ink-100);
  --c-tier-1: var(--t0);  --c-tier-1-bg: var(--t0-soft);
  --c-tier-2: var(--t1);  --c-tier-2-bg: var(--t1-soft);
  --c-tier-3: var(--t2);  --c-tier-3-bg: var(--t2-soft);
  --c-tier-4: var(--t3);  --c-tier-4-bg: var(--t3-soft);
  --c-tier-5: var(--t4);  --c-tier-5-bg: var(--t4-soft);
  --c-tier-6: var(--t5);  --c-tier-6-bg: var(--t5-soft);
  --c-accent: var(--accent);
  --c-accent-soft: var(--accent-soft);
  --c-emergency: var(--emergency);
  --c-emergency-strong: var(--emergency-deep);
  --c-link: var(--accent);
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-sans);
}

/* Targeted polish: serif page titles to match the handoff display face. */
.tcx-reskin .page-title,
.tcx-reskin .gp-title,
.tcx-reskin .gp-doc-title {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}
