/* ============================================================
   KCET Rank Predictor: glass UI, mobile first
   ============================================================ */

/* ---------- tokens: light ---------- */
:root {
  color-scheme: light;
  --bg: #eceefb;
  --bg-2: #f7f5ff;
  --blob-1: rgba(167, 139, 250, 0.55);
  --blob-2: rgba(103, 232, 249, 0.45);
  --blob-3: rgba(249, 168, 212, 0.45);
  --blob-4: rgba(147, 197, 253, 0.55);
  --glass: linear-gradient(150deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.46));
  --glass-solid: rgba(250, 250, 255, 0.94);
  --table-solid: #f6f6fd;
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-hi: rgba(255, 255, 255, 0.9);
  --shadow: 0 24px 48px -28px rgba(49, 46, 129, 0.35), 0 2px 6px rgba(49, 46, 129, 0.05);
  --surface: #f3f3fb;
  --ink: #15142b;
  --ink-2: #45435f;
  --ink-3: #6a6887;
  --hairline: rgba(21, 20, 43, 0.09);
  --grid: rgba(21, 20, 43, 0.08);
  --axis: rgba(21, 20, 43, 0.22);
  --field-bg: rgba(255, 255, 255, 0.6);
  --chip-bg: rgba(255, 255, 255, 0.7);
  --track: rgba(21, 20, 43, 0.1);
  --seg-active: #ffffff;
  --focus: rgba(124, 58, 237, 0.28);
  --me-row: rgba(124, 58, 237, 0.1);
  --notice-bg: rgba(250, 178, 25, 0.14);
  --src-parents: #6d28d9;
  --src-parents-bg: rgba(124, 58, 237, 0.1);
  --src-online: #0e7490;
  --src-online-bg: rgba(8, 145, 178, 0.1);
  --src-app: #1d4ed8;
  --src-app-bg: rgba(37, 99, 235, 0.1);
  --accent-1: #7c3aed;
  --accent-2: #0891b2;
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 55%, #06b6d4 100%);
  --btn-grad: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  --hero-ink: linear-gradient(180deg, #15142b 35%, #5b3fd6 100%);
  --good: #0ca30c;
  --warning: #e39a00;
  --serious: #ec835a;
  /* chart series, newest year first (validated: adjacent CVD ΔE ≥ 9.1) */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #008300;
  --s7: #4a3aa7;
  --s8: #e34948;
}

/* ---------- tokens: dark (system preference, unless the viewer picked light) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0a1a;
    --bg-2: #171433;
    --blob-1: rgba(124, 58, 237, 0.5);
    --blob-2: rgba(6, 182, 212, 0.34);
    --blob-3: rgba(236, 72, 153, 0.3);
    --blob-4: rgba(79, 70, 229, 0.42);
    --glass: linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
    --glass-solid: rgba(28, 27, 51, 0.94);
    --table-solid: #221f3f;
    --glass-border: rgba(255, 255, 255, 0.13);
    --glass-hi: rgba(255, 255, 255, 0.14);
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.2);
    --surface: #1c1b33;
    --ink: #f4f3ff;
    --ink-2: #c6c4e2;
    --ink-3: #9795b8;
    --hairline: rgba(255, 255, 255, 0.1);
    --grid: rgba(255, 255, 255, 0.08);
    --axis: rgba(255, 255, 255, 0.24);
    --field-bg: rgba(255, 255, 255, 0.05);
    --chip-bg: rgba(255, 255, 255, 0.07);
    --track: rgba(255, 255, 255, 0.12);
    --seg-active: rgba(255, 255, 255, 0.14);
    --focus: rgba(167, 139, 250, 0.35);
    --me-row: rgba(167, 139, 250, 0.16);
    --notice-bg: rgba(250, 178, 25, 0.12);
    --src-parents: #c4b5fd;
    --src-parents-bg: rgba(167, 139, 250, 0.14);
    --src-online: #67e8f9;
    --src-online-bg: rgba(34, 211, 238, 0.12);
    --src-app: #93c5fd;
    --src-app-bg: rgba(96, 165, 250, 0.14);
    --accent-1: #a78bfa;
    --accent-2: #22d3ee;
    --hero-ink: linear-gradient(180deg, #ffffff 30%, #c4b5fd 100%);
    --warning: #fab219;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s6: #008300;
    --s7: #9085e9;
    --s8: #e66767;
  }
}

/* ---------- tokens: dark (explicit toggle) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0a1a;
  --bg-2: #171433;
  --blob-1: rgba(124, 58, 237, 0.5);
  --blob-2: rgba(6, 182, 212, 0.34);
  --blob-3: rgba(236, 72, 153, 0.3);
  --blob-4: rgba(79, 70, 229, 0.42);
  --glass: linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
  --glass-solid: rgba(28, 27, 51, 0.94);
  --table-solid: #221f3f;
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-hi: rgba(255, 255, 255, 0.14);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.2);
  --surface: #1c1b33;
  --ink: #f4f3ff;
  --ink-2: #c6c4e2;
  --ink-3: #9795b8;
  --hairline: rgba(255, 255, 255, 0.1);
  --grid: rgba(255, 255, 255, 0.08);
  --axis: rgba(255, 255, 255, 0.24);
  --field-bg: rgba(255, 255, 255, 0.05);
  --chip-bg: rgba(255, 255, 255, 0.07);
  --track: rgba(255, 255, 255, 0.12);
  --seg-active: rgba(255, 255, 255, 0.14);
  --focus: rgba(167, 139, 250, 0.35);
  --me-row: rgba(167, 139, 250, 0.16);
  --notice-bg: rgba(250, 178, 25, 0.12);
  --src-parents: #c4b5fd;
  --src-parents-bg: rgba(167, 139, 250, 0.14);
  --src-online: #67e8f9;
  --src-online-bg: rgba(34, 211, 238, 0.12);
  --src-app: #93c5fd;
  --src-app-bg: rgba(96, 165, 250, 0.14);
  --accent-1: #a78bfa;
  --accent-2: #22d3ee;
  --hero-ink: linear-gradient(180deg, #ffffff 30%, #c4b5fd 100%);
  --warning: #fab219;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s6: #008300;
  --s7: #9085e9;
  --s8: #e66767;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- animated backdrop ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(120% 70% at 50% -10%, var(--bg-2), var(--bg) 65%);
}
.blob {
  position: absolute;
  width: 75vmax;
  height: 75vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--c), transparent 72%);
  will-change: transform;
  animation: drift 28s ease-in-out infinite alternate;
}
.b1 { --c: var(--blob-1); top: -30vmax; left: -25vmax; }
.b2 { --c: var(--blob-2); top: 5vh; right: -35vmax; animation-duration: 34s; animation-delay: -9s; }
.b3 { --c: var(--blob-3); bottom: -35vmax; left: -15vmax; animation-duration: 38s; animation-delay: -15s; }
.b4 { --c: var(--blob-4); bottom: -25vmax; right: -25vmax; animation-duration: 31s; animation-delay: -4s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(7vmax, 5vmax, 0) scale(1.08); }
  100% { transform: translate3d(-5vmax, 9vmax, 0) scale(0.94); }
}
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- glass ---------- */
.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-solid); }
}
.card { border-radius: 24px; padding: 20px; }
.card-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head-wrap { flex-wrap: wrap; align-items: center; }
.card-head-stack { flex-direction: column; align-items: flex-start; gap: 2px; }
.card-sub { font-size: 13px; color: var(--ink-3); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right), calc((100% - 1200px) / 2 + 16px)) 10px max(16px, env(safe-area-inset-left), calc((100% - 1200px) / 2 + 16px));
  transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  background: var(--glass);
  border-bottom-color: var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.6); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.brand-text span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: transform 0.2s;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topnav {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.topnav a {
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current="page"] { background: var(--seg-active); color: var(--ink); box-shadow: 0 2px 8px -2px rgba(15, 12, 40, 0.25); }
@media (max-width: 379px) { .brand-text { display: none; } }
.i-moon { display: none; }
:root[data-effective="light"] .i-sun { display: none; }
:root[data-effective="light"] .i-moon { display: block; }

/* ---------- layout ---------- */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px max(16px, env(safe-area-inset-right)) calc(110px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.columns > *, .results > * { min-width: 0; }

/* ---------- intro ---------- */
.intro { padding: 10px 2px 22px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--glass-border);
  color: var(--ink-2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }
h1 {
  margin-top: 14px;
  font-size: clamp(30px, 8.4vw, 50px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.035em;
  background: var(--hero-ink);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { margin-top: 12px; font-size: 15.5px; color: var(--ink-2); max-width: 36em; }

/* ---------- inputs ---------- */
.inputs .card-title { margin-bottom: 18px; }
.field + .field { margin-top: 24px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.field-head label { font-weight: 700; font-size: 14.5px; }
.chip {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.field-row { display: flex; align-items: center; gap: 10px; }
.num-wrap {
  flex: 1;
  min-width: 0;
  height: 64px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding-top: 11px;
  border-radius: 18px;
  background: var(--field-bg);
  border: 1px solid var(--hairline);
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: text;
}
.num-wrap:focus-within { border-color: var(--accent-1); box-shadow: 0 0 0 4px var(--focus); }
.num-wrap.invalid { border-color: var(--serious); }
.num-wrap input {
  width: 3.6ch;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: right;
}
.num-wrap input::-webkit-inner-spin-button,
.num-wrap input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.num-wrap input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.num-max { font-size: 16px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.step {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--field-bg);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.15s, background 0.2s;
}
.step:active { transform: scale(0.92); background: var(--chip-bg); }
.field-hint { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.field-hint.error { color: var(--serious); font-weight: 600; }

.range {
  --fill: 50%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  margin: 10px 0 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.range:focus-visible { outline: none; }
.range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 99px;
  background: var(--accent-grad) 0 0 / var(--fill) 100% no-repeat, var(--track);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -10px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 4px 14px rgba(15, 12, 40, 0.35), 0 0 0 6px var(--focus);
  transition: transform 0.15s;
}
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range::-moz-range-track { height: 8px; border-radius: 99px; background: var(--track); }
.range::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--accent-grad); }
.range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 4px 14px rgba(15, 12, 40, 0.35), 0 0 0 6px var(--focus);
}

.score {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.ring { position: relative; width: 108px; height: 108px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-track { stroke: var(--track); }
.ring-fill { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-value { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.ring-value small { font-size: 14px; font-weight: 700; }
.ring-label { margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.score-detail { min-width: 0; }
.score-title { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.score-title b { color: var(--ink); font-weight: 800; }
.formula { margin-top: 6px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.score-note { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--notice-bg);
  border: 1px solid rgba(250, 178, 25, 0.35);
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------- hero result ---------- */
.hero { overflow: hidden; padding: 22px 20px 20px; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: var(--accent-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.75;
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  right: -90px;
  top: -110px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.35), transparent);
  pointer-events: none;
}
.hero-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.year-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--hairline);
}
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.hero-label { position: relative; margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.hero-rank {
  position: relative;
  margin-top: 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: clamp(54px, 17vw, 78px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.hero-rank #heroRank {
  background: var(--hero-ink);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.04em;
}
.approx { font-size: 0.5em; font-weight: 700; color: var(--ink-3); letter-spacing: 0; }
.hero-range { position: relative; margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }
.hero-range b { color: var(--ink); font-weight: 700; }
.hero-near { position: relative; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.insight {
  position: relative;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--chip-bg);
  border: 1px solid var(--hairline);
  font-size: 13.5px;
  color: var(--ink-2);
}
.insight b { color: var(--ink); }
.hero-actions { position: relative; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { color: #fff; background: var(--btn-grad); box-shadow: 0 10px 24px -10px rgba(79, 70, 229, 0.8); }
.btn-ghost { background: var(--chip-bg); border-color: var(--hairline); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--ink-3)); }
.pill.high { --dot: var(--good); }
.pill.medium { --dot: var(--warning); }
.pill.low { --dot: var(--serious); }
.pill.outlook { --dot: var(--accent-1); }

/* ---------- year list ---------- */
.year-list { list-style: none; margin: 0; padding: 0; }
.yr { border-top: 1px solid var(--hairline); }
.yr:first-child { border-top: 0; }
.yr-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "id rank" "track track" "range chev";
  align-items: center;
  column-gap: 12px;
  padding: 14px 2px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.yr-id { grid-area: id; display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 800; font-size: 15px; }
.yr-rank { grid-area: rank; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.yr-rank .approx { font-size: 14px; margin-right: 3px; }
.yr-track { grid-area: track; position: relative; height: 16px; margin: 8px 0 6px; }
.yr-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--grid); }
.yr-whisker {
  position: absolute;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  border-radius: 6px;
  background: var(--c);
  opacity: 0.35;
  transition: left 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.yr-dot {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px var(--surface);
  transition: left 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.yr-outlook .yr-whisker { background: repeating-linear-gradient(135deg, var(--c) 0 4px, transparent 4px 7px); opacity: 0.6; }
.yr-outlook .yr-dot { background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--c), 0 0 0 2px var(--surface); }
.yr-outlook .swatch { background: none; box-shadow: inset 0 0 0 2px var(--c); }
.yr-range { grid-area: range; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chev { grid-area: chev; width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s; justify-self: end; }
.yr-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.yr-more { padding: 0 2px 14px; font-size: 13px; color: var(--ink-2); }
.yr-more p + p { margin-top: 6px; }
.track-axis { position: relative; height: 18px; margin: 2px 2px 0; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.track-axis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.track-axis span:first-child { transform: none; }
.track-axis span:last-child { transform: translateX(-100%); }

/* ---------- chart ---------- */
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 13px;
  background: var(--field-bg);
  border: 1px solid var(--hairline);
}
.seg button {
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 11px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.seg button[aria-pressed="true"] { background: var(--seg-active); color: var(--ink); box-shadow: 0 2px 8px -2px rgba(15, 12, 40, 0.25); }
.readout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  margin-bottom: 8px;
  min-height: 70px;
}
.ro-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.ro-head b { color: var(--ink); }
.ro-reset { border: 0; background: none; padding: 2px 0; font-size: 12.5px; font-weight: 700; color: var(--accent-1); cursor: pointer; }
.ro-item { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.ro-key { width: 14px; height: 3px; border-radius: 2px; background: var(--c); flex: none; }
.ro-year { color: var(--ink-3); font-weight: 600; }
.ro-val { margin-left: auto; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart { position: relative; margin: 0 -6px; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; -webkit-user-select: none; user-select: none; overflow: visible; }
.chart text { font-family: inherit; font-size: 11px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .curve { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .curve.ext { stroke-dasharray: 0.5 5; stroke-width: 2.4; opacity: 0.85; }
.chart .pts circle { opacity: 0.45; }
.chart .you-line { stroke: var(--ink); stroke-width: 1.5; opacity: 0.55; }
.chart .you-tag rect { fill: var(--ink); }
.chart .you-tag text { fill: var(--surface); font-weight: 800; font-size: 11px; }
.chart .scrub-line { stroke: var(--ink-3); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:focus { outline: none; }
.chart .hit:focus-visible + .focus-ring { opacity: 1; }
.chart .focus-ring { fill: none; stroke: var(--accent-1); stroke-width: 2; opacity: 0; pointer-events: none; }
.chart .mk { stroke: var(--surface); stroke-width: 2; transition: cy 0.3s; }
.chart-note { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }

.table-wrap { max-height: 380px; overflow: auto; border-radius: 16px; border: 1px solid var(--hairline); background: var(--field-bg); -webkit-overflow-scrolling: touch; }
.table-static { max-height: none; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { position: sticky; top: 0; z-index: 1; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--table-solid); }
thead th .swatch { width: 8px; height: 8px; margin-right: 6px; vertical-align: 1px; }
tbody tr:last-child td { border-bottom: 0; }
tbody th { position: sticky; left: 0; z-index: 1; font-weight: 700; background: var(--table-solid); }
thead th:first-child { left: 0; z-index: 2; }
tr.me td { background: var(--me-row); font-weight: 800; }
tr.me th { background: linear-gradient(var(--me-row), var(--me-row)), var(--table-solid); font-weight: 800; }
td.ext { color: var(--ink-3); }

/* ---------- good to know ---------- */
.note-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 16px; }
.note { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.note + .note { padding-top: 16px; border-top: 1px solid var(--hairline); }
.note-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--chip-bg);
  border: 1px solid var(--hairline);
  color: var(--accent-1);
}
.note-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.note h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; letter-spacing: -0.005em; }
.note p { font-size: 13.5px; color: var(--ink-2); }
.note-example { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--field-bg); border: 1px solid var(--hairline); font-variant-numeric: tabular-nums; }
.note-example b { color: var(--ink); }

.more-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--field-bg);
  border: 1px solid var(--hairline);
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}
.more-link b { color: var(--accent-1); }
.more-link:hover { border-color: var(--accent-1); }
.more-link:active { transform: scale(0.99); }
.more-link svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--accent-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- method ---------- */
.method { padding: 6px 20px; }
.method details + details { border-top: 1px solid var(--hairline); }
.method summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.method summary::-webkit-details-marker { display: none; }
.method details[open] .chev { transform: rotate(180deg); }
.steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.steps b { color: var(--ink); }
.small-print { margin: 14px 0 8px; font-size: 13px; color: var(--ink-2); }
.excluded { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.excluded b { color: var(--ink-2); font-weight: 700; }

.footer { padding: 28px 4px 0; font-size: 12.5px; color: var(--ink-3); text-align: center; max-width: 52em; margin: 0 auto; }
.footer p + p { margin-top: 8px; }
.footer a { color: var(--ink-2); font-weight: 700; }

/* ============================================================
   FAQ page
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.faq-layout { max-width: 880px; }
.faq-layout > * + * { margin-top: 16px; }
.faq-layout > .intro + * { margin-top: 0; }

.legend { padding: 18px 20px; }
.legend-title { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.legend-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.legend-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.legend-list .src-tag { justify-self: start; }

.src-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--tag-ink);
  background: var(--tag-bg);
}
.src-tag.parents, .src-block.parents { --tag-ink: var(--src-parents); --tag-bg: var(--src-parents-bg); }
.src-tag.online, .src-block.online { --tag-ink: var(--src-online); --tag-bg: var(--src-online-bg); }
.src-tag.app, .src-block.app { --tag-ink: var(--src-app); --tag-bg: var(--src-app-bg); }

.faq-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 8px 0 16px;
  border-radius: 18px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.faq-search:focus-within { border-color: var(--accent-1); box-shadow: var(--shadow), 0 0 0 4px var(--focus); }
.faq-search > svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.faq-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
}
.faq-search input::placeholder { color: var(--ink-3); }
.faq-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.faq-clear { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--chip-bg); cursor: pointer; }
.faq-clear svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-2); stroke-width: 2.2; stroke-linecap: round; }

.faq-toolbar {
  position: sticky;
  top: calc(63px + env(safe-area-inset-top));
  z-index: 15;
  margin-left: -16px;
  margin-right: -16px;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.faq-toolbar.stuck {
  background: var(--glass);
  border-bottom-color: var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
}
.chips { display: flex; gap: 8px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn {
  flex: none;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip-btn[aria-pressed="true"] { color: #fff; background: var(--btn-grad); border-color: transparent; box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.8); }

.faq-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; font-size: 13px; color: var(--ink-3); }
.faq-layout > .faq-meta { margin-top: 8px; }
.link-btn { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent-1); cursor: pointer; }

.faq-part { display: grid; gap: 10px; }
.faq-layout > .faq-part { margin-top: 26px; }
.part-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 0 4px 4px; font-size: 18px; font-weight: 800; letter-spacing: -0.015em; }
.part-num {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--btn-grad);
  transform: translateY(-2px);
}

.faq { border-radius: 20px; scroll-margin-top: calc(124px + env(safe-area-inset-top)); transition: box-shadow 0.3s; }
.faq summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 16px 14px;
  cursor: pointer;
  list-style: none;
  border-radius: 20px;
  -webkit-tap-highlight-color: transparent;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible { outline: 2px solid var(--accent-1); outline-offset: -2px; }
.faq .chev { grid-area: auto; width: 20px; height: 20px; }
.faq[open] .chev { transform: rotate(180deg); }
.q-num {
  min-width: 40px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-1);
  background: var(--chip-bg);
  border: 1px solid var(--hairline);
}
.q-text { font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: -0.005em; }
.faq[open] .answer { animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.answer { padding: 0 18px 16px; font-size: 14px; color: var(--ink-2); }
.answer p + p, .answer p + ul, .answer p + ol, .answer p + dl, .answer p + div, .answer ul + p, .answer ol + p, .answer dl + p { margin-top: 10px; }
.answer b { color: var(--ink); }
.answer a { color: var(--accent-1); font-weight: 700; }
.src-block { position: relative; padding: 2px 0 2px 14px; border-left: 3px solid var(--tag-ink); }
.src-block + .src-block { margin-top: 16px; }
.src-block > .src-tag { margin-bottom: 10px; }
.lead-answer { font-size: 15px; font-weight: 800; color: var(--ink); }

ul.dots, ol.numbered, ul.emoji-list, ol.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.dots li { position: relative; padding-left: 18px; }
ul.dots li::before { content: ""; position: absolute; left: 3px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--tag-ink, var(--accent-1)); }
ol.numbered { counter-reset: n; }
ol.numbered li { counter-increment: n; position: relative; padding-left: 36px; min-height: 26px; }
ol.numbered li::before {
  content: counter(n);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: var(--tag-ink, var(--accent-1));
  background: var(--tag-bg, var(--chip-bg));
}
ul.emoji-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
.e { font-size: 16px; line-height: 1.35; text-align: center; }

dl.defs { margin: 0; display: grid; gap: 8px; }
dl.defs > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--field-bg);
  border: 1px solid var(--hairline);
}
dl.defs dt { font-weight: 800; color: var(--tag-ink, var(--ink)); font-size: 13px; }
dl.defs dd { margin: 0; }

.callout {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  border: 1px solid var(--hairline);
  background: var(--field-bg);
}
.answer .callout { margin-top: 12px; }
.callout.warn { background: var(--notice-bg); border-color: rgba(250, 178, 25, 0.35); }
.callout.tip { background: var(--src-online-bg); border-color: transparent; }
.callout.note { background: var(--src-parents-bg); border-color: transparent; }

ol.timeline { position: relative; gap: 0; }
ol.timeline li { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 7px 0 7px 22px; }
ol.timeline li::before { content: ""; position: absolute; left: 3px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--tag-ink); box-shadow: 0 0 0 3px var(--tag-bg); z-index: 1; }
ol.timeline li::after { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 1px; background: var(--tag-ink); opacity: 0.35; }
ol.timeline li:first-child::after { top: 50%; }
ol.timeline li:last-child::after { bottom: 50%; }
.t-date { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

.doc-cards { display: grid; gap: 8px; }
.doc { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--field-bg); border: 1px solid var(--hairline); }
.doc p { margin-top: 2px; }

.inline-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13.5px; text-decoration: none; }
.inline-cta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.faq-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--chip-bg);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
}
.inline-cta + .faq-share { margin-left: 12px; }
.faq-share svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.faq.flash { box-shadow: var(--shadow), 0 0 0 3px var(--focus); }

.faq-empty { text-align: center; font-size: 14px; color: var(--ink-2); }
.faq-empty p + p { margin-top: 6px; }
.faq-layout > .faq-note { margin-top: 26px; }
.faq-note a { color: var(--accent-1); font-weight: 700; }

.cta-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) 22px; align-items: center; gap: 14px; text-decoration: none; transition: transform 0.15s, border-color 0.2s; }
.cta-card:hover { border-color: var(--accent-1); }
.cta-card:active { transform: scale(0.99); }
.cta-icon img { display: block; border-radius: 13px; }
.cta-text { display: grid; gap: 2px; }
.cta-text b { font-size: 15.5px; }
.cta-text span { font-size: 13px; color: var(--ink-2); }
.cta-arrow { width: 22px; height: 22px; fill: none; stroke: var(--accent-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 560px) {
  .faq summary { padding: 18px 20px 18px 16px; gap: 14px; }
  .q-text { font-size: 16px; }
  .answer { padding: 0 24px 20px 70px; font-size: 14.5px; }
  dl.defs > div { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; }
  dl.defs dt { font-size: 13.5px; }
  .legend { padding: 20px 24px; }
}
@media (min-width: 1000px) {
  .faq-toolbar { margin-left: 0; margin-right: 0; border-radius: 18px; border: 1px solid transparent; }
  .faq-toolbar.stuck { border-color: var(--glass-border); }
  .chips { padding: 0 8px; }
}

/* ---------- dock & toast ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  transform: translate(-50%, 160%);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dock.show { transform: translate(-50%, 0); }
.dock.lift { bottom: calc(76px + env(safe-area-inset-bottom)); }
.dock-score { font-weight: 800; font-size: 15px; }
.dock-rank { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.dock-rank b { color: var(--ink); }
.toast {
  position: fixed;
  left: 50%;
  top: calc(16px + env(safe-area-inset-top));
  z-index: 40;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13.5px;
  font-weight: 700;
  transform: translate(-50%, -160%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- entrance ---------- */
.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- small phones ---------- */
@media (max-width: 559px) {
  th, td { padding: 8px 7px; font-size: 12.5px; }
  th:first-child, td:first-child { padding-left: 10px; }
}
@media (max-width: 359px) {
  .card { padding: 18px 16px; }
  .field-row { gap: 8px; }
  .step { width: 42px; height: 42px; border-radius: 14px; }
  .num-wrap { height: 58px; padding-top: 10px; }
  .num-wrap input { font-size: 28px; }
  .num-max { font-size: 14px; }
  .seg button { padding: 8px 9px; }
}

/* ---------- larger screens ---------- */
@media (min-width: 560px) {
  .card { padding: 24px; }
  .method { padding: 6px 24px; }
  .card-head-stack { flex-direction: row; align-items: baseline; }
  .readout { grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 44px; }
  .ro-val { margin-left: 2px; }
  .yr-btn { grid-template-columns: 150px minmax(0, 1fr) 130px 18px; grid-template-areas: "id track rank chev" "id track range chev"; row-gap: 0; padding: 12px 2px; }
  .yr-track { margin: 0 8px; }
  .yr-rank { text-align: right; font-size: 20px; }
  .yr-range { text-align: right; }
}
@media (min-width: 1000px) {
  .layout { padding-top: 16px; }
  .intro { padding: 18px 0 30px; }
  .columns { grid-template-columns: minmax(360px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
  .inputs { position: sticky; top: 84px; }
  .dock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .blob { animation: none; }
}
@media (forced-colors: active) {
  .glass { border: 1px solid CanvasText; }
  .chart .curve.ext { stroke-dasharray: 4 4; }
}
