/* NIKA Energy Check — design system v1.0 (premium / wellness / dark navy) */
:root {
  --bg: #0B0A32; --bg-2: #14114a; --bg-3: #1c1858;
  --card: rgba(255,255,255,.055); --card-2: rgba(255,255,255,.085); --line: rgba(255,255,255,.10); --line-2: rgba(255,255,255,.16);
  --ink: #FFFFFF; --muted: rgba(255,255,255,.64); --faint: rgba(255,255,255,.42);
  --pink: #E33AB6; --pink-2: #B32B8F; --pink-soft: rgba(227,58,182,.16); --rose: #C58B8B; --violet: #6E4E7E; --violet-2: #9F82C2; --aqua: #5ED4E6;
  --ok: #5BD6A4; --warn: #F2B85C; --bad: #FF6B8A;
  --radius: 22px; --radius-s: 14px; --radius-inner: 16px; --pad-inner: 14px 16px; --gap-inner: 10px; --shadow: 0 18px 50px rgba(3,2,20,.45);
  --nav-h: 66px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; scroll-padding-top: calc(64px + var(--safe-t)); }
@supports (padding: max(0px)) { .topbar { padding-top: max(10px, var(--safe-t)); } }
@media (display-mode: standalone) { .topbar { padding-top: calc(12px + var(--safe-t)); } }
body {
  margin: 0; min-height: 100%; color: var(--ink); background: var(--bg);
  background-image: radial-gradient(1000px 600px at -10% -10%, rgba(227,58,182,.22), transparent 60%), radial-gradient(900px 700px at 110% 20%, rgba(110,78,126,.45), transparent 60%), radial-gradient(700px 500px at 50% 110%, rgba(94,212,230,.10), transparent 60%);
  background-attachment: fixed;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--aqua); }
h1, h2, h3 { margin: 0 0 8px; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; } h2 { font-size: 19px; font-weight: 750; } h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.hidden { display: none !important; }
.center { text-align: center; }

/* ---------- layout ---------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + var(--safe-t)) 18px 10px; background: rgba(11,10,50,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.brand .logo { width: 30px; height: 30px; border-radius: 10px; background: radial-gradient(circle at 35% 35%, #fff 0, rgba(255,255,255,.9) 8%, var(--pink) 30%, var(--violet) 75%, transparent 100%); box-shadow: 0 0 22px rgba(227,58,182,.55); }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions select { width: auto; padding: 7px 28px 7px 10px; font-size: 13px; }
.view { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + var(--safe-b) + 24px); }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; } .row.between { justify-content: space-between; } .row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card.soft { box-shadow: none; }
.card.accent { background: linear-gradient(135deg, rgba(227,58,182,.22), rgba(110,78,126,.22)); border-color: rgba(227,58,182,.35); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; }
.section-title h2 { margin: 0; }

/* ---------- controls ---------- */
button, .btn { border: 0; border-radius: var(--radius-s); padding: 12px 16px; font: inherit; font-weight: 700; color: #fff; cursor: pointer; background: linear-gradient(135deg, var(--pink), var(--pink-2)); box-shadow: 0 8px 24px rgba(227,58,182,.28); transition: transform .12s ease, box-shadow .12s ease, opacity .12s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
button:active, .btn:active { transform: translateY(1px) scale(.99); }
button:disabled { opacity: .45; cursor: default; box-shadow: none; }
button.ghost, .btn.ghost { background: rgba(255,255,255,.08); box-shadow: none; color: var(--ink); border: 1px solid var(--line); }
button.ghost:hover { background: rgba(255,255,255,.12); }
button.aqua { background: linear-gradient(135deg, #4cc6d8, #2f9fb3); box-shadow: 0 8px 24px rgba(94,212,230,.22); }
button.danger { background: rgba(255,107,138,.14); color: #ff9db3; box-shadow: none; border: 1px solid rgba(255,107,138,.3); }
/* A finger needs ~44 px however small the label looks. */
button.link { background: none; box-shadow: none; color: var(--aqua); padding: 10px 8px; min-height: 44px; font-weight: 600; }
button.icon { padding: 10px; min-width: 44px; }
button.block { width: 100%; }
button.lg { padding: 16px 22px; font-size: 17px; border-radius: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 650; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: rgba(255,255,255,.06); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 12px 13px; outline: none; transition: border-color .15s; min-height: 44px; }
input:focus, select:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select option { color: #111; background: #fff; }
input[type=date], input[type=datetime-local] { min-height: 46px; }
input[type=file] { padding: 9px; }
textarea { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .full { grid-column: 1 / -1; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; clip: rect(0 0 0 0); }
.photo-box { display: flex; gap: 14px; align-items: center; min-width: 0; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-actions button { padding: 9px 12px; min-height: 40px; font-size: 13px; }
.segmented { display: inline-flex; background: rgba(255,255,255,.07); padding: 4px; border-radius: 14px; border: 1px solid var(--line); gap: 2px; }
.segmented button { background: transparent; box-shadow: none; color: var(--muted); padding: 9px 14px; min-height: 38px; border-radius: 11px; font-size: 13.5px; }
.segmented button.active { background: rgba(255,255,255,.14); color: var(--ink); }
.segmented button.active.pink { background: var(--pink); color: #fff; }
.segmented.block { display: flex; width: 100%; }
/* `min-width: 0` and a wrapping label keep a segmented control from pushing the page sideways when
   the translated words are long — German and Russian both overflow four options at 375 px. */
.segmented.block button { flex: 1 1 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
/* Four long options do not fit one row on a phone: let them fall into a 2 × 2 grid instead. */
.segmented.wrap { flex-wrap: wrap; }
.segmented.wrap button { flex: 1 1 calc(50% - 6px); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.09); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.before { background: var(--pink-soft); color: #ff9ade; border-color: rgba(227,58,182,.35); }
.chip.after { background: rgba(94,212,230,.14); color: #8fe6f2; border-color: rgba(94,212,230,.35); }
.chip.spot { background: rgba(197,139,139,.16); color: #e6bcbc; border-color: rgba(197,139,139,.35); }
.chip.num { background: rgba(110, 78, 126, .14); color: #6E4E7E; font-variant-numeric: tabular-nums; }
.chip.ok { color: #9ff0cf; background: rgba(91,214,164,.14); border-color: rgba(91,214,164,.35); }
.chip.warn { color: #ffd79b; background: rgba(242,184,92,.14); border-color: rgba(242,184,92,.35); }
.chip.bad { color: #ffb0c1; background: rgba(255,107,138,.14); border-color: rgba(255,107,138,.35); }
.chip.pending { color: #ffd79b; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.notice { padding: 12px 14px; border-radius: var(--radius-s); background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.notice.warn { background: rgba(242,184,92,.10); border-color: rgba(242,184,92,.3); color: #ffe0b0; }
.notice.bad { background: rgba(255,107,138,.10); border-color: rgba(255,107,138,.3); color: #ffc0cd; }
.notice.ok { background: rgba(91,214,164,.10); border-color: rgba(91,214,164,.3); color: #bff3de; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- bottom nav ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + var(--safe-b)); background: rgba(11,10,50,.82); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line); }
.bottom-nav button { background: none; box-shadow: none; color: var(--muted); flex-direction: column; gap: 3px; font-size: 11px; font-weight: 650; padding: 6px 4px; min-height: 52px; border-radius: 14px; }
.bottom-nav button .ico { font-size: 20px; line-height: 1; }
.bottom-nav button.active { color: #fff; background: rgba(255,255,255,.07); }
.bottom-nav button.primary .ico { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--pink), var(--pink-2)); box-shadow: 0 6px 18px rgba(227,58,182,.35); color: #fff; margin-top: -14px; }

/* ---------- auth ---------- */
.auth-gate { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 28px 16px; }
.auth-card { width: min(440px, 100%); }
.auth-card .auth-logo { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px; background: radial-gradient(circle at 35% 35%, #fff 0, rgba(255,255,255,.9) 8%, var(--pink) 32%, var(--violet) 78%, transparent 100%); box-shadow: 0 0 40px rgba(227,58,182,.5); }
.auth-status { min-height: 20px; margin-top: 10px; font-size: 13px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-wrap .eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: none; box-shadow: none; color: var(--muted); padding: 8px; min-height: 0; min-width: 0; border-radius: 10px; }
.pw-wrap .eye:hover, .pw-wrap .eye:focus-visible { color: var(--ink); background: rgba(255,255,255,.08); }
.pw-wrap .eye svg { width: 20px; height: 20px; display: block; }
.auth-status.bad { color: var(--bad); }

/* ---------- dashboard ---------- */
.hero-welcome h1 { font-size: 28px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick button { flex-direction: column; gap: 6px; padding: 16px 10px; min-height: 84px; font-size: 13px; }
.quick button .ico { font-size: 24px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 13px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.item:hover { background: var(--card-2); }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* A one-line clamp cut "Ссылка отправлена, замер не сделан · 9 сент." in half on every phone.
   Two lines, then ellipsis — the date is part of the information, not decoration. */
.item .sub { font-size: 12.5px; line-height: 1.35; color: var(--muted); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.item .arrow { color: var(--faint); font-size: 18px; flex: none; }
.item[role="button"], .item[data-wired] { cursor: pointer; -webkit-touch-callout: none; user-select: none; }
.item[role="button"]:active { background: var(--card-2); }
.item > * { pointer-events: none; }
.item button, .item a, .item input, .item label { pointer-events: auto; }
.avatar { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; background: linear-gradient(135deg, var(--violet), var(--pink-2)); display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-size: 15px; }
.avatar.lg { width: 84px; height: 84px; border-radius: 26px; font-size: 26px; }
.avatar.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }
.mini-aura { width: 44px; height: 44px; border-radius: 50%; flex: none; }

.todo-item { align-items: center; }
.todo-ico { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 16px; background: rgba(255,255,255,.08); color: var(--muted); }
.todo-item.after .todo-ico { background: rgba(242,184,92,.16); color: #ffd79b; }
.todo-item.link .todo-ico { background: rgba(94,212,230,.14); color: #8fe6f2; }
.todo-item.new .todo-ico { background: var(--pink-soft); color: #ff9ade; }

/* ---------- client card: one primary path, then the extras (spec §2, §34) ---------- */
.actions-block { display: flex; flex-direction: column; gap: 12px; }
.action { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; text-align: left; padding: 16px 18px; min-height: 76px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); color: var(--ink); box-shadow: none; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.action:hover { background: var(--card-2); }
.action .a-title { font-size: 16px; font-weight: 750; line-height: 1.2; overflow-wrap: anywhere; }
.action .a-sub { font-size: 12.5px; font-weight: 500; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.action.primary { background: linear-gradient(135deg, var(--pink), var(--pink-2)); border-color: transparent; box-shadow: 0 10px 30px rgba(227,58,182,.32); min-height: 86px; }
.action.primary .a-title { font-size: 18px; } .action.primary .a-sub { color: rgba(255,255,255,.86); }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.session-card .steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); min-width: 0; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; background: rgba(255,255,255,.1); color: var(--muted); }
.step.done .step-dot { background: var(--ok); color: #0B0A32; }
.step-body { min-width: 0; } .step-body b { display: block; font-size: 14px; } .step-body small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.progress { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--violet-2), var(--pink)); transition: width .5s ease; }
#histTabs .cnt { opacity: .55; font-size: 11px; margin-left: 4px; }
.session-item .metrics, .last-result .metrics { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.session-item .metrics b, .last-result .metrics b { color: var(--ink); font-weight: 700; }
.last-result { cursor: pointer; }
.report-item { align-items: center; cursor: default; }
.report-item:hover { background: var(--card); }
.report-actions { display: flex; gap: 6px; flex: none; }
.report-actions button { padding: 9px 11px; min-height: 40px; font-size: 13px; }
.pick-row { cursor: pointer; align-items: center; }
.pick-row input { width: auto; min-height: 0; flex: none; }
.switch-row { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); font-weight: 600; }
/* Drawn rather than native, for the same reason as the condition chips: the base input rules make a
   padded 44 px box, and the native control shrinks to 13 px. */
.switch-row input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; min-height: 0; margin: 0; padding: 0; border: 1.5px solid var(--line-2); border-radius: 7px; background: transparent; box-shadow: none; display: grid; place-items: center; }
.switch-row input::after { content: ""; width: 10px; height: 10px; border-radius: 2px; background: #fff; transform: scale(0); transition: transform .12s; }
.switch-row input:checked { background: var(--pink); border-color: var(--pink); }
.switch-row input:checked::after { transform: scale(1); }
.switch-row { min-height: 44px; cursor: pointer; }
/* Access control sits on the light report page but keeps the app's dark chrome: it is a control, not
   part of the document, and it must never end up in the printed PDF. */
.share-panel { max-width: 860px; margin: 16px auto 0; padding: 16px; border-radius: 20px; background: #14114a; color: #fff; box-shadow: 0 14px 40px rgba(11,10,50,.2); }
.share-panel .sp-head { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 800; margin-bottom: 10px; }
.share-panel .muted { color: rgba(255,255,255,.62); }
.share-panel .actions { margin-top: 10px; }

/* ---------- client profile ---------- */
/* A flex child will not shrink below its content unless told to; "Вероника Пономарева-Штайнберг"
   then pushed the whole header off the right edge of a 320 px screen. */
.profile-head { display: flex; gap: 16px; align-items: center; min-width: 0; }
.profile-head > * { min-width: 0; }
.profile-head h1 { margin: 0; font-size: 24px; overflow-wrap: anywhere; }
.profile-meta { min-width: 0; }
.profile-meta span { overflow-wrap: anywhere; }
.profile-meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.stage-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stage-buttons button { flex-direction: column; gap: 4px; min-height: 70px; padding: 12px 6px; font-size: 13px; }
.stage-buttons button small { font-size: 11px; opacity: .8; font-weight: 500; }
.stage-buttons .after { background: linear-gradient(135deg, #4cc6d8, #2f9fb3); box-shadow: 0 8px 24px rgba(94,212,230,.22); }
.stage-buttons .spot { background: linear-gradient(135deg, #c58b8b, #9a6a6a); box-shadow: 0 8px 24px rgba(197,139,139,.22); }
.history-item .metrics { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.history-item .metrics b { color: var(--ink); font-weight: 650; }
.trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trend-card { padding: 12px 12px 6px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.trend-card h4 { margin: 0 0 4px; font-size: 12.5px; line-height: 1.25; color: var(--muted); font-weight: 650; overflow-wrap: anywhere; }
.trend-card { min-width: 0; }
canvas.chart { display: block; width: 100%; height: 150px; }
.link-item .sub { white-space: normal; word-break: break-all; }

/* ---------- measurement overlay ---------- */
/* Overlays sit *below* the bottom bar so "Клиенты" is reachable from a report or a full analysis
   (spec §3); only `.exclusive` — a running recording, an unsaved result — covers it. */
.overlay.exclusive { z-index: 70; padding-bottom: 0; }
/* A confirmation must sit above whatever asked for it, including an exclusive sheet. */
.overlay.dialog { z-index: 90; padding-bottom: 0; }
.overlay { position: fixed; inset: 0; z-index: 50; padding-bottom: calc(var(--nav-h) + var(--safe-b)); background: var(--bg); background-image: radial-gradient(900px 600px at 50% -10%, rgba(227,58,182,.22), transparent 60%), radial-gradient(800px 600px at 80% 110%, rgba(110,78,126,.45), transparent 60%); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.overlay-inner { max-width: 640px; margin: 0 auto; padding: calc(14px + var(--safe-t)) 16px calc(24px + var(--safe-b)); min-height: 100%; display: flex; flex-direction: column; }
.overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.overlay-head .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.overlay-head .who > * { min-width: 0; }
.overlay-head .who b { display: block; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.prep-list { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.prep-list li { margin: 5px 0; }
.measure-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 8px; }
.ring { position: relative; width: min(280px, 72vw); aspect-ratio: 1; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,.10); } .ring .prog { stroke: var(--pink); stroke-linecap: round; transition: stroke-dashoffset .2s linear, stroke .3s; filter: drop-shadow(0 0 10px rgba(227,58,182,.7)); }
.ring .timer { font-size: 46px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ring .timer small { display: block; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; text-align: center; }
.finger { width: 54px; height: 54px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); background: #222; transition: background .2s, border-color .2s; box-shadow: inset 0 0 12px rgba(0,0,0,.4); position: absolute; right: 0; top: 0; }
.finger.on { border-color: var(--ok); }
.quality-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--line); font-weight: 700; }
.quality-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 10px currentColor; }
.quality-pill.poor .dot { background: var(--bad); } .quality-pill.fair .dot { background: var(--warn); } .quality-pill.good .dot { background: var(--aqua); } .quality-pill.excellent .dot { background: var(--ok); }
.quality-track { width: 100%; height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.quality-bar { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--bad), var(--warn) 45%, var(--aqua) 70%, var(--ok)); transition: width .25s; }
.hint { min-height: 24px; text-align: center; font-weight: 650; color: #ffd6f2; }
.hint.good { color: #bff3de; }
.hint.bad { color: #ffb4a0; }
/* Readiness ladder before recording (spec §24): finger found → steady → signal → good quality. */
.ready-panel { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.ready-panel.hidden { display: none; }
.ready-line { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 13.5px; font-weight: 650; color: rgba(255,255,255,.9); text-align: center; overflow-wrap: anywhere; }
.ready-dots { display: inline-flex; gap: 5px; flex: 0 0 auto; }
.ready-dots i { width: 7px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.2); transition: background .25s; }
.ready-dots i.on { background: var(--pink); }
.ready-panel.go .ready-dots i.on { background: #5BD6A4; }
.ready-panel button[disabled] { opacity: .45; }
.finger-help { border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.finger-help summary { cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 650; color: var(--muted); list-style: none; }
.finger-help summary::-webkit-details-marker { display: none; }
.finger-help summary::after { content: ' ›'; }
.finger-help[open] summary::after { content: ' ⌄'; }
.fh-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.fh-body p { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,.82); margin: 0; overflow-wrap: anywhere; }
.fh-body .fg { max-width: 100%; height: auto; }
.wave-card { width: 100%; padding: 12px 12px 6px; }
.wave-card canvas { width: 100%; height: 90px; display: block; }
.live-pulse { font-size: 28px; font-weight: 800; } .live-pulse small { font-size: 12px; color: var(--muted); font-weight: 600; }
video.ppg { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.beat { display: inline-block; animation: beat 1s ease-in-out infinite; color: var(--pink); }
@keyframes beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.25); } }

/* ---------- result ---------- */
.aura-wrap { position: relative; width: min(320px, 78vw); aspect-ratio: 1; margin: 0 auto; }
.aura-wrap canvas { width: 100%; height: 100%; display: block; }
.aura-wrap .aura-ebi { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.aura-ebi b { font-size: 44px; font-weight: 800; letter-spacing: -.03em; text-shadow: 0 2px 20px rgba(0,0,0,.4); }
.aura-ebi span { font-size: 12px; color: rgba(255,255,255,.85); font-weight: 650; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.summary-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.tile span { display: block; font-size: 12px; color: var(--muted); font-weight: 650; }
.tile b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.tile b small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.tile em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.tile.ebi { background: linear-gradient(135deg, rgba(227,58,182,.22), rgba(110,78,126,.22)); border-color: rgba(227,58,182,.35); }
.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric { padding: 12px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.metric span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 650; }
.metric b { font-size: 20px; font-weight: 800; } .metric small { color: var(--muted); font-size: 11px; margin-left: 3px; }
.chart-card { padding: 12px 12px 8px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.chart-card { min-width: 0; }
.chart-card h4 { overflow-wrap: anywhere; margin: 0 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 650; display: flex; justify-content: space-between; }
.chart-card canvas { display: block; width: 100%; }
.interp h4 { margin: 12px 0 4px; font-size: 13px; color: var(--pink); text-transform: uppercase; letter-spacing: .06em; }
.interp p { color: rgba(255,255,255,.86); font-size: 14px; }
/* Headline conclusion — one or two sentences, set apart from the surrounding prose. */
.interp p.verdict { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.45; border-left: 2px solid var(--pink); padding-left: 11px; }
/* Attention points: at most three short items, as a list rather than a run-on paragraph. */
.interp ul.att { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.interp ul.att li { color: rgba(255,255,255,.86); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
details.tech > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-weight: 700; padding: 12px 0; }
details.tech > summary::-webkit-details-marker { display: none; }
details.tech > summary::after { content: '⌄'; font-size: 20px; color: var(--muted); transition: transform .2s; }
details.tech[open] > summary::after { transform: rotate(180deg); }
.caption { font-size: 12px; line-height: 1.45; color: var(--faint); text-align: left; margin-top: 8px; }
.figure-wrap + .caption, .usin-wrap + .caption, .radar-wrap + .caption, .wow + .caption { text-align: center; }

/* ---------- result screen: status, balance, index cards ---------- */
.result { display: flex; flex-direction: column; gap: 14px; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 11px 16px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 13px; color: var(--muted); min-width: 0; }
.status-row b { color: var(--ink); font-size: 16px; font-weight: 800; }
.status-row .q-label { font-weight: 700; } .status-row.excellent .q-label, .status-row.good .q-label { color: #bff3de; } .status-row.fair .q-label { color: #ffe0b0; } .status-row.poor .q-label { color: #ffc0cd; }
.section-intro { font-size: 12.5px; line-height: 1.45; color: var(--muted); padding: 0 6px; overflow-wrap: anywhere; }
.section-intro .bl { display: block; margin-top: 4px; color: #ffd79b; }
.ring-card { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: 22px; background: linear-gradient(135deg, rgba(227,58,182,.18), rgba(110,78,126,.16)); border: 1px solid rgba(227,58,182,.30); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); min-width: 0; }
.ring-card .rc-body { flex: 1; min-width: 0; }
.ring-card .rc-title { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.ring-card .rc-val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; white-space: nowrap; }
.ring-card .rc-val small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 5px; letter-spacing: 0; }
.ring-card .rc-label { font-size: 16px; font-weight: 750; line-height: 1.25; margin-top: 4px; overflow-wrap: anywhere; }
.ring-card .rc-hint { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.ring-big { position: relative; width: 100px; height: 100px; flex: none; }
.ring-big svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-big .track { stroke: rgba(255,255,255,.12); } .ring-big .prog { stroke: var(--pink); stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(227,58,182,.6)); transition: stroke-dashoffset .8s ease; }
.ring-big.good .prog { stroke: var(--aqua); filter: drop-shadow(0 0 8px rgba(94,212,230,.6)); } .ring-big.low .prog { stroke: var(--warn); filter: drop-shadow(0 0 8px rgba(242,184,92,.5)); } .ring-big.bad .prog { stroke: var(--bad); filter: drop-shadow(0 0 8px rgba(255,107,138,.5)); }
.ring-big .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ring-big .num small { display: block; font-size: 11.5px; color: var(--muted); text-align: center; font-weight: 700; margin-top: 2px; }
.idx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--gap-inner); }
.idx { min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: var(--pad-inner); border-radius: var(--radius-inner); background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.idx.wide { grid-column: 1 / -1; }
.idx.lead .idx-val { font-size: 34px; }
.idx.lead .idx-label { font-size: 15px; font-weight: 700; }
/* Caption under the index grid — marks Relaxation as a computed wellness index, not a measurement. */
.grid-note { padding: 0 6px; margin: 8px 0 0; line-height: 1.4; overflow-wrap: anywhere; }
/* A two-line floor: a one-word title and a three-word one then start their numbers at the same
   height, so a row of cards reads as a row rather than a staircase (spec §15). */
.idx .idx-name { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 8px; min-height: 2.5em; font-size: 12.5px; line-height: 1.25; color: var(--muted); font-weight: 700; overflow-wrap: anywhere; hyphens: auto; text-wrap: balance; }
.idx .idx-val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; white-space: nowrap; margin-top: 2px; }
.idx .idx-val small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.idx .idx-label { font-size: 13px; line-height: 1.3; color: rgba(255,255,255,.86); font-weight: 600; overflow-wrap: anywhere; }
.idx .idx-bar { margin-top: auto; padding-top: 8px; }
.idx .idx-bar i { display: block; height: 6px; border-radius: 99px; background: var(--violet-2); transition: width .5s ease; }
.idx .idx-bar { position: relative; } .idx .idx-bar::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); } .idx .idx-bar i { position: relative; }
.idx.good .idx-bar i { background: linear-gradient(90deg, var(--aqua), var(--ok)); } .idx.mid .idx-bar i { background: linear-gradient(90deg, var(--violet-2), var(--aqua)); } .idx.low .idx-bar i { background: linear-gradient(90deg, var(--warn), var(--rose)); } .idx.bad .idx-bar i { background: linear-gradient(90deg, var(--bad), var(--pink)); }
.idx.good .idx-label { color: #bff3de; } .idx.low .idx-label { color: #ffe0b0; } .idx.bad .idx-label { color: #ffc0cd; }
.tag { display: inline-flex; align-items: center; font-size: 11.5px; line-height: 1; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.09); color: var(--muted); white-space: nowrap; letter-spacing: .02em; }
.tag.measured { background: rgba(94,212,230,.14); color: #8fe6f2; }
.reg-card { padding: 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.reg-card .reg-val { font-size: 20px; font-weight: 800; margin-top: 4px; overflow-wrap: anywhere; }
.reg-card .reg-val.calm, .reg-card .reg-val.recovery { color: #bff3de; } .reg-card .reg-val.activated { color: #ffe0b0; } .reg-card .reg-val.tense, .reg-card .reg-val.unstable { color: #ffc0cd; }
.reg-card .idx-name { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.bp-block { padding: 14px 16px; border-radius: 18px; border: 1px dashed var(--line-2); background: rgba(255,255,255,.03); }
.bp-block .bp-val { font-size: 22px; font-weight: 800; }
.bp-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin-top: 10px; }
.tip { display: inline; }
.tip > summary { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.1) 0 14px, transparent 14px); color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; list-style: none; margin-left: 6px; vertical-align: middle; }
.tip > summary::-webkit-details-marker { display: none; }

.tip[open] > summary { background: var(--pink); color: #fff; }
.tip .tip-body { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.4; }

/* ---------- figure & energy profile ---------- */
.figure-wrap { width: min(340px, 100%); margin: 0 auto; }
.figure-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.figure .aura.breathe { transform-box: fill-box; transform-origin: center; animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.035); opacity: 1; } }
.fig-center:focus-visible { outline: 2px solid #fff; border-radius: 50%; }
.fig-center { transition: transform .2s; transform-box: fill-box; transform-origin: center; }
.fig-center:hover { transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { .figure .aura.breathe { animation: none; } }
.centers { display: flex; flex-direction: column; gap: 8px; }
.center-row { display: grid; grid-template-columns: 22px minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); cursor: pointer; min-width: 0; }
.center-row:hover { background: rgba(255,255,255,.07); }
.center-row .dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 12px currentColor; }
.center-row .c-name { font-weight: 700; font-size: 13.5px; line-height: 1.2; overflow-wrap: anywhere; } .center-row .c-name small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.center-row .c-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; } .center-row .c-bar i { display: block; height: 100%; border-radius: 99px; }
.center-row .c-val { font-weight: 800; font-size: 15px; text-align: right; white-space: nowrap; } .center-row .c-val small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: normal; max-width: 120px; line-height: 1.2; }
.center-card .c-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.center-card .c-head .dot { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 22px currentColor; flex: none; }
.center-card .big { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.link-share { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.link-share a { flex: 1; min-width: 100px; }
.new-badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; }

.radar-wrap { width: 100%; max-width: 380px; margin: 0 auto; }
.radar-wrap canvas { display: block; width: 100%; }
.radar-legend { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.radar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.usin-wrap { width: min(340px, 100%); margin: 0 auto; }
.usin-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
/* One list down the page, not two ragged columns: the five names share a left axis, the five values
   a right one, and every row is the same height whatever the description underneath runs to. */
.usin-rows { display: flex; flex-direction: column; gap: var(--gap-inner); margin-top: 14px; }
/* The value column is sized by its content: a single number and a BEFORE → AFTER pair are different
   widths, and a fixed column cut the pair off. `min-content` keeps the five values on one axis. */
.usin-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) max-content; gap: 12px; align-items: center; min-height: 54px; padding: var(--pad-inner); border-radius: var(--radius-inner); background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.usin-row .dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.usin-row .n { min-width: 0; font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.usin-row .n small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); font-weight: 500; }
.usin-row .val { text-align: right; font-weight: 800; font-size: 19px; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.tl-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: 3px; }

/* ---------- compare ---------- */
.cmp-row .v .band { display: block; font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 1px; line-height: 1.2; overflow-wrap: anywhere; }
.cmp-row .v .bar { display: block; height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); margin-top: 5px; overflow: hidden; }
.cmp-row .v .bar i { display: block; height: 100%; border-radius: 99px; }
.cmp-row .v.before .bar i { background: var(--pink); } .cmp-row .v.after .bar i { background: var(--aqua); }
.wow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; text-align: center; }
.wow > * { min-width: 0; }
.wow .side canvas { width: min(200px, 38vw); height: min(200px, 38vw); display: block; margin: 0 auto; }
.wow .side .lbl { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.wow .side .ebi { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.wow .mid { font-size: 26px; color: var(--pink); }
.delta { font-weight: 800; } .delta.up { color: var(--ok); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }
.delta.neutral { color: var(--aqua); }
/* Session monitoring (spec §5–§7): timeline, time spent in each state, and the state chart. */
.mon-h { margin: 18px 0 8px; font-size: 13px; color: var(--pink); text-transform: uppercase; letter-spacing: .06em; }
.mon-timeline { position: relative; height: 26px; border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.mon-timeline i { position: absolute; top: 0; bottom: 0; cursor: pointer; transition: filter .15s; }
.mon-timeline i:hover, .mon-timeline i.on { filter: brightness(1.35); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.mon-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.mon-pick { min-height: 18px; margin-top: 6px; overflow-wrap: anywhere; }
.mon-states { display: flex; flex-direction: column; gap: 8px; }
.mon-state { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 10px; font-size: 13.5px; }
.mon-state .dot { width: 10px; height: 10px; border-radius: 99px; }
.mon-state span { min-width: 0; overflow-wrap: anywhere; }
.mon-state b { font-weight: 800; white-space: nowrap; }
.mon-state em { font-style: normal; color: var(--muted); font-size: 12px; min-width: 34px; text-align: right; }
.mon-peak { font-size: 13.5px; font-weight: 650; color: rgba(255,255,255,.9); overflow-wrap: anywhere; }
/* Composite session dynamics (spec §18) — one headline number above the BEFORE/AFTER table. */
.dyn { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; margin-bottom: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.dyn-name { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; overflow-wrap: anywhere; }
.dyn-val { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.dyn.up .dyn-val { color: #5BD6A4; } .dyn.down .dyn-val { color: #F2B85C; } .dyn.flat .dyn-val { color: rgba(255,255,255,.78); }
.dyn-note { font-size: 11.5px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr); gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row .k { color: var(--muted); font-weight: 650; font-size: 13px; }
.cmp-row .v { font-weight: 700; } .cmp-row .v small { color: var(--muted); font-weight: 500; font-size: 11px; margin-left: 2px; }
.cmp-row .bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); margin-top: 4px; overflow: hidden; }
.cmp-row .bar i { display: block; height: 100%; border-radius: 99px; }
.cmp-row .before .bar i { background: var(--pink); } .cmp-row .after .bar i { background: var(--aqua); }
.cmp-head { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }

/* ---------- report (paper theme, printable) ---------- */
.report-overlay { background: #f6f3fa; color: #0B0A32; }
/* No wrap plus right alignment sent the leftmost buttons to negative x on a phone. */
.report-toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; padding: calc(10px + var(--safe-t)) 14px 10px; background: rgba(246,243,250,.9); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(11,10,50,.08); }
.report-toolbar button.ghost { background: #fff; color: #0B0A32; border-color: rgba(11,10,50,.14); }
.report { max-width: 860px; margin: 0 auto; padding: 22px 18px 40px; color: #0B0A32; }
.report .paper { background: #fff; border-radius: 22px; padding: 28px; box-shadow: 0 20px 60px rgba(11,10,50,.10); }
.report .r-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.report .r-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: #0B0A32; }
.report .r-brand .logo { width: 30px; height: 30px; border-radius: 10px; background: radial-gradient(circle at 35% 35%, #fff 0, rgba(255,255,255,.95) 8%, #E33AB6 32%, #6E4E7E 80%, #0B0A32 100%); }
.report .r-brand small { display: block; font-size: 11px; color: #6E4E7E; font-weight: 600; }
.report .r-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #E33AB6; font-weight: 800; margin-top: 18px; }
.report h1 { font-size: 26px; color: #0B0A32; margin: 4px 0 6px; }
.report .r-meta { color: #6E4E7E; font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
/* The proportions are guaranteed by background-size: cover — the PDF renderer ignores object-fit
   and would stretch the photo to the box instead. */
.report .r-photo { width: 104px; height: 104px; border-radius: 24px; aspect-ratio: 1 / 1; background: linear-gradient(135deg, #6E4E7E, #E33AB6); background-size: cover; background-position: center 35%; background-repeat: no-repeat; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 28px; flex: none; }
.report .r-wow { margin: 22px 0; padding: 22px 16px; border-radius: 22px; background: #0B0A32; color: #fff; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.report .r-wow img { width: min(220px, 36vw); height: auto; border-radius: 50%; display: block; margin: 0 auto; }
.report .r-wow .lbl { font-size: 11px; letter-spacing: .12em; font-weight: 800; color: rgba(255,255,255,.7); }
.report .r-wow .big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.report .r-wow .mid { font-size: 24px; color: #E33AB6; }
.report .r-wow .sub { font-size: 12px; color: rgba(255,255,255,.75); }
.report .r-wow.single { grid-template-columns: 1fr; }
.report table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.report th, .report td { padding: 10px 8px; border-bottom: 1px solid rgba(11,10,50,.08); text-align: right; hyphens: auto; overflow-wrap: anywhere; }
.report th:first-child, .report td:first-child { text-align: left; color: #6E4E7E; font-weight: 650; }
/* The BEFORE/AFTER table. Column widths are stated rather than left to the browser: with automatic
   layout the two value columns took everything and «Изменение» was left 56px of text box for a word
   that needs 90, so the heading broke mid-word and the column ran off the right edge of the sheet. */
.report table.r-idx { table-layout: fixed; }
.report table.r-idx th:first-child, .report table.r-idx td:first-child { width: 32%; }
.report table.r-idx th:nth-child(2), .report table.r-idx td:nth-child(2),
.report table.r-idx th:nth-child(3), .report table.r-idx td:nth-child(3) { width: 23%; }
.report table.r-idx th:last-child, .report table.r-idx td:last-child { width: 22%; }
.report th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6E4E7E; }
.report .pos { color: #1d9a6c; font-weight: 700; } .report .neg { color: #c4375c; font-weight: 700; } .report .flat { color: #6E4E7E; }
.report .r-section { margin-top: 22px; }
.report .r-section h3 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #E33AB6; margin-bottom: 8px; }
.report .r-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.report .r-chart { background: #f6f3fa; border-radius: 16px; padding: 10px 10px 6px; }
.report .r-chart h4 { margin: 0 0 4px; font-size: 12px; color: #6E4E7E; font-weight: 650; }
.report .r-chart canvas { width: 100%; display: block; }
.report .r-interp h4 { margin: 12px 0 2px; font-size: 13px; color: #0B0A32; }
.report .r-interp p { color: #3b355c; font-size: 14px; }
.report .r-interp p.r-verdict { font-weight: 700; color: #0B0A32; border-left: 2px solid #E33AB6; padding-left: 10px; }


/* Conditions of the measurement (spec §4) — the same block on the practitioner's sheet and the
   client's remote page, so both collect exactly the same thing. */
.ctx-block { display: flex; flex-direction: column; gap: 10px; }
.ctx-block .ctx-title { margin: 0; font-size: 15px; }
.ctx-block .ctx-lead { margin: -4px 0 0; }
.ctx-factors-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
/* An even grid rather than ragged wrapping: every option is the same width and height, so ten of
   them read as one list. The checkbox is drawn here from scratch — the base rules give every input a
   44 px min-height and a padded dark box, which turned each one into a large black square, and the
   base `label` is a column, which pushed the caption underneath it. */
.chip-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 8px; }
.chip-check { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.chip-check span { min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.chip-check input { appearance: none; -webkit-appearance: none; flex: none; width: 21px; height: 21px; min-height: 0; margin: 0; padding: 0; border: 1.5px solid var(--line-2); border-radius: 7px; background: transparent; box-shadow: none; display: grid; place-items: center; transition: background .12s, border-color .12s; }
.chip-check input::after { content: ""; width: 9px; height: 9px; border-radius: 2px; background: #fff; transform: scale(0); transition: transform .12s; }
.chip-check input:checked { background: var(--pink); border-color: var(--pink); }
.chip-check input:checked::after { transform: scale(1); }
.chip-check input:focus { box-shadow: 0 0 0 3px var(--pink-soft); }
.chip-check:has(input:checked) { border-color: var(--pink); background: rgba(227,58,182,.14); }

/* Heart rhythm (spec §5): plain reading first, abbreviation second. */
.heart-card .hr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--gap-inner); margin-top: 12px; }
.hr-metric { min-width: 0; padding: var(--pad-inner); border-radius: var(--radius-inner); background: var(--card-2); border: 1px solid var(--line); }
.hr-metric .hr-name { font-size: 12.5px; font-weight: 700; color: var(--muted); line-height: 1.25; }
.hr-metric .hr-abbr { font-weight: 600; opacity: .65; }
.hr-metric .hr-val { font-size: 26px; font-weight: 800; line-height: 1.1; white-space: nowrap; margin-top: 3px; }
.hr-metric .hr-val small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.hr-metric .hr-note { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* "What does this mean?" — a disclosure, so the explanation is one tap away and never in the way. */

/* The five-element reading and the closing explanation (spec §8, §14). */
.usin-reading { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.usin-reading h3 { font-size: 14px; margin: 0 0 6px; }
.usin-reading p, .explain-card p { font-size: 13.5px; line-height: 1.55; color: var(--text); margin: 0 0 7px; }
.explain-card h3 { font-size: 14px; margin: 14px 0 6px; }
.change-list { margin: 0; padding-left: 20px; }
.change-list li { font-size: 13.5px; line-height: 1.5; margin-bottom: 5px; }
.change-list li.better { color: #5BD6A4; }
.change-list li.worse { color: #F2B85C; }

/* Innate profile (spec §9) — visibly its own thing, never mixed with the measured one. */
.innate-card .bz-pillars { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.innate-card .bz-pillar { flex: 1 1 0; min-width: 62px; text-align: center; padding: 10px 6px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.innate-card .bz-cn { display: block; font-size: 21px; font-weight: 700; letter-spacing: .06em; }
.innate-card .bz-pillar small { font-size: 11.5px; color: var(--muted); }

/* The remote intake form (spec §6): the only thing a link holder may write. */
.intake-form .intake-title { font-size: 20px; margin: 6px 0 4px; text-align: center; }
.intake-form .intake-lead { margin: 0 0 14px; text-align: center; font-size: 13.5px; }
.intake-form .intake-group { margin: 16px 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.intake-form .form-grid { gap: 12px; }
.intake-form input.bad, .intake-form select.bad { border-color: #ff7a9c; }
.intake-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255,122,156,.14); color: #ffc2d2; font-size: 13px; }

/* Optional birth data on the client form. */
.extra-fields { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px 14px; margin: 0; }
.extra-fields legend { padding: 0 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }

.session-card .session-stale { margin: 10px 0 0; line-height: 1.4; }

/* A pending reminder: the whole row opens it, and the × only puts the reminder away. */
.todo-item { gap: 12px; }
.todo-item .todo-x { pointer-events: auto; flex: none; width: 40px; height: 40px; min-height: 40px; padding: 0; color: var(--faint); background: transparent; box-shadow: none; }
.todo-item .todo-x:active { background: var(--card-2); color: var(--text); }
.todo-item .open-hint { flex: none; font-size: 12px; font-weight: 700; color: var(--pink); white-space: nowrap; }

/* An arriving result is a notice, not a task (spec §2, §3). */
.card.arrived { border-color: rgba(227,58,182,.4); }
.toast.toast-action { cursor: pointer; pointer-events: auto; }

/* Report typography (spec §12): sized so the exported PDF reads on a phone without pinching. */
.report .paper { font-size: 15px; line-height: 1.55; }
.report .r-lead { font-size: 14.5px; color: #4a4470; margin: 0 0 10px; }
.report .r-section h3 { font-size: 14px; letter-spacing: .1em; }
.report .r-section h4 { font-size: 15px; margin: 14px 0 4px; }
.report .r-interp p, .report .r-interp li, .report .r-section > p { font-size: 15px; line-height: 1.55; }
.report table { font-size: 15px; }
.report th, .report td { padding: 11px 9px; }
.report th { font-size: 12.5px; }
.report td small { font-size: 13px; }
.report .r-abbr { color: #8a82a5; font-weight: 600; }
.report .r-bp { font-size: 13px; line-height: 1.45; color: #6E4E7E; }
.report .r-usin { display: flex; justify-content: center; align-items: center; margin: 10px 0 6px; color: #3b355c; }
.report .r-usin svg { width: 100%; max-width: 400px; height: auto; }
.report .r-usin svg { color: #3b355c; }
.report .r-changes { margin: 4px 0 0; padding-left: 20px; }
.report .r-changes li { font-size: 15px; line-height: 1.5; margin-bottom: 5px; }
.report .r-changes li.better { color: #1c7a56; }
.report .r-changes li.worse { color: #9a6412; }
.report .bz-pillars { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.report .bz-pillar { flex: 1 1 0; min-width: 66px; text-align: center; padding: 10px 6px; border-radius: 12px; background: #f6f3fa; }
.report .bz-pillar .bz-cn { display: block; font-size: 22px; font-weight: 700; color: #0B0A32; letter-spacing: .06em; }
.report .bz-pillar small { font-size: 12px; color: #6E4E7E; }

/* Only while rasterising: bigger still, and two columns instead of three so nothing has to shrink. */
.report .paper.pdf-export { font-size: 18px; line-height: 1.6; }
.report .paper.pdf-export h1 { font-size: 34px; }
.report .paper.pdf-export .r-meta { font-size: 14.5px; }
.report .paper.pdf-export table { font-size: 17px; }
.report .paper.pdf-export .r-tiles { grid-template-columns: repeat(2, 1fr); }
.report .paper.pdf-export .r-tile b { font-size: 32px; }
.report .paper.pdf-export .r-charts { grid-template-columns: 1fr; }
.report .paper.pdf-export .r-wow .big { font-size: 36px; }
.report .paper.pdf-export .r-bp { font-size: 14.5px; }
.report .paper.pdf-export .r-photo { width: 128px; height: 128px; }
/* A page-opening block starts clear of whatever came before it. */
.report .r-page { margin-top: 30px; }


/* Cover composition (spec §1): one grid, the identity on the left axis, the photo balancing it, and
   no accidental vertical gaps between the name, the date and the headline result. */
.report .r-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.report .r-title { margin-top: 10px; }
.report h1 { font-size: 30px; margin: 4px 0 8px; letter-spacing: -.01em; }
.report .r-meta { font-size: 14px; gap: 8px 16px; row-gap: 4px; }
.report .r-wow { margin: 16px 0; }
.report .r-section { margin-top: 20px; }
.report .r-section + .r-section { margin-top: 22px; }
.report .r-lead { max-width: 62ch; }

/* Reading sizes (spec §9). The export scales this layout to 194 mm, so these pixels become points:
   at the 620 px render width 18 px ≈ 16 pt and 14 px ≈ 12.4 pt. */
.report .paper { font-size: 16px; line-height: 1.6; }
.report .r-section h3 { font-size: 15px; letter-spacing: .12em; }
.report .r-section h4 { font-size: 16px; margin: 16px 0 4px; }
.report .r-interp p, .report .r-section > p, .report .r-changes li, .report .r-advice li { font-size: 16px; line-height: 1.6; }
.report table { font-size: 15.5px; }
.report th { font-size: 13px; }
.report td small { font-size: 13.5px; }
.report .r-bp { font-size: 13.5px; }
.report .r-advice { margin: 4px 0 0; padding-left: 20px; }
.report .r-advice li { margin-bottom: 5px; color: #3b355c; }
.report .r-verdict { font-size: 17px; line-height: 1.5; margin: 6px 0 12px; }

/* §12 the innate profile is visibly a different kind of thing: it is arithmetic on a birth date, not
   anything the camera saw, so it gets its own frame rather than the wellness card styling. */
.report .r-section.r-innate { border: 1px solid #ded6ef; border-radius: 20px; padding: 18px 18px 14px; background: #faf8fe; }
.report .r-section.r-innate h3 { color: #6E4E7E; }
.report .r-section.r-innate .r-usin svg { max-width: 340px; }

/* One chart across the page reads better than two squeezed side by side. */
.report .r-charts.one { grid-template-columns: 1fr; }
.report .r-chart h4 { font-size: 13.5px; }

/* Composite session dynamics headline in the client report (spec §18, §28). */
.report .r-dyn { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 14px; padding: 12px 16px; margin-bottom: 12px; border-radius: 12px; background: #f4f1fb; border: 1px solid #e0d9f2; }
.report .r-dyn span { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5b5480; }
.report .r-dyn b { font-size: 26px; font-weight: 800; line-height: 1; color: #0B0A32; }
.report .r-dyn.up b { color: #1c7a56; } .report .r-dyn.down b { color: #9a6412; }
.report .r-dyn em { grid-column: 1 / -1; font-style: normal; font-size: 11px; line-height: 1.4; color: #6b6490; }
.report .r-top { font-size: 12.5px; line-height: 1.45; color: #3b355c; font-weight: 600; margin: 8px 0 0; }
/* Session timeline in the printed report (spec §25) — static, no canvas. */
.report .r-mon-tl { position: relative; height: 20px; border-radius: 7px; overflow: hidden; background: #efecf7; border: 1px solid #e0d9f2; }
.report .r-mon-tl i { position: absolute; top: 0; bottom: 0; }
.report .r-mon-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: #6b6490; margin-top: 3px; }
.report .r-mon-states { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.report .r-mon-row { display: grid; grid-template-columns: 9px 1fr auto auto; align-items: center; gap: 9px; font-size: 12.5px; color: #0B0A32; }
.report .r-mon-row i { width: 9px; height: 9px; border-radius: 99px; }
.report .r-mon-row b { font-weight: 800; white-space: nowrap; }
.report .r-mon-row em { font-style: normal; color: #6b6490; min-width: 32px; text-align: right; }
.report .r-verdict { font-size: 13px; font-weight: 700; color: #0B0A32; border-left: 2px solid #E33AB6; padding-left: 10px; margin: 10px 0 0; }
.report .r-interp ul { margin: 2px 0 0; padding-left: 18px; }
.report .r-interp li { color: #3b355c; font-size: 14px; line-height: 1.45; margin-bottom: 4px; }
.report .r-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid rgba(11,10,50,.1); font-size: 11.5px; color: #6E4E7E; }
.report .r-foot p { margin: 0 0 6px; }
.report .r-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; margin-top: 12px; }
.report .r-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; background: #f6f3fa; }
.report .r-tile span { display: block; font-size: 12.5px; line-height: 1.25; color: #6E4E7E; font-weight: 650; min-height: 2.4em; }
.report .r-tile b { font-size: 24px; line-height: 1.15; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; margin-top: auto; }
.report .r-tile em { display: block; font-style: normal; font-size: 12.5px; line-height: 1.3; color: #3b355c; margin-top: 2px; }
/* One tidy column rather than two ragged ones: names on the left axis, values on a single right
   axis, identical row height and padding throughout (spec §7, §8). */
.report .r-profile { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 10px; border-top: 1px solid rgba(11,10,50,.08); }
.report .r-profile .row-c { display: grid; grid-template-columns: 14px minmax(0, 1fr) max-content; gap: 10px; align-items: center; min-height: 34px; font-size: 14.5px; padding: 7px 2px; border-bottom: 1px solid rgba(11,10,50,.08); }
.report .r-profile .row-c > :last-child { text-align: right; font-variant-numeric: tabular-nums; }
.report .r-profile small { display: block; font-size: 12.5px; line-height: 1.3; }
.report .r-profile .dot { width: 12px; height: 12px; border-radius: 50%; }
.report .r-profile b { font-weight: 800; } .report .r-profile small { color: #6E4E7E; }
.report .r-figures { display: flex; justify-content: center; align-items: stretch; gap: 18px; margin-top: 12px; }
.report .r-figures figure { flex: 1 1 0; min-width: 0; max-width: 230px; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 12px 10px; border-radius: 22px; background: #0B0A32; text-align: center; font-size: 12.5px; color: rgba(255,255,255,.78); font-weight: 700; letter-spacing: .08em; }
.report .r-figures figure:only-child { max-width: 300px; }
.report .r-figures figcaption { margin-top: 10px; }
/* The drawing fills its own dark card; the card supplies the padding, so the figure is centred
   optically and not merely technically (spec §6). */
.report .r-figures svg { width: 100%; max-width: 100%; height: auto; display: block; margin: 0 auto; background: none; padding: 0; }
.report .r-figures .aura.breathe { animation: none; }
.report .r-bp { font-size: 12px; color: #6E4E7E; margin-top: 10px; }

/* ---------- toasts ---------- */
.toast-host { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; pointer-events: none; padding: 0 16px; }
.toast { background: rgba(28,24,88,.96); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; border: 1px solid var(--line-2); box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; max-width: 92vw; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.toast-error { background: rgba(120,30,55,.96); } .toast-success { background: rgba(24,96,70,.96); }
.offline-badge { font-size: 11px; padding: 4px 9px; border-radius: 999px; background: rgba(242,184,92,.16); color: #ffd79b; border: 1px solid rgba(242,184,92,.35); font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .grid.two, .grid.three, .grid.four, .form-grid, .metrics-grid, .report .r-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view { padding: 14px 12px calc(var(--nav-h) + var(--safe-b) + 24px); }
  .card { padding: 15px; border-radius: 20px; }
  .topbar .brand small { display: none; }
}
@media (max-width: 560px) {
  .grid.two, .grid.three, .grid.four, .form-grid { grid-template-columns: 1fr; }
  .center-row { grid-template-columns: 18px minmax(0, 1fr) auto; } .center-row .c-bar { display: none; }
  .bp-form { grid-template-columns: 1fr 1fr; } .bp-form button { grid-column: 1 / -1; }
  .action-row { grid-template-columns: 1fr; }
  .report-item { flex-wrap: wrap; } .report-actions { width: 100%; } .report-actions button { flex: 1; }
  .idx { padding: 14px; } .idx .idx-val { font-size: 27px; } .idx .idx-val small { font-size: 12px; }
  .ring-card { padding: 16px; gap: 14px; } .ring-big { width: 92px; height: 92px; } .ring-big .num { font-size: 27px; }
  .ring-card .rc-val { font-size: 26px; } .ring-card .rc-label { font-size: 15px; }
  .wow .side canvas { width: min(150px, 36vw); height: min(150px, 36vw); }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .quick { grid-template-columns: repeat(3, 1fr); }
  .stage-buttons { grid-template-columns: repeat(2, 1fr); }
  /* one metric = one small card: name + change on top, BEFORE and AFTER beneath (spec §3) */
  /* Two halves of exactly the same width: the AFTER column used to be `auto`, so a shorter value
     made its card visibly narrower than BEFORE and the pair stopped reading as a pair (spec §1). */
  .cmp-row { grid-template-columns: 1fr 1fr; grid-template-areas: "k d" "b a"; row-gap: 8px; column-gap: 10px; padding: 12px 0; font-size: 14px; }
  .cmp-row .k { grid-area: k; font-size: 13.5px; align-self: center; }
  .cmp-row > .delta { grid-area: d; text-align: right; align-self: center; white-space: nowrap; }
  .cmp-row .v.before { grid-area: b; } .cmp-row .v.after { grid-area: a; }
  /* Equal height as well as equal width, so the two bars line up whatever the labels say. */
  .cmp-row .v { min-width: 0; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); display: flex; flex-direction: column; }
  .cmp-row .v .bar { margin-top: auto; }
  .cmp-row .v::before { content: attr(data-l); display: block; font-size: 10px; letter-spacing: .08em; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
  .cmp-row .v.after { background: rgba(94,212,230,.09); }
  .cmp-row.cmp-head { display: none; }
  .radar-wrap { max-width: 100%; }
  .report .paper { padding: 18px; }
  /* The sheet is a document, but when it is previewed on a phone the identity block still has to fit:
     one column, the photo above the name, nothing squeezed into 126 px. */
  .report .r-head { grid-template-columns: 1fr; justify-items: start; gap: 12px; }
  .report .r-head > div:last-child { order: -1; }
  .report h1 { font-size: 22px; overflow-wrap: anywhere; }
  .report .r-title { margin-top: 0; }
  .report-toolbar { justify-content: flex-start; }
  .report-toolbar button { flex: 1 1 auto; min-width: 0; }
  .report .r-figures { flex-direction: column; align-items: stretch; }
  .report .r-figures figure { max-width: none; }
  .report .r-wow { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .report .r-wow > * { min-width: 0; }
  .report .r-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report .r-tile em, .report .r-tile span { overflow-wrap: anywhere; }
  /* The print sheet is a document, not the interface, but when it is previewed on a phone its four
     columns must still not push the page sideways (spec §10). */
  .report table { table-layout: fixed; font-size: 13px; }
  .report th, .report td { padding: 8px 5px; overflow-wrap: anywhere; }
  .report th:first-child, .report td:first-child { width: 34%; }
  .report td small { display: block; font-size: 11px; }
  .report .r-charts { grid-template-columns: 1fr; }
  .report .bz-pillar { min-width: 56px; }
  .top-actions .install-label { display: none; }
  h1 { font-size: 23px; }
}
@media (max-width: 360px) {
  .idx-grid { gap: 10px; } .idx { padding: 12px; } .idx .idx-val { font-size: 25px; }
  .status-row { padding: 10px 12px; font-size: 12.5px; }
}
@media (min-width: 861px) { .bottom-nav { display: none; } .view { padding-bottom: 40px; } .toast-host { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .beat { animation: none; } }

/* ---------- print ---------- */
@media print {
  body { background: #fff !important; }
  #app, .toast-host, .report-toolbar, .share-panel { display: none !important; }
  .overlay { position: static; background: #fff !important; background-image: none !important; overflow: visible; }
  .report { max-width: none; padding: 0; }
  .report .paper { box-shadow: none; padding: 0; border-radius: 0; }
  .report .r-wow { -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
  .report .r-chart, .report .r-wow, .report .r-tile, .report .row-c { break-inside: avoid; page-break-inside: avoid; }
  .report .r-section > h3, .report .r-section > h4 { break-after: avoid; page-break-after: avoid; }
  .report .r-head, .report .r-dyn, .report .r-usin, .report .bz-pillar, .report tr, .report figure,
  .report .r-interp p, .report .r-section > p, .report .r-changes li, .report .r-advice li, .report .r-verdict, .report .r-bp { break-inside: avoid; page-break-inside: avoid; }
  /* orphans and widows are the paged-media way of saying "do not leave one line behind" */
  .report p, .report li { orphans: 2; widows: 2; }
  .report .paper { font-size: 15pt; line-height: 1.6; }
  .report h1 { font-size: 24pt; }
  .report table, .report .r-interp p, .report .r-section > p, .report .r-changes li, .report .r-advice li { font-size: 14.5pt; }
  .report .r-meta, .report .r-section h3 { font-size: 12pt; }
  .report .r-section h4 { font-size: 14pt; break-after: avoid; page-break-after: avoid; }
  .report .r-tile b { font-size: 26pt; }
  .report .r-bp { font-size: 11.5pt; color: #6E4E7E; }
  @page { margin: 14mm; }
}

/* A named way back to the list, not just an arrow (spec §3). */
.back-to-list { padding: 9px 14px; font-size: 13.5px; font-weight: 700; }

/* The BEFORE → AFTER figure pair. Three columns that can all shrink, and a figure sized to the column
   rather than to a fixed 150 px — measured at 288 px inside a 264 px card before this. */
.fig-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: start; justify-items: center; }
.fig-pair > * { min-width: 0; width: 100%; }
.fig-pair .fig-arrow { width: auto; align-self: center; color: var(--pink); font-size: 18px; }
.fig-pair .figure-wrap { width: 100%; max-width: 100%; }
.fig-pair svg { width: 100%; height: auto; }
.fig-pair .fig-lbl { font-weight: 800; letter-spacing: .08em; }

/* The five-element reading: magazine rhythm — a short heading, one to three paragraphs or a short
   list, all on the card's left axis. */
.er h3 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--pink); margin: 16px 0 6px; }
.er h3:first-child { margin-top: 0; }
.er p { font-size: 14px; line-height: 1.55; margin: 0 0 8px; }
.er-list { margin: 0 0 6px; padding-left: 18px; }
.er-list li { font-size: 14px; line-height: 1.5; margin-bottom: 4px; }
.er-cmp { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.er-cmp-head, .er-cmp-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr); gap: 8px; align-items: center; font-size: 13px; }
.er-cmp-head { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 0 12px; }
.er-cmp-row { min-height: 44px; padding: 8px 12px; border-radius: var(--radius-inner); background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.er-cmp-row .n { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.er-cmp-row .n .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.er-cmp-row .dir { font-weight: 800; }
.er-cmp-row .dir.up { color: var(--ok); } .er-cmp-row .dir.down { color: var(--warn); } .er-cmp-row .dir.same { color: var(--muted); }
.er-unavailable { margin-top: 14px; padding: var(--pad-inner); border-radius: var(--radius-inner); background: rgba(255,255,255,.04); border: 1px dashed var(--line-2); }
.er-unavailable p { margin: 4px 0 0; }
.innate-empty p { margin: 0 0 8px; }

/* The report: the innate and current diagrams side by side, one row, identical size. Not BEFORE and
   AFTER — two different kinds of profile, and the captions say which is which. */
.report .r-usin-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; margin: 8px 0 4px; }
.report .r-usin-pair figure { margin: 0; padding: 12px 8px; border-radius: 18px; background: #f6f3fa; display: flex; flex-direction: column; align-items: stretch; }
.report .r-usin-pair figcaption { text-align: center; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: #6E4E7E; margin-bottom: 6px; }
.report .r-usin-pair .r-usin { margin: 0; }
.report .r-usin-pair .r-usin svg { width: 100%; max-width: 100%; }
.report .r-usin-pair .r-profile { margin-top: 8px; }
.report .r-usin-pair .row-c { font-size: 12.5px; min-height: 30px; padding: 5px 2px; gap: 6px; }
.report .r-usin-pair .row-c small { font-size: 11.5px; }
.report .r-cmp td:not(:first-child) { text-align: center; }
.report .r-innate-empty { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: #faf8fe; border: 1px dashed #ded6ef; }
.report .r-innate-empty p { margin: 4px 0 0; font-size: 14px; color: #6E4E7E; }

@media (max-width: 560px) {
  .er-cmp-head { display: none; }
  .er-cmp-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n d" "i i" "c c"; row-gap: 3px; }
  .er-cmp-row .n { grid-area: n; }
  .er-cmp-row .dir { grid-area: d; text-align: right; }
  .er-cmp-row > span:nth-child(2) { grid-area: i; font-size: 12.5px; color: var(--muted); }
  .er-cmp-row > span:nth-child(2)::before { content: attr(data-l) ": "; }
  .er-cmp-row > span:nth-child(3) { grid-area: c; font-size: 12.5px; color: var(--muted); }
  .er-cmp-row > span:nth-child(3)::before { content: attr(data-l) ": "; }
}

@media (max-width: 560px) {
  .report .r-usin-pair { grid-template-columns: 1fr; }
  .report .r-usin-pair .row-c { font-size: 14px; min-height: 34px; }
  .report .r-usin-pair .row-c small { font-size: 12.5px; }
}

/* The public measurement page has nothing to navigate to, and in Telegram's and WhatsApp's in-app
   browsers a sticky header sat on top of the text. It scrolls away with the page there. */
body.public .topbar { position: static; }
body.public .view { padding-top: 12px; }
/* Readiness before a recording: the ladder, and a settle bar that fills while the signal holds. */
.ready-panel { display: flex; flex-direction: column; gap: 8px; align-items: center; margin: 4px 0 6px; }
.settle-track { width: min(240px, 80%); height: 5px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.settle-track i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--ok); transition: width .25s linear; }
.ready-panel.go .ready-line { color: #bff3de; }

/* How to measure. The three facts come first — a minute, now, nothing but the phone — because people
   were postponing for a "good day"; then the picture, because "which camera" is the other question. */
.guide-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.guide-facts span { padding: 7px 12px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 650; color: var(--ink); }
.guide-title { font-size: 15px; margin: 0 0 8px; }
.guide-pic { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 12px 14px; border-radius: var(--radius-inner); background: var(--card-2); border: 1px solid var(--line); margin-bottom: 10px; }
.guide-pic .fg { flex: none; }
.guide-pic p { margin: 0; min-width: 0; }
.guide-steps { margin: 0; padding-left: 20px; }
.guide-steps li { font-size: 13.5px; line-height: 1.5; margin-bottom: 6px; }
.guide-steps li:first-child { font-weight: 650; color: var(--ink); }
@media (max-width: 420px) { .guide-pic { flex-direction: column; align-items: flex-start; } }

/* The "i" beside a metric name. The box stays 44×44 so a finger hits it reliably, but the visible
   disc is 28px and the box is pulled in vertically, so putting one on a card costs no height. */
.tip > summary { width: 44px; height: 44px; margin: -8px 0 -8px 2px; font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: 14px; font-weight: 700; background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.08) 0 13px, rgba(255,255,255,.26) 13px 14px, transparent 14px); flex: none; }
.tip[open] > summary { background: radial-gradient(circle at 50% 50%, var(--pink) 0 14px, transparent 14px); color: #fff; }
/* Inside a flex name row the open explanation takes a line of its own, beside the "i" rather than under it. */
/* A tap target must never be squeezed by the row it sits in. */
.tip { flex: none; }
.idx .idx-name .tip[open] { display: flex; align-items: flex-start; gap: 4px; flex-basis: 100%; }
.idx .idx-name .tip[open] .tip-body { min-width: 0; margin-top: 0; }
.status-row > span { min-width: 0; }

/* The "i" is a control, not content: it and anything opened under it stay out of print and PDF,
   where the same ground is covered by the prose captions. */
.pdf-export .tip, .shot .tip { display: none; }
@media print { .tip { display: none; } }
