/* Ten Seconds of Warning: the Investigations look. Dark, full screen and quiet, with the site's Inter and blue accent.
   Glass panels float over a 3D scene; one primary action at a time; large type for the story beats. */
:root {
  --bg: #050607; --ink: #f5f5f7; --ink2: #a1a1a6; --ink3: #6e6e73;
  --accent: #2997ff; --accent-2: #0a84ff; --amber: #ff9f0a; --red: #ff453a;
  --glass: rgb(20 22 26 / 0.62); --glass-2: rgb(30 32 38 / 0.72); --line: rgb(255 255 255 / 0.09); --line-2: rgb(255 255 255 / 0.16);
  --r: 20px; --ease: cubic-bezier(0.2, 0.8, 0.2, 1); --spring: cubic-bezier(0.25, 1.25, 0.4, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
body { font-family: Inter, system-ui, -apple-system, sans-serif; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#gl:active { cursor: grabbing; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgb(0 0 0 / 0.55) 100%); }

/* ---------- top bar ---------- */
.top { position: fixed; inset: 0 0 auto; z-index: 30; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 16px 20px; pointer-events: none; transition: opacity 0.6s var(--ease); }
.top > * { pointer-events: auto; }
.top.is-quiet { opacity: 0; }
.top.is-quiet > * { pointer-events: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.brand__mark { width: 22px; height: 22px; border-radius: 7px; background: conic-gradient(from 210deg, #2997ff, #64d2ff, #2997ff 60%, #0a84ff); box-shadow: 0 0 18px rgb(41 151 255 / 0.45); position: relative; }
.brand__mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid rgb(5 6 7 / 0.85); }
.thread { display: flex; justify-content: center; gap: 6px; max-width: 520px; width: 100%; justify-self: center; }
.thread__seg { position: relative; flex: 1; height: 26px; display: grid; align-items: center; background: none; border: 0; padding: 0; cursor: default; }
.thread__seg::before { content: ""; height: 3px; border-radius: 3px; background: rgb(255 255 255 / 0.14); }
.thread__fill { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px rgb(41 151 255 / 0.7); width: 0; transition: width 0.8s var(--ease); }
.thread__tip { position: absolute; top: 30px; left: 50%; transform: translate(-50%, -4px); white-space: nowrap; padding: 6px 10px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 12px; color: var(--ink2); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s var(--ease); }
.thread__tip b { color: var(--ink); font-weight: 600; }
.thread__seg:hover .thread__tip, .thread__seg:focus-visible .thread__tip { opacity: 1; transform: translate(-50%, 0); }
.top__tools { display: flex; gap: 8px; }
.ibtn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 40px; padding: 0 10px; justify-content: center; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); color: var(--ink); font-size: 14px; font-weight: 500; transition: background 0.2s, border-color 0.2s, transform 0.15s; }
.ibtn:hover { background: var(--glass-2); border-color: var(--line-2); }
.ibtn:active { transform: scale(0.96); }
.ibtn svg { width: 20px; height: 20px; fill: currentColor; }
.ibtn--nb { padding: 0 14px 0 12px; }
.nb-dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); transform: scale(0); transition: transform 0.4s var(--spring); }
.nb-dot.is-on { transform: scale(1); }

/* ---------- shared controls ---------- */
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.go { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; box-shadow: 0 8px 28px rgb(41 151 255 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.25); transition: transform 0.2s var(--spring), box-shadow 0.2s, opacity 0.25s, filter 0.2s; }
.go svg { width: 20px; height: 20px; fill: currentColor; transition: transform 0.25s var(--spring); }
.go:hover { filter: brightness(1.08); box-shadow: 0 10px 34px rgb(41 151 255 / 0.5), inset 0 1px 0 rgb(255 255 255 / 0.25); }
.go:hover svg { transform: translateX(3px); }
.go:active { transform: scale(0.97); }
.go:disabled { opacity: 0.32; box-shadow: none; cursor: not-allowed; filter: grayscale(0.4); }
.go--xl { height: 60px; padding: 0 34px; font-size: 18px; }
.ghost { height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: rgb(255 255 255 / 0.04); color: var(--ink); font-size: 15px; font-weight: 500; transition: background 0.2s, border-color 0.2s; }
.ghost:hover { background: rgb(255 255 255 / 0.09); }
.link { border: 0; background: none; padding: 6px 0; color: var(--ink2); font-size: 14px; font-weight: 500; }
.link:hover { color: var(--ink); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- title ---------- */
.title { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(24px, 8vw, 120px); pointer-events: none; background: linear-gradient(90deg, rgb(5 6 7 / 0.88) 0%, rgb(5 6 7 / 0.55) 40%, transparent 70%); }
.title > * { pointer-events: auto; }
.title h1 { margin: 0; padding-bottom: 0.12em; max-width: 100%; font-size: clamp(44px, min(8.2vw, 14vh), 112px); line-height: 0.95; font-weight: 700; letter-spacing: -0.045em; background: linear-gradient(180deg, #fff 30%, #a9c8ee 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.title__lead { max-width: 30em; margin: 26px 0 34px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--ink2); text-wrap: pretty; }
.title .go { align-self: flex-start; }
.title__meta { margin: 18px 0 0; font-size: 13px; color: var(--ink3); }
.title.is-out { opacity: 0; transform: translateY(-14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); pointer-events: none; }
.title.is-out > * { pointer-events: none; }

/* ---------- cold open ---------- */
.cold { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: radial-gradient(70% 60% at 50% 55%, #0c1626 0%, #000 70%); overflow: hidden; }
.cold__cap { z-index: 2; max-width: min(26em, 38vw) !important; position: absolute; top: clamp(70px, 14vh, 140px); left: clamp(24px, 8vw, 120px); max-width: 26em; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.35; font-weight: 500; letter-spacing: -0.02em; }
.cold__cap span { display: block; animation: rise 0.9s var(--ease) both; }
.cold__cap span + span { color: var(--ink2); }
.phone { position: relative; width: min(300px, 70vw); aspect-ratio: 300 / 620; border-radius: 52px; padding: 11px; background: linear-gradient(145deg, #2a2c31, #0f1013 45%, #1d1f23); box-shadow: 0 50px 120px rgb(0 0 0 / 0.7), 0 0 0 1px rgb(255 255 255 / 0.08), inset 0 0 0 1px rgb(255 255 255 / 0.06); transform: perspective(1400px) rotateY(-14deg) rotateX(6deg) translateX(14%); transition: transform 1.2s var(--ease), opacity 0.8s, filter 0.8s; opacity: 0; }
.cold.is-in .phone { opacity: 1; }
.phone__screen { position: relative; width: 100%; height: 100%; border-radius: 42px; overflow: hidden; background: radial-gradient(120% 70% at 20% 0%, #24406e 0%, transparent 60%), radial-gradient(100% 70% at 100% 100%, #3a1d4f 0%, transparent 60%), #07090f; }
.ph-island { position: absolute; top: 12px; left: 50%; width: 32%; height: 26px; margin-left: -16%; border-radius: 20px; background: #000; z-index: 3; }
.ph-lock { position: absolute; top: 12%; left: 0; right: 0; text-align: center; transition: filter 0.6s, opacity 0.6s; }
.ph-home { position: absolute; left: 50%; bottom: 8px; width: 36%; height: 5px; margin-left: -18%; border-radius: 3px; background: rgb(255 255 255 / 0.55); z-index: 3; }
.ph-day { display: block; font-size: 15px; font-weight: 600; color: rgb(255 255 255 / 0.8); }
.ph-time { display: block; margin-top: 2px; font-size: 76px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; color: rgb(255 255 255 / 0.92); }
.ph-alert { position: absolute; left: 10px; right: 10px; bottom: 98px; padding: 14px 14px 12px; border-radius: 22px; background: rgb(28 28 32 / 0.82); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid rgb(255 255 255 / 0.08); transform: translateY(160%) scale(0.96); opacity: 0; transition: transform 0.7s var(--spring), opacity 0.3s; z-index: 2; }
.ph-alert.is-on { transform: none; opacity: 1; }
.ph-alert__h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: rgb(255 255 255 / 0.6); }
.ph-alert__h small { margin-left: auto; font-size: 11px; font-weight: 500; text-transform: none; }
.ph-ico { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--red); color: #fff; font-size: 13px; font-weight: 800; }
.ph-alert b { display: block; margin-top: 8px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.ph-alert p { margin: 4px 0 0; font-size: 13px; line-height: 1.35; color: rgb(255 255 255 / 0.78); }
.ph-count { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; font-size: 13px; color: rgb(255 255 255 / 0.7); }
.ph-count strong { font-size: 40px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; }
.ph-bar { height: 4px; margin-top: 10px; border-radius: 4px; background: rgb(255 255 255 / 0.12); overflow: hidden; }
.ph-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--amber), var(--red)); transform-origin: left; }
.ph-shaking { position: absolute; left: 10px; right: 10px; bottom: 28px; padding: 14px; border-radius: 18px; text-align: center; font-weight: 700; font-size: 18px; background: rgb(255 69 58 / 0.9); opacity: 0; transform: translateY(20px); transition: opacity 0.3s, transform 0.4s var(--spring); }
.ph-shaking.is-on { opacity: 1; transform: none; }
.phone.is-buzz { animation: buzz 0.09s linear 8; }
.cold.is-quake .phone, .cold.is-quake .cold__cap { animation: quake 0.12s linear infinite; }
.cold.is-done .phone { transform: perspective(1400px) rotateY(-22deg) rotateX(10deg) translateX(46%) scale(0.86); filter: blur(2px) brightness(0.45); }
.cold.is-done .cold__cap { opacity: 0; transition: opacity 0.5s; }
.cold__q { position: absolute; left: clamp(24px, 8vw, 120px); top: 50%; transform: translateY(-50%); max-width: 34em; animation: rise 0.9s var(--ease) both; }
.cold__q h2 { margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.15; font-weight: 600; letter-spacing: -0.03em; color: var(--ink2); }
.cold__big { margin: 10px 0 30px; font-size: clamp(44px, 6vw, 84px); line-height: 1; font-weight: 700; letter-spacing: -0.045em; }
.skip { position: absolute; right: 24px; bottom: calc(24px + var(--safe-b)); height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: rgb(255 255 255 / 0.05); color: var(--ink2); font-size: 14px; font-weight: 500; }
.skip:hover { color: var(--ink); }
.flash { position: fixed; inset: 0; z-index: 25; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgb(255 159 10 / 0.18), transparent 60%); animation: flash 1.6s ease-out forwards; }

/* ---------- town labels ---------- */
.labels { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.town { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; pointer-events: auto; border: 0; padding: 0; background: none; transform: translate(-50%, -100%); opacity: 0; transition: opacity 0.5s var(--ease); will-change: transform; }
.town.is-on { opacity: 1; }
.town:not(.is-on) { pointer-events: none; visibility: hidden; }
.town__card { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: rgb(14 16 20 / 0.78); border: 1px solid var(--line-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); white-space: nowrap; transition: background 0.25s, border-color 0.25s, box-shadow 0.3s, transform 0.3s var(--spring); }
.town:hover .town__card { border-color: rgb(255 255 255 / 0.32); transform: translateY(-2px); }
.town__ic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgb(255 255 255 / 0.1); font-size: 11px; font-weight: 700; color: var(--ink2); }
.town__ic svg { width: 13px; height: 13px; fill: currentColor; }
.town__txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.town__txt b { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.town__txt small { font-size: 11px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.town__state { max-width: 0; overflow: hidden; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; transition: max-width 0.4s var(--ease), padding 0.3s; }
.town__stem { width: 1px; height: var(--stem, 18px); background: linear-gradient(var(--line-2), transparent); transition: opacity 0.2s; }
.town.is-pushed .town__stem { opacity: 0; }
.town[data-k="p"] .town__ic { background: rgb(100 181 255 / 0.2); color: #8cc8ff; }
.town[data-k="alert"] .town__card { background: rgb(10 70 140 / 0.82); border-color: rgb(41 151 255 / 0.9); box-shadow: 0 0 28px rgb(41 151 255 / 0.55); }
.town[data-k="alert"] .town__ic { background: var(--accent); color: #fff; }
.town[data-k="shake"] .town__card { background: rgb(95 55 5 / 0.85); border-color: rgb(255 159 10 / 0.9); box-shadow: 0 0 24px rgb(255 159 10 / 0.4); }
.town[data-k="shake"] .town__ic { background: var(--amber); color: #1d1300; }
.town[data-k="none"] .town__card { background: rgb(100 16 12 / 0.85); border-color: rgb(255 69 58 / 0.9); box-shadow: 0 0 24px rgb(255 69 58 / 0.45); }
.town[data-k="none"] .town__ic { background: var(--red); color: #fff; }
.town:not([data-k="calm"]) .town__state { max-width: 240px; padding-left: 4px; }
.town[data-k="shake"] .town__card, .town[data-k="none"] .town__card { animation: shiver 0.12s linear 10; }
.town.is-sel .town__card { outline: 2px solid #fff; outline-offset: 2px; }
.town.is-pick .town__card { outline: 2px solid var(--accent); outline-offset: 3px; }
.town.is-pick .town__card::after { content: "My pick"; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; }
.home-tag { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: rgb(41 151 255 / 0.18); color: #8cc8ff; font-size: 10px; font-weight: 700; }

/* ---------- the guide card ---------- */
.card { position: fixed; z-index: 15; left: 24px; bottom: calc(24px + var(--safe-b)); width: 400px; max-height: calc(100% - 110px); overflow: auto; overscroll-behavior: contain; padding: 26px 26px 22px; border-radius: 26px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(28px) saturate(1.5); -webkit-backdrop-filter: blur(28px) saturate(1.5); box-shadow: 0 24px 70px rgb(0 0 0 / 0.5), inset 0 1px 0 rgb(255 255 255 / 0.06); scrollbar-width: thin; }
.card.is-center { left: 50%; bottom: auto; top: 50%; width: min(620px, calc(100% - 32px)); transform: translate(-50%, -50%); padding: 34px 36px 28px; }
.card.is-wide { width: 460px; }
.card.is-swap { animation: cardIn 0.6s var(--ease) both; }
.card.is-center.is-swap { animation: cardInC 0.6s var(--ease) both; }
.card h2 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 650; letter-spacing: -0.03em; text-wrap: balance; }
.card.is-center h2 { font-size: 34px; }
.card p { margin: 10px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--ink2); text-wrap: pretty; }
.card p b { color: var(--ink); font-weight: 600; }
.card .q { margin: 22px 0 10px; font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.card__f { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.card__f .go { margin-left: auto; }
.card > * { animation: rise 0.6s var(--ease) both; }
.card > *:nth-child(2) { animation-delay: 0.05s; } .card > *:nth-child(3) { animation-delay: 0.1s; } .card > *:nth-child(4) { animation-delay: 0.15s; } .card > *:nth-child(5) { animation-delay: 0.2s; } .card > *:nth-child(n+6) { animation-delay: 0.25s; }
.hint-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 600; }
.hint { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: rgb(41 151 255 / 0.1); border: 1px solid rgb(41 151 255 / 0.25); font-size: 14px; line-height: 1.5; color: #cfe5ff; animation: rise 0.4s var(--ease) both; }

/* choices */
.choices { display: grid; gap: 8px; }
.choice { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: rgb(255 255 255 / 0.035); text-align: left; font-size: 15px; line-height: 1.4; color: var(--ink); transition: background 0.2s, border-color 0.2s, transform 0.2s var(--spring); }
.choice:hover { background: rgb(255 255 255 / 0.07); border-color: var(--line-2); }
.choice:active { transform: scale(0.99); }
.choice__k { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 700; color: var(--ink2); transition: all 0.2s; }
.choice[aria-pressed="true"], .choice[aria-checked="true"] { background: rgb(41 151 255 / 0.14); border-color: var(--accent); }
.choice[aria-pressed="true"] .choice__k, .choice[aria-checked="true"] .choice__k { background: var(--accent); border-color: var(--accent); color: #fff; }
.choices--2 { grid-template-columns: 1fr 1fr; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgb(255 255 255 / 0.04); font-size: 14px; font-weight: 500; line-height: 1.3; text-align: left; transition: all 0.2s var(--ease); }
.chip:hover { background: rgb(255 255 255 / 0.08); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip[aria-pressed="true"]::before { content: "✓ "; }
textarea.input { display: block; width: 100%; min-height: 60px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgb(0 0 0 / 0.3); font-size: 15px; line-height: 1.45; resize: vertical; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(41 151 255 / 0.2); }
textarea.input::placeholder { color: var(--ink3); }

/* confidence */
.conf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.conf button { height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgb(255 255 255 / 0.035); font-size: 14px; font-weight: 600; color: var(--ink2); transition: all 0.2s; }
.conf button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.conf__ends { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--ink3); }

/* the estimate slider */
.est { margin-top: 4px; }
.est__val { display: flex; align-items: baseline; gap: 6px; }
.est__val strong { font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; transition: color 0.2s; }
.est__val span { color: var(--ink2); font-size: 15px; }
.est.is-unset .est__val strong { color: var(--ink3); }
input[type="range"].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; margin: 6px 0 0; background: transparent; }
input[type="range"].slider::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) 0 var(--p, 0%), rgb(255 255 255 / 0.14) var(--p, 0%)); }
input[type="range"].slider::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) 0 var(--p, 0%), rgb(255 255 255 / 0.14) var(--p, 0%)); }
input[type="range"].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; box-shadow: 0 2px 12px rgb(0 0 0 / 0.5), 0 0 0 6px rgb(41 151 255 / 0.25); }
input[type="range"].slider::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 12px rgb(0 0 0 / 0.5), 0 0 0 6px rgb(41 151 255 / 0.25); }
.est__ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink3); }

/* results */
.bars { display: grid; gap: 12px; margin-top: 18px; }
.bar { display: grid; grid-template-columns: 118px 1fr 58px; align-items: center; gap: 10px; font-size: 14px; }
.bar__n { display: flex; flex-direction: column; line-height: 1.2; }
.bar__n b { font-weight: 600; } .bar__n small { color: var(--ink3); font-size: 12px; font-variant-numeric: tabular-nums; }
.bar__t { position: relative; height: 26px; border-radius: 8px; background: rgb(255 255 255 / 0.05); overflow: hidden; }
.bar__t i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; background: linear-gradient(90deg, #0a5cc2, var(--accent)); box-shadow: 0 0 16px rgb(41 151 255 / 0.5); width: 0; transition: width 1.1s var(--ease); }
.bar__t em { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; font-weight: 700; color: #ff8a80; letter-spacing: 0.02em; }
.bar__v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar.is-pick .bar__n b::after { content: "My pick"; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgb(41 151 255 / 0.2); color: #8cc8ff; font-size: 10px; font-weight: 700; vertical-align: 1px; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.cmp div { padding: 14px; border-radius: 16px; background: rgb(255 255 255 / 0.04); border: 1px solid var(--line); }
.cmp small { display: block; font-size: 12px; color: var(--ink3); }
.cmp strong { display: block; margin-top: 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cmp .is-real strong { color: var(--accent); }
.verdict { margin-top: 14px; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; background: rgb(255 255 255 / 0.04); border: 1px solid var(--line); color: var(--ink2); }
.verdict b { color: var(--ink); }

/* the driving question */
.card .dq { color: var(--ink); }
.dq { margin: 18px 0 0; padding: 22px 24px; border-radius: 20px; background: linear-gradient(135deg, rgb(41 151 255 / 0.2), rgb(41 151 255 / 0.04)); border: 1px solid rgb(41 151 255 / 0.4); font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -0.025em; }
.road { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 2px; counter-reset: ch; }
.road li { counter-increment: ch; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.road li::before { content: counter(ch); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 12px; font-weight: 700; color: var(--ink2); }
.road li.is-done::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: #fff; }
.road li small { color: var(--ink3); font-size: 12px; }

/* ---------- race controls ---------- */
.race { position: fixed; z-index: 14; right: 24px; bottom: calc(24px + var(--safe-b)); width: min(600px, calc(100% - 472px)); display: grid; gap: 10px; animation: rise 0.6s var(--ease) both; }
.seis { padding: 12px 14px 8px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); }
.seis__h { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--ink3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.seis__h b { color: var(--ink); text-transform: none; letter-spacing: -0.01em; font-size: 14px; }
.seis__d { margin-left: auto; text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
#seisCv { display: block; width: 100%; height: 120px; margin-top: 4px; }
.hud { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); }
.play { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 6px 22px rgb(41 151 255 / 0.45); transition: transform 0.2s var(--spring); }
.play:active { transform: scale(0.93); }
.play svg { width: 22px; height: 22px; fill: currentColor; }
.play .i-pause, .play.is-on .i-play { display: none; }
.play.is-on .i-pause { display: inline; }
.play.is-nudge { animation: nudge 1.6s ease-in-out infinite; }
.hud__time { flex: none; width: 66px; display: flex; align-items: baseline; gap: 3px; font-variant-numeric: tabular-nums; }
.hud__time b { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.hud__time span { font-size: 13px; color: var(--ink2); }
.scrub { position: relative; flex: 1; min-width: 80px; }
.scrub input { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 0; background: transparent; position: relative; z-index: 2; }
.scrub input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #fff 0 var(--p, 0%), rgb(255 255 255 / 0.16) var(--p, 0%)); }
.scrub input::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #fff 0 var(--p, 0%), rgb(255 255 255 / 0.16) var(--p, 0%)); }
.scrub input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 1px 8px rgb(0 0 0 / 0.5); }
.scrub input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.scrub__marks { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.scrub__marks i { position: absolute; top: 50%; width: 3px; height: 12px; margin: -6px 0 0 -1.5px; border-radius: 2px; }
.seg { flex: none; display: flex; padding: 3px; border-radius: 999px; background: rgb(255 255 255 / 0.06); }
.seg button { height: 32px; min-width: 40px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--ink2); font-size: 13px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: rgb(255 255 255 / 0.16); color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; padding: 0 6px; font-size: 12px; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 3px; }
.lg-p { background: #2997ff; box-shadow: 0 0 8px #2997ff; } .lg-s { background: var(--amber); box-shadow: 0 0 8px var(--amber); height: 5px !important; } .lg-a { background: #9fd0ff; }

.toast { position: fixed; z-index: 40; top: 76px; left: 50%; transform: translate(-50%, -12px); padding: 10px 18px 10px 14px; border-radius: 999px; background: rgb(10 70 140 / 0.9); border: 1px solid var(--accent); box-shadow: 0 10px 40px rgb(41 151 255 / 0.45); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.4s var(--spring); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgb(255 255 255 / 0.7); animation: ping 1.2s ease-out infinite; }
.toast.is-amber { background: rgb(95 55 5 / 0.92); border-color: var(--amber); box-shadow: 0 10px 40px rgb(255 159 10 / 0.35); }

/* ---------- notebook ---------- */
.nb { position: fixed; z-index: 50; top: 12px; right: 12px; bottom: 12px; width: min(400px, calc(100% - 24px)); display: flex; flex-direction: column; border-radius: 26px; background: rgb(18 20 24 / 0.86); border: 1px solid var(--line-2); backdrop-filter: blur(30px) saturate(1.5); -webkit-backdrop-filter: blur(30px) saturate(1.5); box-shadow: 0 30px 90px rgb(0 0 0 / 0.6); animation: slideIn 0.45s var(--ease) both; }
.nb__h { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px 22px; }
.nb__h h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.nb__body { flex: 1; overflow: auto; padding: 4px 22px 18px; }
.nb__item { padding: 14px 0; border-top: 1px solid var(--line); }
.nb__item small { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink3); }
.nb__item p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; }
.nb__item.is-empty p { color: var(--ink3); font-style: italic; }
.nb__f { display: flex; align-items: center; gap: 12px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.nb__note { font-size: 12px; color: var(--ink3); line-height: 1.4; }
.nojs { position: fixed; inset: 0; display: grid; place-items: center; }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
@keyframes cardInC { from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)) scale(0.98); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes buzz { 0% { translate: 0 0; } 25% { translate: -3px 1px; } 50% { translate: 3px -1px; } 75% { translate: -2px -1px; } 100% { translate: 0 0; } }
@keyframes quake { 0% { translate: 0 0; } 20% { translate: -9px 4px; } 40% { translate: 8px -6px; } 60% { translate: -6px -4px; } 80% { translate: 7px 5px; } 100% { translate: 0 0; } }
@keyframes shiver { 0%, 100% { translate: 0 0; } 33% { translate: -2px 1px; } 66% { translate: 2px -1px; } }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 10px rgb(255 255 255 / 0); } }
@keyframes nudge { 0%, 100% { box-shadow: 0 6px 22px rgb(41 151 255 / 0.45), 0 0 0 0 rgb(41 151 255 / 0.5); } 50% { box-shadow: 0 6px 22px rgb(41 151 255 / 0.45), 0 0 0 12px rgb(41 151 255 / 0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .race { width: calc(100% - 472px); }
  .legend { display: none; }
}
@media (max-width: 860px) {
  .top { grid-template-columns: auto 1fr auto; gap: 12px; padding: 12px 14px; }
  .brand__txt { display: none; }
  .ibtn--nb span { display: none; }
  .ibtn--nb { padding: 0 10px; }
  .thread__tip { display: none; }
  .card, .card.is-wide { left: 10px; right: 10px; width: auto; bottom: calc(10px + var(--safe-b)); max-height: 52%; padding: 20px 20px 18px; border-radius: 24px; }
  .card.is-center { left: 50%; right: auto; width: calc(100% - 20px); max-height: calc(100% - 90px); padding: 24px 22px 20px; }
  .card h2 { font-size: 22px; } .card.is-center h2 { font-size: 26px; }
  .card p { font-size: 15px; }
  .race { left: 10px; right: 10px; width: auto; bottom: calc(var(--card-h, 0px) + 18px + var(--safe-b)); gap: 8px; }
  #seisCv { height: 74px; }
  .seis { padding: 8px 12px 4px; border-radius: 16px; }
  .hud { gap: 8px; }
  .hud__time { width: 54px; } .hud__time b { font-size: 18px; }
  .seg button { min-width: 34px; padding: 0 6px; }
  .bar { grid-template-columns: 100px 1fr 50px; }
  .dq { font-size: 21px; }
  .choices--2 { grid-template-columns: 1fr; }
  .phone { transform: perspective(1400px) rotateY(-8deg) rotateX(4deg) translateY(8%); width: min(250px, 62vw); }
  .cold.is-done .phone { transform: perspective(1400px) rotateY(-10deg) translateY(55%) scale(0.8); }
  .cold__cap { top: 64px; left: 22px; right: 22px; font-size: 19px; }
  .cold__q { left: 22px; right: 22px; top: auto; bottom: calc(80px + var(--safe-b)); transform: none; }
  .title { background: linear-gradient(0deg, rgb(5 6 7 / 0.92) 0%, rgb(5 6 7 / 0.6) 55%, transparent 85%); justify-content: flex-end; padding-bottom: calc(60px + var(--safe-b)); }
  .town__card { padding: 4px 10px 4px 6px; }
  .town__txt small { display: none; }
  .town__state { font-size: 11px; }
  .card.is-compact > p:not(.eyebrow):not(:nth-of-type(2)) { display: none; } /* keep the first instruction, drop the rest */
  .card.is-compact > p:nth-of-type(2) { margin-top: 6px; font-size: 14px; line-height: 1.4; }
  .card.is-compact .card__f { margin-top: 12px; } .town__txt b { font-size: 12px; } .town__ic { width: 18px; height: 18px; }
}
@media (max-height: 700px) and (min-width: 861px) {
  #seisCv { height: 84px; }
  .card { max-height: calc(100% - 96px); }
}

/* ======================================================================
   Full investigation: settings, pins, panels, data tasks, modes, print
   ====================================================================== */
.c-p { color: #64b5ff; } .c-s { color: #ffb340; } .c-red { color: #ff7a5c; }
.dim { color: var(--ink3); font-weight: 500; }
.card p.small, p.small { font-size: 14px; }
.card h2:focus { outline: none; }
.h-big { font-size: 44px !important; letter-spacing: -0.04em !important; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.dot--p, .dot--k1 { background: #2997ff; box-shadow: 0 0 8px rgb(41 151 255 / 0.7); }
.dot--s, .dot--k3 { background: var(--amber); box-shadow: 0 0 8px rgb(255 159 10 / 0.6); }
.dot--k4 { background: #f2f4f8; }

/* the Aa button and the settings sheet */
.ibtn--aa { width: 44px; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.settings { position: fixed; z-index: 60; top: 66px; right: 16px; width: min(360px, calc(100% - 24px)); padding: 8px 8px 10px; border-radius: 24px; background: rgb(22 24 28 / 0.92); border: 1px solid var(--line-2); backdrop-filter: blur(30px) saturate(1.5); -webkit-backdrop-filter: blur(30px) saturate(1.5); box-shadow: 0 30px 90px rgb(0 0 0 / 0.6); animation: rise 0.3s var(--ease) both; }
.set__h { padding: 10px 14px 6px; }
.set__h h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.set__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px; border: 0; border-radius: 16px; background: none; text-align: left; font-size: 15px; }
.set__row b { font-weight: 600; }
.set__row small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink3); font-weight: 500; }
.set__tog:hover { background: rgb(255 255 255 / 0.05); }
.knob { flex: none; position: relative; width: 46px; height: 28px; border-radius: 999px; background: rgb(255 255 255 / 0.18); transition: background 0.2s; }
.knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / 0.4); transition: transform 0.25s var(--spring); }
.set__tog[aria-checked="true"] .knob { background: var(--accent); }
.set__tog[aria-checked="true"] .knob::after { transform: translateX(18px); }
.seg--set button { min-width: 0; padding: 0 12px; height: 34px; }
.seg--set button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* read aloud */
.spk { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 50%; background: rgb(255 255 255 / 0.06); color: var(--ink); z-index: 2; }
.spk svg { width: 20px; height: 20px; fill: currentColor; }
.spk.is-on { background: var(--accent); border-color: var(--accent); animation: nudge 1.4s ease-in-out infinite; }
.card:has(.spk) > .eyebrow { padding-right: 46px; }

/* feedback lines, choices marked right or wrong */
.fb { margin-top: 12px; font-size: 14.5px; line-height: 1.5; color: var(--ink2); min-height: 0; }
.fb:empty { margin: 0; }
.fb.is-right { padding: 12px 14px; border-radius: 14px; background: rgb(48 209 88 / 0.1); border: 1px solid rgb(48 209 88 / 0.35); color: #cdf5d6; }
.fb.is-wrong { padding: 12px 14px; border-radius: 14px; background: rgb(255 159 10 / 0.08); border: 1px solid rgb(255 159 10 / 0.35); color: #ffe2b8; }
.fb b { color: #fff; }
.choice.is-right { background: rgb(48 209 88 / 0.14) !important; border-color: #30d158 !important; }
.choice.is-right .choice__k { background: #30d158 !important; border-color: #30d158 !important; }
.choice.is-wrong { background: rgb(255 159 10 / 0.1) !important; border-color: var(--amber) !important; }
.choice:disabled { cursor: default; }
.qn { margin: 6px 0 0 !important; font-size: 12px !important; font-weight: 700; letter-spacing: 0.06em; color: var(--ink3) !important; }
.link--go { color: var(--accent); padding: 0 0 0 6px; font-weight: 600; }
.seg--wide { display: flex; width: 100%; margin-top: 8px; }
.seg--wide button { flex: 1; height: 42px; font-size: 14px; }
.seg--wide button[aria-pressed="true"], .seg--pick button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg--pick { display: inline-flex; }
.seg--pick button { height: 38px; padding: 0 14px; display: inline-flex; align-items: center; }
/* the selected wave takes its own color; its dot turns to the text color so it never vanishes into the button */
.seg--pick button:is([data-m="s"], [data-w="s"])[aria-pressed="true"] { background: var(--amber); color: #1d1300; }
.seg--pick button[aria-pressed="true"] .dot { background: currentColor; box-shadow: 0 0 0 2px rgb(255 255 255 / 0.25); }
.seg--pick button:is([data-m="s"], [data-w="s"])[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px rgb(0 0 0 / 0.15); }
.count { margin: 14px 0 0 !important; font-size: 15px !important; font-weight: 600; color: var(--ink) !important; font-variant-numeric: tabular-nums; }

/* number questions */
.numq { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgb(255 255 255 / 0.04); border: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.numq__in { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); }
.numq input, .dt input { width: 84px; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line-2); background: rgb(0 0 0 / 0.35); font-size: 18px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; outline: none; -moz-appearance: textfield; }
.numq input:focus, .dt input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(41 151 255 / 0.2); }
.dt input { width: 70px; height: 36px; font-size: 15px; }
.dt input.is-off { border-color: var(--red); box-shadow: 0 0 0 3px rgb(255 69 58 / 0.2); }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* readouts */
.ro { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.ro--2 { grid-template-columns: 1fr 1fr; }
.ro > div { padding: 10px; border-radius: 14px; background: rgb(255 255 255 / 0.04); border: 1px solid var(--line); }
.ro small { display: block; font-size: 11px; color: var(--ink3); line-height: 1.2; }
.ro b { display: block; margin-top: 4px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ro .is-blue b { color: var(--accent); } .ro .is-red b { color: #ff7a6e; }

/* data tables */
.dt { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.dt th { padding: 6px 6px; text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink3); border-bottom: 1px solid var(--line-2); }
.dt td { padding: 6px 6px; border-bottom: 1px solid var(--line); }
.dt .hl { color: #d0e6ff; background: rgb(41 151 255 / 0.1); }
.dt b.ok { color: #6fe38d; }
.dt--big { font-size: 16px; margin: 0; } .dt--big td { padding: 10px 8px; }

/* map pins */
.pin { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; transform: translate(-50%, -100%); will-change: transform; }
button.pin { pointer-events: auto; border: 0; background: none; padding: 0; cursor: grab; touch-action: none; }
button.pin.is-drag { cursor: grabbing; }
.pin--epi { padding: 5px 10px; border-radius: 999px; background: rgb(120 25 10 / 0.8); border: 1px solid rgb(255 90 60 / 0.8); color: #ffd9cf; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pin--st { flex-direction: row; gap: 6px; align-items: baseline; padding: 3px 9px; border-radius: 999px; background: rgb(14 16 20 / 0.82); border: 1px solid var(--line-2); white-space: nowrap; }
.pin--st b { font-size: 13px; } .pin--st small { font-size: 11px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.pin--k1 { border-color: rgb(41 151 255 / 0.8); } .pin--k3 { border-color: rgb(255 159 10 / 0.8); } .pin--k4 { border-color: rgb(255 255 255 / 0.8); }
.pin--test { transform: translate(-50%, -100%); }
.pin__lab { padding: 6px 12px; border-radius: 999px; background: #fff; color: #0b0d10; font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: 0 6px 20px rgb(0 0 0 / 0.5); }
.pin__dot { width: 4px; height: 26px; margin-top: -2px; border-radius: 2px; background: linear-gradient(#fff, rgb(255 255 255 / 0.2)); }
.pin--test:focus-visible .pin__lab, .pin--handle:focus-visible .pin__knob { outline: 3px solid var(--accent); outline-offset: 3px; }
.pin__knob { display: block; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 4px solid #2997ff; box-shadow: 0 4px 14px rgb(0 0 0 / 0.5); }
.pin--k3 .pin__knob { border-color: var(--amber); } .pin--k4 .pin__knob { border-color: #b8c2d6; }
.pin--guess .pin__x { display: block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; background: rgb(255 69 58 / 0.6); box-shadow: 0 0 18px rgb(255 69 58 / 0.8); }
.town::after { content: attr(data-pick); display: none; }

/* chapter panels: records, graphs, tables, particles */
.stage { position: fixed; inset: 0; z-index: 14; pointer-events: none; }
.panel { position: absolute; right: 24px; bottom: calc(24px + var(--safe-b)); width: min(640px, calc(100% - 476px)); padding: 16px; border-radius: 24px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(26px) saturate(1.4); -webkit-backdrop-filter: blur(26px) saturate(1.4); box-shadow: 0 24px 70px rgb(0 0 0 / 0.45); pointer-events: auto; animation: rise 0.6s var(--ease) both; max-height: calc(100% - 110px); overflow: auto; }
.rec__top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rec__step { font-size: 13px; font-weight: 600; color: var(--ink); }
.rec__tip { font-size: 13px; font-weight: 500; color: var(--ink); }
.rec__tip::first-letter { color: var(--accent); }
.seg--pick button[aria-pressed="false"]:hover { color: var(--ink); background: rgb(255 255 255 / 0.06); }
.rec__cv { display: block; width: 100%; height: 280px; margin-top: 10px; cursor: crosshair; touch-action: none; }
.gr__cv { display: block; width: 100%; height: 340px; touch-action: none; }
.gr__ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.gr__ctl label { display: grid; gap: 2px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.slider--p::-webkit-slider-runnable-track { background: linear-gradient(90deg, #2997ff 0 var(--p, 0%), rgb(255 255 255 / 0.14) var(--p, 0%)) !important; }
.slider--s::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--amber) 0 var(--p, 0%), rgb(255 255 255 / 0.14) var(--p, 0%)) !important; }
.mo__cv { display: block; width: 100%; height: 190px; margin-top: 12px; }
.mo__desc { margin: 10px 2px 0; font-size: 15px; line-height: 1.5; color: var(--ink2); }
.panel--table { width: min(560px, calc(100% - 476px)); }

/* chapter 5 */
.crit { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.crit li { position: relative; padding: 12px 14px 12px 44px; border-radius: 14px; background: rgb(41 151 255 / 0.08); border: 1px solid rgb(41 151 255 / 0.25); font-size: 15px; line-height: 1.4; }
.crit li::before { content: "✓"; position: absolute; left: 14px; top: 11px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.runbar { height: 8px; margin-top: 14px; border-radius: 8px; background: rgb(255 255 255 / 0.1); overflow: hidden; }
.runbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #0a5cc2, var(--accent)); transition: width 0.3s; }
.scs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 16px; }
.sc { padding: 14px; border-radius: 18px; background: rgb(255 255 255 / 0.04); border: 1px solid var(--line); }
.sc--best { border-color: rgb(41 151 255 / 0.5); background: rgb(41 151 255 / 0.07); }
.sc__h { margin: 0 0 8px !important; font-size: 12px !important; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink3) !important; }
.sc__m { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.sc__m small { font-size: 12.5px; color: var(--ink2); }
.sc__m b { font-size: 18px; font-variant-numeric: tabular-nums; }
.sc__m.is-ok b { color: #6fe38d; } .sc__m.is-no b { color: #ff8a80; }
.sc__v { margin: 8px 0 0 !important; font-size: 13px !important; font-weight: 700; color: #ff8a80 !important; }
.sc__v.is-ok { color: #6fe38d !important; }

/* chapter 6 */
.quote { margin: 10px 0 0; padding: 14px 16px; border-left: 3px solid var(--accent); border-radius: 0 14px 14px 0; background: rgb(41 151 255 / 0.07); font-size: 16px; line-height: 1.5; }
.quote--sm { font-size: 14.5px; color: var(--ink2); }
.dq--sm { font-size: 18px !important; padding: 14px 16px !important; margin-top: 12px !important; }
.input--tall { min-height: 110px; }
.starters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip--sm { padding: 7px 11px; font-size: 13px; color: var(--ink2); }
.evs { display: grid; gap: 8px; margin-top: 16px; }
.ev { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: rgb(255 255 255 / 0.035); text-align: left; font-size: 15px; line-height: 1.4; transition: all 0.2s var(--ease); }
.ev__k { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; border: 1.5px solid var(--line-2); }
.ev[aria-pressed="true"] { background: rgb(41 151 255 / 0.14); border-color: var(--accent); }
.ev[aria-pressed="true"] .ev__k { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='m9.5 16.2-4.2-4.2-1.4 1.4 5.6 5.6 11-11-1.4-1.4z'/%3E%3C/svg%3E") center/16px no-repeat; border-color: var(--accent); }
.letter { margin-top: 14px; padding: 18px 18px 8px; border-radius: 18px; background: rgb(255 255 255 / 0.035); border: 1px solid var(--line); }
.letter p { margin: 10px 0 0 !important; color: var(--ink) !important; font-size: 15px; }
.letter p:first-child { margin-top: 0 !important; }
.thread__seg { cursor: pointer; }
.thread__seg.is-cur::before { background: rgb(255 255 255 / 0.24); }
.no-gl #gl { display: none; }
body.no-gl { background: radial-gradient(80% 60% at 60% 40%, #0d1a2e, #050607); }

/* ---------- large text ---------- */
.is-large .card, .is-large .panel, .is-large .nb, .is-large .settings, .is-large .race, .is-large .cold__q, .is-large .toast { zoom: 1.16; }
.is-large .title__lead, .is-large .title .row, .is-large .title__meta { zoom: 1.16; }
.is-large .town, .is-large .pin { zoom: 1.12; }

/* ---------- high contrast ---------- */
.is-hc { --glass: #0b0c0e; --glass-2: #15171a; --line: rgb(255 255 255 / 0.4); --line-2: rgb(255 255 255 / 0.7); --ink2: #e6e6ea; --ink3: #c9c9cf; --accent: #4aa8ff; }
.is-hc .card, .is-hc .panel, .is-hc .nb, .is-hc .settings, .is-hc .seis, .is-hc .hud { backdrop-filter: none; -webkit-backdrop-filter: none; border-width: 2px; }
.is-hc .town__card, .is-hc .pin--st { background: #000; border-width: 2px; }
.is-hc .choice, .is-hc .chip, .is-hc .ev, .is-hc .numq { border-width: 2px; }
.is-hc a, .is-hc .link { text-decoration: underline; }
.is-hc .vignette { display: none; }

/* ---------- reduced motion ---------- */
.is-rm *, .is-rm *::before, .is-rm *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) { .panel { width: calc(100% - 476px); } }
@media (max-width: 860px) {
  .panel, .panel--table { left: 10px; right: 10px; width: auto; bottom: calc(var(--card-h, 0px) + 18px + var(--safe-b)); padding: 12px; border-radius: 20px; max-height: calc(100% - var(--card-h, 0px) - 90px); }
  .rec__cv { height: 200px; } .gr__cv { height: 220px; } .mo__cv { height: 120px; }
  .ro { grid-template-columns: 1fr 1fr; }
  .settings { top: 60px; right: 10px; }
  .h-big { font-size: 34px !important; }
  .spk { top: 10px; right: 10px; }
}

/* ---------- print the notebook ---------- */
@media print {
  @page { margin: 16mm; }
  html, body { overflow: visible !important; height: auto !important; background: #fff !important; color: #111 !important; }
  body > *:not(#notebook) { display: none !important; }
  #notebook { display: block !important; position: static !important; width: auto !important; background: #fff !important; border: 0 !important; box-shadow: none !important; backdrop-filter: none !important; color: #111; animation: none !important; }
  #notebook .nb__f, #notebook #nbClose { display: none !important; }
  .nb__body { overflow: visible !important; padding: 0 !important; }
  .nb__h h2 { font-size: 22pt; color: #0a5cc2; }
  .nb__ch { color: #0a5cc2; border-bottom: 2px solid #0a5cc2; break-after: avoid; }
  .nb__item { break-inside: avoid; border-top-color: #ddd !important; }
  .nb__item small { color: #555 !important; } .nb__item p { color: #111 !important; }
}
.nb__ch { margin: 20px 0 4px; padding-bottom: 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); border-bottom: 1px solid rgb(41 151 255 / 0.3); }
.nb__ch:first-child { margin-top: 6px; }
.nb__f { flex-direction: column; align-items: flex-start; }

/* town popover: a town's details, above its label on the map */
.tpop { position: absolute; left: 0; top: 0; z-index: 6; width: 236px; padding: 14px 16px 14px; border-radius: 18px; background: rgb(18 20 25 / 0.94); border: 1px solid var(--line-2); box-shadow: 0 18px 50px rgb(0 0 0 / 0.55); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); pointer-events: auto; opacity: 0; transition: opacity 0.2s var(--ease); will-change: transform; }
.tpop.is-on { opacity: 1; }
.tpop__h { display: flex; align-items: center; gap: 8px; margin: 0 28px 0 0; font-size: 16px; }
.tpop__h b { font-weight: 700; letter-spacing: -0.01em; }
.tpop .home-tag { margin: 8px 0 0; }
.tpop__p { margin: 8px 0 0; font-size: 14px; line-height: 1.4; color: var(--ink2); }
.tpop__dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.tpop__dl div { padding: 8px 10px; border-radius: 10px; background: rgb(255 255 255 / 0.05); }
.tpop__dl dt { font-size: 11px; color: var(--ink2); }
.tpop__dl dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tpop__x { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.07); color: inherit; cursor: pointer; }
.tpop__x svg { width: 16px; height: 16px; fill: currentColor; }
.tpop__x:hover { background: rgb(255 255 255 / 0.14); }
.is-hc .tpop { background: #000; border-color: #fff; }
.tpop::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -7px; width: 12px; height: 12px; margin-left: -6px; background: inherit; border: 1px solid var(--line-2); border-width: 0 1px 1px 0; transform: rotate(45deg); }
.tpop.is-below::after { bottom: auto; top: -7px; border-width: 1px 0 0 1px; }
.town.is-open .town__card { border-color: rgb(255 255 255 / 0.6); background: rgb(30 34 42 / 0.9); }

/* ---------- tools: Ruler and Calculator ---------- */
.ibtn--tool { padding: 0 14px 0 12px; }
.ibtn--tool.is-on { background: rgb(41 151 255 / 0.18); border-color: rgb(41 151 255 / 0.6); color: #cfe6ff; }
.ibtn--tool[hidden] { display: none; }
.top__tools.is-tools-off .ibtn--tool { display: none; }
@media (max-width: 1100px) { .ibtn--tool .ibtn__t { display: none; } .ibtn--tool { padding: 0; width: 40px; } }

.calc { position: fixed; z-index: 58; top: 66px; right: 16px; width: 300px; padding: 10px 12px 12px; border-radius: 24px; background: rgb(22 24 28 / 0.94); border: 1px solid var(--line-2); backdrop-filter: blur(30px) saturate(1.5); -webkit-backdrop-filter: blur(30px) saturate(1.5); box-shadow: 0 24px 70px rgb(0 0 0 / 0.55); animation: calcIn 0.24s var(--ease); }
@keyframes calcIn { from { opacity: 0; transform: translateY(-8px) scale(0.97); } }
.calc.is-bad { animation: shiver 0.25s linear 2; }
.calc__h { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 6px 6px; cursor: grab; touch-action: none; }
.calc__h h2 { margin: 0; font-size: 15px; font-weight: 600; }
.calc__x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.07); color: inherit; cursor: pointer; }
.calc__x svg { width: 16px; height: 16px; fill: currentColor; }
.calc__f { margin: 0 0 8px; padding: 8px 10px; border-radius: 12px; background: rgb(41 151 255 / 0.12); border: 1px solid rgb(41 151 255 / 0.3); font-size: 13px; line-height: 1.5; color: #dcecff; }
.calc__f small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #8cc8ff; }
.calc__vals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.calc__vals button { display: grid; gap: 1px; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line); background: rgb(255 255 255 / 0.04); color: inherit; cursor: pointer; text-align: center; }
.calc__vals button:hover { border-color: var(--line-2); background: rgb(255 255 255 / 0.08); }
.calc__vals b { font-size: 15px; font-variant-numeric: tabular-nums; }
.calc__vals small { font-size: 9.5px; line-height: 1.2; color: var(--ink2); }
.calc__disp { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: #0c0d10; border: 1px solid var(--line); }
.calc__in { width: 100%; border: 0; background: none; color: var(--ink); font-family: inherit; font-size: 22px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; text-align: right; outline: none; }
.calc__in::placeholder { color: var(--ink3); font-size: 15px; }
.calc__out { min-height: 20px; font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; color: #8cc8ff; }
.calc__keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.calc__keys button { height: 46px; border: 0; border-radius: 12px; background: rgb(255 255 255 / 0.07); color: var(--ink); font-size: 18px; font-weight: 500; cursor: pointer; transition: background 0.15s, transform 0.1s; }
.calc__keys button:hover { background: rgb(255 255 255 / 0.12); }
.calc__keys button:active { transform: scale(0.95); }
.calc__keys .is-op { background: rgb(41 151 255 / 0.18); color: #9fd0ff; }
.calc__keys .is-fn { color: var(--ink2); }
.calc__keys .is-eq { background: var(--accent); color: #fff; }
.calc__hist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.calc__hist button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 5px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink2); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.calc__hist button:hover { background: rgb(255 255 255 / 0.06); color: var(--ink); }
.calc__hist b { color: var(--ink); }
.calc__note { margin: 8px 4px 0; font-size: 11.5px; color: var(--ink3); }
@media (max-width: 860px) {
  .calc { top: 60px; left: 10px; right: 10px; width: auto; padding: 8px 10px 10px; }
  .calc__keys button { height: 42px; }
  .calc__hist, .calc__note { display: none; }
}
.is-hc .calc { background: #000; border-color: #fff; }

.pin--ruler .ruler__card { display: grid; gap: 3px; padding: 7px 11px; border-radius: 12px; background: rgb(14 16 20 / 0.9); border: 1px solid rgb(255 255 255 / 0.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); white-space: nowrap; font-size: 12px; color: var(--ink2); box-shadow: 0 8px 24px rgb(0 0 0 / 0.45); }
.pin--ruler .ruler__card b { font-size: 16px; color: #fff; font-variant-numeric: tabular-nums; }
.ruler__row { display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.ruler__row .dot { width: 7px; height: 7px; margin: 0 1px 0 4px; } .ruler__row .dot:first-child { margin-left: 0; }
.ruler__w { font-weight: 600; } .ruler__w.is-ok { color: #8cc8ff; } .ruler__w.is-no { color: #ff9a92; }
.ruler__stem { width: 2px; height: 16px; background: #fff; opacity: 0.8; }
.ruler__knob { width: 22px; height: 22px; margin-top: -2px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); box-shadow: 0 4px 14px rgb(0 0 0 / 0.5); cursor: grab; }
.pin--ruler.is-drag .ruler__knob { cursor: grabbing; transform: scale(1.1); }
.pin--ruler:focus-visible .ruler__knob { outline: 3px solid var(--accent); outline-offset: 3px; }
.ro .is-q { border-style: dashed; border-color: rgb(191 160 255 / 0.6); } .ro .is-q b { color: #cdb8ff; }
.hint.is-ok { border-color: rgb(48 209 88 / 0.45); background: rgb(48 209 88 / 0.08); color: #cdf5d6; }
.numq__go { display: flex; align-items: center; gap: 14px; margin-top: 10px; }

/* the race panel: seismogram or side view */
.seis__tabs { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: rgb(255 255 255 / 0.06); }
.seis__tabs button { height: 26px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--ink3); font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.seis__tabs button[aria-pressed="true"] { background: rgb(255 255 255 / 0.12); color: var(--ink); }
#sideCv { display: block; width: 100%; height: 150px; margin-top: 4px; }
#sideCv[hidden], #seisCv[hidden] { display: none; }
@media (max-width: 860px) { #sideCv { height: 104px; } }
/* towns react: the label jolts when the shaking arrives, a phone pops up when the alert lands */
.town__card { position: relative; }
.town__ph { position: absolute; top: -12px; right: -8px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--accent); box-shadow: 0 0 16px rgb(41 151 255 / 0.8); opacity: 0; transform: scale(0.4) translateY(6px); transition: opacity 0.2s, transform 0.35s var(--spring); pointer-events: none; }
.town__ph svg { width: 14px; height: 14px; fill: #fff; }
.town[data-k="alert"] .town__ph { opacity: 1; transform: none; animation: phbuzz 0.12s linear 6 0.3s; }
@keyframes phbuzz { 0%, 100% { translate: 0 0; } 25% { translate: -1.5px 0; } 75% { translate: 1.5px 0; } }
.town[data-k="shake"] .town__card, .town[data-k="none"] .town__card { animation: quake 0.11s linear 14; }
.is-rm .town[data-k] .town__card, .is-rm .town__ph { animation: none !important; }

/* In the real world */
.rw { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgb(41 151 255 / 0.12), rgb(41 151 255 / 0.04)); border: 1px solid rgb(41 151 255 / 0.3); }
.rw__k { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: #8cc8ff; }
.rw__k svg { width: 14px; height: 14px; fill: currentColor; }
.rw p:not(.rw__k) { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
.card.is-compact .rw { display: none; }
