/* ============================================================
   Jaw Surgery Journey — "Scrub" redesign
   Clinical calm: porcelain light / deep-sea dark, scrub teal.
   Mobile-first · light-first (dark via [data-theme="dark"])
   Single stylesheet for every page.
   ============================================================ */

/* ---- self-hosted variable fonts (assets/fonts/) ---- */
@font-face {
  font-family: 'IBM Plex Sans Thai';
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/plex-thai-thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'IBM Plex Sans Thai';
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/plex-thai-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('fonts/grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #F1F5F2;
  --bg-2: #E6ECE7;
  --card: #FFFFFF;
  --card-hl: rgba(255, 255, 255, .7);
  --line: #E0E7E1;
  --line-strong: #C6D1C8;
  --fg: #12201A;
  --dim: #5A6C62;
  --brand: #0B7C6B;
  --brand-ink: #07604F;
  --brand-soft: #DCF1EA;
  --brand-line: #B9DCD0;
  --on-brand: #FFFFFF;
  --ok: #16875A;
  --ok-soft: #D9F0E2;
  --warn: #A06607;
  --warn-soft: #FAF0D8;
  --danger: #DB4553;
  --danger-ink: #BF3040;
  --danger-soft: #FBE9EB;
  --shadow: 0 1px 2px rgba(15, 42, 34, .05), 0 16px 38px rgba(15, 42, 34, .09);
  --shadow-sm: 0 1px 2px rgba(15, 42, 34, .06);
  --r-lg: 24px;
  --r: 16px;
  --r-sm: 12px;
  --grad-hero: linear-gradient(155deg, #055648 0%, #0B7C6B 54%, #2CA78C 100%);
  --grad-ok: linear-gradient(145deg, #0E7A55 0%, #26AB7E 100%);
  --grad-btn: linear-gradient(165deg, #108B76 0%, #0B7C6B 55%, #086150 100%);
  --btn-fg: #FFFFFF;
  --btn-shadow: 0 8px 20px rgba(11, 124, 107, .30), inset 0 1px 0 rgba(255, 255, 255, .20);
  --font: 'Space Grotesk', 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0A1310;
  --bg-2: #0F1C17;
  --card: #122019;
  --card-hl: rgba(255, 255, 255, .045);
  --line: #1E332A;
  --line-strong: #2C473B;
  --fg: #E6F1EB;
  --dim: #8DA699;
  --brand: #41C5A8;
  --brand-ink: #7BDAC3;
  --brand-soft: #14312A;
  --brand-line: #26503F;
  --on-brand: #052219;
  --ok: #46C98E;
  --ok-soft: #112A1F;
  --warn: #E3B55F;
  --warn-soft: #312712;
  --danger: #F27380;
  --danger-ink: #FF9AA5;
  --danger-soft: #381D22;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 38px rgba(0, 0, 0, .48);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --grad-hero: linear-gradient(155deg, #04443A 0%, #0A6B5B 54%, #1E9178 100%);
  --grad-btn: linear-gradient(165deg, #4AD0B4 0%, #36BA9C 100%);
  --btn-fg: #052219;
  --btn-shadow: 0 8px 22px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .28);
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.66;
  min-height: 100dvh;
  transition: background .25s ease, color .25s ease;
}
/* ambient glow at the top of every page */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(85% 40% at 50% -6%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 62%);
}
[data-theme="dark"] body::before {
  background: radial-gradient(85% 40% at 50% -6%, color-mix(in srgb, var(--brand) 11%, transparent), transparent 62%);
}

::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }

img { max-width: 100%; display: block; }
a { color: var(--brand-ink); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
h1, h2, h3 { line-height: 1.32; letter-spacing: -0.015em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15.5px; font-weight: 650; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
/* ---------- shell: top app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 37px; height: 37px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: var(--grad-hero); color: #fff;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--brand) 36%, transparent), inset 0 1px 0 rgba(255,255,255,.28);
}
.brand-mark .ic { width: 20px; height: 20px; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--fg); white-space: nowrap; }
.appbar-actions { display: flex; align-items: center; gap: 8px; }
.sos {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--danger-soft); color: var(--danger-ink);
  font-size: 13px; font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
  -webkit-tap-highlight-color: transparent;
}
.sos .ic { width: 16px; height: 16px; }
.sos:active { transform: scale(.96); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--bg-2); color: var(--dim);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- shell: floating tab dock ---------- */
.tabbar {
  position: fixed; z-index: 60;
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
  display: flex; gap: 4px; padding: 6px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 10px 34px rgba(15, 42, 34, .15), inset 0 1px 0 var(--card-hl);
}
[data-theme="dark"] .tabbar { box-shadow: 0 10px 34px rgba(0, 0, 0, .5), inset 0 1px 0 var(--card-hl); }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 6px; border-radius: 19px;
  color: var(--dim); font-size: 10.5px; font-weight: 650;
  -webkit-tap-highlight-color: transparent;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}
.tab .ic { width: 22px; height: 22px; }
.tab.active {
  color: var(--brand-ink); background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand-line);
}
.tab:active { background: var(--brand-soft); }

/* ---------- shell: page container ---------- */
.page {
  display: block; width: 100%; max-width: 620px; margin: 0 auto;
  padding: 16px 16px calc(108px + env(safe-area-inset-bottom));
}
.page-head { margin: 6px 2px 16px; }
.page-title { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--dim); font-size: 13.5px; margin-top: 4px; }

/* ---------- shell: flash toast + loadbar ---------- */
.flash {
  position: fixed; top: calc(62px + env(safe-area-inset-top)); left: 16px; right: 16px; z-index: 90;
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--brand-line);
  box-shadow: var(--shadow);
  font-size: 14.5px; font-weight: 650;
  animation: flash-in .3s cubic-bezier(.2,.9,.3,1.2);
}
.flash::before { content: ""; width: 9px; height: 9px; border-radius: 999px; background: var(--brand); flex: none; }
.flash.error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.flash.error::before { background: var(--danger); }
.flash.hide { opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-10px); } }

.loadbar {
  position: fixed; top: 0; left: 0; z-index: 100; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--brand), #2CA78C); border-radius: 0 3px 3px 0;
  opacity: 0; transition: width .35s ease, opacity .25s ease;
}
html.nav-loading .loadbar { width: 72%; opacity: 1; }

/* ---------- shared bits ---------- */
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: 10px; font-weight: 700; }
.skip:focus { left: 8px; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.pre-line { white-space: pre-line; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; flex: none; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); font-weight: 700; }
.neg { color: var(--danger-ink); font-weight: 700; }
.space-top { margin-top: 14px; }
.space-top-xs { margin-top: 7px; }
.eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .09em;
  color: var(--brand-ink); text-transform: uppercase;
}
/* ---------- card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--card-hl);
  padding: 20px;
  margin-bottom: 14px;
}
.card > h2:first-child, .card > h3:first-child { margin-bottom: 10px; }
.card > :last-child { margin-bottom: 0; }
.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 13.5px; font-weight: 700; letter-spacing: .01em; color: var(--dim);
  margin: 24px 4px 10px;
}

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--bg-2); color: var(--dim);
  font-size: 12.5px; font-weight: 650; line-height: 1.5; white-space: nowrap;
}
.chip-brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger-ink); }

/* ---------- buttons ---------- */
.btn, button.btn, form > button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px;
  border-radius: 16px; border: none;
  background: var(--grad-btn); color: var(--btn-fg);
  font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em;
  box-shadow: var(--btn-shadow);
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:active, form > button:active { transform: scale(.97); filter: brightness(.97); }
.btn .ic, form > button .ic { width: 19px; height: 19px; }
.btn-ghost {
  background: var(--card); color: var(--fg);
  border: 1.5px solid var(--line-strong); box-shadow: none;
}
.btn-danger-ghost {
  background: var(--danger-soft); color: var(--danger-ink);
  border: 1.5px solid color-mix(in srgb, var(--danger) 35%, transparent); box-shadow: none;
}
.btn-sm { min-height: 40px; padding: 0 15px; font-size: 13.5px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { min-height: 44px; width: 44px; padding: 0; margin-top: 0; border-radius: 14px; background: var(--bg-2); color: var(--dim); border: none; box-shadow: none; flex: none; }
.btn-icon .ic { width: 18px; height: 18px; }
.btn-icon.danger { background: var(--danger-soft); color: var(--danger-ink); }
/* ---------- forms ---------- */
label { display: block; font-size: 13.5px; font-weight: 650; color: var(--fg); margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  width: 100%; min-height: 52px; padding: 12px 15px;
  border-radius: 15px; border: 1.5px solid var(--line-strong);
  background: var(--card); color: var(--fg);
  font: inherit; font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 88px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--dim); opacity: .7; }
input[type=file] { padding: 12px 14px; font-size: 14px; }
input[type=file]::file-selector-button {
  margin-right: 12px; padding: 8px 14px; border: none; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand-ink); font: inherit; font-size: 13.5px; font-weight: 700;
}
.check-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-weight: 650; font-size: 15px; }
.check-line input { width: 22px; height: 22px; accent-color: var(--brand); }
form > button, form > .btn { width: 100%; margin-top: 18px; }
.field-grid { display: grid; gap: 0 12px; }
@media (min-width: 420px) { .field-grid { grid-template-columns: 1fr 1fr; } }
.form-error { color: var(--danger-ink); font-size: 13.5px; font-weight: 700; margin-top: 8px; }

/* quick-add collapsible sheet (no JS needed) */
details.add { margin-bottom: 14px; }
details.add > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 18px;
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-strong);
  color: var(--brand-ink); font-size: 15px; font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
details.add > summary::-webkit-details-marker { display: none; }
details.add > summary::before { content: "+"; font-size: 21px; font-weight: 500; line-height: 1; }
details.add > summary:active { background: var(--brand-soft); }
details.add[open] > summary { border-style: solid; border-color: var(--brand-line); background: var(--brand-soft); margin-bottom: 10px; }

/* range slider (big thumb, one-hand friendly) */
input[type=range].range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; background: transparent; border: none; padding: 0; min-height: 44px;
}
input[type=range].range::-webkit-slider-runnable-track {
  height: 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line);
}
input[type=range].range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 30px; border-radius: 50%; margin-top: -11px;
  background: var(--card); border: 3px solid var(--brand);
  box-shadow: 0 2px 8px rgba(15, 42, 34, .22);
}
input[type=range].range::-moz-range-track { height: 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
input[type=range].range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--card); border: 3px solid var(--brand); }

/* thick rounded progress bar */
.pbar { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #2CA78C); transition: width .5s ease; }
.pbar-lg { height: 12px; }

/* round toggle checkbox (appointments / checklist / expenses) */
.check-btn {
  width: 40px; height: 40px; min-height: 40px; padding: 0; margin-top: 0;
  border-radius: 50%; flex: none;
  border: 2px solid var(--line-strong); background: var(--card); color: transparent;
  display: grid; place-items: center;
  transition: all .15s ease; -webkit-tap-highlight-color: transparent;
}
.check-btn .ic { width: 17px; height: 17px; }
.check-btn.is-done {
  background: var(--ok); border-color: var(--ok); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ok) 38%, transparent);
}
.check-btn:active { transform: scale(.9); }

/* generic list row inside cards */
.row-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; }
.row-item + .row-item { border-top: 1px solid var(--line); }
.row-item .grow.done strong { color: var(--dim); text-decoration: line-through; }
/* ---------- home: hero countdown (breathing aurora) ---------- */
.hero { overflow: hidden; }
.hero-band {
  position: relative; isolation: isolate;
  margin: -20px -20px 0; padding: 26px 20px 22px;
  background: var(--grad-hero); color: #fff;
}
.hero-band::before, .hero-band::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.hero-band::before {
  background:
    radial-gradient(48% 62% at 80% 14%, rgba(255,255,255,.26), transparent 64%),
    radial-gradient(55% 72% at 4% 94%, rgba(110,242,203,.20), transparent 62%),
    radial-gradient(42% 56% at 46% 112%, rgba(4,38,32,.34), transparent 70%);
}
.hero-band::after {
  background:
    radial-gradient(38% 54% at 88% 6%, rgba(255,255,255,.17), transparent 60%),
    radial-gradient(48% 62% at 10% 98%, rgba(124,255,216,.15), transparent 64%);
  animation: hero-breathe 9s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
@keyframes hero-breathe {
  from { opacity: .55; transform: translate3d(-2%, 1.5%, 0) scale(.99); }
  to   { opacity: 1;   transform: translate3d(2%, -1.5%, 0) scale(1.05); }
}
.hero-band > * { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.hero-top .chip {
  background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.hero-date { font-size: 12.5px; font-weight: 650; opacity: .92; font-variant-numeric: tabular-nums; }
.hero-count { display: flex; align-items: baseline; gap: 12px; }
.hero-num {
  font-size: 92px; font-weight: 700; letter-spacing: -0.05em; line-height: .92;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255,255,255,.10), 0 12px 36px rgba(3,32,27,.42);
}
.hero-unit { font-size: 19px; font-weight: 650; line-height: 1.3; }
.hero-unit .dim { color: rgba(255,255,255,.78); font-size: 13.5px; font-weight: 550; }
.hero-prog { margin-top: 16px; }
.hero-prog .pbar { background: rgba(255,255,255,.24); }
.hero-prog .pbar > i { background: linear-gradient(90deg, #D9FFF2, #FFFFFF); }
.hero-prog .dim { color: rgba(255,255,255,.85); font-size: 12.5px; margin-top: 7px; }
.hero-note { margin-top: 12px; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.93); }
.hero-surgery { padding: 10px 4px 4px; text-align: center; }
.hero-surgery h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0; }
hr.perf { border: none; height: 1px; background: var(--line); margin: 16px -20px 14px; }
/* journey stepper */
.journey {
  list-style: none; display: flex; gap: 2px;
  padding: 14px 0 2px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.journey::-webkit-scrollbar { display: none; }
.j-node { flex: 1 0 auto; min-width: 76px; position: relative; text-align: center; padding: 0 6px; }
.j-dot {
  width: 23px; height: 23px; border-radius: 50%; margin: 0 auto;
  background: var(--card); border: 2px solid var(--line-strong); color: #fff;
  display: grid; place-items: center; position: relative; z-index: 1;
}
.j-node.is-done .j-dot { background: var(--ok); border-color: var(--ok); }
.j-node.is-now .j-dot {
  background: var(--brand); border-color: var(--brand);
  box-shadow: 0 0 0 5px var(--brand-soft);
}
.j-node.is-now .j-dot::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
  animation: j-pulse 2.4s ease-out infinite;
}
@keyframes j-pulse {
  0% { transform: scale(.72); opacity: 0; }
  35% { opacity: .9; }
  100% { transform: scale(1.28); opacity: 0; }
}
.j-node::before {
  content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px;
  background: var(--line-strong);
}
.j-node:first-child::before { display: none; }
.j-node.is-done::before, .j-node.is-now::before { background: var(--ok); }
.j-label { display: block; font-size: 11px; font-weight: 650; color: var(--dim); margin-top: 7px; line-height: 1.35; }
.j-node.is-now .j-label { color: var(--brand-ink); }

/* ---------- home: today todos ---------- */
.todo-list { list-style: none; }
.todo-list li + li { border-top: 1px solid var(--line); }
.todo {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 0; color: var(--fg); min-height: 60px;
  -webkit-tap-highlight-color: transparent;
}
.todo-ic {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink);
}
.todo-ic .ic { width: 20px; height: 20px; }
.todo-text { display: block; font-size: 15px; font-weight: 650; line-height: 1.4; }
.todo-sub { display: block; font-size: 12.5px; color: var(--dim); margin-top: 1px; }
.todo-arrow { flex: none; color: var(--dim); display: grid; place-items: center; }
.todo-empty { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; padding: 6px 0; }

/* stat grid (dashboard quick numbers) */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 460px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; box-shadow: var(--shadow-sm), inset 0 1px 0 var(--card-hl);
  transition: transform .15s ease;
}
a.stat { display: block; color: inherit; -webkit-tap-highlight-color: transparent; }
a.stat:active { background: var(--bg-2); transform: scale(.98); }
.stat .stat-label { display: flex; align-items: center; gap: 5px; }
.stat .stat-label .ic { width: 15px; height: 15px; }
.stat-num { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; display: block; margin-top: 4px; }
.stat-num small { font-size: 13px; font-weight: 650; color: var(--dim); }
.stat-sub { display: block; font-size: 11.5px; font-weight: 600; color: var(--dim); margin: 2px 0 8px; }
.stat .pbar { height: 6px; }
/* ---------- appointments timeline ---------- */
.tl { list-style: none; position: relative; }
.tl-node { position: relative; padding: 0 0 6px 30px; }
.tl-node::before {
  content: ""; position: absolute; left: 9px; top: 6px; bottom: -6px;
  width: 2px; background: var(--line);
}
.tl-node:last-child::before { display: none; }
.tl-node::after {
  content: ""; position: absolute; left: 3px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-2); border: 2.5px solid var(--line-strong);
}
.tl-node.is-done::after { background: var(--ok); border-color: var(--ok); }
.tl-node.is-next::after { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); }
.tl-node.is-past::after { background: var(--line-strong); }
.tl-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0 14px; }
.tl-date-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-date { font-size: 12.5px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .03em; }
.tl-title { font-size: 15.5px; font-weight: 650; margin-top: 3px; line-height: 1.45; }
.tl-title.done { color: var(--dim); text-decoration: line-through; }
.tl-card {
  margin-top: 8px; padding: 11px 13px;
  background: var(--bg-2); border-radius: var(--r-sm);
}

/* ---------- checklist ---------- */
.cl-overview { display: flex; align-items: center; gap: 18px; }
.cl-overview-num { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.cl-overview-num small { font-size: 16px; font-weight: 650; color: var(--dim); }
details.cl-phase {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--card-hl); margin-bottom: 12px; overflow: hidden;
}
details.cl-phase.is-current { border-color: var(--brand-line); }
summary.cl-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; cursor: pointer; list-style: none;
  -webkit-tap-highlight-color: transparent; min-height: 62px;
}
summary.cl-head::-webkit-details-marker { display: none; }
.cl-head h2 { font-size: 15.5px; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-mini { width: 52px; flex: none; }
.cl-mini .pbar { height: 6px; }
.cl-count { font-size: 13px; font-weight: 700; color: var(--dim); font-variant-numeric: tabular-nums; flex: none; }
.chev { flex: none; color: var(--dim); transition: transform .2s ease; display: grid; place-items: center; }
.chev .ic { width: 18px; height: 18px; }
details[open] > summary .chev { transform: rotate(180deg); }
.cl-items { padding: 2px 16px 14px; }
.cl-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; }
.cl-item + .cl-item { border-top: 1px solid var(--line); }
.cl-item-text { flex: 1; min-width: 0; font-size: 15px; line-height: 1.5; padding-top: 9px; }
.cl-item-text.done { color: var(--dim); text-decoration: line-through; }

/* ---------- journal ---------- */
.seg { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
.seg label { margin: 0; }
.seg-btn {
  display: grid; place-items: center; min-height: 44px;
  border-radius: 12px; background: var(--bg-2); border: 1.5px solid transparent;
  font-size: 15px; font-weight: 650; color: var(--dim); cursor: pointer;
  transition: all .12s ease; font-variant-numeric: tabular-nums;
}
.seg input:checked + .seg-btn { color: #fff; border-color: transparent; transform: scale(1.05); }
[data-sev="ok"] .seg input:checked + .seg-btn { background: var(--ok); }
[data-sev="warn"] .seg input:checked + .seg-btn { background: var(--warn); }
[data-sev="danger"] .seg input:checked + .seg-btn { background: var(--danger); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.swell { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
@media (min-width: 460px) { .swell { grid-template-columns: repeat(4, 1fr); } }
.swell label { margin: 0; }
.swell-chip {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 13px 6px; border-radius: 15px; cursor: pointer;
  background: var(--bg-2); border: 1.5px solid transparent;
  font-size: 12.5px; font-weight: 650; color: var(--dim); text-align: center;
  transition: all .12s ease;
}
.swell-chip .em { font-size: 22px; line-height: 1; }
.swell input:checked + .swell-chip { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
fieldset { border: none; margin-top: 16px; }
legend { font-size: 13.5px; font-weight: 650; margin-bottom: 2px; }
legend output { color: var(--brand-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.entry { position: relative; padding: 13px 0 13px 22px; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry-dot { position: absolute; left: 2px; top: 21px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); }
.entry-dot.warn { background: var(--warn); }
.entry-dot.danger { background: var(--danger); }
.entry-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }

/* mini trend charts */
.spark { width: 100%; height: auto; display: block; margin-top: 6px; }
.spark-line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.spark-area { fill: var(--brand); opacity: .1; }
.spark circle { fill: var(--brand); }
.spark-label { fill: var(--dim); font-size: 11px; font-weight: 700; }
/* ---------- expenses ---------- */
.exp-total { font-size: 42px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.exp-total small { font-size: 17px; font-weight: 650; color: var(--dim); }
.split { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); margin-top: 14px; }
.split > i { display: block; height: 100%; }
.split-paid { background: var(--ok); }
.split-due { background: var(--warn); }
.split-legend { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.split-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.exp-chart-scroll { overflow-x: auto; padding-bottom: 4px; }
.exp-bar-base { stroke: var(--line-strong); stroke-width: 1; }
.exp-bar-due { fill: var(--warn); }
.exp-bar-val { font-size: 10.5px; font-weight: 700; fill: var(--dim); font-variant-numeric: tabular-nums; }
.exp-bar-month { font-size: 11.5px; font-weight: 650; fill: var(--dim); }
.exp-amount { font-variant-numeric: tabular-nums; font-size: 16px; }

/* ---------- insight / notice boxes ---------- */
.insight {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--r);
  background: var(--brand-soft); color: var(--fg);
  border: 1px solid var(--brand-line);
  font-size: 14px; line-height: 1.55; margin-top: 12px;
}
.insight > span { flex: none; font-size: 17px; line-height: 1.4; }
.insight.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.insight.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.insight.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.insight a { font-weight: 700; text-decoration: underline; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 28px 18px; }
.empty .em { font-size: 34px; display: block; margin-bottom: 8px; }
.empty p { color: var(--dim); font-size: 14.5px; }

/* ---------- photos ---------- */
.ph-toolbar { display: flex; align-items: center; gap: 10px; margin: 4px 2px 14px; flex-wrap: wrap; }
.ph-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 6px; }
@media (min-width: 520px) { .ph-grid { grid-template-columns: repeat(3, 1fr); } }
.ph { position: relative; margin: 0; }
.ph-link { display: block; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.ph-link img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .25s ease; }
.ph-link:active img { transform: scale(1.03); }
.ph-cap { font-size: 12px; color: var(--dim); margin-top: 5px; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-del { position: absolute; top: 6px; right: 6px; }
.ph-del button {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(9, 18, 15, .62); color: #fff;
  display: grid; place-items: center; backdrop-filter: blur(6px);
}
.ph-del button .ic { width: 14px; height: 14px; }
body.cmp-on .ph-link { outline: 3px dashed var(--brand-line); outline-offset: 2px; }
.ph[data-pick] .ph-link { outline: 3px solid var(--brand); outline-offset: 2px; }
.ph[data-pick]::after {
  content: attr(data-pick); position: absolute; top: 8px; left: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
/* ---------- dialogs (lightbox / compare) ---------- */
dialog.dlg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  max-width: none; max-height: none; margin: 0; padding: 0;
  border: none; background: transparent;
}
dialog.dlg::backdrop { background: rgba(7, 15, 12, .86); backdrop-filter: blur(6px); }
.dlg figure { position: absolute; inset: 0; display: grid; place-items: center; padding: 26px; }
.dlg figure img { max-width: 100%; max-height: 100%; border-radius: var(--r); object-fit: contain; }
.dlg figcaption {
  position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); left: 16px; right: 16px;
  text-align: center; color: rgba(255,255,255,.88); font-size: 13.5px; font-weight: 650;
}
.dlg-btn {
  position: absolute; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff;
  display: grid; place-items: center; font-size: 24px; line-height: 1;
  backdrop-filter: blur(6px);
}
.dlg-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.dlg-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.dlg-next { right: 10px; top: 50%; transform: translateY(-50%); }
.cmp-head {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 16px; right: 16px; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; color: #fff;
}
.cmp-stage { position: absolute; inset: 0; touch-action: none; }
.cmp-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cmp-divider { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 12px rgba(0,0,0,.5); }
.cmp-divider::after {
  content: "⇄"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #333;
  display: grid; place-items: center; font-size: 17px;
}
.cmp-tag {
  position: absolute; bottom: 76px; padding: 5px 11px; border-radius: 999px;
  background: rgba(9, 18, 15, .7); color: #fff; font-size: 12px; font-weight: 650;
}
.cmp-tag-a { left: 14px; }
.cmp-tag-b { right: 14px; }
.cmp-foot {
  position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 16px; right: 16px; z-index: 2;
  display: flex; align-items: center; gap: 12px;
}
.cmp-foot label { color: rgba(255,255,255,.8); font-size: 12px; margin: 0; flex: none; }
.cmp-foot .range { flex: 1; }
.cmp-foot .range::-webkit-slider-thumb { background: #fff; border-color: #fff; }
.cmp-swap { color: #fff; font-size: 13px; font-weight: 650; padding: 8px 4px; flex: none; }

/* ---------- emergency ---------- */
.sos-hero {
  background: linear-gradient(150deg, #C93445, #E85B6A);
  color: #fff; border-radius: var(--r-lg);
  padding: 18px; margin-bottom: 14px;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--danger) 34%, transparent), inset 0 1px 0 rgba(255,255,255,.22);
}
.sos-hero h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 12px; }
.sos-hero .ic { width: 20px; height: 20px; flex: none; }
.flag-grid { display: grid; gap: 8px; }
.flag {
  display: flex; gap: 11px; align-items: flex-start;
  background: rgba(255,255,255,.13); border-radius: var(--r-sm);
  padding: 11px 13px;
}
.flag .em { font-size: 19px; flex: none; line-height: 1.3; }
.flag b { font-size: 14px; display: block; }
.flag .dim { color: rgba(255,255,255,.82); font-size: 12.5px; }
.call {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 15px; border-radius: var(--r); border: 1.5px solid var(--line);
  color: var(--fg); margin-top: 10px;
  -webkit-tap-highlight-color: transparent;
}
.call:active { background: var(--bg-2); }
.call b { display: block; font-size: 15px; }
.call-sub { display: block; font-size: 12px; color: var(--dim); margin-top: 1px; }
.call-num {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  font-weight: 700; font-size: 15px; color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
}
.call-num .ic { width: 16px; height: 16px; }
.call-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.call-danger .call-sub, .call-danger .call-num { color: #fff; }
.call-pending { opacity: .75; }

/* ---------- docs gallery ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.doc-tile { display: block; }
.doc-tile img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2);
}
.doc-cap { font-size: 12.5px; font-weight: 650; color: var(--dim); margin-top: 6px; }
/* ---------- CT viewer ---------- */
.series-nav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.series-nav::-webkit-scrollbar { display: none; }
.series-nav button {
  flex: none; padding: 9px 15px; border-radius: 999px;
  background: var(--card); border: 1.5px solid var(--line); color: var(--dim);
  font-size: 13px; font-weight: 650; -webkit-tap-highlight-color: transparent;
}
.series-nav button.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.ct-stage {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: #080F0C; aspect-ratio: 1; margin-bottom: 12px;
  touch-action: pan-y;
}
.ct-stage img { width: 100%; height: 100%; object-fit: contain; }
.ct-pill {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  padding: 5px 13px; border-radius: 999px;
  background: rgba(9, 18, 15, .66); color: #fff;
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
}

/* ---------- sim3d ---------- */
.sim-stage {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: radial-gradient(120% 100% at 50% 0%, #1B2C26 0%, #0A1310 72%);
  height: min(66vw, 420px); margin-bottom: 12px;
  touch-action: none;
}
.sim-stage canvas { display: block; }
.sim-anno { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 2; }
.anno-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(9, 18, 15, .55); color: #fff; font-size: 12px; font-weight: 650;
  backdrop-filter: blur(6px);
}
.anno-chip i { width: 10px; height: 10px; border-radius: 3px; }
.anno-max i { background: #6FA8FF; }
.anno-man i { background: #FF9F68; }
.sim-load {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: rgba(255,255,255,.75); font-size: 13.5px; font-weight: 650;
}
.spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3.5px solid rgba(255,255,255,.2); border-top-color: #fff;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sim-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.sim-btns button {
  min-height: 46px; border-radius: 13px; padding: 0 8px;
  background: var(--bg-2); color: var(--dim); border: 1.5px solid var(--line);
  font-size: 13.5px; font-weight: 650;
}
.sim-btns button.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.ba-labels { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 650; color: var(--dim); margin-top: 2px; }
#bapct { color: var(--brand-ink); }
/* ---------- plan page (markdown reader) ---------- */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; background: transparent; }
.read-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #2CA78C); }
.toc { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc .chip { flex: none; text-decoration: none; }
.md h2 { font-size: 19px; margin: 22px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.md h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.md h3 { margin: 16px 0 6px; }
.md p { margin: 8px 0; font-size: 15px; }
.md ul { margin: 8px 0 8px 20px; }
.md li { margin: 5px 0; font-size: 15px; }
.md li.plan-li-warn { color: var(--danger-ink); font-weight: 600; }
.md-quote { border-left: 3px solid var(--brand-line); padding: 4px 0 4px 12px; color: var(--dim); margin: 10px 0; }
.md code { background: var(--bg-2); border-radius: 6px; padding: 2px 6px; font-size: 13.5px; }
.md hr { border: none; height: 1px; background: var(--line); margin: 16px 0; }
.tbl { overflow-x: auto; margin: 10px 0; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl td, .tbl th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.tbl tr:first-child td { background: var(--bg-2); font-weight: 700; }

/* ---------- more page menu ---------- */
.menu-list { list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--card-hl); overflow: hidden; margin-bottom: 14px; }
.menu-list li + li { border-top: 1px solid var(--line); }
.menu-item {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 16px; color: var(--fg); min-height: 64px;
  -webkit-tap-highlight-color: transparent;
}
.menu-item:active { background: var(--bg-2); }
.menu-ic {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink);
}
.menu-ic .ic { width: 21px; height: 21px; }
.menu-ic.red { background: var(--danger-soft); color: var(--danger-ink); }
.menu-text { flex: 1; min-width: 0; }
.menu-text b { display: block; font-size: 15.5px; font-weight: 650; }
.menu-text small { display: block; font-size: 12.5px; color: var(--dim); margin-top: 1px; }
.menu-item .chev { flex: none; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 20px; gap: 22px;
}
.login-mark {
  width: 72px; height: 72px; border-radius: 24px;
  display: grid; place-items: center;
  background: var(--grad-hero); color: #fff;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--brand) 38%, transparent), inset 0 1px 0 rgba(255,255,255,.28);
}
.login-mark .ic { width: 36px; height: 36px; }
.login-intro { text-align: center; }
.login-intro h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 14px; }
.login-intro p { color: var(--dim); font-size: 14px; margin-top: 4px; }
.login-card { width: 100%; max-width: 380px; }
.login-hint { margin-top: 12px; }

/* ---------- error page (CSRF etc.) ---------- */
.error-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.error-page .card { max-width: 400px; text-align: center; }
.error-page .btn { margin-top: 14px; }
/* ---------- page entrance (staggered rise) ---------- */
@keyframes page-rise { from { opacity: 0; transform: translateY(12px); } }
.page > *:not(.flash) { animation: page-rise .45s cubic-bezier(.2,.75,.25,1) both; }
.page > *:nth-child(2):not(.flash) { animation-delay: .05s; }
.page > *:nth-child(3):not(.flash) { animation-delay: .09s; }
.page > *:nth-child(4):not(.flash) { animation-delay: .125s; }
.page > *:nth-child(5):not(.flash) { animation-delay: .155s; }
.page > *:nth-child(n+6):not(.flash) { animation-delay: .18s; }

/* ---------- larger screens ---------- */
@media (min-width: 720px) {
  .page { max-width: 680px; padding-top: 26px; }
  .page-title { font-size: 30px; }
  .hero-num { font-size: 104px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- print (emergency sheet) ---------- */
@media print {
  .appbar, .tabbar, .noprint, .loadbar, .flash, .skip { display: none !important; }
  body::before { display: none; }
  body { background: #fff; color: #000; font-size: 12px; }
  .page { max-width: none; padding: 0; }
  .page > *:not(.flash) { animation: none; }
  .card, .sos-hero { border: 1px solid #bbb; box-shadow: none; break-inside: avoid; background: #fff; }
  .call { border: 1px solid #999; }
  a { color: #000; }
}











