/* Spotter page: demo phone, counter lab and case-study sections.
   Colours inside the phone are the app's own (src/ui/theme.ts). */

.theme-spotter {
  --good: #2BD576;
  --almost: #FFC53D;
  --bad: #FF4D4F;
  --app-bg: #0B0D10;
  --app-surface: #171A1F;
  --app-raised: #22262D;
  --app-border: #2E333B;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.theme-spotter .btn-light { background: #FFFFFF; color: #0B0D10; }
.theme-spotter .btn-light:hover { color: #0B0D10; }
.theme-spotter code { font-family: var(--mono); font-size: 0.86em; background: rgba(255, 255, 255, 0.06); border-radius: 6px; padding: 2px 6px; color: var(--ink); }
.theme-spotter ::selection { background: rgba(255, 90, 31, 0.35); }
html:has(body.theme-spotter) { scroll-behavior: smooth; }

/* ─── Hero ─────────────────────────────────────────────────────────────── */
.sp-hero h1 { font-size: 56px; }
.sp-hero > * { min-width: 0; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.sp-chips span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sp-hero-art { position: relative; width: 360px; height: 360px; }
.sp-hero-art img {
  position: absolute; left: 50px; top: 50px; width: 260px; height: 260px; border-radius: 58px;
  box-shadow: 0 30px 90px -20px rgba(255, 90, 31, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.sp-float {
  position: absolute; background: rgba(20, 23, 28, 0.94); border: 1px solid var(--line); border-radius: 14px;
  padding: 8px 12px; font-size: 13px; font-weight: 900; letter-spacing: 0.02em; white-space: nowrap;
  box-shadow: 0 16px 30px -16px rgba(0, 0, 0, 0.9); animation: sp-float 6s ease-in-out infinite;
}
.sp-float-a { top: 6px; right: 0; display: flex; align-items: baseline; gap: 6px; }
.sp-float-a b { font-size: 30px; line-height: 1; color: var(--ink); }
.sp-float-a span { font-size: 12px; color: var(--muted); font-weight: 600; }
.sp-float-b { bottom: 54px; left: -26px; color: var(--almost); animation-delay: -2s; }
.sp-float-c { bottom: 6px; right: -6px; color: var(--bad); animation-delay: -4s; }
.sp-float-d { top: 78px; left: -14px; color: var(--good); animation-delay: -1s; }
@keyframes sp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.sp-facts { background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 30px 32px; }
.sp-facts-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.sp-fact b { display: block; font-size: 32px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.sp-fact span { display: block; font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 4px; }

/* ─── Sections ─────────────────────────────────────────────────────────── */
.sp-section { max-width: 1120px; margin: 0 auto; padding: 88px 32px; }
.sp-band { background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 88px 32px; }
.sp-band-inner { max-width: 1120px; margin: 0 auto; }
.sp-head { max-width: 740px; margin-bottom: 36px; }
.sp-head h2 { font-size: 38px; line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 14px; }
.sp-head p { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0; }

/* ─── Demo layout ──────────────────────────────────────────────────────── */
.sp-demo { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.sp-demo > * { min-width: 0; }
.sp-stage {
  position: relative; height: 540px; overflow: hidden; border-radius: 24px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 90, 31, 0.10), rgba(0, 0, 0, 0) 62%), #0E1014;
  --sP: 0.55; --sL: 0.7;
}
.sp-stage-badges { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; z-index: 5; }
.sp-badge { font-size: 12px; font-weight: 700; color: var(--almost); background: rgba(255, 197, 61, 0.1); border: 1px solid rgba(255, 197, 61, 0.35); border-radius: 999px; padding: 5px 10px; }
.sp-badge[hidden] { display: none; }

.sp-speech {
  position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 8px); z-index: 5;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  background: rgba(20, 23, 28, 0.94); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
  font-size: 15px; font-weight: 700; white-space: nowrap; opacity: 0; transition: opacity 0.25s, transform 0.25s;
}
.sp-speech.on { opacity: 1; transform: translate(-50%, 0); }
.sp-speech-label { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
#speech-text { overflow: hidden; text-overflow: ellipsis; }
.sp-replay { position: absolute; right: 16px; bottom: 16px; z-index: 6; background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 10px 14px; font: 700 14px/1 inherit; font-family: inherit; cursor: pointer; }
.sp-replay[hidden] { display: none; }

/* Controls */
.sp-controls { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.sp-ctl {
  height: 40px; min-width: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.sp-ctl:hover { border-color: #3d434d; }
.sp-ctl:focus-visible, .sp-pill:focus-visible, .lab-moves button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-ctl-play { background: var(--accent); border-color: var(--accent); color: #fff; min-width: 48px; }
.sp-ctl[aria-pressed="true"] { border-color: var(--good); color: var(--good); }
.sp-pills { display: flex; gap: 6px; order: 10; flex: 1 1 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.sp-controls [data-sound] { margin-left: auto; }
.sp-pills::-webkit-scrollbar { display: none; }
.sp-pill {
  position: relative; overflow: hidden; flex-shrink: 0; white-space: nowrap; background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font: 600 13px/1 inherit; font-family: inherit; cursor: pointer;
}
.sp-pill.on { color: #fff; border-color: var(--accent); background: rgba(255, 90, 31, 0.12); }
.sp-pill.on::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: var(--p, 0%); background: var(--accent); }
.sp-pill.done { color: var(--ink); }

/* Caption */
.sp-caption { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.sp-caption-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.sp-caption h3 { font-size: 24px; font-weight: 800; margin: 8px 0 10px; letter-spacing: -0.01em; }
.sp-caption p { font-size: 15.5px; line-height: 1.6; color: var(--muted); margin: 0 0 14px; }
.sp-why { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.sp-why li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.sp-why li::before { content: ""; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.sp-live { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: #bfe9cf; background: #07090B; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; white-space: pre-wrap; }
.sp-live[hidden] { display: none; }
.sp-live b { color: var(--muted); font-weight: 600; }
.sp-code { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-code code { font-size: 12px; }

.sp-demo:fullscreen { background: var(--bg); padding: 28px; grid-template-columns: minmax(0, 1fr) 380px; align-content: center; }
.sp-demo:fullscreen .sp-stage { height: calc(100vh - 130px); }

/* ─── The phone ────────────────────────────────────────────────────────── */
.sp-device {
  position: absolute; left: 50%; top: 50%; width: 418px; height: 872px; margin: -436px 0 0 -209px;
  border-radius: 62px; background: #1a1d22;
  box-shadow: inset 0 0 0 2px #3a3f48, inset 0 0 0 7px #0d0f12, 0 50px 90px -30px rgba(0, 0, 0, 0.9), 0 0 140px -30px rgba(255, 90, 31, 0.35);
  transform: rotate(var(--rot)) scale(var(--s)); transition: transform 0.9s cubic-bezier(0.65, 0, 0.25, 1);
  --rot: 0deg; --s: var(--sP);
}
.sp-device[data-orient="landscape"] { --rot: -90deg; --s: var(--sL); }
.sp-device.no-anim, .sp-device.no-anim .sp-layer { transition: none; }
.sp-island { position: absolute; left: 149px; top: 25px; width: 120px; height: 34px; border-radius: 17px; background: #000; z-index: 20; }
.sp-screen {
  position: absolute; inset: 14px; border-radius: 48px; overflow: hidden; background: var(--app-bg);
  font-family: -apple-system, "SF Pro Text", BlinkMacSystemFont, system-ui, sans-serif; color: #F4F5F7;
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
}
.sp-layer { position: absolute; transition: opacity 0.35s ease 0.5s; }
.sp-portrait { left: 0; top: 0; width: 390px; height: 844px; }
.sp-landscape { left: -227px; top: 227px; width: 844px; height: 390px; transform: rotate(90deg); }
.sp-device[data-orient="portrait"] .sp-landscape,
.sp-device[data-orient="landscape"] .sp-portrait { opacity: 0; transition-delay: 0s; transition-duration: 0.25s; pointer-events: none; }

.sp-view { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0s 0.3s; overflow: hidden; }
.sp-view.on { opacity: 1; visibility: visible; transition: opacity 0.3s; }

.sp-tap { position: absolute; left: 0; top: 0; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); border: 2px solid rgba(255, 255, 255, 0.75); opacity: 0; pointer-events: none; z-index: 40; }
.sp-tap.on { animation: sp-tap 0.6s ease-out; }
@keyframes sp-tap { 0% { opacity: 0; transform: scale(0.5); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
.is-pressed { opacity: 0.8; }

/* Status bar, tab bar */
.sp-statusbar { position: absolute; left: 0; right: 0; top: 0; height: 54px; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 6px 34px 0 48px; background: linear-gradient(#0B0D10 60%, rgba(11, 13, 16, 0)); }
.sp-clock { font-size: 17px; font-weight: 600; }
.sp-status-icons { display: flex; gap: 6px; align-items: center; }
.sp-status-icons i { display: block; background: #F4F5F7; }
.sp-signal { width: 18px; height: 11px; clip-path: polygon(0 100%, 22% 100%, 22% 70%, 0 70%, 0 100%, 26% 100%, 26% 50%, 48% 50%, 48% 100%, 52% 100%, 52% 28%, 74% 28%, 74% 100%, 78% 100%, 78% 0, 100% 0, 100% 100%); }
.sp-wifi { width: 16px; height: 12px; clip-path: polygon(50% 100%, 0 30%, 15% 12%, 50% 0, 85% 12%, 100% 30%); }
.sp-battery { width: 25px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px rgba(244, 245, 247, 0.5); background: linear-gradient(90deg, #F4F5F7 78%, transparent 78%) !important; background-clip: content-box !important; padding: 2.5px; }

.sp-tabbar {
  position: absolute; left: 50%; bottom: 30px; width: 214px; height: 62px; margin-left: -107px; z-index: 10;
  display: flex; padding: 4px; border-radius: 31px; background: rgba(42, 46, 54, 0.78); border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
}
.sp-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 27px; color: #9AA1AC; font-size: 10px; font-weight: 600; transition: background 0.2s, color 0.2s; }
.sp-tab svg { width: 24px; height: 24px; fill: currentColor; stroke: currentColor; }
.sp-tab.on { background: rgba(255, 255, 255, 0.09); color: #FF5A1F; }
.sp-home-indicator { position: absolute; left: 50%; bottom: 8px; width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: #F4F5F7; z-index: 11; }

/* ─── App screens (sizes in points, from the React Native styles) ──────── */
.sp-scroll { position: absolute; left: 0; right: 0; top: 0; padding: 63px 16px 130px; display: flex; flex-direction: column; gap: 16px; transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1); }
#analytics-scroll { gap: 12px; }
.rn-title { font-size: 34px; line-height: 41px; font-weight: 800; }
#analytics-scroll .rn-title { margin-bottom: 4px; }
.rn-start { background: #FF5A1F; border-radius: 20px; padding: 22px 0; text-align: center; color: #fff; font-size: 20px; font-weight: 800; }
.rn-guide-link { margin-top: -6px; text-align: center; color: #9AA1AC; font-size: 15px; font-weight: 600; }
.rn-row { display: flex; gap: 10px; }
.rn-row-12 { gap: 12px; }
.rn-tile { flex: 1; min-width: 0; background: #171A1F; border-radius: 20px; padding: 14px; }
.rn-tile-value { font-size: 30px; line-height: 36px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rn-tile-value small { font-size: 15px; font-weight: 600; color: #9AA1AC; }
.rn-tile-label { font-size: 13px; color: #9AA1AC; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-section { font-size: 18px; font-weight: 700; }
.rn-section[hidden] { display: none; }
#an-day-title { margin-top: 8px; }
.rn-sets { display: flex; flex-direction: column; gap: 10px; }
.rn-set { display: flex; align-items: center; gap: 16px; background: #171A1F; border-radius: 16px; padding: 14px; transition: box-shadow 0.4s; }
.rn-set.new { box-shadow: inset 0 0 0 2px #2BD576; }
.rn-set-reps { color: #FF5A1F; font-size: 32px; font-weight: 800; min-width: 56px; font-variant-numeric: tabular-nums; }
.rn-set-time { font-size: 16px; font-weight: 600; }
.rn-set-meta { font-size: 13px; color: #9AA1AC; }
.rn-empty { font-size: 15px; color: #9AA1AC; }
.rn-card { background: #171A1F; border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.rn-card-head { display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: 800; }
.rn-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 400; color: #9AA1AC; }
.rn-legend > span { margin: 0 4px; }
.rn-legend i, .rn-cell { display: flex; align-items: center; justify-content: center; }
.rn-legend i { width: 16px; height: 16px; }
.rn-dot { border-radius: 50%; display: block; }
.rn-dot.glow { box-shadow: 0 0 4px 1px rgba(255, 90, 31, 0.85); }
.rn-year { display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 16px; }
.rn-month-label { font-size: 12px; font-weight: 700; color: #9AA1AC; margin: 0 0 4px 2px; }
.rn-week { display: flex; }
.rn-cell { border-radius: 50%; box-sizing: border-box; }
.rn-cell.today { border: 1.5px solid #9AA1AC; }
.rn-cell.selected { border: 1.5px solid #F4F5F7; }
.rn-hint { color: #9AA1AC; font-size: 15px; text-align: center; margin-top: 8px; }
.rn-hint[hidden] { display: none; }

/* Landscape screens: safe area is 59 pt left and right, 21 pt at the bottom. */
.rn-rotate { position: absolute; inset: 0; padding: 16px 75px 37px; display: flex; align-items: center; gap: 24px; }
.rn-illus { flex: 1; max-width: 360px; align-self: stretch; background: #171A1F; border-radius: 28px; display: flex; align-items: center; justify-content: center; padding: 8px; }
.rn-rotate-text { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.rn-h1 { font-size: 30px; line-height: 36px; font-weight: 800; }
.rn-body { font-size: 18px; line-height: 26px; opacity: 0.9; }
.rn-buttons { display: flex; gap: 12px; margin-top: 8px; }
.rn-button { flex: 1; background: #FF5A1F; border-radius: 20px; padding: 16px 0; text-align: center; color: #fff; font-size: 18px; font-weight: 800; }
.rn-secondary { background: #22262D; }
.rn-tall { padding: 18px 0; }

.rn-guide { position: absolute; inset: 0; padding: 0 59px 21px; display: flex; flex-direction: column; }
.rn-guide-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 24px 0; color: #9AA1AC; font-size: 15px; font-weight: 600; }
.rn-guide-top span:last-child { font-size: 16px; }
.rn-pager { flex: 1; min-height: 0; overflow: hidden; }
.rn-pages { display: flex; height: 100%; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.rn-page { flex: 0 0 100%; display: flex; align-items: center; gap: 24px; padding: 0 28px; }
.rn-illus-wide { flex: 1; max-width: 340px; align-self: center; height: 196px; padding: 8px 0; }
.rn-copy { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.rn-h2 { font-size: 26px; line-height: 31px; font-weight: 800; }
.rn-body2 { font-size: 17px; line-height: 24px; opacity: 0.9; }
.rn-dots { display: flex; justify-content: center; gap: 8px; padding: 8px 0; }
.rn-dots i { width: 8px; height: 8px; border-radius: 4px; background: #2E333B; transition: width 0.3s, background 0.3s; }
.rn-dots i.on { width: 24px; background: #FF5A1F; }
.rn-guide-buttons { padding: 0 24px 12px; margin-top: 0; }

/* Illustrations */
.ill { width: 100%; height: 100%; max-height: 196px; display: block; overflow: visible; }
.ill-floor { fill: #2E333B; }
.ill-phone { fill: #0B0D10; stroke: #9AA1AC; stroke-width: 3; }
.ill-phone-screen { fill: #171A1F; }
.ill-cam { fill: #2BD576; }
.ill-check { fill: #2BD576; font-size: 18px; font-weight: 800; text-anchor: middle; font-family: -apple-system, system-ui, sans-serif; }
.ill-arrow { fill: #FF5A1F; font-size: 56px; font-weight: 700; font-family: -apple-system, system-ui, sans-serif; }
.ill-db { fill: #9AA1AC; }
.ill-cone { fill: rgba(43, 213, 118, 0.12); }
.ill-ruler { fill: #FFC53D; }
.ill-ruler-label { fill: #FFC53D; font-size: 16px; font-weight: 800; text-anchor: end; font-family: -apple-system, system-ui, sans-serif; }
.ds-body, .ds-arm, .ds-head { fill: #FF5A1F; }
.wl-flash { fill: #2BD576; opacity: 0; }
.wl-count { fill: #F4F5F7; font-size: 52px; font-weight: 900; text-anchor: middle; font-family: -apple-system, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.wl-cue { fill: #2BD576; font-size: 14px; font-weight: 900; text-anchor: middle; font-family: -apple-system, system-ui, sans-serif; }
.wl-wave { fill: none; stroke: #FF5A1F; stroke-width: 4; stroke-linecap: round; opacity: 0.2; }

/* Camera: position check and counting */
.sp-camera { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rn-flash { position: absolute; inset: 0; background: #2BD576; opacity: 0; pointer-events: none; }
.rn-flash.on { opacity: 0.45; }
.rn-overlay { position: absolute; inset: 0; padding: 12px 71px 33px; display: none; }
.rn-overlay.on { display: flex; }
.rn-check { align-items: flex-end; gap: 16px; padding-right: 135px; }
.rn-progress { width: 104px; height: 104px; flex-shrink: 0; border-radius: 52px; background: rgba(11, 13, 16, 0.85); display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rn-check-panel { flex: 1; max-width: 620px; min-width: 0; background: rgba(11, 13, 16, 0.85); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.rn-big-hint { font-size: 28px; line-height: 33px; font-weight: 900; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rn-check-list { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 2px; }
.rn-check-list span { font-size: 15px; white-space: nowrap; color: #9AA1AC; transition: color 0.2s; }
.rn-check-list span.ok { color: #2BD576; }
.rn-debug { font-size: 11px; color: #9AA1AC; font-variant-numeric: tabular-nums; }
.rn-close { position: absolute; top: 12px; right: 71px; width: 48px; height: 48px; border-radius: 24px; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; font-size: 22px; }

.rn-counting { align-items: center; }
.rn-gauge-col { width: 80px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rn-gauge { position: relative; width: 28px; height: 190px; border-radius: 14px; background: #22262D; }
.rn-zone { position: absolute; left: 0; right: 0; opacity: 0.25; }
.rn-zone-almost { background: #FFC53D; }
.rn-zone-deep { background: #2BD576; bottom: 0; border-radius: 0 0 14px 14px; }
.rn-target { position: absolute; left: -6px; right: -6px; height: 2px; background: #2BD576; }
.rn-gauge-label { position: absolute; left: 36px; color: #2BD576; font-size: 14px; font-weight: 700; }
.rn-marker { position: absolute; left: -8px; right: -8px; height: 8px; border-radius: 4px; background: #2E333B; }
.rn-legs { border: 2px solid #2E333B; border-radius: 10px; padding: 3px 6px; background: rgba(11, 13, 16, 0.8); font-size: 12px; font-weight: 900; color: #9AA1AC; white-space: nowrap; }
.rn-center { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 8px; }
.rn-timer { background: rgba(11, 13, 16, 0.8); border-radius: 14px; padding: 4px 14px; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rn-count { font-size: 170px; line-height: 180px; font-weight: 900; font-variant-numeric: tabular-nums; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); }
.rn-cue { min-height: 76px; font-size: 31px; line-height: 38px; font-weight: 900; text-align: center; align-self: stretch; color: #9AA1AC; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8); }
.rn-side { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.rn-round { width: 60px; height: 60px; border-radius: 30px; background: rgba(34, 38, 45, 0.9); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; }
.rn-finish { background: #FF5A1F; border-radius: 16px; padding: 12px 16px; font-size: 17px; font-weight: 800; }

.rn-summary { position: absolute; inset: 0; background: #0B0D10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 75px 33px; }
.rn-summary-count { color: #FF5A1F; font-size: 110px; line-height: 112px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rn-summary-label { font-size: 22px; font-weight: 700; text-align: center; }
.rn-summary-time { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.rn-summary-meta { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.rn-summary-meta div { font-size: 16px; color: #9AA1AC; text-align: center; }
.rn-summary-buttons { display: flex; gap: 12px; margin-top: 18px; width: 100%; max-width: 480px; }
.rn-sum-button { padding: 16px 0; border-radius: 16px; font-weight: 700; }

/* ─── How it counts ────────────────────────────────────────────────────── */
.sp-pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sp-pipeline li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 6px; }
.sp-pipeline b { font-size: 16.5px; }
.sp-pipeline p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); flex: 1; }
.sp-pipeline code { align-self: flex-start; font-size: 12px; margin-top: 6px; color: var(--muted); }
.sp-pipe-num { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 90, 31, 0.14); color: var(--accent); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }

.sp-how-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; margin-top: 16px; }
.sp-machine-card, .sp-rules-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.sp-machine-card figcaption { font-size: 14px; line-height: 1.55; color: var(--muted); margin-top: 10px; }
.sp-machine { width: 100%; height: auto; display: block; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.m-node rect { fill: #171A1F; stroke: #353B45; stroke-width: 1.5; transition: fill 0.15s, stroke 0.15s; }
.m-node text { fill: var(--ink); font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-anchor: middle; }
.m-node.on rect { fill: rgba(255, 90, 31, 0.2); stroke: var(--accent); }
.m-node.lost.on rect { fill: rgba(255, 77, 79, 0.2); stroke: var(--bad); }
.m-edge { fill: none; stroke: #4a515c; stroke-width: 2; }
.m-edge-good { stroke: var(--good); }
.m-edge-warn { stroke: var(--almost); stroke-dasharray: 5 4; }
.m-arrowhead { fill: #6b7380; }
.m-label { fill: var(--muted); font-size: 11.5px; font-weight: 600; text-anchor: middle; }
.m-label-good { fill: var(--good); }
.m-label-warn { fill: var(--almost); }
.m-flash { animation: m-flash 0.7s ease-out; }
@keyframes m-flash { from { stroke-width: 5; } to { stroke-width: 2; } }

.sp-events { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.sp-event-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-event-chips code { font-size: 12px; }
.sp-events p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.sp-rules-card { overflow-x: auto; }
.sp-rules { width: 100%; border-collapse: collapse; font-size: 14px; }
.sp-rules th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.sp-rules td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.sp-rules td:first-child { font-weight: 600; white-space: nowrap; }
.sp-rules td:nth-child(2) { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.sp-rules td:nth-child(3) { color: var(--muted); }
.sp-rules tr:last-child td { border-bottom: 0; }
.sp-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* ─── Lab ──────────────────────────────────────────────────────────────── */
.lab { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.lab-view { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.lab-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lab-hud { position: absolute; inset: 0; pointer-events: none; font-family: -apple-system, system-ui, sans-serif; }
.lab-count { position: absolute; top: 4%; right: 4%; font-size: clamp(40px, 9vw, 92px); line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7); }
.lab-cue { position: absolute; left: 12%; right: 12%; bottom: 5%; text-align: center; font-size: clamp(14px, 2.2vw, 24px); font-weight: 900; color: #9AA1AC; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9); }
.lab-legs { position: absolute; top: 5%; left: 4%; border: 2px solid #2E333B; border-radius: 9px; padding: 2px 6px; background: rgba(11, 13, 16, 0.8); font-size: 12px; font-weight: 900; color: #9AA1AC; }
.lab-gauge { position: absolute; left: 4.5%; top: 20%; bottom: 20%; width: 16px; border-radius: 8px; background: #22262D; }
.lab-gauge-almost, .lab-gauge-deep { position: absolute; left: 0; right: 0; opacity: 0.25; }
.lab-gauge-almost { background: #FFC53D; }
.lab-gauge-deep { background: #2BD576; bottom: 0; border-radius: 0 0 8px 8px; }
.lab-gauge-line { position: absolute; left: -4px; right: -4px; height: 2px; background: #2BD576; }
.lab-gauge-marker { position: absolute; left: -5px; right: -5px; height: 6px; border-radius: 3px; background: #2E333B; }
.lab-flash { animation: lab-flash 0.25s steps(1, end); }
@keyframes lab-flash { 0% { box-shadow: inset 0 0 0 2000px rgba(43, 213, 118, 0.45); } 100% { box-shadow: none; } }

.lab-side { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.lab-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lab-stats div { background: #0E1014; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.lab-stats b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lab-stats span { font-size: 11.5px; color: var(--muted); }
.lab-group { display: flex; flex-direction: column; gap: 8px; }
.lab-label { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.lab-label b { color: var(--ink); font-family: var(--mono); letter-spacing: 0; }
.lab-moves { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-moves button { border: 1px solid var(--line); background: #0E1014; color: var(--ink); border-radius: 10px; padding: 8px 10px; font: 600 13px/1.1 inherit; font-family: inherit; cursor: pointer; }
.lab-moves button:hover { border-color: var(--accent); }
.lab-moves button:active { transform: translateY(1px); }
.lab-toggles { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.lab-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.lab-switch input, #lab-jitter { accent-color: var(--accent); }
#lab-jitter { width: 100%; }
.lab-toggles .sp-ctl { height: 32px; font-size: 13px; }
.lab-tips { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 0; }
.lab-tips b { color: var(--ink); }

.lab-chart-card, .lab-log-card { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; }
.lab-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.lab-key { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.lab-key i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-left: 8px; }
.k-raw { background: #6b7380; }
.k-ema { background: var(--accent); }
#lab-chart { width: 100%; height: 220px; display: block; }
.lab-log-actions { display: flex; gap: 8px; }
.lab-log-actions .sp-ctl { height: 32px; font-size: 13px; }
.lab-score { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.lab-score b { color: var(--ink); }
.lab-table-wrap { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.lab-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.lab-table th { position: sticky; top: 0; background: #1a1e24; text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; white-space: nowrap; }
.lab-table td { padding: 8px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.lab-table .o-rep { color: var(--good); font-weight: 700; }
.lab-table .o-shallow, .lab-table .o-tooFast { color: var(--almost); font-weight: 700; }
.lab-table .o-badForm, .lab-table .o-lost { color: var(--bad); font-weight: 700; }
.lab-table .m-yes { color: var(--good); }
.lab-table .m-no { color: var(--bad); font-weight: 800; }
.lab-table tr.fresh td { animation: lab-row 1.2s ease-out; }
@keyframes lab-row { from { background: rgba(255, 90, 31, 0.18); } to { background: transparent; } }

/* ─── Data & validation ────────────────────────────────────────────────── */
.sp-proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sp-proof-col { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; border-top: 3px solid var(--c); }
.sp-proof-ok { --c: var(--good); }
.sp-proof-warn { --c: var(--almost); }
.sp-proof-next { --c: var(--accent); }
.sp-proof-head { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.sp-proof-head span { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 900; color: #0B0D10; background: var(--c); }
.sp-proof-col ul, .sp-proof-col ol { margin: 0; padding-left: 18px; }
.sp-proof-col li { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin-bottom: 10px; }
.sp-proof-col li:last-child { margin-bottom: 0; }
.sp-proof-col li b { color: var(--ink); }
.sp-proof-col li::marker { color: var(--c); font-weight: 800; }

.sp-schema { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; margin-top: 16px; align-items: stretch; }
.sp-schema-text { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.sp-schema-text h3 { font-size: 21px; font-weight: 800; margin: 0 0 12px; }
.sp-schema-text p { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 12px; }
.sp-tag { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--almost); background: rgba(255, 197, 61, 0.1); border: 1px solid rgba(255, 197, 61, 0.35); border-radius: 999px; padding: 5px 10px; }
.sp-code-block { margin: 0; background: #07090B; border: 1px solid var(--line); border-radius: 20px; padding: 20px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: #c9ced6; }
.sp-code-block code { background: none; padding: 0; font-size: inherit; color: inherit; }
.sp-code-block .k { color: #8ab4f8; }
.sp-code-block .s { color: #8fe3b0; }
.sp-code-block .n { color: #FFC53D; }

/* ─── Build notes ──────────────────────────────────────────────────────── */
.sp-stories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sp-story { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.sp-story-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sp-story h3 { font-size: 17px; font-weight: 800; margin: 0; }
.sp-story-top code { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.sp-story p { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 10px 0 0; }

.sp-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.sp-work-text, .sp-timeline { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.sp-work h3 { font-size: 21px; font-weight: 800; margin: 0 0 12px; }
.sp-work-text p { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 12px; }
.sp-work-text ul { margin: 0; padding-left: 18px; }
.sp-work-text li { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin-bottom: 8px; }
.sp-work-text li::marker { color: var(--accent); }
.sp-work-text blockquote { margin: 18px 0 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); font-size: 16px; line-height: 1.5; font-weight: 600; font-style: italic; }
.sp-work-text blockquote cite { display: block; margin-top: 8px; font-size: 12px; font-style: normal; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.sp-timeline ol { list-style: none; margin: 0; padding: 0; }
.sp-timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.sp-timeline li:last-child { border-bottom: 0; }
.sp-timeline time { font-size: 13px; font-weight: 800; color: var(--accent); padding-top: 1px; }
.sp-timeline li span { font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.sp-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.sp-stack span { font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; background: rgba(255, 255, 255, 0.02); }

/* ─── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1020px) {
  .sp-demo { grid-template-columns: minmax(0, 1fr); }
  .sp-stories { grid-template-columns: repeat(2, 1fr); }
  .sp-proof { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sp-facts-inner { grid-template-columns: repeat(2, 1fr); }
  .sp-pipeline { grid-template-columns: repeat(2, 1fr); }
  .sp-how-grid, .lab, .sp-schema, .sp-work { grid-template-columns: minmax(0, 1fr); }
  .sp-hero-art { transform: scale(0.85); margin: -24px 0; }
}
@media (max-width: 600px) {
  .sp-hero h1 { font-size: 38px; }
  .sp-section { padding: 56px 16px; }
  .sp-band { padding: 56px 16px; }
  .sp-facts { padding: 24px 16px; }
  .sp-facts-inner { gap: 16px; }
  .sp-fact b { font-size: 26px; }
  .sp-head h2 { font-size: 28px; }
  .sp-head p { font-size: 16px; }
  .sp-stage { height: 420px; border-radius: 18px; }
  .sp-caption { padding: 20px; }
  .sp-pipeline, .sp-stories { grid-template-columns: minmax(0, 1fr); }
  .sp-hero-art { width: 300px; height: 300px; transform: none; margin: 0; }
  .sp-hero-art img { left: 45px; top: 45px; width: 210px; height: 210px; border-radius: 48px; }
  .sp-float-b { left: -6px; }
  .sp-float-d { left: 0; }
  .sp-float-c { right: 0; }
  .lab-stats { grid-template-columns: repeat(2, 1fr); }
  .lab-legs { font-size: 10px; }
  .sp-rules td:first-child { white-space: normal; }
  .sp-speech { font-size: 13px; padding: 7px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-float { animation: none; }
  html:has(body.theme-spotter) { scroll-behavior: auto; }
}
