:root {
  --bg: #F2F6FB;
  --bg-alt: #E8EEF7;
  --surface: #FFFFFF;
  --ink: #11243A;
  --ink-muted: #4A5B70;
  --ink-faint: #6B7A8C;
  --line: #D6DFEA;
  --primary: #1E56C8;
  --primary-hover: #1947A6;
  --primary-soft: #E2EBFB;
  --zone: #DDF1E6;
  --zone-edge: #9ED3B4;
  --paper-ink: #2A2F36;
  --chat-bg: #EFE9E1;
  --chat-out: #D9FDD3;
  --radius: 16px;
  --wrap: 1180px;
  --nav-h: 68px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --paper: "Arial Narrow", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--sans); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
h1, h2, h3 { font-family: var(--cond); line-height: 1.06; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--primary); text-underline-offset: 3px; }
::selection { background: var(--primary-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.sprite { position: absolute; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--surface); padding: 8px 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 24px; border-radius: 999px;
  background: var(--primary); color: #fff; font-weight: 600; text-decoration: none;
  box-shadow: 0 8px 20px -10px rgba(30, 86, 200, .7);
  transition: background-color .2s, transform .2s var(--ease-out), box-shadow .2s;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(30, 86, 200, .8); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary); }
.btn-light { background: #fff; color: var(--primary); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .4); }
.btn-light:hover { background: var(--primary-soft); }

/* Nav with chapter links and story progress */
.nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 20px/1 var(--cond); }
.brand-mark { width: 30px; height: 30px; color: var(--primary); }
.chapters { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(17, 36, 58, .05); }
.chapters a { padding: 7px 14px; border-radius: 999px; color: var(--ink-muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: background-color .25s, color .25s; }
.chapters a:hover { color: var(--ink); }
.chapters a.is-active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(17, 36, 58, .12); }
.nav-end { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(17, 36, 58, .06); }
.lang button {
  min-width: 40px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  color: var(--ink-muted); font: 600 14px var(--sans); transition: background-color .2s, color .2s;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(17, 36, 58, .12); }
.lang button[lang="hi"] { font-family: "IBM Plex Sans Devanagari", var(--sans); }
@media (max-width: 420px) { .brand span { display: none; } }

/* Languages: Devanagari needs room above and below the line; the condensed face has no Devanagari glyphs. */
.i18n-pending main, .i18n-pending .nav-end .btn { visibility: hidden; }
:lang(hi) body { font-family: "IBM Plex Sans Devanagari", var(--sans); }
:lang(hi) h1, :lang(hi) h2, :lang(hi) h3, :lang(hi) .brand { font-family: "IBM Plex Sans Devanagari", var(--cond); letter-spacing: 0; }
:lang(hi) .hero-title { line-height: 1.22; font-size: clamp(40px, 5.8vw, 80px); }
:lang(hi) .ht-line { padding: .04em 0 .1em; }
:lang(hi) h2, :lang(hi) h3 { line-height: 1.3; }
:lang(hi) .step p, :lang(hi) .lede { line-height: 1.75; }
.progress { height: 2px; background: transparent; }
.progress span { display: block; height: 100%; width: 100%; background: var(--primary); transform-origin: 0 50%; transform: scaleX(0); }
@media (max-width: 900px) { .chapters { display: none; } }

/* ---------- HERO ---------- */
.hero { padding: 56px 0 24px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; min-height: min(78vh, 720px); }
.hero-title { font-size: clamp(44px, 6.6vw, 92px); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.ht-line { display: block; overflow: hidden; padding-bottom: .06em; }
.ht-line > span { display: inline-block; }
.ht-soft { color: var(--primary); font-weight: 600; }
.lede { margin-top: 26px; max-width: 54ch; font-size: 19px; color: var(--ink-muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.soon {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; padding: 6px 14px 6px 6px;
  border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500;
  box-shadow: 0 1px 2px rgba(17, 36, 58, .06), 0 10px 24px -16px rgba(17, 36, 58, .4);
  transition: box-shadow .25s, transform .25s var(--ease-out);
}
.soon:hover { transform: translateY(-1px); box-shadow: 0 1px 2px rgba(17, 36, 58, .06), 0 14px 28px -16px rgba(17, 36, 58, .5); }
.soon-tag { padding: 4px 10px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; }
.soon-item { display: inline-flex; align-items: center; gap: 6px; }
.soon-item + .soon-item { padding-left: 10px; border-left: 1px solid var(--line); }
.soon-item .ic { width: 16px; height: 16px; color: var(--primary); }
@media (max-width: 480px) {
  .soon { display: grid; justify-items: start; gap: 8px; border-radius: 16px; padding: 12px 16px 14px; }
  .soon-item + .soon-item { padding-left: 0; border-left: 0; }
}

.hero-art { position: relative; height: 520px; }
.pile { position: absolute; inset: 0; }
.pile-item { position: absolute; border-radius: 6px; will-change: transform; }
.pile-paper {
  left: 0; top: 12%; width: 64%; padding: 22px 22px 18px; background: #fff; color: var(--paper-ink);
  font-family: var(--paper); font-size: 14px; transform: rotate(-5deg);
  box-shadow: 0 1px 0 #e3e8ef, 0 30px 50px -28px rgba(17, 36, 58, .45);
}
.pp-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--paper-ink); padding-bottom: 8px; margin-bottom: 6px; }
.pp-head b { font-size: 17px; }
.pp-head span { font-size: 11px; color: #5b6168; }
.pp-row { display: grid; grid-template-columns: 1fr 48px 46px; padding: 8px 4px; border-bottom: 1px dotted #c9cdd3; }
.pp-row.is-key { background: rgba(30, 86, 200, .14); box-shadow: inset 3px 0 0 var(--primary); }
.pile-chat {
  right: 0; top: 0; z-index: 2; width: 44%; padding: 12px 14px; background: var(--chat-out); border-radius: 12px 12px 4px 12px;
  display: grid; gap: 4px; transform: rotate(4deg);
  box-shadow: 0 20px 36px -24px rgba(17, 36, 58, .5);
}
.pc-file { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 8px; background: rgba(255, 255, 255, .7); font-size: 14px; }
.pc-file .ic { color: #C2410C; color: var(--primary); }
.pc-meta { font-size: 12px; color: #4b5d52; }
.pile-photo {
  left: 22%; top: 52%; width: 44%; height: 34%; padding: 16px; transform: rotate(7deg);
  background: linear-gradient(160deg, #f4f4f2, #dcdfe2); border: 6px solid #fff; border-radius: 10px;
  box-shadow: 0 24px 40px -24px rgba(17, 36, 58, .55);
}
.photo-lines { display: grid; gap: 9px; transform: skewY(-3deg); filter: blur(.4px); }
.photo-lines i { height: 6px; border-radius: 3px; background: #9aa3ad; }
.photo-lines i:nth-child(odd) { width: 78%; }
.photo-tag { position: absolute; left: 10px; bottom: 8px; font-size: 11px; color: var(--ink-muted); background: #fff; padding: 1px 6px; border-radius: 4px; }

.hero-result {
  position: absolute; right: 0; bottom: 4%; width: 300px; padding: 18px 18px 14px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(17, 36, 58, .06), 0 36px 60px -30px rgba(17, 36, 58, .55);
}
.hr-head { display: flex; justify-content: space-between; align-items: baseline; }
.hr-head span { font-weight: 600; }
.hr-head b { font-size: 30px; font-weight: 600; }
.hr-head small { font-size: 14px; font-weight: 400; color: var(--ink-muted); }
.hr-change { font-size: 14px; color: var(--ink-muted); margin: 2px 0 10px; }
.hr-chart { width: 100%; height: auto; display: block; overflow: visible; }
.hr-plot { fill: #F5F8FC; }
.hr-band { fill: var(--zone); }
.hr-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.hr-dot { fill: var(--primary); stroke: #fff; stroke-width: 2; }
.hr-dates { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); margin-top: 4px; }


@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; gap: 24px; }
  .hero-art { height: 440px; max-width: 520px; width: 100%; margin: 0 auto; }
}
@media (max-width: 480px) {
  .hero-art { height: 380px; }
  .pile-paper { width: 78%; font-size: 12px; padding: 16px; }
  .pile-chat { width: 58%; right: 0; }
  .hero-result { width: 250px; }
}

/* ---------- CHAPTERS (sticky stage + scrolling steps) ---------- */
.chapter { position: relative; padding: 80px 0 40px; }
.chapter-alt { background: var(--bg-alt); }
.chapter-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; }
.chapter-doctor .chapter-grid { grid-template-columns: 1.55fr 1fr; gap: 48px; }
.stage-col { position: relative; order: 0; }
.stage {
  position: sticky; top: calc(var(--nav-h) + 24px);
  height: calc(100vh - var(--nav-h) - 48px); min-height: 520px; max-height: 760px;
  display: grid; place-items: center;
}
.steps-col { padding-bottom: 20vh; }
.chapter-head { min-height: 46vh; display: flex; flex-direction: column; justify-content: center; }
.chapter-tag { color: var(--primary); font-weight: 600; margin-bottom: 14px; }
.chapter-head h2 { font-size: clamp(34px, 4.2vw, 56px); font-weight: 700; }
.step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; max-width: 46ch; transition: opacity .4s; }
.js .step { opacity: .28; }
.js .step.is-active { opacity: 1; }
.step h3 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; margin-bottom: 12px; }
.step p { color: var(--ink-muted); font-size: 18px; }

/* Phones: the scene and its caption cards share one grid cell. The scene sticks under the nav
   for exactly the height of its chapter, and cards scroll over the lower part of the screen. */
@media (max-width: 900px) {
  .chapter { padding: 40px 0 0; }
  .chapter-grid, .chapter-doctor .chapter-grid { grid-template-columns: 1fr; gap: 0; }
  .stage-col, .steps-col { grid-area: 1 / 1; min-width: 0; }
  .stage-col { z-index: 1; }
  .stage {
    position: sticky; top: calc(var(--nav-h) + 4px); height: 56vh; min-height: 360px; max-height: none;
  }
  .steps-col { position: relative; z-index: 2; padding: 60vh 0 18vh; }
  .chapter-head, .step {
    min-height: 0; margin-bottom: 30vh; padding: 20px; border-radius: var(--radius); background: var(--surface);
    box-shadow: 0 -8px 30px -12px rgba(17, 36, 58, .18), 0 20px 40px -24px rgba(17, 36, 58, .35);
  }
  .chapter-head h2 { font-size: 28px; }
  .chapter-tag { margin-bottom: 8px; }
  .step:last-child { margin-bottom: 0; }
  .js .chapter-head, .js .step { opacity: 0; transform: translateY(16px); transition: opacity .35s, transform .5s var(--ease-out); }
  .js .chapter-head.is-active, .js .step.is-active { opacity: 1; transform: none; }
  .step h3 { font-size: 22px; margin-bottom: 6px; }
  .step p { font-size: 16px; }
}

/* Shared bits */
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.pr-main { display: grid; min-width: 0; line-height: 1.25; }
.pr-main b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-main small { font-size: 12px; color: var(--ink-muted); }
.t-two { color: var(--primary); }

/* Phone frame */
.phone {
  position: relative; width: 290px; height: 590px; border-radius: 44px; padding: 12px;
  background: #0E1B2C; box-shadow: 0 0 0 2px #2b3a4f inset, 0 50px 80px -40px rgba(17, 36, 58, .6);
}
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; width: 84px; height: 22px; margin-left: -42px; border-radius: 12px; background: #0E1B2C; z-index: 3; }
.screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: var(--bg); }
.scene { position: absolute; inset: 0; transition: opacity .45s var(--ease-out), transform .6s var(--ease-out); }

/* Chapter 1: Front desk */
.stage-phone { --s: 1; }
.floaters { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.floater {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px;
  background: var(--surface); font-size: 14px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 18px 36px -20px rgba(17, 36, 58, .5);
  transition: transform .8s var(--ease-out), opacity .5s;
}
.floater .ic { color: var(--primary); }
.f-paper { left: 0; top: 22%; transform: rotate(-6deg); }
.f-chat { right: 0; top: 40%; transform: rotate(4deg); background: var(--chat-out); }
.f-photo { left: 4%; top: 64%; transform: rotate(-3deg); }
.stage-phone:not([data-step="1"]) .floater { opacity: 0; transform: translate(var(--tx, 0), 0) scale(.4); }
.f-paper { --tx: 40%; } .f-chat { --tx: -40%; } .f-photo { --tx: 50%; }

.app-bar { display: flex; justify-content: space-between; align-items: baseline; padding: 50px 18px 10px; }
.app-bar b { font: 700 24px/1 var(--cond); }
.app-date { font-size: 12px; color: var(--ink-muted); }
.search { margin: 0 14px 10px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-faint); font-size: 14px; }
.typed { color: var(--ink); opacity: 0; transition: opacity .3s; display: inline-flex; align-items: center; }
.caret { width: 1.5px; height: 16px; background: var(--primary); margin-left: 1px; }
.prow { display: flex; align-items: center; gap: 10px; margin: 0 8px; padding: 10px; border-radius: 12px; transition: background-color .4s, opacity .4s; }
.pr-aside { margin-left: auto; font-size: 11px; color: var(--ink-muted); white-space: nowrap; }
.ticks { margin-left: auto; position: relative; width: 22px; height: 22px; }
.ticks .ic { position: absolute; inset: 0; width: 22px; height: 22px; opacity: 0; }
.t-clock { color: var(--ink-faint); }
.t-one { color: var(--ink-muted); }
.toast {
  position: absolute; left: 50%; bottom: 92px; transform: translate(-50%, 20px); opacity: 0;
  display: inline-flex; gap: 8px; align-items: center; padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: opacity .4s, transform .5s var(--ease-out);
}
.toast .ic { color: #8DB4FF; }
.fab { position: absolute; left: 14px; right: 14px; bottom: 20px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--primary); color: #fff; font-weight: 600; font-size: 15px; transition: transform .2s; }

.sc-camera { background: #0b0f14; opacity: 0; transform: scale(1.04); }
.viewfinder { position: absolute; left: 16px; right: 16px; top: 58px; bottom: 150px; display: grid; place-items: center; }
.vf-paper { width: 82%; height: 88%; padding: 16px 14px; background: #f5f5f2; border-radius: 3px; transform: rotate(-2deg); display: grid; align-content: start; gap: 10px; font-family: var(--paper); font-size: 13px; color: var(--paper-ink); }
.vf-paper i { height: 5px; border-radius: 3px; background: #b8bec6; }
.vf-paper i:nth-child(3n) { width: 64%; }
.corner { position: absolute; width: 26px; height: 26px; border: 3px solid #fff; transition: transform .6s var(--ease-out); }
.c1 { left: 4px; top: 4px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.c2 { right: 4px; top: 4px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.c3 { left: 4px; bottom: 4px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.c4 { right: 4px; bottom: 4px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.cam-hint { position: absolute; left: 0; right: 0; bottom: 116px; text-align: center; color: #cfd6df; font-size: 12px; }
.shutter { position: absolute; left: 50%; bottom: 30px; width: 70px; height: 70px; margin-left: -35px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; }
.shutter span { width: 54px; height: 54px; border-radius: 50%; background: #fff; transition: transform .2s; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.stopwatch {
  position: absolute; right: 2%; top: 14%; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 16px 30px -14px rgba(30, 86, 200, .8);
  opacity: 0; transform: translateY(10px) scale(.9); transition: opacity .4s, transform .6s var(--ease-out);
}

.stage-phone[data-step="2"] .typed,
.stage-phone[data-step="4"] .typed { opacity: 1; }
.stage-phone[data-step="2"] .prow:not(.is-target),
.stage-phone[data-step="4"] .prow:not(.is-target) { opacity: .35; }
.stage-phone[data-step="2"] .is-target,
.stage-phone[data-step="4"] .is-target { background: var(--primary-soft); }
.stage-phone[data-step="3"] .sc-list { opacity: 0; transform: scale(.96); }
.stage-phone[data-step="3"] .sc-camera { opacity: 1; transform: none; }
.stage-phone[data-step="3"] .corner { transform: scale(.92); }
.stage-phone[data-step="4"] .t-two { opacity: 1; }
.stage-phone[data-step="4"] .toast { opacity: 1; transform: translate(-50%, 0); }
.stage-phone[data-step="4"] .stopwatch { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  .stage-phone[data-step="1"] .floater { animation: bob 4s ease-in-out infinite alternate; }
  .stage-phone[data-step="1"] .f-chat { animation-delay: -1.3s; }
  .stage-phone[data-step="1"] .f-photo { animation-delay: -2.6s; }
  .stage-phone[data-step="2"] .caret { animation: blink 1s steps(1) infinite; }
  .stage-phone[data-step="3"] .shutter span { animation: press .5s .9s both; }
  .stage-phone[data-step="3"] .flash { animation: flash .6s 1.05s both; }
  .stage-phone[data-step="4"] .t-clock { animation: k-out .25s .7s both; }
  .stage-phone[data-step="4"] .t-one { animation: k-blip 1s .8s both; }
  .stage-phone[data-step="4"] .t-two { animation: k-pop .45s 1.7s both; }
  .stage-phone[data-step="4"] .toast { animation: k-toast .5s 1.9s both; }
}
@keyframes bob { from { translate: 0 -6px; } to { translate: 0 6px; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes press { 0%, 100% { transform: scale(1); } 40% { transform: scale(.82); } }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: .9; } 100% { opacity: 0; } }
@keyframes k-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes k-blip { 0% { opacity: 0; } 15%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes k-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes k-toast { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Chapter: AI reading */
.stage-read { align-content: center; gap: 0; }
.rd-sheet {
  position: relative; width: min(100%, 520px); padding: 22px 22px 18px; background: #fff; color: var(--paper-ink);
  font-family: var(--paper); font-size: 14px; border-radius: 4px; overflow: hidden;
  box-shadow: 0 1px 0 #e3e8ef, 0 30px 50px -28px rgba(17, 36, 58, .45);
  transition: transform .9s var(--ease-out), filter .9s;
}
.rd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--paper-ink); padding-bottom: 8px; margin-bottom: 4px; }
.rd-head b { font-size: 17px; }
.rd-head span { font-size: 11px; color: #5b6168; }
.rd-row { display: grid; grid-template-columns: 1fr 44px 50px 70px; padding: 9px 4px; border-bottom: 1px dotted #c9cdd3; transition: background-color .4s, box-shadow .4s; transition-delay: calc(var(--i) * 180ms + 200ms); }
.rd-row b { font-weight: 700; }
.stage-read:not([data-step="1"]) .rd-row { background: rgba(30, 86, 200, .08); box-shadow: inset 3px 0 0 var(--primary); }
.rd-beam { position: absolute; left: 0; right: 0; top: 0; height: 70px; background: linear-gradient(transparent, rgba(30, 86, 200, .18) 70%, var(--primary) 70%, var(--primary) 72%, transparent 72%); opacity: 0; pointer-events: none; }
.rd-photo-tag { position: absolute; right: 10px; top: 10px; display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #fff; font: 500 12px var(--sans); opacity: 0; transition: opacity .4s; }
.rd-photo-tag .ic { width: 14px; height: 14px; }
.rd-out { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 520px); margin-top: -26px; padding: 0 14px; position: relative; z-index: 1; }
.rd-val {
  display: grid; gap: 1px; padding: 12px 14px; border-radius: 14px; background: var(--surface); font-family: var(--sans);
  box-shadow: 0 16px 32px -20px rgba(17, 36, 58, .5);
  opacity: 0; transform: translateY(-40px) scale(.9);
  transition: opacity .45s, transform .7s var(--ease-out); transition-delay: calc(var(--i) * 110ms);
}
.rv-t { font-size: 13px; color: var(--ink-muted); font-weight: 500; }
.rv-v { font-size: 22px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.rv-v small { font-size: 12px; color: var(--ink-muted); font-weight: 400; }
.rv-h { font-size: 12.5px; color: var(--primary); opacity: 0; transform: translateY(-4px); transition: opacity .4s, transform .5s var(--ease-out); transition-delay: calc(var(--i) * 110ms); }
.ring { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--primary); transform: scale(0); transition: transform .4s var(--ease-out); }
.stage-read:not([data-step="1"]) .rd-val { opacity: 1; transform: none; }
.stage-read[data-step="3"] .rv-h, .stage-read[data-step="4"] .rv-h { opacity: 1; transform: none; }
.stage-read[data-step="4"] .rd-sheet { transform: rotate(-3deg) translateY(6px); filter: grayscale(.4) contrast(.92) blur(.3px); }
.stage-read[data-step="4"] .rd-sheet::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 48%, rgba(0, 0, 0, .07) 50%, transparent 52%), linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(120, 130, 140, .12)); pointer-events: none; }
.stage-read[data-step="4"] .rd-photo-tag { opacity: 1; }
.stage-read[data-step="4"] .ring { transform: scale(1); }
.stage-read[data-step="4"] .rd-unsure { box-shadow: 0 0 0 2px var(--primary), 0 16px 32px -20px rgba(17, 36, 58, .5); }
@media (prefers-reduced-motion: no-preference) {
  .stage-read[data-step="1"] .rd-beam { animation: scan 2.2s .2s var(--ease-out) both; }
  .stage-read[data-step="1"] .rd-row { animation: rowread .01s both; animation-delay: calc(var(--i) * 360ms + 600ms); }
  .stage-read[data-step="4"] .rd-beam { animation: scan 2.2s .5s var(--ease-out) both; }
}
@keyframes scan { 0% { opacity: 1; transform: translateY(-60px); } 90% { opacity: 1; } 100% { opacity: 0; transform: translateY(260px); } }
@keyframes rowread { to { background: rgba(30, 86, 200, .08); box-shadow: inset 3px 0 0 var(--primary); } }

/* Chapter: Doctor */
.browser { width: 100%; max-width: 760px; border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: 0 2px 4px rgba(17, 36, 58, .06), 0 50px 80px -40px rgba(17, 36, 58, .55); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #EAF0F7; border-bottom: 1px solid var(--line); }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #C9D4E3; }
.browser-bar span { margin-left: 12px; font-size: 12px; color: var(--ink-muted); background: #fff; padding: 3px 12px; border-radius: 6px; }
.desk { position: relative; display: grid; grid-template-columns: 168px 1fr; min-height: 420px; font-size: 13px; }
.desk-list { padding: 14px 10px; border-right: 1px solid var(--line); background: #FAFBFD; display: grid; align-content: start; gap: 6px; }
.dl-h { font: 700 18px/1 var(--cond); padding: 2px 6px 6px; }
.next-card { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: var(--primary); color: #fff; }
.next-card small { opacity: .85; font-size: 11px; }
.next-card span { font-size: 11px; padding: 4px 6px; margin-top: 4px; border-radius: 6px; background: rgba(255, 255, 255, .16); }
.dl-row { display: grid; padding: 8px; border-radius: 10px; line-height: 1.3; }
.dl-row small { color: var(--ink-muted); font-size: 11px; }
.desk-main { padding: 16px 18px; display: grid; align-content: start; gap: 12px; transition: opacity .5s; }
.dm-head b { font-size: 17px; display: block; }
.dm-head span { font-size: 12px; color: var(--ink-muted); }
.dm-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dm-row { display: grid; grid-template-columns: 1.1fr .8fr 1fr 80px; align-items: center; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--line); opacity: 0; transform: translateX(16px); transition: opacity .4s, transform .6s var(--ease-out), background-color .3s; }
.dm-row:first-child { border-top: 0; }
.dm-row:nth-child(2) { transition-delay: .1s; } .dm-row:nth-child(3) { transition-delay: .2s; }
.dm-row b { font-size: 16px; font-weight: 600; }
.dm-row b small { font-size: 11px; color: var(--ink-muted); font-weight: 400; }
.dm-c { color: var(--ink-muted); font-size: 12px; }
.dm-row .spark { width: 80px; height: 26px; }
.dm-row.is-sel { background: var(--primary-soft); }
.spark { overflow: visible; }
.spark polyline { fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--primary); }
.dm-chart { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 6px; opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .7s var(--ease-out); }
.dm-legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-muted); }
.dm-legend .sw { width: 14px; height: 10px; border-radius: 2px; background: var(--zone); border: 1px solid var(--zone-edge); }
.trend { width: 100%; height: auto; display: block; overflow: visible; }
.t-plot { fill: #F5F8FC; }
.t-band { fill: var(--zone); }
.t-grid line { stroke: #E3E9F1; }
.t-ticks text, .t-x text { font: 11px var(--sans); fill: var(--ink-muted); text-anchor: end; }
.t-x text { text-anchor: middle; }
.t-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset 1.4s var(--ease-out) .2s; }
.t-dots circle { fill: var(--primary); stroke: #fff; stroke-width: 2; opacity: 0; transition: opacity .3s; }
.t-dots circle:nth-child(1) { transition-delay: .3s; } .t-dots circle:nth-child(2) { transition-delay: .65s; } .t-dots circle:nth-child(3) { transition-delay: 1s; } .t-dots circle:nth-child(4) { transition-delay: 1.3s; }
.t-lab { font: 600 13px var(--sans); fill: var(--ink); text-anchor: middle; opacity: 0; transition: opacity .3s 1.4s; }
.desk-src {
  position: absolute; top: 0; right: 0; bottom: 0; width: 56%; padding: 16px; background: #EEF2F7; border-left: 1px solid var(--line);
  display: grid; align-content: start; gap: 12px;
  transform: translateX(102%); transition: transform .7s var(--ease-out);
}
.src-page { padding: 14px; background: #fff; border-radius: 4px; font-family: var(--paper); color: var(--paper-ink); box-shadow: 0 10px 24px -16px rgba(17, 36, 58, .5); }
.src-page > b { display: block; font-size: 15px; border-bottom: 2px solid var(--paper-ink); padding-bottom: 6px; margin-bottom: 4px; }
.src-row { display: flex; justify-content: space-between; padding: 7px 4px; border-bottom: 1px dotted #c9cdd3; font-size: 12.5px; }
.src-hl { transition: background-color .4s .7s, box-shadow .4s .7s; }
.pop { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: var(--surface); box-shadow: 0 16px 30px -18px rgba(17, 36, 58, .5); opacity: 0; transform: translateY(12px); transition: opacity .4s 1s, transform .6s var(--ease-out) 1s; }
.pop b { font-size: 17px; }
.pop small { color: var(--ink-muted); font-size: 12px; line-height: 1.4; }
.pop-btns { display: flex; gap: 8px; margin-top: 4px; }
.pop-confirm, .pop-edit { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.pop-confirm { background: var(--primary); color: #fff; }
.pop-confirm .ic { width: 15px; height: 15px; }
.pop-edit { color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }

.js .stage-desk[data-step="1"] .desk-main { opacity: .2; }
.stage-desk:not([data-step="1"]) .dm-row { opacity: 1; transform: none; }
.stage-desk[data-step="3"] .dm-chart, .stage-desk[data-step="4"] .dm-chart { opacity: 1; transform: none; }
.stage-desk[data-step="3"] .t-line, .stage-desk[data-step="4"] .t-line { stroke-dashoffset: 0; }
.stage-desk[data-step="3"] .t-dots circle, .stage-desk[data-step="4"] .t-dots circle,
.stage-desk[data-step="3"] .t-lab, .stage-desk[data-step="4"] .t-lab { opacity: 1; }
.stage-desk[data-step="4"] .desk-src { transform: none; }
.stage-desk[data-step="4"] .src-hl { background: rgba(30, 86, 200, .16); box-shadow: inset 3px 0 0 var(--primary); }
.stage-desk[data-step="4"] .pop { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .stage-desk[data-step="1"] .next-card { animation: glow 1.6s .3s ease-in-out 2; }
}
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(30, 86, 200, .22); } }

@media (max-width: 600px) {
  .phone { width: 220px; height: 450px; border-radius: 36px; padding: 9px; }
  .phone::before { top: 15px; width: 64px; height: 18px; margin-left: -32px; }
  .screen { border-radius: 28px; }
  .app-bar { padding-top: 40px; }
  .prow { padding: 7px; } .prow:nth-of-type(n+5) { display: none; }
  .fab { height: 44px; bottom: 14px; }
  .toast { bottom: 70px; }
  .floater { font-size: 12px; padding: 7px 10px; }
  .stopwatch { top: 4%; right: 0; font-size: 14px; padding: 7px 12px; }
  .rd-sheet { font-size: 11.5px; padding: 14px; }
  .rd-row { grid-template-columns: 1fr 34px 40px; padding: 6px 2px; }
  .rd-row span:last-child { display: none; }
  .rd-head span { display: none; }
  .rd-out { gap: 6px; padding: 0 6px; }
  .rd-val { padding: 8px 10px; }
  .rv-v { font-size: 17px; }
  .desk { grid-template-columns: 1fr; min-height: 330px; font-size: 12px; }
  .desk-list { display: none; }
  .js .stage-desk[data-step="1"] .desk-list { display: grid; position: absolute; inset: 0; z-index: 2; }
  .dm-row { grid-template-columns: 1fr .8fr 64px; }
  .dm-c { display: none; }
  .dm-row .spark { width: 64px; }
  .desk-src { width: 100%; }
  .browser-bar span { display: none; }
}

/* ---------- TWO VIEWS ---------- */
.views { padding: 110px 0; background: var(--ink); color: #fff; }
.views-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.views h2 { font-size: clamp(34px, 4.4vw, 56px); font-weight: 700; }
.views-copy > p { margin-top: 16px; color: #C9D4E3; font-size: 18px; max-width: 46ch; }
.seg { margin-top: 28px; display: inline-grid; grid-auto-flow: column; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.seg button { min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: none; color: #C9D4E3; font: 600 15px var(--sans); cursor: pointer; transition: background-color .3s, color .3s; }
.seg button[aria-checked="true"] { background: #fff; color: var(--primary); }
.seg button:focus-visible { outline-color: #fff; }
.ticks-list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; color: #DCE4EF; }
.ticks-list li { position: relative; padding-left: 30px; }
.ticks-list li::before {
  content: ""; position: absolute; left: 0; top: .3em; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(141, 180, 255, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.5 2.5L14 7.5' fill='none' stroke='%238DB4FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px no-repeat;
}
.views ::selection { background: var(--primary); color: #fff; }
.role-card { background: var(--surface); color: var(--ink); border-radius: 20px; padding: 20px; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6); }
.rc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rc-head b { display: block; font-size: 17px; }
.rc-head small { font-size: 13px; color: var(--ink-muted); }
.rc-as { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 4px 10px; border-radius: 999px; }
.rc-body { display: grid; padding-top: 14px; }
.rc-reception, .rc-doctor { grid-area: 1 / 1; display: grid; align-content: start; gap: 10px; transition: opacity .4s, transform .6s var(--ease-out); }
.rc-report { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg); }
.rc-report > .ic:first-child { color: var(--ink-muted); width: 22px; height: 22px; }
.rc-report b { display: block; font-size: 14px; }
.rc-report small { font-size: 12px; color: var(--ink-muted); }
.rc-report .t-two { margin-left: auto; }
.rc-lock { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--ink-muted); }
.rc-val { display: grid; grid-template-columns: 1fr auto; padding: 12px; border-radius: 12px; background: var(--bg); }
.rc-val span { font-weight: 500; }
.rc-val b { font-size: 20px; font-weight: 600; text-align: right; }
.rc-val b small { font-size: 12px; font-weight: 400; color: var(--ink-muted); }
.rc-val > small { grid-column: 1 / -1; color: var(--ink-muted); font-size: 13px; }
.role-card[data-view="reception"] .rc-doctor { opacity: 0; transform: translateY(10px); pointer-events: none; }
.role-card[data-view="doctor"] .rc-reception { opacity: 0; transform: translateY(-10px); pointer-events: none; }
@media (max-width: 860px) { .views-grid { grid-template-columns: 1fr; gap: 20px; } .views { padding: 80px 0; } }

/* ---------- PILOT ---------- */
.pilot { background: var(--primary); color: #fff; padding: 110px 0; position: relative; overflow: hidden; }
.pilot h2 { font-size: clamp(36px, 5.4vw, 68px); font-weight: 700; max-width: 16ch; }
.pilot p { max-width: 56ch; margin: 18px 0 30px; color: #DCE6FA; font-size: 18px; }
.pilot .pilot-small { margin: 22px 0 0; font-size: 15px; }
.pilot a:not(.btn) { color: #fff; }
.pilot ::selection { background: #fff; color: var(--primary); }

.foot { padding: 28px 0; font-size: 14px; color: var(--ink-muted); }
.foot-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-links a { color: var(--ink-muted); }
.foot-links a:hover { color: var(--primary); }

/* ---------- LEGAL PAGES ---------- */
.legal { max-width: 760px; padding-top: 48px; padding-bottom: 96px; }
.legal h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 700; }
.legal-meta { margin-top: 10px; color: var(--ink-muted); font-size: 15px; }
.legal-lead { margin-top: 24px; font-size: 19px; color: var(--ink); }
.legal h2 { font-size: 26px; font-weight: 600; margin: 48px 0 12px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.legal h3 { font-size: 18px; font-family: var(--sans); font-weight: 600; margin: 22px 0 6px; }
.legal p, .legal li { color: var(--ink-muted); }
.legal p + p { margin-top: 12px; }
.legal strong { color: var(--ink); }
.legal ul { padding-left: 22px; margin: 8px 0 0; display: grid; gap: 8px; }
.legal-toc { margin-top: 28px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 20px; }
.legal-toc a { color: var(--primary); text-decoration: none; font-weight: 500; font-size: 15px; }
.legal-toc a:hover { text-decoration: underline; }
.legal-table { margin-top: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.legal-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal-table th, .legal-table td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.legal-table thead th { border-top: 0; color: var(--ink); background: var(--bg); }
.legal-table td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
.legal-contact { padding: 16px 18px; border-radius: 12px; background: var(--surface); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* Stagger index (inline styles are blocked by the CSP). */
[data-i="0"] { --i: 0; } [data-i="1"] { --i: 1; } [data-i="2"] { --i: 2; } [data-i="3"] { --i: 3; }
