/* PulSentry - patient & family lane stylesheet.
   Accessibility-first (WCAG 2.2 AA): larger base text, big tap targets,
   high contrast, strong focus, reduced-motion safe, comfortable measure.
   Mirrors the main design tokens. */

:root, [data-theme="light"] {
  --bg-page: #F7F5EF;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-inset: #EFEBE1;
  --text-heading: #0B1220;
  --text-body: #1A2433;        /* darker body for >=7:1 on cream where possible */
  --text-secondary: #3D4A56;   /* AA-strong secondary */
  --text-muted: #5A6671;
  --accent: #07795E;           /* slightly deeper teal: >=4.5:1 on white */
  --accent-deep: #055A46;
  --accent-bright: #00B894;
  --accent-bg: rgba(7,121,94,0.07);
  --accent-border: rgba(7,121,94,0.22);
  --alert: #B3261E;            /* emergency red, AA on white */
  --alert-bg: rgba(179,38,30,0.07);
  --alert-border: rgba(179,38,30,0.30);
  --calm: #1E5A8A;             /* calm blue for reassurance cards */
  --calm-bg: rgba(30,90,138,0.07);
  --calm-border: rgba(30,90,138,0.22);
  --border: rgba(14,22,40,0.12);
  --divider: rgba(14,22,40,0.08);
  --shadow-sm: 0 1px 2px rgba(14,22,40,0.06), 0 1px 3px rgba(14,22,40,0.05);
  --shadow-md: 0 6px 18px rgba(14,22,40,0.10), 0 2px 6px rgba(14,22,40,0.05);
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}
[data-theme="dark"] {
  --bg-page: #0E1216;
  --bg-elevated: #161B22;
  --bg-card: #161B22;
  --bg-inset: #1C232B;
  --text-heading: #F4F8FC;
  --text-body: #E6EDF4;
  --text-secondary: #BCC7D2;
  --text-muted: #93A0AC;
  --accent: #1FDFB5;
  --accent-deep: #00B894;
  --accent-bright: #1FDFB5;
  --accent-bg: rgba(31,223,181,0.10);
  --accent-border: rgba(31,223,181,0.26);
  --alert: #FF8A80;
  --alert-bg: rgba(255,138,128,0.12);
  --alert-border: rgba(255,138,128,0.34);
  --calm: #8FC2E8;
  --calm-bg: rgba(143,194,232,0.12);
  --calm-border: rgba(143,194,232,0.30);
  --border: rgba(255,255,255,0.14);
  --divider: rgba(255,255,255,0.09);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; font-size: 106.25%; }
body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-body);
  font-size: 1.1875rem;          /* ~19px base for older readers */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Accessibility helpers */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 0.75rem 1.25rem;
  border-radius: 0 0 10px 0; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[data-theme="dark"] :focus-visible { outline-color: var(--accent-bright); }

/* Header */
.p-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem clamp(1rem, 5vw, 2.5rem);
  background: rgba(247,245,239,0.94);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--divider);
}
[data-theme="dark"] .p-nav { background: rgba(14,18,22,0.9); }
.p-logo { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; min-height: 44px; }
.p-logo-icon { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg,#00B894,#055A46); display: grid; place-items: center; flex-shrink: 0; }
.p-logo-icon svg { width: 20px; height: 20px; stroke: #fff; fill: none; }
.p-logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--text-heading); letter-spacing: -0.02em; }
.p-logo-text .teal { color: var(--accent); }
.p-nav-links { display: flex; align-items: center; gap: 0.4rem; }
.p-nav-links a {
  color: var(--text-secondary); text-decoration: none; font-size: 1.02rem; font-weight: 600;
  padding: 0.6rem 0.8rem; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center;
}
.p-nav-links a:hover { color: var(--accent); background: var(--accent-bg); }
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 9px;
  min-width: 44px; min-height: 44px; cursor: pointer; color: var(--text-secondary); font-size: 1.1rem;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) { .p-nav-links a.hide-sm { display: none; } }

/* Layout */
.p-wrap { max-width: 720px; margin: 0 auto; padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1.1rem, 5vw, 1.5rem) 4rem; }

/* Hero / intro */
.p-eyebrow {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent);
  display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;
}
.p-eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--accent); }
.p-hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.12; letter-spacing: -0.02em;
  color: var(--text-heading); text-wrap: balance; margin-bottom: 1rem;
}
.p-hero-lede { font-size: 1.3rem; line-height: 1.6; color: var(--text-secondary); margin-bottom: 2rem; }

/* Section blocks - each question */
.p-section { margin: 2.6rem 0; scroll-margin-top: 90px; }
.p-section h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; letter-spacing: -0.015em;
  color: var(--text-heading); margin-bottom: 0.9rem; text-wrap: balance;
}
.p-section h3 { font-size: 1.2rem; font-weight: 700; color: var(--text-heading); margin: 1.4rem 0 0.5rem; }
.p-section p { font-size: 1.1875rem; line-height: 1.75; color: var(--text-body); margin-bottom: 1.1rem; }
.p-section p strong { color: var(--text-heading); font-weight: 700; }
.p-section ul { margin: 0 0 1.1rem 1.4rem; }
.p-section li { margin-bottom: 0.6rem; line-height: 1.65; }
.p-define { color: var(--accent-deep); font-weight: 700; font-style: normal; }
[data-theme="dark"] .p-define { color: var(--accent-bright); }

/* Plain-language term cards */
.term-card {
  background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 1.1rem 1.3rem; margin: 1.3rem 0; box-shadow: var(--shadow-sm);
}
.term-card .term { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; color: var(--text-heading); margin-bottom: 0.3rem; }
.term-card .def { font-size: 1.1rem; color: var(--text-secondary); margin: 0; }

/* Reassurance (calm) callout */
.calm-box {
  background: var(--calm-bg); border: 1px solid var(--calm-border); border-radius: 14px;
  padding: 1.3rem 1.5rem; margin: 1.6rem 0;
}
.calm-box p { margin: 0; color: var(--text-body); font-size: 1.12rem; }
.calm-box .calm-icon { color: var(--calm); font-weight: 700; }

/* When-to-call emergency box */
.call-box {
  background: var(--alert-bg); border: 2px solid var(--alert-border); border-radius: 16px;
  padding: 1.4rem 1.6rem; margin: 1.8rem 0; box-shadow: var(--shadow-sm);
}
.call-box h3 { color: var(--alert); font-size: 1.25rem; font-weight: 800; margin: 0 0 0.7rem; display: flex; align-items: center; gap: 0.5rem; }
.call-box .call-911 { font-size: 1.18rem; font-weight: 700; color: var(--text-heading); margin-bottom: 0.8rem; }
.call-box ul { margin: 0.3rem 0 0 1.3rem; }
.call-box li { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-body); }
.call-box .call-soft { margin-top: 0.9rem; font-size: 1.08rem; color: var(--text-secondary); }

/* Investigational disclosure */
.invest-box {
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.2rem 1.4rem; margin: 1.6rem 0;
}
.invest-box p { margin: 0; font-size: 1.08rem; color: var(--text-secondary); }
.invest-box strong { color: var(--text-heading); }

/* Figures */
.p-figure { margin: 1.8rem 0; text-align: center; }
.p-figure img { width: 100%; max-width: 560px; height: auto; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-elevated); box-shadow: var(--shadow-sm); }
.p-figure figcaption { font-size: 1.02rem; color: var(--text-muted); margin-top: 0.7rem; line-height: 1.5; }

/* Step list (how monitoring works) */
.steps { list-style: none; margin: 1.4rem 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 0 1.3rem 3.4rem; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 1.1rem;
  display: grid; place-items: center;
}
[data-theme="dark"] .steps li::before { color: #03110d; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 1.2rem; top: 2.4rem; bottom: 0.3rem; width: 2px; background: var(--accent-border); }
.steps li strong { display: block; font-size: 1.15rem; color: var(--text-heading); margin-bottom: 0.2rem; }

/* Buttons / CTAs - generous tap targets */
.p-cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 1.6rem 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 52px; padding: 0.85rem 1.6rem; border-radius: 12px; font-weight: 700;
  font-size: 1.1rem; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
[data-theme="dark"] .btn-accent { color: #03110d; }
.btn-outline { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-bg); }

/* Mini table of contents */
.p-toc { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem 1.4rem; margin: 2rem 0; box-shadow: var(--shadow-sm); }
.p-toc h2 { font-family: var(--font-body); font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.8rem; }
.p-toc ol { margin: 0; padding-left: 1.3rem; }
.p-toc li { margin-bottom: 0.5rem; }
.p-toc a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 1.08rem; }
.p-toc a:hover { text-decoration: underline; }

/* Reviewer / trust block */
.reviewer {
  display: flex; align-items: flex-start; gap: 1rem; margin-top: 2.5rem; padding: 1.3rem 1.5rem;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.reviewer .r-badge { width: 46px; height: 46px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; font-weight: 700; border: 1px solid var(--accent-border); }
.reviewer .r-name { font-weight: 700; color: var(--text-heading); }
.reviewer .r-meta { font-size: 1rem; color: var(--text-muted); margin-top: 0.2rem; }

/* Sources */
.p-sources { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--divider); }
.p-sources h2 { font-family: var(--font-body); font-size: 1.1rem; font-weight: 700; color: var(--text-heading); margin-bottom: 0.7rem; }
.p-sources ol { margin-left: 1.3rem; }
.p-sources li { font-size: 0.98rem; color: var(--text-muted); margin-bottom: 0.5rem; line-height: 1.5; }
.p-sources a { color: var(--text-secondary); }

.back-link { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; color: var(--text-secondary); text-decoration: none; font-size: 1.02rem; font-weight: 600; }
.back-link:hover { color: var(--accent); }

/* Lane switcher (quiet cross-links) */
.lane-switch { margin-top: 3rem; padding: 1.3rem 1.5rem; background: var(--bg-inset); border-radius: 14px; font-size: 1.05rem; color: var(--text-secondary); }
.lane-switch a { color: var(--accent); font-weight: 600; text-decoration: none; }
.lane-switch a:hover { text-decoration: underline; }

/* Footer */
.p-footer { border-top: 1px solid var(--divider); padding: 2rem clamp(1.1rem,5vw,2.5rem); text-align: center; font-size: 1rem; color: var(--text-muted); line-height: 1.6; }
.p-footer a { color: var(--text-secondary); text-decoration: none; }
.p-footer .lang { margin-top: 0.6rem; font-size: 0.98rem; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .btn:hover { transform: none; }
}

/* ---- Patient hub: guide cards ---- */
.guide-hub { margin: 2.5rem 0; }
.guide-hub > h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem,4vw,1.85rem); color: var(--text-heading); margin-bottom: 1.1rem; }
.guide-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 680px) { .guide-grid { grid-template-columns: 1fr 1fr; } }
.guide-card {
  display: flex; flex-direction: column; gap: 0.4rem; padding: 1.3rem 1.4rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  text-decoration: none; box-shadow: var(--shadow-sm); min-height: 52px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.guide-card .gc-title { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; color: var(--text-heading); line-height: 1.25; }
.guide-card .gc-desc { font-size: 1.02rem; color: var(--text-secondary); line-height: 1.55; }
.guide-card .gc-go { margin-top: auto; padding-top: 0.5rem; font-weight: 700; font-size: 0.98rem; color: var(--accent); }

/* ---- Glossary ---- */
.glossary { margin: 2rem 0; border-top: 1px solid var(--divider); }
.glossary-term {
  padding: 1.3rem 0; border-bottom: 1px solid var(--divider);
}
.glossary-term dt { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--text-heading); margin-bottom: 0.35rem; }
.glossary-term .say { font-family: var(--font-mono); font-size: 0.92rem; color: var(--accent); margin-bottom: 0.5rem; }
.glossary-term dd { margin: 0; font-size: 1.12rem; line-height: 1.7; color: var(--text-body); }
.glossary-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 2rem; }
.glossary-jump a { min-height: 44px; display: inline-flex; align-items: center; padding: 0.5rem 0.9rem; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text-secondary); font-weight: 600; }
.glossary-jump a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

/* ---- Printable one-page guide ---- */
.print-actions { margin: 1.5rem 0; }
.onepager { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; padding: 1.6rem; box-shadow: var(--shadow-sm); }
.onepager h2 { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-heading); margin: 1.2rem 0 0.5rem; }
.onepager h2:first-child { margin-top: 0; }
.onepager ul { margin: 0 0 0.8rem 1.3rem; }
.onepager li { margin-bottom: 0.4rem; }
@media print {
  .p-nav, .skip-link, .back-link, .print-actions, .lane-switch, .p-footer, .theme-toggle { display: none !important; }
  body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  .p-wrap { max-width: 100%; padding: 0; }
  .onepager { border: none; box-shadow: none; padding: 0; }
  .call-box { border: 2px solid #000 !important; }
  a { color: #000 !important; text-decoration: none; }
  .p-hero-title { font-size: 20pt; }
}

/* ============================================================
   PATIENT-LANE INTERACTIVE WIDGETS (animated, accessible)
   ============================================================ */

/* Reveal-on-scroll (gentle; disabled under reduced motion) */
.p-reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.p-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .p-reveal { opacity: 1; transform: none; transition: none; } }

/* ---- Widget shell ---- */
.pw {
  margin: 2rem 0; padding: 1.5rem; border-radius: 18px;
  background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.pw-kicker { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.4rem; }
.pw-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--text-heading); margin: 0 0 0.4rem; line-height: 1.25; }
.pw-intro { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.6; margin: 0 0 1.1rem; }

/* ---- Breathing + pulse animation ---- */
.bp-monitor {
  position: relative; height: 180px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, var(--bg-inset), var(--bg-card));
  border: 1px solid var(--border);
}
.bp-track { position: absolute; inset: 0; }
.bp-scale { position: absolute; inset: 0; transform-origin: center center; }
@keyframes bpScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes bpBreathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(var(--bp-amp, 0.9)); } }
.bp-scrollwrap { position: absolute; top: 0; left: 0; height: 100%; width: 200%; animation: bpScroll 9s linear infinite; }
.bp-svg { height: 100%; width: 50%; display: block; }
.bp-paused .bp-scrollwrap, .bp-paused .bp-scale { animation-play-state: paused; }
.bp-pulse-path { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bp-baseline { stroke: var(--divider); stroke-width: 1; }
.bp-breath-badge {
  position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.35rem 0.7rem; border-radius: 999px; background: var(--accent-bg); border: 1px solid var(--accent-border);
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent);
}
.bp-lung { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); animation: bpLung 4.5s ease-in-out infinite; }
@keyframes bpLung { 0%,100% { transform: scale(0.7); opacity: 0.6; } 50% { transform: scale(1.15); opacity: 1; } }
.bp-paused .bp-lung { animation-play-state: paused; }
.bp-controls { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; align-items: center; }
.bp-seg { display: inline-flex; background: var(--bg-inset); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; }
.bp-seg button {
  appearance: none; border: none; background: none; cursor: pointer; min-height: 40px; padding: 0.4rem 0.9rem;
  border-radius: 9px; font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; color: var(--text-secondary);
}
.bp-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
[data-theme="dark"] .bp-seg button[aria-pressed="true"] { color: #03110d; }
.bp-pause { appearance: none; min-height: 40px; padding: 0.4rem 0.9rem; border-radius: 10px; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); font-weight: 600; font-size: 0.95rem; }
.bp-readout { font-size: 1rem; color: var(--text-body); margin-top: 0.9rem; line-height: 1.55; }
.bp-readout strong { color: var(--text-heading); }
@media (prefers-reduced-motion: reduce) {
  .bp-scrollwrap, .bp-scale, .bp-lung { animation: none !important; }
}

/* ---- "When should I call?" symptom -> action guide ---- */
.call-guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (min-width: 560px) { .call-guide-grid { grid-template-columns: 1fr 1fr 1fr; } }
.cg-chip {
  appearance: none; cursor: pointer; text-align: left; min-height: 56px; padding: 0.8rem 0.95rem;
  border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-body);
  font-family: var(--font-body); font-weight: 600; font-size: 0.98rem; line-height: 1.3;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.cg-chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.cg-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); }
.cg-result { margin-top: 1.1rem; border-radius: 14px; padding: 1.1rem 1.2rem; border: 1px solid var(--border); background: var(--bg-inset); }
.cg-result[data-level="emergency"] { border-left: 5px solid var(--alert); background: var(--alert-bg); }
.cg-result[data-level="soon"] { border-left: 5px solid var(--warning); background: var(--warning-bg); }
.cg-result[data-level="watch"] { border-left: 5px solid var(--accent); background: var(--accent-bg); }
.cg-result-tag { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.cg-result[data-level="emergency"] .cg-result-tag { color: var(--alert); }
.cg-result[data-level="soon"] .cg-result-tag { color: var(--warning); }
.cg-result[data-level="watch"] .cg-result-tag { color: var(--accent); }
.cg-result-text { font-size: 1.08rem; line-height: 1.6; color: var(--text-body); margin: 0.4rem 0 0; }
.cg-result-text strong { color: var(--text-heading); }

/* ---- Recovery week-by-week timeline ---- */
.rt-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.rt-tab {
  appearance: none; cursor: pointer; min-height: 44px; padding: 0.5rem 1rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary);
  font-family: var(--font-body); font-weight: 600; font-size: 0.96rem;
}
.rt-tab[aria-selected="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme="dark"] .rt-tab[aria-selected="true"] { color: #03110d; }
.rt-panel { border-radius: 14px; border: 1px solid var(--border); background: var(--bg-card); padding: 1.2rem 1.3rem; }
.rt-panel h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--text-heading); margin: 0 0 0.6rem; }
.rt-panel .rt-normal, .rt-panel .rt-watch { font-size: 1.03rem; line-height: 1.6; margin: 0 0 0.6rem; }
.rt-panel .rt-normal strong { color: var(--accent); }
.rt-panel .rt-watch strong { color: var(--alert); }
.rt-progress { height: 6px; border-radius: 4px; background: var(--bg-inset); overflow: hidden; margin: 0.2rem 0 1rem; }
.rt-progress span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.4s ease; }

/* ---- "Questions to ask your care team" picker ---- */
.q-list { display: grid; grid-template-columns: 1fr; gap: 0.55rem; }
@media (min-width: 620px) { .q-list { grid-template-columns: 1fr 1fr; } }
.q-item {
  appearance: none; cursor: pointer; text-align: left; min-height: 48px; padding: 0.75rem 0.95rem 0.75rem 2.4rem;
  position: relative; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-body); font-family: var(--font-body); font-size: 1rem; line-height: 1.35;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.q-item::before {
  content: ""; position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-strong); background: var(--bg-page);
}
.q-item[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); }
.q-item[aria-pressed="true"]::before { background: var(--accent); border-color: var(--accent); }
.q-item[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 1.18rem; top: 50%; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-65%) rotate(45deg);
}
[data-theme="dark"] .q-item[aria-pressed="true"]::after { border-color: #03110d; }
.q-tally { margin-top: 1.1rem; font-size: 1.02rem; color: var(--text-secondary); }
.q-tally #q-count { font-weight: 700; color: var(--text-heading); }
.q-print { appearance: none; cursor: pointer; margin-left: 0.5rem; min-height: 40px; padding: 0.4rem 0.9rem;
  border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; font-size: 0.95rem; }
[data-theme="dark"] .q-print { color: #03110d; }
