/* Body Check web app: the Flutter app's design system as CSS variables (bodycheck-app/lib/theme/tokens.dart).
   Light / dark follow the phone. Lexend, falling back to Noto Sans; served from our own origin (OFL). */
@font-face { font-family: "Lexend"; src: url("vendor/fonts/Lexend-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("vendor/fonts/NotoSans-Subset.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #F3F8F9; --surface: #FFFFFF; --card: #FFFFFF; --tint: #E2F5F7; --line: #D2E2E5; --control-line: #6E8C95;
  --ink: #003D52; --ink-muted: #4A6670; --accent-text: #005D7D; --action: #007EA3; --on-action: #FFFFFF; --caution: #A84E14; --danger: #B3261E; --chart-color: var(--action);
  --deep-teal: #005D7D; --primary-teal: #007EA3; --bright-cyan: #1CCEDC; --light-aqua: #6CEAF0; --ecg-mid: #00AFC8;
  --reaction-go: #00873A; /* decision 74: bright, saturated; white text on it 4.6:1 (AA) */
  --r-small: 12px; --r-medium: 16px; --r-large: 24px; --r-hero: 28px; --r-pill: 999px; --hero-dark: #003D52; --chip-muted: #EEF2F3;
  --tap: 48px; --main-button: 56px; --gutter: 16px; --gap: 12px; --content-max: 560px;
  --font: "Lexend", "Noto Sans", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071310; --surface: #0B1D18; --card: #10251D; --tint: #12333A; --line: #22413A; --control-line: #6F9C95;
    --ink: #EEF8F8; --ink-muted: #9DC4C8; --accent-text: #6CEAF0; --action: #1CCEDC; --on-action: #071310; --caution: #F2A46C; --danger: #F2B8B5; --chart-color: #6CEAF0; --chip-muted: #1B332B;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 25px; font-weight: 400; -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }

/* ---- type scale (size / line height / weight, as the Flutter app) ---- */
.t-metric { font-size: 64px; line-height: 64px; font-weight: 700; }
.t-display { font-size: 32px; line-height: 40px; font-weight: 700; margin: 0; }
.t-title { font-size: 22px; line-height: 30px; font-weight: 600; margin: 0; }
.t-heading { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0; }
.t-body { font-size: 16px; line-height: 25px; }
.t-small { font-size: 14px; line-height: 22px; }
.t-label { font-size: 13px; line-height: 18px; font-weight: 600; }
.t-caption { font-size: 12px; line-height: 17px; }
.muted { color: var(--ink-muted); }
.caution { color: var(--caution); }
.center { text-align: center; }

/* ---- page frame: 320 px phones to tablets; content at most 560 px; safe areas ---- */
.app { min-height: 100dvh; display: flex; justify-content: center; }
.page {
  width: 100%; max-width: var(--content-max); min-height: 100dvh; display: flex; flex-direction: column;
  padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.bar { display: flex; align-items: center; gap: 4px; min-height: 56px; padding-top: env(safe-area-inset-top); }
.bar .t-heading { flex: 1; }
.content { flex: 1; padding: 8px 0 24px; }
.bottom {
  position: sticky; bottom: 0; background: var(--bg); padding: 8px 0 max(var(--gutter), env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--gap);
}
.stack > * + * { margin-top: var(--gap); }
.heading-block { margin-bottom: 16px; }
.heading-block p { margin: 8px 0 0; color: var(--ink-muted); }
.gap-24 { height: 24px; }
.gap-16 { height: 16px; }
.gap-12 { height: 12px; }
.gap-8 { height: 8px; }
p { margin: 0; }

/* ---- controls: every tap target at least 48 px; main buttons 54 px; no hover-only actions ---- */
.icon-btn {
  min-width: var(--tap); min-height: var(--tap); border: 0; background: transparent; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
}
.icon-btn:focus-visible, .btn:focus-visible, .card.tappable:focus-visible, .choice:focus-within { outline: 3px solid var(--action); outline-offset: 2px; }
.icon-btn svg { width: 24px; height: 24px; }
.btn {
  min-height: var(--main-button); width: 100%; border-radius: var(--r-pill); font-size: 17px; line-height: 24px;
  font-weight: 600; cursor: pointer; padding: 0 16px; touch-action: manipulation;
}
.btn-main { background: var(--action); color: var(--on-action); border: 0; }
.btn-main:disabled { opacity: 0.45; cursor: default; }
.btn-main.btn-dimmed { opacity: 0.45; }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--control-line); }
.btn-text {
  min-height: var(--tap); background: transparent; border: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; padding: 0 8px;
}
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin 0.8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; margin-bottom: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); }
.input {
  width: 100%; min-height: var(--tap); padding: 14px 16px; border-radius: var(--r-small); border: 1px solid var(--control-line);
  background: var(--surface); color: var(--ink); font-size: 16px; /* 16 px: no zoom on focus in iPhone Safari */
}
.input:focus { outline: none; border: 2px solid var(--action); padding: 13px 15px; }
.input[aria-invalid="true"] { border-color: var(--caution); }
/* The label on the box's border; it stays there (the Flutter app's always-floating label). */
.on-border { position: relative; }
label.field > span.border-label, label.border-label { position: absolute; z-index: 1; top: -9px; left: 12px; margin: 0; padding: 0 4px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); background: linear-gradient(var(--bg) 50%, var(--surface) 50%); pointer-events: none; }
.on-border .input { display: block; }
.input.with-pick, .input.with-pick:focus { padding-right: 48px; }
.phone-pick { position: absolute; z-index: 1; top: 50%; right: 0; transform: translateY(-50%); color: var(--accent-text); }
/* Read only: words, no box; a small lock at the end. */
.readonly-field { margin-bottom: 16px; }
.readonly-field > .t-label { display: block; margin-bottom: 4px; }
.readonly-value { display: flex; align-items: center; gap: 8px; }
.readonly-lock { flex: none; display: flex; color: var(--ink-muted); }
.readonly-lock svg { width: 18px; height: 18px; }
.field-error { display: block; margin-top: 6px; color: var(--caution); font-size: 14px; line-height: 22px; }

.segmented { display: flex; border: 1px solid var(--control-line); border-radius: var(--r-pill); overflow: hidden; }
.segmented button { flex: 1; min-height: var(--tap); border: 0; background: transparent; cursor: pointer; font-weight: 600; }
.segmented button[aria-pressed="true"] { background: var(--tint); color: var(--accent-text); }
.choice { display: flex; align-items: center; gap: 12px; min-height: var(--tap); cursor: pointer; }
.choice input { width: 22px; height: 22px; accent-color: var(--action); margin: 0; }

/* ---- cards, tags, notes ---- */
.card { background: var(--card); border: 0; border-radius: var(--r-large); padding: 16px; display: block; width: 100%; text-align: left; color: var(--ink); }
.card.tinted { background: var(--tint); }
.card.tappable { cursor: pointer; }
.card.caution-card { border-color: var(--caution); }
.tile { display: flex; align-items: center; gap: 14px; min-height: var(--tap); }
.tile .ico { width: 48px; height: 48px; border-radius: var(--r-small); background: var(--tint); color: var(--accent-text); display: flex; align-items: center; justify-content: center; flex: none; }
.tile .ico svg { width: 24px; height: 24px; }
.tile .name { flex: 1; }
.tile.inactive { opacity: 0.6; }
.tag { display: inline-block; padding: 4px 10px; border-radius: var(--r-pill); background: var(--tint); color: var(--accent-text); font-size: 13px; line-height: 18px; font-weight: 600; }
.tag.strong { background: var(--action); color: var(--on-action); }
.note { padding: 8px 0; color: var(--ink-muted); }
.note.caution { color: var(--caution); }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 12px; margin-bottom: 14px; align-items: flex-start; }
.steps .num { width: 32px; height: 32px; flex: none; border-radius: var(--r-pill); background: var(--tint); color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.metric-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.metric-row .unit { padding-bottom: 10px; color: var(--ink-muted); }

/* ---- check screens ---- */
.ring { position: relative; width: 220px; height: 220px; margin: 8px auto 0; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring .inside { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring video { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; }
.stage {
  min-height: 320px; border-radius: var(--r-large); border: 2px solid var(--line); background: var(--card);
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: pointer;
}
.stage.go { background: var(--reaction-go); border-color: var(--reaction-go); color: #FFFFFF; }
.stage.early { background: var(--tint); color: var(--caution); }
/* Reaction Time (decision 74): the box down to just above the wellness line; 5 dots for the taps counted. */
.content:has(> .rt-stage) { display: flex; flex-direction: column; }
.stage.rt-stage { flex: 1 1 auto; min-height: 240px; }
.rt-dots { display: flex; justify-content: center; gap: 10px; }
.rt-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-muted); box-sizing: border-box; }
.rt-dot.on { background: var(--accent-text); border-color: var(--accent-text); }
.result-hero .result-unit { font-weight: 600; }
.rt-tap-time { display: flex; flex-direction: column; align-items: center; }
/* Breath Blast (decision 82): the round area that starts listening, growing and glowing with the blow; the time left as a bar. */
.content:has(> .bb-ring-wrap) { display: flex; flex-direction: column; }
.bb-ring-wrap { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 240px; }
.bb-ring-wrap > .bb-ring { flex: none; }
.bb-ring {
  --glow: 0; width: 220px; height: 220px; border-radius: 50%; border: 4px solid var(--bright-cyan); background: var(--tint); color: var(--accent-text);
  padding: 24px; font: inherit; cursor: pointer; transition: transform 90ms linear;
  box-shadow: 0 0 calc(40px * var(--glow)) calc(6px * var(--glow)) color-mix(in srgb, var(--bright-cyan) calc(60% * var(--glow)), transparent);
}
.bb-ring.live { cursor: default; color: var(--ink); background: color-mix(in srgb, var(--bright-cyan) calc(25% + 50% * var(--glow)), var(--tint)); }
.bb-ring .t-metric { font-size: 64px; }
.bb-ring #bbTapText { display: block; overflow-wrap: break-word; } /* measured by fitCircleText (checks/breath.js) */
.bb-bar-track { height: 6px; }
.bb-bar { display: block; height: 6px; background: var(--bright-cyan); }
.quiet-note { font-size: 14px; margin: 8px 0 0; }
/* Finger Tapping (decision 77): the box down to just above the wellness line; the count big; the time left as a thin bar. */
.content:has(> .ft-pad) { display: flex; flex-direction: column; }
.pad.ft-pad { flex: 1 1 auto; min-height: 240px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ft-bar { position: absolute; top: 0; left: 0; height: 6px; background: currentColor; opacity: .85; }
.ft-count { font-size: 72px; line-height: 1; color: inherit; }
.pad.ft-pad.flash { filter: brightness(1.25); }
/* The hand (decision 78): two large buttons above the box, 48 high; locked once tapping has started. */
.ft-hands { display: flex; gap: 10px; }
.ft-hand { flex: 1 1 0; min-height: 48px; padding: 0 8px; border-radius: var(--r-medium); border: 1px solid var(--line); background: transparent;
  color: var(--ink); font: inherit; font-size: 16px; font-weight: 500; cursor: pointer; }
.ft-hand.on { border: 2px solid var(--accent-text); background: var(--tint); font-weight: 700; }
.ft-hand:disabled { cursor: default; color: var(--ink-muted); }
.ft-hand.on:disabled { color: var(--ink); }
.pad {
  min-height: 260px; border-radius: var(--r-large); border: 0; width: 100%; background: var(--tint); color: var(--accent-text);
  font-size: 22px; line-height: 30px; font-weight: 600; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.pad.live { background: var(--action); color: var(--on-action); }
.meter { height: 12px; border-radius: var(--r-pill); background: var(--tint); overflow: hidden; }
.meter > div { height: 100%; background: var(--ecg-mid); width: 2%; transition: width 80ms linear; }
.face-box { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-large); overflow: hidden; background: var(--tint); }
.face-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-box .guide {
  position: absolute; left: 22%; top: 18%; width: 56%; height: 46%; border-radius: 50%; border: 3px solid var(--line);
}
.face-box .guide.ok { border-color: var(--bright-cyan); border-width: 4px; }
.face-box .guide.bad { border-color: var(--caution); border-width: 4px; }
/* Decision 79: white dashed while no face is found; the time left as a thin bar; the starting picture. */
.face-box .guide.none { border: 4px dashed #FFFFFF; }
.face-box .bl-bar { position: absolute; top: 0; left: 0; height: 6px; background: var(--bright-cyan); }
/* Decision 84: the seconds left, large, centred under the bar. */
.face-box .bl-timer { position: absolute; top: 14px; left: 0; right: 0; text-align: center; font-family: "Lexend", sans-serif; font-size: 56px; line-height: 1; font-weight: 700; color: #FFFFFF; text-shadow: 0 0 8px rgba(0, 0, 0, 0.6); font-variant-numeric: tabular-nums; pointer-events: none; }
.bl-starting { height: 260px; padding: 12px; border-radius: var(--r-large); background: var(--hero-dark, #003D52); display: flex; justify-content: center; }
.bl-starting .hero-art { height: 100%; width: auto; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); max-width: min(528px, calc(100% - 32px));
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--r-small); z-index: 10;
}
dialog { border: 1px solid var(--line); border-radius: var(--r-medium); background: var(--surface); color: var(--ink); max-width: min(480px, calc(100% - 32px)); padding: 20px; }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ring .overlay { background: color-mix(in srgb, var(--bg) 78%, transparent); border-radius: 50%; inset: 35px; }

.boot { padding: 48px 16px; text-align: center; }


/* ---- Stress & Relax ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips.center { justify-content: center; }
.sr-circle { width: 140px; height: 140px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--ecg-mid); background: color-mix(in srgb, var(--ecg-mid) 25%, transparent); }
.sr-circle.small { width: 72px; height: 72px; margin: 0; flex: none; }
.sr-circle.breathing { animation: sr-breathe-slow 10s ease-in-out infinite; }
@keyframes sr-breathe-slow { 0%, 100% { transform: scale(0.62); } 50% { transform: scale(1); } }
.sr-mirror { display: flex; align-items: center; gap: 16px; margin: 8px 0 12px; }
.sr-answer {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; text-align: left; cursor: pointer;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-medium);
}
.sr-answer.selected { background: var(--tint); border: 2px solid var(--action); padding: 11px 15px; }
.sr-answer .t-heading { flex: 1; }
.sr-bars { display: flex; align-items: flex-end; gap: 3px; }
.sr-bars span { width: 5px; border-radius: 2px; background: var(--line); }
.sr-bars span.on { background: var(--accent-text); }
.sr-line { width: 100%; height: 56px; color: var(--ecg-mid); display: block; }
.sr-tips { padding-left: 20px; margin: 6px 0; }
.sr-tips li { margin-bottom: 6px; }
/* the breathing screen: dark, whatever the phone's theme */
.page.sr-dark { background: #071310; color: #EEF8F8; --ink: #EEF8F8; --ink-muted: #9DC4C8; --tint: #12333A; --line: #22413A; }
.sr-dark .bottom { background: #071310; }
.sr-muted { color: #9DC4C8; }
.sr-breathe-stage { position: relative; height: 300px; display: flex; align-items: center; justify-content: center; }
.sr-circle.guided { position: absolute; width: 260px; height: 260px; border-color: var(--bright-cyan); background: color-mix(in srgb, var(--ecg-mid) 22%, transparent);
  animation: sr-guided 10s infinite; }
/* 4 s in (0-40 %), 6 s out (40-100 %) */
@keyframes sr-guided { 0% { transform: scale(0.46); animation-timing-function: ease-in-out; } 40% { transform: scale(1); animation-timing-function: ease-in-out; } 100% { transform: scale(0.46); } }
.sr-breathe-word { position: relative; margin: 8px 0 12px; font-size: 22px; font-weight: 700; }
/* Decision 91: the one header (X, "Stress & Relax", "Step n of 4"), the "Before" label, the result's table. */
.sr-header { gap: 8px; padding-left: 4px; padding-right: 8px; }
.sr-header-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sr-header-step { color: var(--ink-muted); }
.reading-title .t-heading { display: block; font-size: 16px; color: #9DC4C8; }
.reading-sub { display: block; font-size: 13px; color: #9DC4C8; }
.sr-before-tag { font-size: 12px; font-weight: 600; color: var(--accent-text); background: var(--tint); border-radius: 999px; padding: 2px 8px; margin-right: 8px; }
.sr-table { border: 1px solid var(--line); border-radius: 16px; padding: 0 16px; background: var(--card); }
.sr-table-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.sr-table-row + .sr-table-row { border-top: 1px solid var(--line); }
.sr-table-row .t-label { width: 96px; flex: none; }
@media (prefers-reduced-motion: reduce) {
  .sr-circle.breathing, .sr-circle.guided { animation: none; transform: scale(0.75); }
}

/* ---- the "everyday day" drawing on Welcome (lib/welcome-art.js): once, after the logo (1.8 s); never loops ---- */
.welcome-art { display: block; width: 100%; max-width: 350px; height: auto; margin: 0 auto 24px; color: var(--ecg-mid); }
@media (prefers-color-scheme: dark) { .welcome-art { color: var(--light-aqua); } }
.art-stroke { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 2; stroke-dashoffset: 1; opacity: 0; animation: art-draw var(--art-ms) linear calc(1800ms + var(--art-from)) forwards; }
.art-window { fill: currentColor; opacity: 0; animation: art-fade 400ms linear 4800ms forwards; }
@keyframes art-draw { from { opacity: 1; stroke-dashoffset: 1; } to { opacity: 1; stroke-dashoffset: 0; } }
@keyframes art-fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .art-stroke { animation: none; opacity: 1; stroke-dasharray: none; stroke-dashoffset: 0; }
  .art-window { animation: none; opacity: 1; }
}
.welcome-text { text-align: center; }

/* ---- the Aarolife mark on Welcome (lib/logo.js) ---- */
.welcome-logo { display: flex; justify-content: center; padding: 16px 0 20px; }
.logo-mark { width: 104px; height: auto; display: block; }
.logo-knock { fill: var(--bg); }
.logo-animate .logo-a { opacity: 0; transform-origin: 610px 470px; animation: logo-rise 0.5s ease-out forwards; }
.logo-animate .logo-pulse { clip-path: inset(0 100% 0 0); animation: logo-wipe 1.2s 0.35s ease-in-out forwards; }
.logo-animate .logo-dot { opacity: 0; transform-origin: 947px 508px; animation: logo-pop 0.3s 1.5s ease-out forwards; }
@keyframes logo-rise { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes logo-wipe { to { clip-path: inset(0 0 0 0); } }
@keyframes logo-pop { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .logo-animate .logo-a, .logo-animate .logo-pulse, .logo-animate .logo-dot { animation: none; opacity: 1; clip-path: none; transform: none; }
}

/* ---- the finger guide (lib/finger-guide.js): 12 s loop, 3 times, then the hold state ---- */
.finger-guide { margin: 8px 0 16px; padding: 12px; border-radius: var(--r-medium); background: var(--tint); }
.fg { width: 100%; max-width: 360px; height: auto; display: block; margin: 0 auto; }
.fg-phone { fill: color-mix(in srgb, var(--ink) 14%, var(--bg)); }
.fg-island { fill: color-mix(in srgb, var(--ink) 24%, var(--bg)); }
.fg-lens circle { fill: #10191B; stroke: color-mix(in srgb, var(--ink) 45%, var(--bg)); }
.fg-ring { stroke: color-mix(in srgb, var(--ink) 45%, var(--bg)); }
.fg-dash { stroke: var(--ink-muted); }
.fg-dial { fill: #10191B; }
.fg-caps { position: relative; min-height: 76px; margin-top: 8px; }
.fg-caps p { position: absolute; inset: 0 0 auto 0; margin: 0; font-size: 17px; line-height: 25px; color: var(--ink); opacity: 0; }
.fg-light-on, .fg-halo, .fg-glow, .fg-finger { opacity: 0; }
.finger-guide .fg-light-on { animation: fg-light 12s 3; }
.finger-guide .fg-halo { animation: fg-halo 12s 3; }
.finger-guide .fg-finger { animation: fg-move 12s ease-in-out 3; }
.finger-guide .fg-glow { animation: fg-glow 12s 3; }
.finger-guide .fg-dial { animation: fg-dial 12s 3; }
.fg-cap1 { animation: fg-cap1 12s 3; } .fg-cap2 { animation: fg-cap2 12s 3; } .fg-cap3 { animation: fg-cap3 12s 3; }
.fg-cap4 { animation: fg-cap4 12s 3; } .fg-cap5 { animation: fg-cap5 12s 3; }
@keyframes fg-light { 0%, 3% { opacity: 0; } 8%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fg-halo { 0%, 3% { opacity: 0; } 8% { opacity: 0.9; } 13% { opacity: 0.6; } 16%, 26% { opacity: 0; } 30% { opacity: 0.6; } 34%, 45% { opacity: 0; } 49%, 67% { opacity: 0.6; } 71%, 100% { opacity: 0; } }
@keyframes fg-move {
  0%, 9% { transform: translate(18px, -40px); opacity: 0; }
  15% { transform: translate(0, -40px); opacity: 1; }
  26.7% { transform: translate(0, -40px); } 33.3% { transform: translate(0, 0); }
  45% { transform: translate(0, 0); } 51.7% { transform: translate(0, 40px); }
  63.3% { transform: translate(0, 40px); } 70% { transform: translate(0, 0); }
  96% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; }
}
@keyframes fg-glow { 0%, 32% { opacity: 0; } 35%, 45% { opacity: 0.75; } 48%, 68% { opacity: 0; } 71%, 96% { opacity: 0.75; } 100% { opacity: 0; } }
@keyframes fg-dial { 0%, 32% { fill: #10191B; } 35%, 45% { fill: #B0182E; } 48%, 68% { fill: #10191B; } 71%, 96% { fill: #B0182E; } 100% { fill: #10191B; } }
@keyframes fg-cap1 { 0%, 1% { opacity: 0; } 3%, 12% { opacity: 1; } 15%, 100% { opacity: 0; } }
@keyframes fg-cap2 { 0%, 15% { opacity: 0; } 17%, 26% { opacity: 1; } 29%, 100% { opacity: 0; } }
@keyframes fg-cap3 { 0%, 33% { opacity: 0; } 35%, 45% { opacity: 1; } 48%, 100% { opacity: 0; } }
@keyframes fg-cap4 { 0%, 52% { opacity: 0; } 54%, 63% { opacity: 1; } 66%, 100% { opacity: 0; } }
@keyframes fg-cap5 { 0%, 70% { opacity: 0; } 72%, 95% { opacity: 1; } 98%, 100% { opacity: 0; } }
/* the hold state: after the loops, and with reduced motion */
/* on a dark background (the Heartbeat intro hero, How to, the reading screens): as the Flutter app's BcColors.dark (decision 68) */
.finger-guide.fg-on-dark { --bg: #071310; --ink: #EEF8F8; --ink-muted: #9DC4C8; }
.intro-art .finger-guide, .how-to-loop .finger-guide { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; }
.intro-art .finger-guide .fg, .how-to-loop .finger-guide .fg { flex: 1 1 0; min-height: 0; width: 100%; height: 100%; max-width: none; }
.fg-on-dark .fg-caps { display: grid; width: 100%; min-height: 0; margin-top: 6px; }
.fg-on-dark .fg-caps p { position: static; grid-area: 1 / 1; font-size: 15px; line-height: 20px; color: #FFF; text-align: center; }
@media (max-height: 699px) { .result-howto { height: 130px; } }
/* the straight loop (6 s, for ever): the placing picture and "No reading this time"; as the Flutter app's FingerStraightTimeline */
.finger-guide.fg-straight .fg-light-on { animation: fgs-light 6s infinite; }
.finger-guide.fg-straight .fg-halo { animation: fgs-halo 6s infinite; }
.finger-guide.fg-straight .fg-finger { animation: fgs-move 6s ease-in-out infinite; }
.finger-guide.fg-straight .fg-glow { animation: fgs-glow 6s infinite; }
.finger-guide.fg-straight .fg-dial { animation: fgs-dial 6s infinite; }
@keyframes fgs-light { 0%, 5% { opacity: 0; } 12%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fgs-halo { 0%, 5% { opacity: 0; } 12% { opacity: 0.9; } 20%, 34% { opacity: 0.6; } 40%, 100% { opacity: 0; } }
@keyframes fgs-move {
  0%, 12% { transform: translate(18px, 60px); opacity: 0; }
  22% { opacity: 1; } 40% { transform: translate(0, 0); }
  96% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; }
}
@keyframes fgs-glow { 0%, 48% { opacity: 0; } 56%, 96% { opacity: 0.75; } 100% { opacity: 0; } }
@keyframes fgs-dial { 0%, 48% { fill: #10191B; } 56%, 96% { fill: #B0182E; } 100% { fill: #10191B; } }
@media (prefers-reduced-motion: reduce) {
  .finger-guide.fg-straight .fg-light-on, .finger-guide.fg-straight .fg-halo, .finger-guide.fg-straight .fg-finger, .finger-guide.fg-straight .fg-glow, .finger-guide.fg-straight .fg-dial { animation: none; }
  .finger-guide.fg-straight .fg-light-on, .finger-guide.fg-straight .fg-finger { opacity: 1; }
  .finger-guide.fg-straight .fg-glow { opacity: 0.75; }
  .finger-guide.fg-straight .fg-dial { fill: #B0182E; }
}
.finger-guide.fg-done .fg-light-on, .finger-guide.fg-done .fg-halo, .finger-guide.fg-done .fg-finger, .finger-guide.fg-done .fg-glow,
.finger-guide.fg-done .fg-dial, .finger-guide.fg-done .fg-caps p { animation: none; }
.finger-guide.fg-done .fg-light-on, .finger-guide.fg-done .fg-finger, .finger-guide.fg-done .fg-cap5 { opacity: 1; }
.finger-guide.fg-done .fg-glow { opacity: 0.75; }
.finger-guide.fg-done .fg-dial { fill: #B0182E; }
@media (prefers-reduced-motion: reduce) {
  .finger-guide .fg-light-on, .finger-guide .fg-halo, .finger-guide .fg-finger, .finger-guide .fg-glow, .finger-guide .fg-dial, .finger-guide .fg-caps p { animation: none; }
  .finger-guide .fg-light-on, .finger-guide .fg-finger, .finger-guide .fg-cap5 { opacity: 1; }
  .finger-guide .fg-glow { opacity: 0.75; }
  .finger-guide .fg-dial { fill: #B0182E; }
}

/* ---- the signal meter under a reading (lib/signal-meter.js) ---- */
.sig { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 16px 0 4px; }
.sig-bar { width: 12px; border-radius: 4px; background: #22413A; }
.sig-bar.on { background: #1CCEDC; }
.sig[data-word="weak"] .sig-bar.on, .sig[data-word="motion"] .sig-bar.on { background: #F2A46C; }
/* ---- upright only (main.js rotateNotice): a phone held sideways ---- */
.rotate-notice { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .rotate-notice { display: flex; position: fixed; inset: 0; z-index: 1000; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 24px; text-align: center; background: var(--bg); color: var(--ink); }
}

/* ---- the bottom bar (lib/tabs.js): Today · Checks · History · Me; words at 14 px, targets 56 px ---- */
.page.with-tabs { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.page.with-tabs > .content { padding-top: max(16px, env(safe-area-inset-top)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line); padding: 8px 8px max(10px, env(safe-area-inset-bottom));
}
.tab {
  flex: 1; max-width: 140px; min-height: 56px; border: 0; background: transparent; color: var(--ink-muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 14px; line-height: 18px; font-weight: 600;
}
.tab svg { width: 24px; height: 24px; }
.tab-pill { width: 60px; height: 34px; border-radius: 17px; display: flex; align-items: center; justify-content: center; }
.tab.active { color: var(--accent-text); font-weight: 700; }
.tab.active .tab-pill { background: var(--tint); }
.tab:focus-visible { outline: 3px solid var(--action); outline-offset: -3px; }

/* ---- Today, the Daily Check, BP and sugar, History (part B) ---- */
.step-label { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--accent-text); margin: 0 0 8px; }
.dsteps { display: flex; gap: 6px; }
.dsteps > div { flex: 1; min-width: 0; }
.dsteps .bar6 { height: 6px; border-radius: var(--r-pill); background: var(--line); }
.dsteps .bar6.done { background: var(--action); }
.dsteps .bar6.current { background: var(--accent-text); }
.dsteps .bar6.dashed { background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); }
.dsteps .bar6.dashed.done { background: var(--action); }
.dsteps span { display: block; margin-top: 6px; font-size: 14px; line-height: 22px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsteps .now span { color: var(--ink); font-weight: 600; }
.pulse { animation: dc-pulse 1.2s ease-in-out 3; }
@keyframes dc-pulse { 0%, 100% { transform: none; } 50% { transform: scale(1.035); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.row { display: flex; align-items: center; gap: 12px; }
.row > .grow { flex: 1; min-width: 0; }
.day-row { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 8px 0; width: 100%; background: none; border: 0; text-align: left; color: var(--ink); }
.day-row + .day-row { border-top: 1px solid var(--line); }
.day-row .grow { flex: 1; min-width: 0; }
button.day-row { cursor: pointer; }
.day-row > .day-row { flex: 1; min-width: 0; padding: 0; }
/* ---- the redesign: Today and Checks (founder's design board, 3 Nov 2026) ---- */
.today-head { display: flex; align-items: flex-start; gap: 8px; }
.today-date { margin: 0 0 2px; font-size: 13px; line-height: 18px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-greeting { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.section-title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 700; }
.month-caption { margin: 0 0 4px; text-align: right; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
span.other-dot { margin-right: 4px; font-weight: 700; color: var(--chart-color); }
.chart-glyph { font-weight: 700; color: var(--chart-color); }
.arrow-value { display: inline-flex; align-items: center; gap: 0.25em; }
.arrow-glyph { display: inline-flex; align-items: center; }
.arrow-glyph svg { width: 1em; height: 1em; }
.arrow-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: pre; }
.history-legend { margin: 8px 0 0; }
.today-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 6px 0; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; }
.today-row:first-child { border-top: 0; }
button.today-row { cursor: pointer; }
.today-row-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.today-row-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-row-status { font-size: 14px; line-height: 18px; color: var(--ink-muted); }
.today-row-value { flex: none; max-width: 50%; text-align: right; font-size: 17px; line-height: 24px; font-weight: 700; }
.today-row-chevron { flex: none; font-size: 22px; line-height: 1; color: var(--ink-muted); }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
.week-dot { width: 32px; height: 32px; border-radius: 50%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; background: var(--card); border: 1.5px solid var(--line); }
.week-dot.today { border: 3px solid var(--action); }
.week-dot.done { background: var(--action); border: 0; color: var(--on-action); }
.week-dot svg { width: 16px; height: 16px; }
.inbox-bell { position: relative; flex: none; }
.inbox-dot { position: absolute; top: 10px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--action); }
.bp-prompt { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 15px; line-height: 22px; }
.bp-prompt p { margin: 0; }
.daily-hero { position: relative; overflow: hidden; border-radius: var(--r-hero); background: var(--deep-teal); color: #FFFFFF; padding: 20px; }
.daily-hero > * { position: relative; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hero-ecg { flex: none; width: 84px; height: 28px; color: #6CEAF0; opacity: 0.45; }
.hero-ecg svg { width: 100%; height: 100%; }
.hero-eyebrow { margin: 0; font-size: 14px; line-height: 18px; font-weight: 600; letter-spacing: 0.08em; color: #6CEAF0; }
.hero-title { margin: 0 0 14px; font-size: 26px; line-height: 32px; font-weight: 700; }
.hero-fresh { position: relative; margin: -4px 0 12px; font-size: 16px; line-height: 22px; color: #E2F5F7; }
.hero-tiles { display: flex; gap: 6px; margin-bottom: 14px; }
.hero-tile { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px 4px; border-radius: 18px; background: rgb(255 255 255 / 0.12); font-size: clamp(10.5px, 3.3vw, 14px); line-height: 18px; font-weight: 500; color: rgb(255 255 255 / 0.8); }
.hero-tile.done { font-weight: 700; color: #FFFFFF; }
.hero-tile svg { flex: none; }
.slot-label { max-width: 100%; font-size: clamp(10px, 3vw, 12px); line-height: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; color: rgb(255 255 255 / 0.8); }
.slot-text { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.slot-practice { font-size: 12px; line-height: 14px; font-weight: 500; color: #6CEAF0; }
.hero-pill { width: 100%; height: var(--main-button); border: 0; border-radius: var(--r-pill); background: #FFFFFF; color: var(--deep-teal); font-size: 18px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; }
.hero-pill svg { width: 20px; height: 20px; }
.hero-pill:focus-visible { outline: 3px solid #6CEAF0; outline-offset: 2px; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.day-tile { position: relative; background: var(--card); border-radius: 22px; padding: 16px; min-width: 0; }
.day-tile-hit { position: absolute; inset: 0; width: 100%; border: 0; background: none; border-radius: 22px; cursor: pointer; }
.day-tile-hit:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.day-tile p { margin: 0; }
.day-tile-name { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ink-muted); margin-bottom: 10px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-tile-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-number { font-size: 32px; line-height: 36px; font-weight: 700; }
.day-tile-unit { font-size: 15px; color: var(--ink-muted); }
.day-tile-status { position: relative; margin-top: 10px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--tint); color: var(--accent-text); font-size: 14px; line-height: 18px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--action); flex: none; }
.muted-chip { background: var(--chip-muted); color: var(--ink-muted); }
.muted-chip .status-dot { background: var(--control-line); }
.practice-tag.practice-chip { margin-left: 0; min-width: 0; min-height: var(--tap); margin-top: -12px; margin-bottom: -12px; justify-content: flex-start; }
.checks-title { margin: 0 0 16px; font-size: 30px; line-height: 36px; font-weight: 700; }
.card.checks-daily { padding: 14px; }
.checks-daily .tile { gap: 8px; }
.checks-section { margin: 16px 0 8px; }
.daily-ico { width: 48px; height: 48px; margin-right: 4px; flex: none; border-radius: 16px; background: var(--deep-teal); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.daily-ico svg { width: 26px; height: 26px; }
.daily-name { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700; }
.daily-line { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.start-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: var(--r-pill); background: var(--action); color: var(--on-action); font-size: 16px; font-weight: 700; }
.start-pill svg { width: 14px; height: 14px; }
.card.check-tile { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.check-tile p { margin: 0; }
.check-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.check-ico { width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--tint); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.check-ico svg { width: 20px; height: 20px; }
.done-tick { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--action); color: var(--on-action); display: flex; align-items: center; justify-content: center; }
.done-tick svg { width: 14px; height: 14px; }
.check-tile-name { font-size: 16px; line-height: 22px; font-weight: 700; }
.coming-card { margin-top: 20px; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-large); border: 1.5px dashed var(--control-line); color: var(--ink-muted); }
.coming-card svg { width: 24px; height: 24px; flex: none; }
.coming-card p { margin: 0; font-size: 15px; line-height: 22px; }
.coming-name { font-weight: 700; color: var(--ink); }

/* ---- the redesign: the check intros (the board's keyframes; still with reduced motion) ---- */
.intro { width: 100%; max-width: var(--content-max); margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; background: var(--hero-dark); }
.intro-hero { flex: none; height: clamp(240px, 43dvh, 360px); display: flex; flex-direction: column; color: #FFFFFF; padding-top: env(safe-area-inset-top); }
.intro-top { display: flex; align-items: center; gap: 8px; padding: 8px 16px 0; }
.hero-btn, .intro-top .icon-btn, .intro-top .how-to-btn { min-width: 48px; height: 48px; border: 0; border-radius: 24px; background: rgb(255 255 255 / 0.12); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.hero-btn svg { width: 22px; height: 22px; }
.hero-btn:focus-visible, .intro-top .icon-btn:focus-visible, .intro-top .how-to-btn:focus-visible { outline: 3px solid #6CEAF0; outline-offset: 2px; }
.intro-art { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 4px 16px 12px; }
.hero-art { height: 100%; max-width: 100%; display: block; font-family: var(--font); }
/* Decision 90: the Breath Blast animation on a light card (the same in both themes), at most 240 px wide, 728:544, inside the hero. */
.bb-intro-art { height: min(100%, 179px); aspect-ratio: 728 / 544; max-width: 100%; background: #FFFFFF; border-radius: 24px; overflow: hidden; display: flex; }
.bb-intro-art picture, .bb-intro-art img { width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; }
.intro-sheet { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg); border-radius: 32px 32px 0 0; color: var(--ink); }
.intro-scroll { flex: 1; padding: 26px 22px 12px; }
.intro-title { margin: 0; font-size: 30px; line-height: 36px; font-weight: 700; }
.intro-chip { padding: 6px 12px; font-size: 14px; line-height: 20px; }
.intro .chips { margin-top: 10px; }
.intro-steps { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.intro-step { display: flex; align-items: center; gap: 14px; }
.intro-ico { width: 48px; height: 48px; flex: none; border-radius: var(--r-medium); background: var(--card); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.intro-ico svg { width: 24px; height: 24px; }
.intro-step-text { font-size: 18px; line-height: 24px; font-weight: 500; }
.intro-num { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--card); color: var(--accent-text); font-size: 17px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.intro-step-title { display: block; font-size: 18px; line-height: 23px; font-weight: 600; }
.intro-step-sub { display: block; font-size: 15px; line-height: 22px; color: var(--ink-muted); }
.intro-bottom { position: sticky; bottom: 0; background: var(--bg); padding: 8px 22px max(16px, env(safe-area-inset-bottom)); }
.intro-bottom .btn { min-height: 60px; font-size: 19px; font-weight: 700; }
.how-to-loop { height: 300px; padding: 12px; border-radius: var(--r-large); background: var(--hero-dark, #003D52); display: flex; justify-content: center; }
.result-howto .finger-guide, .finger-picture .finger-guide { height: 100%; }
.result-howto .fg, .finger-picture .fg { height: 100%; width: auto; max-width: none; }
/* Decision 92: the check's own picture on a failure, still. */
.fail-still * { animation: none !important; }
.fail-still svg { height: 100%; width: auto; max-width: 100%; }
.fail-breath { height: 190px; margin-top: 14px; display: flex; justify-content: center; }
.fail-breath img { height: 100%; width: auto; max-width: 100%; aspect-ratio: 728 / 544; background: #FFFFFF; border-radius: var(--r-large); object-fit: contain; }
@media (max-height: 699px) { .fail-breath { height: 130px; } }
.result-howto { height: 190px; margin-top: 14px; padding: 8px; border-radius: var(--r-large); background: var(--hero-dark, #003D52); display: flex; justify-content: center; }
.finger-picture[hidden], .reading-disc[hidden], .reading-disc [hidden], .sig-words[hidden], .sig-wrap[hidden], .sr-caption[hidden], .sr-line[hidden] { display: none !important; }
/* placing: the finger loop, small, above the ring; the ring shows the camera's own view (founder, 6 Nov 2026) */
.finger-picture { display: flex; align-items: center; justify-content: center; gap: 10px; height: 104px; margin-bottom: 8px; }
@media (max-height: 699px) { .finger-picture { height: 72px; margin-bottom: 4px; } }
.hb-hint-word { font-size: 13px; font-weight: 600; color: #6CEAF0; }
.sr-caption { margin: 4px 0 0; font-size: 13px; color: #9DC4C8; }
/* The pulse line's heart (founder, 6 Nov 2026): outline, teal, the words' size; it pulses on each beat (drawSignalLine), still with reduced motion. */
.sr-caption .pulse-heart { width: 13px; height: 13px; color: #6CEAF0; vertical-align: -2px; margin-right: 4px; transform-origin: center; }
/* "Wellness check, not a medical test." on every measuring screen: small grey 13 text, centred, 16 high; above the buttons (page footer). */
.page-footer { padding: 4px 0 0; }
.measuring-wellness { margin: 0; font-size: 13px; line-height: 16px; color: var(--ink-muted); text-align: center; }
.reading-content .measuring-wellness { margin-top: 8px; color: #9DC4C8; }
.sig-wrap { display: flex; flex-direction: column; align-items: center; }
.sig-words { margin: 4px 0 0; font-size: 13px; color: #9DC4C8; }
.sig-wrap[data-word="weak"] .sig-words, .sig-wrap[data-word="motion"] .sig-words { color: #F2A46C; }
.reading-ring.weak .progress { stroke: #F2A46C; }
.reading-measuring { font-size: 26px; font-weight: 700; color: #FFF; }
.reading-heart { color: #E0394B; width: 44px; height: 44px; animation: heart-beat 0.9s linear infinite; transform-origin: center; }
.reading-final { font-size: 13px; color: #9DC4C8; }
.range-bar.has-ticks { height: 72px; }
.range-tick { position: absolute; top: 48px; transform: translateX(-50%); font-size: 13px; color: var(--ink-muted); white-space: nowrap; }
.heart-dot, .heart-dot-glow { offset-path: path("M6 150 L70 150 L84 150 L94 134 L104 166 L114 120 L126 160 L134 150 L224 150"); offset-rotate: 0deg; animation: heart-dot var(--beat) linear infinite; }
@keyframes heart-dot { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.intro-hero.hero-tall { height: clamp(220px, 46dvh, 390px); }
.intro-hero.hero-short { height: clamp(220px, 38dvh, 320px); }
.intro-steps:has(.intro-row) { gap: 6px; }
.intro-row { padding: 8px 10px; border-radius: 18px; }
.intro-row .intro-ico, .intro-row .intro-num { background: var(--tint); }
/* Finger Tapping's intro (decisions 77 T1, 78a): four quick taps up onto the box on the phone's screen, a flash on each, a pause. */
@keyframes tp-finger {
  0% { transform: translateY(0); } 6%, 9% { transform: translateY(-36px); } 15% { transform: translateY(0); }
  21%, 24% { transform: translateY(-36px); } 30% { transform: translateY(0); } 36%, 39% { transform: translateY(-36px); }
  45% { transform: translateY(0); } 51%, 54% { transform: translateY(-36px); } 60%, 100% { transform: translateY(0); }
}
@keyframes tp-pad {
  0%, 5% { fill: #12333A; } 6%, 10% { fill: #1CCEDC; } 12%, 20% { fill: #12333A; } 21%, 25% { fill: #1CCEDC; } 27%, 35% { fill: #12333A; }
  36%, 40% { fill: #1CCEDC; } 42%, 50% { fill: #12333A; } 51%, 55% { fill: #1CCEDC; } 57%, 100% { fill: #12333A; }
}
.tp-finger { animation: tp-finger 2s linear infinite; }
.tp-pad { animation: tp-pad 2s linear infinite; }
@keyframes srs-sc1 { 0%, 23% { opacity: 1; } 26%, 97% { opacity: 0; } 100% { opacity: 1; } }
@keyframes srs-sc2 { 0%, 23% { opacity: 0; } 26%, 48% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes srs-sc3 { 0%, 48% { opacity: 0; } 51%, 73% { opacity: 1; } 76%, 100% { opacity: 0; } }
@keyframes srs-sc4 { 0%, 73% { opacity: 0; } 76%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes srs-hl1 { 0%, 25% { background: var(--card); box-shadow: 0 0 0 2px var(--action); } 25.01%, 100% { background: transparent; box-shadow: none; } }
@keyframes srs-hl2 { 0%, 25% { background: transparent; box-shadow: none; } 25.01%, 50% { background: var(--card); box-shadow: 0 0 0 2px var(--action); } 50.01%, 100% { background: transparent; box-shadow: none; } }
@keyframes srs-hl3 { 0%, 50% { background: transparent; box-shadow: none; } 50.01%, 75% { background: var(--card); box-shadow: 0 0 0 2px var(--action); } 75.01%, 100% { background: transparent; box-shadow: none; } }
@keyframes srs-hl4 { 0%, 75% { background: transparent; box-shadow: none; } 75.01%, 100% { background: var(--card); box-shadow: 0 0 0 2px var(--action); } }
@keyframes srs-breathe { 0%, 100% { transform: scale(.62); } 50% { transform: scale(1); } }
@keyframes srs-pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes srs-face { 0%, 30% { transform: scale(1); } 40%, 60% { transform: scale(1.18); } 70%, 100% { transform: scale(1); } }
.srs-sc1 { animation: srs-sc1 var(--srs-loop, 12s) linear infinite; }
.srs-sc2 { animation: srs-sc2 var(--srs-loop, 12s) linear infinite; opacity: 0; }
.srs-sc3 { animation: srs-sc3 var(--srs-loop, 12s) linear infinite; opacity: 0; }
.srs-sc4 { animation: srs-sc4 var(--srs-loop, 12s) linear infinite; opacity: 0; }
.srs-hl1 { animation: srs-hl1 var(--srs-loop, 12s) linear infinite; }
.srs-hl2 { animation: srs-hl2 var(--srs-loop, 12s) linear infinite; }
.srs-hl3 { animation: srs-hl3 var(--srs-loop, 12s) linear infinite; }
.srs-hl4 { animation: srs-hl4 var(--srs-loop, 12s) linear infinite; }
.srs-breathe { animation: srs-breathe var(--srs-breath, 3s) ease-in-out infinite; transform-origin: 150px 85px; }
.srs-pulse { animation: srs-pulse 1s ease-in-out infinite; }
.srs-face { animation: srs-face 1.3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
/* Reaction Time's intro (decisions 74a, 75a): the finger waits just below the box, the box turns green, the finger moves up and taps,
   a tick, it drops back down. */
@keyframes rt-box { 0%, 44% { fill: #4A6670; } 47%, 90% { fill: #00873A; } 94%, 100% { fill: #4A6670; } }
@keyframes rt-w { 0%, 44% { opacity: 1; } 47%, 94% { opacity: 0; } 97%, 100% { opacity: 1; } }
@keyframes rt-g { 0%, 44% { opacity: 0; } 47%, 56% { opacity: 1; } 58%, 100% { opacity: 0; } }
@keyframes rt-tick { 0%, 56% { opacity: 0; } 58%, 88% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes rt-f { 0%, 48% { transform: translateY(0); } 54%, 62% { transform: translateY(-48px); } 72%, 100% { transform: translateY(0); } }
.rt-box { animation: rt-box 3.6s linear infinite; }
.rt-w { animation: rt-w 3.6s linear infinite; }
.rt-g { animation: rt-g 3.6s linear infinite; opacity: 0; }
.rt-tick { animation: rt-tick 3.6s linear infinite; opacity: 0; }
.rt-f { animation: rt-f 3.6s linear infinite; }
@keyframes bb-wave { 0% { transform: translateX(-40px); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateX(70px); opacity: 0; } }
@keyframes bb-bar { 0%, 10% { transform: scaleY(.15); } 30%, 85% { transform: scaleY(1); } 100% { transform: scaleY(.15); } }
.bb-w1 { animation: bb-wave 1.6s linear infinite; }
.bb-w2 { animation: bb-wave 1.6s linear .5s infinite; }
.bb-w3 { animation: bb-wave 1.6s linear 1s infinite; }
.bb-bar { animation: bb-bar 4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
@keyframes bl-eye { 0%, 44%, 52%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.08); } }
@keyframes bl-ring { 0%, 44%, 56%, 100% { stroke: #1CCEDC; } 48%, 52% { stroke: #6CEAF0; } }
.bl-eye { animation: bl-eye 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.bl-ring { animation: bl-ring 3s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .tp-finger { transform: translateY(-36px); } /* the fingertip resting on the box (decision 78a) */
  .tp-finger, .tp-pad,
  .srs-sc1, .srs-sc2, .srs-sc3, .srs-sc4, .srs-hl1, .srs-hl2, .srs-hl3, .srs-hl4, .srs-breathe, .srs-pulse, .srs-face,
  .rt-box, .rt-w, .rt-g, .rt-tick, .rt-f, .bb-w1, .bb-w2, .bb-w3, .bb-bar, .bl-eye, .bl-ring { animation: none; }
  /* the finger above the green box (decision 74a) */
  .rt-box { fill: #00873A; } .rt-w, .rt-tick { opacity: 0; } .rt-g { opacity: 1; } .rt-f { transform: none; }
  .reading-heart { animation: none; }
}

.practice-tag { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: var(--tap); margin-left: 8px; padding: 0; background: none; border: 0; cursor: pointer; vertical-align: middle; flex: none; }
.chip {
  min-height: var(--tap); padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--control-line); background: transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.chip[aria-pressed="true"] { background: var(--tint); color: var(--accent-text); border-color: var(--action); }
.boxes { display: flex; gap: 12px; }
.bp-boxes { gap: 6px; }
.bp-slash { flex: none; align-self: center; font-size: 32px; line-height: 40px; font-weight: 400; color: var(--ink-muted); }
.v-line { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.v-suffix { font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.meal-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.meal-chips .chip { min-height: var(--tap); padding: 0 8px; white-space: nowrap; overflow: hidden; }
.unit-chip { flex: none; align-self: center; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 8px 0 14px; border-radius: var(--r-pill); border: 1px solid var(--control-line); background: transparent; color: var(--accent-text); font-size: 16px; line-height: 25px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.unit-chip svg { width: 22px; height: 22px; }
.unit-label { margin: 0 0 8px; }
.unit-row { display: flex; gap: 8px; align-items: flex-end; }
.unit-row .unit-chip { align-self: flex-end; margin-bottom: 2px; margin-left: 4px; width: 112px; justify-content: space-between; }
.unit-row label.field { margin-bottom: 0; }
.box {
  flex: 1; min-height: 84px; border-radius: var(--r-small); border: 1px solid var(--control-line); background: var(--card); padding: 8px 12px;
  text-align: left; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; color: var(--ink);
}
.box.on { border: 2.5px solid var(--action); padding: 6.5px 10.5px; }
.box .v { font-size: 28px; line-height: 34px; font-weight: 600; min-height: 34px; }
.box .l { font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numpad button { min-height: 60px; border-radius: var(--r-small); border: 1px solid var(--control-line); background: transparent; font-size: 22px; font-weight: 600; cursor: pointer; color: var(--ink); }
.numpad button svg { width: 24px; height: 24px; }
.progress-bar { height: 8px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--action); }
.safety-card { border: 1px solid var(--caution); }
.country-btn { width: auto; min-height: var(--tap); flex: none; padding: 0 8px 0 12px; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.consent-row { display: flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; font-size: 16px; line-height: 25px; }
.consent-box { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--action); cursor: pointer; }
.consent-row a { color: var(--accent-text); font-weight: 600; text-decoration: underline; }
.country-btn svg { width: 20px; height: 20px; flex: none; color: var(--ink-muted); }
.country-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; }
.country-dialog[open] { display: flex; }
.country-list { overflow-y: auto; max-height: 60dvh; }
.grow { flex: 1; min-width: 0; }
.test-version { display: inline-block; margin: 0 0 8px; padding: 4px 10px; border: 1px solid var(--caution); border-radius: var(--r-pill); color: var(--caution); font-size: 14px; line-height: 18px; font-weight: 600; }

/* ---- the How to button and guide (28 Oct 2026): next to the voice button; the guide as a panel at the bottom ---- */
.how-to-btn {
  min-height: var(--tap); min-width: var(--tap); border: 0; background: transparent; border-radius: var(--r-pill); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; color: var(--accent-text); font: inherit; font-size: 14px; font-weight: 600;
}
.how-to-btn svg { width: 22px; height: 22px; }
.how-to-btn:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
dialog.how-to {
  margin: auto auto 0; width: 100%; max-width: 560px; max-height: 90dvh; padding: 0; border-radius: var(--r-large) var(--r-large) 0 0;
  border-bottom: 0; flex-direction: column;
}
dialog.how-to[open] { display: flex; }
.how-to-body { overflow-y: auto; padding: 20px 16px 8px; }
.how-to-bottom { padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }

/* A reading, Breathe, and the results (founder's design board, 3 Nov 2026). */
.page.reading-page { background: #071310; color: #EEF8F8; --ink: #EEF8F8; --ink-muted: #9DC4C8; --tint: #12333A; --line: #22413A; min-height: 100dvh; }
.reading-bar { gap: 8px; }
.reading-bar .icon-btn, .reading-bar .btn-text, .reading-bar button { background: #10251D; color: #EEF8F8; border-radius: 50%; min-width: 48px; min-height: 48px; }
.reading-bar .reading-title { flex: 1; min-width: 0; text-align: center; font-size: 16px; color: #9DC4C8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reading-content { display: flex; flex-direction: column; align-items: center; }
.reading-of { color: #9DC4C8; margin: 0 0 8px; }
.ring.reading-ring { width: min(290px, 76vw); height: min(290px, 76vw); margin: 4px auto 16px; }
.reading-glow { opacity: 0.25; animation: reading-glow 1.1s ease-in-out infinite; }
@keyframes reading-glow { 50% { opacity: 0.5; } }
.ring .overlay.reading-disc { background: #071310; inset: 12%; gap: 2px; }
.reading-bpm { font-size: 84px; line-height: 88px; font-weight: 700; color: #FFF; }
.reading-unit { font-size: 18px; color: #9DC4C8; }
.reading-left { margin-top: 8px; padding: 6px 14px; border-radius: var(--r-pill); background: #10251D; color: #6CEAF0; font-weight: 600; font-size: 16px; }
.reading-page .sr-line { height: 60px; }
.reading-line { color: #FFF; margin: 12px 0 0; font-weight: 700; font-size: 24px; line-height: 30px; }
.breathe-stage { position: relative; width: min(300px, 80vw); height: min(300px, 80vw); margin: 16px auto 24px; display: flex; align-items: center; justify-content: center; }
.breathe-track { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #22413A; }
.breathe-circle { position: absolute; inset: 0; border-radius: 50%; background: #12333A; border: 3px solid #1CCEDC; box-shadow: 0 0 60px rgb(28 206 220 / 25%); animation: breathe-circle 10s linear infinite; }
@keyframes breathe-circle {
  0% { transform: scale(0.62); animation-timing-function: ease-in-out; }
  40% { transform: scale(1); animation-timing-function: ease-in-out; }
  100% { transform: scale(0.62); }
}
.breathe-word { position: relative; font-size: 28px; font-weight: 700; color: #FFF; }
.breathe-hint { color: #9DC4C8; font-size: 18px; margin-bottom: 24px; }
.btn.breathe-done { width: 100%; height: 56px; background: transparent; color: #EEF8F8; border: 1.5px solid #6F9C95; }
.result-bar .t-heading { text-align: center; font-size: 16px; color: var(--ink-muted); padding-right: 48px; }
.result-bar .icon-btn { background: var(--card); border-radius: 50%; }
.result-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 20px 20px; border-radius: var(--r-hero); background: var(--hero-dark); color: #FFF; text-align: center; margin-top: 8px; }
.result-hero .metric-row { display: flex; align-items: flex-end; justify-content: center; gap: 8px; flex-wrap: wrap; }
.result-hero .t-metric { color: #FFF; }
.result-hero .unit { color: #A8C9D1; font-weight: 600; font-size: 18px; padding-bottom: 6px; }
.result-hero .t-body { color: #A8C9D1; }
.result-icon { width: 72px; height: 72px; margin: 6px 0 8px; border-radius: 50%; background: #0A4A60; color: var(--light-aqua); display: flex; align-items: center; justify-content: center; }
.result-icon svg { width: 36px; height: 36px; }
.result-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r-pill); background: #0A4A60; color: var(--light-aqua); font-size: 15px; font-weight: 700; }
.result-chip svg { width: 16px; height: 16px; flex: none; }
.result-chip.light { background: var(--chip-muted); color: var(--ink); }
.beating-heart { width: 230px; height: 170px; display: block; }
.heart-glow { opacity: 0.5; animation: heart-glow var(--beat) linear infinite; }
@keyframes heart-glow { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.7; } }
.heart-shape { transform-box: fill-box; transform-origin: center; animation: heart-beat var(--beat) linear infinite; }
@keyframes heart-beat { 0%, 60%, 100% { transform: scale(1); } 14% { transform: scale(1.13); } 28% { transform: scale(0.97); } 42% { transform: scale(1.06); } }
.heart-ecg { opacity: .55; } /* drawn in full; a dot runs along it once a beat (founder, 6 Nov 2026) */
.result-high { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: 26px; background: var(--card); margin-top: 8px; }
.result-high .t-metric { display: block; line-height: 66px; }
.result-high .unit { font-size: 15px; color: var(--ink-muted); }
.range-card { padding: 14px 18px 16px; border-radius: var(--r-large); background: var(--card); }
.range-bar { position: relative; height: 54px; pointer-events: none; user-select: none; touch-action: auto; }
.range-track { position: absolute; left: 0; right: 0; top: 30px; height: 12px; border-radius: 6px; background: var(--chip-muted); overflow: hidden; }
.range-band { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.range-band.usual, .range-swatch.usual { background: #B9E6EC; }
.range-band.normal, .range-swatch.normal { background: var(--primary-teal); }
.range-mark { position: absolute; top: 20px; width: 4px; height: 32px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.range-today { position: absolute; top: -2px; transform: translateX(-50%); font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.range-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.range-key { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-muted); }
.range-swatch { width: 14px; height: 10px; border-radius: 5px; }
.tips-card { padding: 14px 16px; border-radius: var(--r-large); background: var(--tint); }
.tips-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.tips-title { flex: 1; font-size: 15px; font-weight: 700; color: var(--accent-text); }
.tip-dots { display: inline-flex; gap: 6px; }
.tip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--control-line); opacity: 0.4; }
.tip-dot.on { background: var(--accent-text); opacity: 1; }
.tips-row { display: flex; align-items: center; gap: 12px; }
.tips-row .t-body { flex: 1; min-height: 48px; display: flex; align-items: center; }
.tip-icon { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--card); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.tip-icon svg { width: 22px; height: 22px; }
.tip-next { flex: none; background: var(--card); color: var(--accent-text); border-radius: 50%; }
.try-this { padding: 20px; border-radius: 26px; background: var(--deep-teal); color: #E2F5F7; display: flex; flex-direction: column; gap: 14px; }
.try-eyebrow { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 1.1px; color: var(--light-aqua); }
.try-title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; color: #FFF; }
.try-this .t-body, .try-this .t-small { color: #E2F5F7; }
.remind-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; border: 0; border-radius: var(--r-pill); background: #FFF; color: var(--deep-teal); font: inherit; font-weight: 700; cursor: pointer; }
.remind-btn:disabled { opacity: 0.75; cursor: default; }
.remind-btn svg { width: 20px; height: 20px; }
.breathe-row, .care-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 14px 16px; border: 0; border-radius: 22px; background: var(--card); color: var(--ink); font: inherit; text-align: left; }
.breathe-row { cursor: pointer; }
.breathe-row > svg { width: 24px; height: 24px; flex: none; color: var(--control-line); }
.breathe-row.dark { background: var(--deep-teal); color: #FFF; }
.breathe-row.dark > svg { color: #FFF; }
.breathe-row.dark .tile-icon { background: rgb(255 255 255 / 14%); color: #FFF; }
.breathe-row.dark .row-line { color: #E2F5F7; }
.tile-icon { flex: none; width: 48px; height: 48px; border-radius: 16px; background: var(--tint); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.tile-icon svg { width: 24px; height: 24px; }
.row-title { display: block; font-weight: 600; font-size: 18px; }
.row-line { display: block; font-size: 15px; color: var(--ink-muted); }
.result-footer { padding-top: 8px; margin: 0; }
.page.summary-page { padding-left: 0; padding-right: 0; }
.summary-page > .content { padding-top: 0; }
.summary-page > .bottom { padding-left: 16px; padding-right: 16px; }
.summary-body { padding: 20px 20px 12px; }
.summary-rows-area { padding: 0 16px 12px; }
.summary-band { position: relative; display: flex; flex-direction: column; align-items: center; padding: calc(4px + env(safe-area-inset-top)) 22px 12px; border-radius: 0 0 36px 36px; background: var(--deep-teal); color: #FFF; }
.summary-title { margin: 10px 0 0; font-size: 28px; line-height: 34px; font-weight: 700; color: #FFF; }
.icon-btn.on-band { position: absolute; left: 22px; top: calc(4px + env(safe-area-inset-top)); background: rgb(255 255 255 / 12%); color: #FFF; border-radius: 50%; }
.summary-tick { width: 56px; height: 56px; margin-top: 8px; border-radius: 50%; background: #FFF; color: var(--primary-teal); box-shadow: 0 0 0 7px rgb(108 234 240 / 28%); display: flex; align-items: center; justify-content: center; }
.summary-tick svg { width: 28px; height: 28px; }
.summary-month { margin: 2px 0 0; font-size: 13px; line-height: 18px; font-weight: 400; color: #E2F5F7; }
.card#summaryRows { padding: 4px 16px; }
.summary-row { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 0; }
.summary-left { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.summary-left .row-title { max-width: 100%; font-size: 16px; line-height: 25px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-row + .summary-row { border-top: 1px solid var(--line); }
.summary-row .tile-icon { width: 36px; height: 36px; margin-right: 4px; border-radius: 13px; }
.summary-row .tile-icon svg { width: 22px; height: 22px; }
.summary-value { flex: none; max-width: calc(100% - 100px); text-align: right; font-size: 17px; line-height: 24px; font-weight: 700; }
.care-top { display: flex; flex-direction: column; gap: 10px; padding-top: calc(16px + env(safe-area-inset-top)); }
.care-bar { display: flex; align-items: center; justify-content: space-between; }
.care-spacer { width: 48px; }
.icon-btn.on-card { background: var(--card); border-radius: 50%; }
.care-eyebrow { margin: 6px 0 0; font-size: 14px; font-weight: 600; letter-spacing: 0.8px; color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) {
  .reading-glow, .heart-glow, .heart-shape { animation: none; }
  .heart-dot, .heart-dot-glow { display: none; }
  .breathe-circle { animation: none; transform: scale(0.85); }
}

/* How you feel (founder's design board, 3 Nov 2026). */
.mood-bar { display: flex; align-items: center; gap: 12px; padding-top: calc(12px + env(safe-area-inset-top)); }
.mood-steps { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mood-steps span { height: 8px; border-radius: 4px; background: var(--line); }
.mood-steps span.on { background: var(--primary-teal); }
.mood-step-word { flex: none; font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.mood-title { margin: 4px 0 0; font-size: 28px; line-height: 34px; font-weight: 700; text-align: center; color: var(--ink); }
.mood-float { width: 170px; margin: 32px auto 28px; animation: mood-float 3.2s ease-in-out infinite; }
@keyframes mood-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.mood-orb { width: 170px; height: 170px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.mood-pop { animation: mood-pop 0.35s ease-out; }
@keyframes mood-pop { 0% { transform: scale(0.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.mood-word { margin: 0; text-align: center; font-size: 24px; line-height: 30px; font-weight: 700; color: var(--ink); }
.mood-page #moodGentle { margin: 4px 0 0; }
.mood-choices { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.mood-choice { min-height: 96px; padding: 8px 2px; box-sizing: border-box; border-radius: 20px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; line-height: 16px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.mood-choice svg { flex: none; }
.mood-choice.on { background: #E2F5F7; border: 3px solid #003D52; color: #003D52; }
.mood-tags-block { margin-top: 14px; }
.mood-tags-title { margin: 0 0 8px; font-size: 17px; font-weight: 700; color: var(--ink); }
.mood-tags-title span { font-weight: 400; color: var(--ink-muted); }
.mood-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-tag { min-height: 48px; padding: 0 16px; border-radius: var(--r-pill); border: 1.5px solid var(--control-line); background: var(--card); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.mood-tag.on { background: var(--deep-teal); border-color: var(--deep-teal); color: #FFF; }
.mood-page .bottom #moodSkip { display: block; margin: 8px auto 0; }
.mood-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mood-day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-muted); }
.mood-day-none { width: 8px; height: 8px; margin: 14px; border-radius: 50%; background: var(--line); }
@media (prefers-reduced-motion: reduce) { .mood-float, .mood-pop { animation: none; } }

/* Fitting a screen on one screen (founder, 3 Nov 2026), as the Flutter app's compact mode: under 700 px high, smaller gaps
   and pictures; text stays readable (body 16, labels 14). What still doesn't fit scrolls, and the main button stays pinned. */
@media (max-height: 699px) {
  .gap-24 { height: 12px; }
  .gap-16 { height: 10px; }
  .gap-8 { height: 4px; }
  .content { padding: 4px 0 8px; }
  .page.with-tabs > .content { padding-top: max(8px, env(safe-area-inset-top)); }
  .bottom { padding: 4px 0 max(10px, env(safe-area-inset-bottom)); gap: 4px; }
  .heading-block { margin-bottom: 8px; }

  /* Welcome */
  .welcome-logo { padding: 4px 0 8px; }
  .logo-mark { width: 80px; }
  .welcome-art { max-width: 280px; margin-bottom: 12px; }
  .welcome-text .t-display { font-size: 28px; line-height: 34px; }

  /* the intros */
  .intro-hero { height: clamp(150px, 30dvh, 210px); }
  .intro-scroll { padding: 14px 22px 4px; }
  .intro-title { font-size: 24px; line-height: 30px; }
  .intro-steps { margin-top: 10px; gap: 6px; }
  .intro-ico { width: 40px; height: 40px; }
  .intro-num { width: 40px; height: 40px; }
  .intro-step-text { font-size: 16px; line-height: 22px; }
  .intro-step-title { font-size: 16px; line-height: 22px; }
  .intro-step-sub { font-size: 14px; line-height: 18px; }
  .intro-bottom { padding: 4px 22px max(10px, env(safe-area-inset-bottom)); }
  .intro-bottom .btn { min-height: 56px; }

  /* Today */
  .week-dot { width: 28px; height: 28px; }
  .week-day { gap: 2px; }
  .daily-hero { padding: 14px; }
  .hero-top { margin-bottom: 2px; }
  .hero-title { margin-bottom: 8px; font-size: 22px; line-height: 28px; }
  .hero-tiles { margin-bottom: 8px; }
  .hero-tile { padding: 6px 4px; gap: 2px; }
  .day-tile { padding: 10px; }
  .day-tile-name { margin-bottom: 2px !important; }
  .day-tile-status { margin-top: 2px; }

  /* Checks */
  .checks-title { margin: 0 0 4px; font-size: 24px; line-height: 30px; }
  .card.checks-daily { padding: 10px 12px; }
  .checks-section { margin: 8px 0 4px; }
  .daily-ico { width: 40px; height: 40px; }
  .daily-ico svg { width: 24px; height: 24px; }
  .tile-grid { row-gap: 8px; }
  .card.check-tile { padding: 8px 10px; }
  .coming-card { margin-top: 8px; padding: 6px 18px; }

  /* readings and Breathe */
  .ring.reading-ring { width: min(230px, 70vw, 40dvh); height: min(230px, 70vw, 40dvh); margin: 0 auto 6px; }
  .ring.reading-ring video { width: 60%; height: 60%; }
  .reading-bpm { font-size: 64px; line-height: 68px; }
  .reading-unit { font-size: 16px; }
  .reading-left { margin-top: 4px; }
  .reading-page .sr-line { height: 44px; }
  .reading-line { margin-top: 6px; font-size: 20px; line-height: 26px; }
  .reading-content .measuring-wellness { margin-top: 4px; }
  .breathe-stage { width: min(230px, 70vw, 42dvh); height: min(230px, 70vw, 42dvh); margin: 4px auto 12px; }
  .breathe-hint { font-size: 16px; margin-bottom: 12px; }

  /* results: the picture beside the number, not above it */
  .result-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-items: center; justify-items: start; padding: 8px 14px 10px; border-radius: var(--r-large); text-align: left; margin-top: 2px; }
  .result-hero > .beating-heart, .result-hero > .result-icon { grid-row: span 2; }
  .result-hero > .metric-row, .result-hero > .result-chip, .result-hero > .practice-tag, .result-hero > .t-display { grid-column: 2; }
  .result-hero > .t-body { grid-column: 1 / -1; }
  .result-hero .metric-row { justify-content: flex-start; flex-wrap: nowrap; align-items: baseline; }
  .result-hero .t-metric { font-size: 48px; line-height: 52px; }
  .result-hero .unit { font-size: 16px; padding-bottom: 0; }
  .beating-heart { width: 104px; height: 76px; }
  .result-icon { width: 56px; height: 56px; margin: 0; }
  .result-icon svg { width: 28px; height: 28px; }
  .result-high { padding: 8px 14px; gap: 12px; }
  .result-high .t-metric { font-size: 48px; line-height: 50px; }
  .range-card { padding: 8px 14px; }
  .range-legend { margin-top: 2px; }
  .tips-card { padding: 8px 12px; }
  .tips-head { margin-bottom: 4px; }
  .tip-icon { width: 36px; height: 36px; }
  .try-this { padding: 12px; gap: 6px; }
  .try-title { font-size: 18px; line-height: 24px; }
  .remind-btn { min-height: 48px; }
  .breathe-row, .care-row { padding: 8px 12px; }
  .tile-icon { width: 40px; height: 40px; border-radius: 13px; }
  .result-footer { padding-top: 2px; }

  /* the mood step */
  .mood-bar { padding-top: calc(4px + env(safe-area-inset-top)); }
  .mood-title { margin: 0; font-size: 22px; line-height: 28px; }
  .mood-float { width: 110px; margin: 16px auto 14px; }
  .mood-orb { width: 110px; height: 110px; box-shadow: 0 0 0 8px var(--mood-halo) !important; }
  .mood-orb svg { width: 97px; height: 97px; }
  .mood-page.picked .mood-float { width: 64px; margin: 12px auto 10px; }
  .mood-page.picked .mood-orb { width: 64px; height: 64px; }
  .mood-page.picked .mood-orb svg { width: 56px; height: 56px; }
  .mood-word { font-size: 18px; line-height: 24px; }
  .mood-page #moodGentle { margin: 0; }
  .mood-choices { margin-top: 8px; }
  .mood-choice { min-height: 72px; padding: 4px 2px; gap: 3px; }
  .mood-choice svg { width: 32px; height: 32px; }
  .mood-tags-block { margin-top: 8px; }
  .mood-tags-title { margin-bottom: 4px; }
  .mood-tags { gap: 6px; }
  .mood-tag { min-height: 44px; padding: 0 14px; }
  .mood-page .bottom #moodSkip { margin-top: 0; min-height: 44px; }

  /* Daily Check done */
  .summary-body { padding: 10px 20px 4px; }
  .summary-rows-area { padding: 0 16px 4px; }
  .care-top { gap: 6px; padding-top: calc(4px + env(safe-area-inset-top)); }

  /* BP and sugar */
  .box { min-height: 62px; padding: 5px 12px; }
  .box.on { padding: 3.5px 10.5px; }
  .box .v { font-size: 22px; line-height: 26px; min-height: 26px; }
  .box .l { line-height: 20px; }
  .numpad { gap: 4px; }
  .numpad button { min-height: 48px; }
}

/* History and Me (founder's design board, 3 Nov 2026). */
.history-average { margin: 2px 0 0; font-size: 36px; line-height: 42px; font-weight: 700; color: var(--ink); }
.history-unit { font-size: 15px; font-weight: 400; color: var(--ink-muted); }
.history-chart { display: block; width: 100%; height: auto; font-family: var(--font); pointer-events: none; }
.history-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 4px; font-size: 14px; text-align: center; color: var(--ink-muted); }
.history-days .today { font-weight: 700; color: var(--ink); }
.reports-line { font-size: 15px; line-height: 22px; color: var(--ink-muted); }
.day-row-left { min-width: 0; }
.day-row-title { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-row-value { flex: none; max-width: 55%; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 17px; line-height: 24px; font-weight: 700; color: var(--ink); }
#historyMoods { margin-top: 16px; }
.me-who { display: flex; align-items: center; gap: 14px; }
.me-who-words { min-width: 0; }
.me-who-words p { margin: 0; }
.me-initial { flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--deep-teal); color: #FFF; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.me-add-contact { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 8px 8px 8px 14px; border-radius: var(--r-large); border: 1.5px solid var(--caution); background: color-mix(in srgb, var(--caution) 14%, var(--card)); }
.me-add-contact > svg { width: 24px; height: 24px; flex: none; color: var(--caution); }
.me-section { margin: 16px 0 8px; font-size: 20px; line-height: 28px; font-weight: 700; color: var(--ink); }
.me-group { border-radius: var(--r-large); background: var(--card); overflow: hidden; }
.me-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tap); box-sizing: border-box; padding: 6px 14px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; }
button.me-row { cursor: pointer; }
a.me-row { color: inherit; text-decoration: none; }
.me-group > * + * { border-top: 1px solid var(--line); }
.me-row:focus-visible { outline: 3px solid var(--action); outline-offset: -3px; }
.me-row > svg { width: 22px; height: 22px; flex: none; color: var(--ink-muted); }
.me-tile { flex: none; width: 36px; height: 36px; border-radius: 12px; background: var(--tint); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.me-tile svg { width: 20px; height: 20px; }
.me-words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-line { font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.me-value { flex: 0 1 auto; min-width: 0; text-align: right; }
/* Destructive actions only; messages and the emergency contact card keep --caution. On the card: 6.54:1 light, 9.43:1 dark. --on-action on it: 6.54:1 light, 11.08:1 dark. */
.btn-main.danger { background: var(--danger); color: var(--on-action); }
.me-row.danger .t-body, .me-row.danger .me-tile, .icon-btn.danger, .btn-text.danger { color: var(--danger); }

/* Decision 94 DC1: the Daily Check's one header (lib/daily-header.js). */
.daily-header .bar { gap: 8px; }
.daily-head { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.daily-progress { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.daily-progress .on { color: var(--accent-text); font-weight: 700; }
.daily-header.dark .daily-progress, .daily-header.dark .t-heading { color: #9DC4C8; }
.daily-header.dark .daily-progress .on { color: #1CCEDC; }
.daily-done { color: var(--accent-text); font-weight: 600; margin: 4px 16px 0; }
.daily-header #dailyVoiceLine { margin: 4px 16px 0; }
.bb-swap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.bb-swap[hidden] { display: none; }

/* Decision 97: the Daily Check's header with less clutter (lib/daily-header.js). */
.daily-header.h2 .daily-head { overflow: hidden; }
.daily-header.h2 .one-line { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-header.h2 .daily-step { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.daily-header.h2.dark .daily-step { color: #9DC4C8; }
.daily-header.h2 .how-to-btn { width: var(--tap); padding: 0; justify-content: center; }
.daily-header.h2 .how-to-btn span { display: none; }
.daily-bar { display: flex; gap: 4px; padding: 6px 20px 0; }
.daily-bar span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.daily-bar span.on { background: var(--accent-text); }
.daily-header.dark .daily-bar span { background: #12333A; }
.daily-header.dark .daily-bar span.on { background: #1CCEDC; }

/* Decision 101: History v2 (lib/history-v2.js). */
/* The page is a flex item of .app: without min-width 0 its min-content width (the chips on one line) widened the whole page
   past the screen (528 px at 360). The scroller and the page stay at the screen's width; only the chip row scrolls. */
.page, .content { min-width: 0; }
/* Each screen is a plain wrapper div rendered into #app (main.js: root.replaceChildren(out.el)); that wrapper, not .page, is the
   flex item of .app. With min-width auto it took its content's widest line (the chip row, 460 px at 360) and the page scrolled
   sideways. It now fills the screen and never grows past it; .page inside it is centred as before (at most 560 wide). */
.app > * { flex: 1 1 0; min-width: 0; } /* no max-width here: a screen whose root is .page keeps its 560 px cap */
.app > * > .page { margin-inline: auto; }
.history-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; max-width: 100%; min-width: 0; }
.history-chips::-webkit-scrollbar { display: none; }
.history-chips .chip { flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.history-chips .chip-icon svg { width: 18px; height: 18px; }
.history-number-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 6px; } /* the ring goes under the number when narrow */
.history-number-row .history-average { margin: 0; font-size: 40px; line-height: 46px; }
.history-number-row .history-unit { padding-bottom: 7px; color: var(--ink-muted); }
.history-number-row .grow { flex: 1; }
.history-ring { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-muted); padding-bottom: 8px; }
.history-ring .ring { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--action) calc(var(--p) * 360deg), var(--line) 0); -webkit-mask: radial-gradient(circle, transparent 7px, #000 8px); mask: radial-gradient(circle, transparent 7px, #000 8px); }
.history-chart.v2 .band { fill: var(--tint); }
.history-chart.v2 .line { fill: none; stroke: var(--chart-color); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: history-draw 0.6s ease-out forwards; }
.history-chart.v2 .point { fill: var(--chart-color); animation: history-fade 0.6s ease-out both; }
.history-chart.v2 .latest { fill: var(--chart-color); font-size: 13px; font-weight: 600; animation: history-fade 0.6s ease-out both; }
@keyframes history-draw { to { stroke-dashoffset: 0; } }
@keyframes history-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .history-chart.v2 .line { animation: none; stroke-dashoffset: 0; }
  .history-chart.v2 .point, .history-chart.v2 .latest { animation: none; }
}
#historyDayLabels { grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); }
.history-day { border-top: 1px solid var(--line); }
.history-day:first-child { border-top: 0; }
.history-day-row { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.history-day-row .grow { flex: 1 1 40%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-day-value { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.history-others { padding: 0 0 8px 16px; }
.history-others[hidden] { display: none; }
.history-other { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 32px; }
.history-other .grow { flex: 1; }
.history-faces { display: inline-flex; align-items: center; gap: 4px; }
.practice { font-size: 13px; }

/* Decision 102 (History): HI9 the chip row runs to the screen's right edge (past the page margin) under a soft fade, so the next chip
   is cut there; the first visit's hint slides it 40 px left and back. HI12 one value column. HI10 the Daily Check tab. */
.history-chips-wrap { margin-right: calc(-1 * max(var(--gutter), env(safe-area-inset-right))); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.history-chips { padding-right: 24px; }
.history-chips.hint { animation: history-chip-hint 0.7s ease-in-out 0.3s 1; }
@keyframes history-chip-hint { 0%, 100% { transform: none; } 50% { transform: translateX(-40px); } }
@media (prefers-reduced-motion: reduce) { .history-chips.hint { animation: none; } }
.history-value-col { flex: none; width: 132px; display: flex; flex-direction: column; align-items: flex-end; text-align: right; min-width: 0; }
.history-value-col > * { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-day-row { align-items: flex-start; padding: 8px 0; }
.history-day-row .grow { padding-top: 2px; }
.history-edit { flex: none; width: var(--tap); }
.history-more { min-height: var(--tap); padding: 0; font-size: 14px; color: var(--accent-text); }
.dh-ring { padding-bottom: 6px; }
.dh-dots { display: flex; margin-top: 12px; }
.dh-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; }
.dh-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.dh-dot.done { background: var(--action); border-color: var(--action); }
.dh-dot.today { border-color: var(--ink); border-width: 2.5px; }
.dh-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; border: 0; background: none; padding: 8px 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; border-top: 1px solid var(--line); }
.dh-row:first-child { border-top: 0; }
.dh-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-face { width: 24px; flex: none; }
.dh-cell { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 600; min-width: 0; white-space: nowrap; }
.dh-ico svg { width: 14px; height: 14px; color: var(--ink-muted); }

/* Decision 103: the animated tap hint (lib/tap-hint.js): the finger presses about once a second and a ripple spreads from its tip;
   with reduced motion the still finger, no ripple. */
.tap-hint-stack { display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.tap-hint { display: block; width: 56px; height: 56px; color: var(--accent-text); }
.tap-hint svg { width: 100%; height: 100%; overflow: visible; }
.tap-hint-finger { animation: tap-hint-press 1s ease-in-out infinite; }
.tap-hint-ripple { transform-box: fill-box; transform-origin: center; opacity: 0; animation: tap-hint-ripple 1s ease-out infinite; }
@keyframes tap-hint-press { 0%, 35%, 100% { transform: none; } 15% { transform: translateY(2px); } }
@keyframes tap-hint-ripple { 0%, 12% { opacity: 0; transform: scale(0.4); } 15% { opacity: 0.6; transform: scale(0.6); } 100% { opacity: 0; transform: scale(3.6); } }
@media (prefers-reduced-motion: reduce) {
  .tap-hint-finger { animation: none; }
  .tap-hint-ripple { animation: none; display: none; }
}

/* Decision 104: "You're offline" (lib/offline-gate.js). */
.offline-icon { display: block; width: 48px; height: 48px; color: var(--ink-muted); }
.offline-icon svg { width: 100%; height: 100%; }
