:root {
  color-scheme: dark;
  --bg: #07101d;
  --bg-soft: #0b1728;
  --panel: rgba(13, 28, 47, 0.88);
  --panel-strong: #10223a;
  --line: rgba(143, 184, 220, 0.16);
  --line-strong: rgba(143, 184, 220, 0.3);
  --text: #edf6ff;
  --muted: #8ba5be;
  --dim: #58718a;
  --cyan: #5de4ff;
  --violet: #a78bfa;
  --green: #71f0ad;
  --orange: #ffb86b;
  --danger: #ff718d;
  --shadow: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 0; background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--text);
  background: linear-gradient(135deg, #07101d 0%, #091626 48%, #07101d 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(126, 184, 220, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 184, 220, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 88%);
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.42; }

.app-shell { width: min(1480px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}

.topbar-main { position: relative; }
/* The state pill carries a dot beside its words. `gap` rather than a margin on
   the dot so the two stay the right distance apart at any pill padding. */
.state-pill { gap: 6px; }

/* The environment-notice line. Empty and untranslated by default, so it must
   collapse completely: a fixed margin or min-height would leave a strip of dead
   space under the heading on every ordinary page load. */
.control-notice {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.control-notice:empty { margin: 0; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.brand-version { margin-left: 4px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }

.brand-lockup, .topbar-status, .site-nav, .panel-heading, .button-row, .result-footer, .progress-label, .legend, .hero-tags { display: flex; align-items: center; }
.site-nav { gap: 5px; margin-left: auto; margin-right: 18px; }
.site-nav a { padding: 7px 9px; color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-decoration: none; text-transform: uppercase; border-radius: 2px; }
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a.active { color: var(--cyan); background: rgba(93, 228, 255, 0.07); outline: none; }

.brand-lockup { gap: 12px; }
.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #05111d;
  font-size: 24px;
  font-weight: 800;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--cyan), #b6f4ff);
}
.brand-name { letter-spacing: 0.13em; font-size: 13px; font-weight: 800; }
.brand-name span, .brand-slashes { color: var(--cyan); }
.brand-wordmark { white-space: nowrap; }
.brand-suffix { margin-left: 0.2em; }
.brand-slashes { color: var(--cyan); }
.brand-subtitle { margin-top: 2px; color: var(--dim); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
.topbar-status { gap: 9px; color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status-dot.running { background: var(--cyan); animation: pulse 1.2s infinite; }
.status-dot.error { background: var(--danger); }
.version-badge { display: inline-flex; align-items: center; min-height: 32px; margin-left: 10px; padding: 8px 12px; color: var(--text); font-size: 11px; font-weight: 750; line-height: 1; letter-spacing: 0.06em; white-space: nowrap; background: rgba(13, 28, 47, 0.72); border: 1px solid var(--line-strong); border-radius: 2px; }
.version-badge .brand-wordmark { font-weight: 800; }
.language-select { width: auto; min-height: 30px; padding: 0 8px; color: var(--muted); font-size: 10px; border-radius: 2px; }

@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.75); } }

main { padding: 34px 0 30px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr); gap: 28px; align-items: center; }
.hero-copy { padding: 8px 0 18px 4px; }
.eyebrow { margin: 0 0 11px; color: var(--cyan); font-size: 10px; font-weight: 750; letter-spacing: 0.2em; text-transform: uppercase; }
h1 { max-width: 780px; margin: 0; font-size: clamp(38px, 5vw, 72px); line-height: 1; letter-spacing: -0.065em; }
h1 em { color: transparent; font-style: normal; background: linear-gradient(100deg, var(--cyan), #9d8bff 75%); -webkit-background-clip: text; background-clip: text; }
.hero-description { max-width: 650px; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.hero-tags { flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-tags span { padding: 7px 10px; color: var(--dim); font-size: 9px; font-weight: 800; letter-spacing: 0.14em; border: 1px solid var(--line); border-radius: 2px; }

.panel { min-width: 0; background: linear-gradient(145deg, rgba(16, 34, 57, 0.9), rgba(8, 20, 35, 0.88)); border: 1px solid var(--line); border-radius: 2px; box-shadow: var(--shadow); }
.control-card { padding: 18px; }
.panel-heading { justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.panel-heading.compact { margin-bottom: 13px; }
h2 { margin: 0; font-size: 18px; letter-spacing: -0.025em; }
.state-pill, .small-stat, .verification-badge { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 2px; font-size: 9px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.state-pill.idle { color: var(--cyan); background: rgba(93, 228, 255, 0.09); border: 1px solid rgba(93, 228, 255, 0.25); }
.state-pill.running { color: var(--green); background: rgba(113, 240, 173, 0.09); border: 1px solid rgba(113, 240, 173, 0.28); }
.state-pill.error { color: var(--danger); background: rgba(255, 113, 141, 0.09); border: 1px solid rgba(255, 113, 141, 0.28); }

.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full-width { grid-column: 1 / -1; }
.field > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.field small { min-height: 14px; color: var(--dim); font-size: 10px; }
.duration-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.duration-button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 54px; padding: 8px 10px; color: var(--muted); text-align: left; background: rgba(3, 12, 23, 0.48); border: 1px solid var(--line-strong); border-radius: 2px; transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease; }
.duration-button strong { color: var(--text); font-size: 12px; }
.duration-button small { margin-top: 4px; color: var(--dim); font-size: 9px; }
.duration-button:hover, .duration-button.active { background: rgba(93, 228, 255, 0.08); border-color: rgba(93, 228, 255, 0.55); transform: translateY(-1px); }
.duration-button.active strong { color: var(--cyan); }
.auto-scale-card { padding: 10px 12px; background: rgba(3, 12, 23, 0.34); border: 1px solid var(--line); border-radius: 2px; }
.auto-scale-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auto-scale-heading span { color: var(--muted); font-size: 11px; font-weight: 650; }
.auto-scale-heading strong { color: var(--cyan); font-size: 15px; }
.auto-scale-card p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.auto-scale-card small { display: block; margin-top: 5px; color: var(--dim); font-size: 9px; }
input, select { width: 100%; min-height: 42px; padding: 0 12px; color: var(--text); background: rgba(3, 12, 23, 0.58); border: 1px solid var(--line-strong); border-radius: 2px; outline: none; }
input:focus, select:focus { border-color: var(--cyan); outline: 2px solid rgba(93, 228, 255, 0.55); outline-offset: 2px; box-shadow: none; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 12px; color: var(--text); font-size: 12px; font-weight: 750; line-height: 1; text-decoration: none; white-space: nowrap; border: 1px solid var(--line-strong); border-radius: 2px; transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(93, 228, 255, 0.6); }
.button.primary { color: #04111c; background: linear-gradient(135deg, var(--cyan), #9ef2ff); border-color: transparent; }
.button.danger { color: #ffdce4; background: rgba(255, 113, 141, 0.1); border-color: rgba(255, 113, 141, 0.35); }
.button.ghost { color: var(--muted); background: rgba(255, 255, 255, 0.025); }
.button.small { min-height: 32px; padding: 0 10px; font-size: 10px; }
.button-icon { margin-right: 5px; font-size: 10px; }
.button-row { flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.progress-block { margin-top: 16px; }
.progress-label { justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.progress-label strong { color: var(--text); font-variant-numeric: tabular-nums; }
.progress-track { height: 7px; overflow: hidden; background: rgba(255, 255, 255, 0.07); border-radius: 2px; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--green)); transition: width 0.2s ease; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px; }
.metric-card { position: relative; min-height: 118px; padding: 15px 15px 14px; overflow: hidden; background: rgba(12, 28, 47, 0.75); border: 1px solid var(--line); border-radius: 2px; }
.metric-card::after { display: none; }
.accent-cyan.metric-card, .stats-kpi.accent-cyan { border-color: rgba(93, 228, 255, 0.58); background: linear-gradient(135deg, rgba(93, 228, 255, 0.11), rgba(12, 28, 47, 0.75) 68%); }
.accent-violet.metric-card, .stats-kpi.accent-violet { border-color: rgba(167, 139, 250, 0.58); background: linear-gradient(135deg, rgba(167, 139, 250, 0.11), rgba(12, 28, 47, 0.75) 68%); }
.accent-green.metric-card, .stats-kpi.accent-green { border-color: rgba(113, 240, 173, 0.58); background: linear-gradient(135deg, rgba(113, 240, 173, 0.10), rgba(12, 28, 47, 0.75) 68%); }
.accent-orange.metric-card, .stats-kpi.accent-orange { border-color: rgba(255, 184, 107, 0.58); background: linear-gradient(135deg, rgba(255, 184, 107, 0.10), rgba(12, 28, 47, 0.75) 68%); }
.metric-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.16em; }
.metric-value { position: relative; z-index: 1; margin-top: 13px; color: var(--text); font-size: clamp(25px, 3vw, 37px); font-weight: 780; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.metric-unit { position: relative; z-index: 1; margin-top: 2px; color: var(--dim); font-size: 10px; }
.metric-detail { position: relative; z-index: 1; margin-top: 11px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr); gap: 10px; margin-top: 10px; }
.chart-panel, .result-panel, .diagnostics-panel, .workers-panel { min-width: 0; padding: 16px; }
.legend { gap: 7px; color: var(--dim); font-size: 10px; }
.legend-swatch { width: 18px; height: 3px; border-radius: 2px; background: var(--cyan); }
.chart-wrap { position: relative; height: 220px; overflow: hidden; border: 1px solid rgba(143, 184, 220, 0.1); border-radius: 2px; background: rgba(3, 12, 23, 0.36); }
#rateChart { display: block; width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 11px; pointer-events: none; }
.telemetry-inline { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.telemetry-inline-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.telemetry-inline-heading .eyebrow { margin-bottom: 4px; }
.telemetry-inline-heading h3 { margin: 0; color: var(--text); font-size: 15px; }
.telemetry-inline .worker-table { max-height: 180px; }
.result-panel { scroll-margin-top: 24px; }
.result-panel:focus { outline: 1px solid var(--line-strong); outline-offset: 3px; }
.result-ready { margin: 0 0 12px; padding: 10px 12px; color: var(--cyan); font-size: 11px; line-height: 1.45; background: rgba(93, 228, 255, 0.06); border-left: 2px solid var(--cyan); border-radius: 2px; }
.result-ready[hidden] { display: none; }
.final-score-banner { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 13px; }
.final-score-banner > div { padding: 11px 12px; background: rgba(93, 228, 255, 0.06); border: 1px solid rgba(93, 228, 255, 0.18); border-radius: 2px; }
.final-score-banner span { display: block; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; }
.final-score-banner strong { display: block; margin-top: 6px; color: var(--text); font-size: 24px; letter-spacing: -0.05em; }
.verification-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -3px 0 12px; }
.verification-badge.pending { color: var(--dim); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.verification-badge.ok { color: var(--green); background: rgba(113, 240, 173, 0.09); border: 1px solid rgba(113, 240, 173, 0.28); }
.verification-badge.bad { color: var(--danger); background: rgba(255, 113, 141, 0.09); border: 1px solid rgba(255, 113, 141, 0.28); }
.checksum { overflow: hidden; color: var(--dim); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { padding: 5px 8px; color: var(--muted); font-size: 10px; background: transparent; border: 1px solid var(--line); border-radius: 2px; }
.icon-button:hover:not(:disabled) { color: var(--cyan); border-color: var(--cyan); }
.digits-output { height: 210px; margin: 0; padding: 11px; overflow: auto; color: #bdefff; font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(2, 9, 18, 0.62); border: 1px solid rgba(93, 228, 255, 0.13); border-radius: 2px; }
.result-footer { justify-content: space-between; gap: 10px; margin-top: 11px; color: var(--dim); font-size: 10px; }
.submit-panel { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.submit-copy strong { display: block; color: var(--text); font-size: 11px; }
.submit-copy p { margin: 4px 0 0; color: var(--dim); font-size: 9px; line-height: 1.45; }
.privacy-link { display: inline-block; margin-top: 6px; color: var(--cyan); font-size: 9px; text-decoration: none; }
.privacy-link:hover { text-decoration: underline; }
.consent-check { display: flex; grid-column: 1 / -1; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.consent-check input { width: 14px; min-height: 14px; accent-color: var(--cyan); }
.submit-status { grid-column: 1 / -1; color: var(--dim); font-size: 9px; }
.submit-link { grid-column: 1 / -1; color: var(--cyan); font-size: 10px; text-decoration: none; }
.submit-link:hover { text-decoration: underline; }

.bottom-grid { display: block; margin-top: 10px; }
.diagnostics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 2px; }
.diagnostics-grid > div { min-height: 62px; padding: 12px; background: rgba(8, 20, 35, 0.7); }
dt { color: var(--dim); font-size: 10px; }
dd { margin: 6px 0 0; color: var(--text); font-size: 12px; font-weight: 700; }
.diagnostics-note { margin: 12px 0 0; color: var(--dim); font-size: 10px; line-height: 1.55; }
.small-stat { color: var(--dim); }
.worker-table { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 2px; }
.empty-workers { padding: 34px 15px; color: var(--dim); font-size: 11px; text-align: center; }
.worker-row { display: grid; grid-template-columns: 54px 1fr 94px; align-items: center; gap: 10px; min-height: 45px; padding: 0 11px; border-bottom: 1px solid rgba(143, 184, 220, 0.08); }
.worker-row:last-child { border-bottom: 0; }
.worker-id { color: var(--cyan); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.worker-bar { height: 5px; overflow: hidden; background: rgba(255, 255, 255, 0.06); border-radius: 2px; }
.worker-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--cyan)); transition: width 0.25s ease; }
.worker-digits { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worker-digits.done { color: var(--green); }

.methodology { display: grid; grid-template-columns: 240px 1fr; gap: 30px; margin-top: 10px; padding: 16px; }
.methodology p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.methodology strong { color: var(--text); }
.privacy-panel { margin-top: 10px; padding: 16px; scroll-margin-top: 24px; }
.privacy-intro { max-width: 820px; }
.privacy-intro h2 { margin-top: 0; }
.privacy-intro > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.privacy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 18px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 2px; }
.privacy-item { padding: 15px; background: rgba(8, 20, 35, 0.7); }
.privacy-item h3 { margin: 0; color: var(--text); font-size: 12px; }
.privacy-item p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.privacy-item code { padding: 1px 4px; color: var(--cyan); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; background: rgba(93, 228, 255, 0.08); border-radius: 2px; }
.footer { display: flex; justify-content: space-between; gap: 15px; padding: 19px 3px 28px; color: var(--dim); font-size: 9px; letter-spacing: 0.11em; text-transform: uppercase; }
.footer > span:first-child { color: var(--text); font-weight: 800; }
.footer .footer-credit { color: var(--cyan); }
.footer .footer-legal { max-width: 440px; text-align: right; text-transform: none; letter-spacing: 0; line-height: 1.45; }
.footer .brand-slashes { color: var(--cyan); }

.page-main { padding: 32px 0 28px; }
.page-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.page-hero h1 { max-width: 820px; margin-top: 0; font-size: clamp(38px, 5vw, 68px); }
.page-hero > div:first-child > p:last-child { max-width: 670px; margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.page-actions { display: flex; align-items: center; gap: 12px; padding-bottom: 4px; }
.page-updated { color: var(--dim); font-size: 10px; }
.personal-rank { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 18px 20px; }
.personal-rank-icon { display: grid; width: 45px; height: 45px; flex: 0 0 auto; place-items: center; color: #04111c; font-size: 20px; font-weight: 850; background: linear-gradient(135deg, var(--cyan), var(--violet)); border-radius: 2px; }
.personal-rank-copy { min-width: 0; flex: 1; }
.personal-rank > .button { flex: 0 0 auto; align-self: center; }
.personal-rank-copy .eyebrow { margin-bottom: 5px; }
.personal-rank h2 { font-size: 17px; }
.muted-text { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.leaderboard-card { padding: 21px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.table-status { min-height: 18px; margin-bottom: 10px; color: var(--dim); font-size: 10px; }
.stats-status { margin: -10px 0 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 2px; }
.leaderboard-table { width: 100%; min-width: 1040px; border-collapse: collapse; font-size: 11px; }
.leaderboard-table th { padding: 11px 12px; color: var(--dim); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-align: left; text-transform: uppercase; background: rgba(3, 12, 23, 0.45); }
.leaderboard-table td { padding: 12px; color: var(--muted); border-top: 1px solid rgba(143, 184, 220, 0.08); white-space: nowrap; }
.leaderboard-table tbody tr:hover { background: rgba(93, 228, 255, 0.035); }
.rank-cell { color: var(--cyan) !important; font-weight: 800; }
.score-cell { color: var(--text) !important; font-weight: 800; }
.digits-cell { color: var(--green) !important; }
.hardware-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.country-name { display: inline-flex; align-items: center; white-space: nowrap; }
.country-flag-image, .country-flag-fallback { display: inline-flex; width: 28px; height: 21px; flex: 0 0 28px; align-items: center; justify-content: center; margin-right: 7px; overflow: hidden; vertical-align: middle; border: 1px solid rgba(237, 246, 255, 0.28); border-radius: 2px; background: rgba(3, 12, 23, 0.5); }
.country-flag-image { object-fit: cover; }
.country-flag-fallback { font-size: 15px; }
.empty-table { padding: 35px !important; color: var(--dim) !important; text-align: center; }
.table-footnote { margin: 13px 0 0; color: var(--dim); font-size: 9px; line-height: 1.5; }
.stats-hero { align-items: center; }
.period-tabs { display: flex; flex-wrap: wrap; gap: 5px; padding: 5px; background: rgba(3, 12, 23, 0.5); border: 1px solid var(--line); border-radius: 2px; }
.period-tab { min-height: 32px; padding: 0 10px; color: var(--dim); font-size: 10px; font-weight: 750; background: transparent; border: 1px solid transparent; border-radius: 2px; }
.period-tab:hover, .period-tab.active { color: var(--cyan); background: rgba(93, 228, 255, 0.08); border-color: rgba(93, 228, 255, 0.22); }
.stats-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 14px; }
.stats-kpi { min-height: 112px; padding: 17px; }
.stats-kpi > span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.stats-kpi strong { display: block; margin-top: 15px; color: var(--text); font-size: 28px; letter-spacing: -0.05em; }
.stats-kpi small { display: block; min-height: 13px; margin-top: 5px; color: var(--green); font-size: 9px; }
.stats-kpi small.negative { color: var(--danger); }
.stats-kpi small.positive { color: var(--green); }
.stats-main-grid, .stats-lower-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr); gap: 14px; }
.stats-lower-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; }
.activity-panel, .signal-panel, .mix-panel { min-width: 0; padding: 16px; }
.activity-chart-wrap { position: relative; height: 220px; overflow: hidden; border: 1px solid rgba(143, 184, 220, 0.1); border-radius: 2px; background: rgba(3, 12, 23, 0.36); }
#activityChart { display: block; width: 100%; height: 100%; }
.signal-list { display: grid; gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 2px; }
.signal-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 53px; padding: 11px 12px; background: rgba(8, 20, 35, 0.7); }
.signal-list span { color: var(--muted); font-size: 10px; }
.signal-list strong { color: var(--text); font-size: 12px; text-align: right; }
.mix-list { display: grid; gap: 13px; }
.mix-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; }
.mix-label { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mix-row strong { color: var(--text); font-size: 10px; }
.mix-track { grid-column: 1 / -1; height: 5px; overflow: hidden; background: rgba(255, 255, 255, 0.06); border-radius: 2px; }
.mix-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--cyan)); border-radius: inherit; }
.empty-mix { margin: 0; color: var(--dim); font-size: 10px; }
.stats-privacy { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 13px 16px; color: var(--muted); font-size: 10px; }
.privacy-icon { color: var(--cyan); font-size: 18px; }
@media (max-width: 1050px) {
  .hero-grid, .content-grid { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 0; }
  .control-card { max-width: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-main-grid, .stats-lower-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 620px) {
  .app-shell { width: min(100% - 24px, 1480px); }
  /* Brand and the language selector share the first row, with the selector hard
     right; the page links get a row of their own underneath.

     This was a flex column with `order`, which put each of the three on its own
     full-width line and left the selector stranded under the navigation. Order
     alone cannot place two siblings on one line while a third sits below them,
     so the row is expressed as a grid instead and the areas say which line each
     part belongs to.

     Scoped to `.topbar` and not to `.topbar-main`: only the benchmark page carries
     that second class, and scoping to it left the other two pages' headers on
     auto-placement, which put the selector back on the left. */
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "nav nav";
    align-items: center;
    gap: 10px 12px;
    padding: 12px 0;
  }
  .topbar .brand-lockup { grid-area: brand; }
  .topbar .header-actions { grid-area: actions; justify-self: end; }
  .topbar .site-nav { grid-area: nav; }
  .topbar-status, .header-actions { flex-wrap: wrap; }
  .language-select { min-height: 36px; font-size: 16px; }
  .site-nav { flex-wrap: wrap; margin: 0; }
  main { padding-top: 28px; }
  h1 { font-size: clamp(34px, 12vw, 56px); }
  .control-grid, .diagnostics-grid { grid-template-columns: 1fr; }
  .field.full-width { grid-column: auto; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 110px; padding: 12px; }
  .metric-value { font-size: 25px; }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .submit-panel { grid-template-columns: 1fr; }
  .methodology { grid-template-columns: 1fr; gap: 12px; }
  .privacy-grid { grid-template-columns: 1fr; }
  .page-hero { align-items: flex-start; flex-direction: column; }
  .page-actions { padding-bottom: 0; }
  .personal-rank { align-items: flex-start; flex-wrap: wrap; }
  .personal-rank .button { width: 100%; }
  .stats-kpi-grid { grid-template-columns: 1fr 1fr; }
  .period-tabs { width: 100%; }
  .period-tab { flex: 1; }
  .footer { flex-direction: column; }
  .version-badge { margin-left: 0; }
}

/* ---------------------------------------------------------------------------
   Board selectors

   The four boards are peers, so they read as one connected tab row instead of
   four separate boxes: no gaps, no per-button border, and the selected board
   marked by an underline. The 60s board is the reference every score is
   projected to, so it keeps a permanent gold accent, the same one the benchmark
   already uses for its highlighted values.
   --------------------------------------------------------------------------- */
.duration-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.duration-buttons .duration-button {
  flex: 1 1 auto;
  min-width: 128px;
  min-height: 0;
  padding: 9px 12px 10px;
  color: var(--dim);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transform: none;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.duration-buttons .duration-button strong { color: var(--muted); }
.duration-buttons .duration-button small { color: var(--dim); }
.duration-buttons .duration-button:hover {
  background: rgba(255, 255, 255, 0.03);
  border-bottom-color: var(--line-strong);
  transform: none;
}
.duration-buttons .duration-button:hover strong { color: var(--text); }

/* The reference board keeps its accent whether or not it is the selected one,
   so the board that matters is identifiable without reading the row. */
.duration-buttons .duration-button.board-reference {
  background: rgba(255, 184, 107, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 184, 107, 0.2);
}
.duration-buttons .duration-button.board-reference strong { color: var(--orange); }
.duration-buttons .duration-button.board-reference small { color: rgba(255, 184, 107, 0.72); }
.duration-buttons .duration-button.board-reference:hover { background: rgba(255, 184, 107, 0.09); }

.duration-buttons .duration-button.active,
.duration-buttons .duration-button[aria-pressed="true"] {
  background: rgba(93, 228, 255, 0.07);
  border-bottom-color: var(--cyan);
}
.duration-buttons .duration-button.active strong,
.duration-buttons .duration-button[aria-pressed="true"] strong { color: var(--cyan); }
.duration-buttons .duration-button.board-reference.active,
.duration-buttons .duration-button.board-reference[aria-pressed="true"] {
  background: rgba(255, 184, 107, 0.14);
  border-bottom-color: var(--orange);
}
.duration-buttons .duration-button.board-reference.active strong,
.duration-buttons .duration-button.board-reference[aria-pressed="true"] strong { color: var(--orange); }

/* ---------------------------------------------------------------------------
   Board selectors

   Four bordered options sharing a single row, in the order they matter:
   the 60s reference board first, the 60s enhanced board next, then the two
   quick checks. The reference board keeps a permanent gold accent, the same one
   the benchmark already uses for its highlighted values.

   The row is allowed to wrap. Four boxes on one line is right on a desktop and
   impossible on a phone: with `nowrap` and an equal basis the four were squeezed
   to about a hundred pixels each on a 420px screen, so the labels truncated to
   "5s quick che" and the sub-labels spilled sideways over their neighbours. A
   basis wide enough to read is what makes the row wrap by itself when there is no
   room, and it still fills a single row wherever four of them do fit. */
.duration-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.duration-buttons .duration-button {
  flex: 1 1 150px;
  min-width: 0;
  min-height: 0;
  padding: 8px 10px;
  color: var(--muted);
  text-align: left;
  background: rgba(3, 12, 23, 0.48);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  transform: none;
  transition: border-color .15s ease, background .15s ease;
}
/* The board name wraps rather than truncating. A clipped "5s quick che" does not
   say which board it is; a two-line "60s + worker finish" does. */
.duration-buttons .duration-button strong {
  color: var(--text);
  font-size: 12px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
}
/* The sub-label is the first thing that can be spared, so it truncates -- but on
   its own, inside its own box, rather than running out over the next one. */
.duration-buttons .duration-button small {
  display: block;
  max-width: 100%;
  color: var(--dim);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.duration-buttons .duration-button:hover {
  background: rgba(93, 228, 255, 0.08);
  border-color: rgba(93, 228, 255, 0.55);
  transform: none;
}

/* The reference board keeps its accent whether or not it is the selected one,
   so the board the others are measured against is identifiable at a glance. */
.duration-buttons .duration-button.board-reference {
  background: rgba(255, 184, 107, 0.06);
  border-color: rgba(255, 184, 107, 0.45);
}
.duration-buttons .duration-button.board-reference strong { color: var(--orange); }
.duration-buttons .duration-button.board-reference small { color: rgba(255, 184, 107, 0.75); }
.duration-buttons .duration-button.board-reference:hover { background: rgba(255, 184, 107, 0.12); }

.duration-buttons .duration-button.active,
.duration-buttons .duration-button[aria-pressed="true"] {
  background: rgba(93, 228, 255, 0.1);
  border-color: rgba(93, 228, 255, 0.6);
}
.duration-buttons .duration-button.active strong,
.duration-buttons .duration-button[aria-pressed="true"] strong { color: var(--cyan); }
.duration-buttons .duration-button.board-reference.active,
.duration-buttons .duration-button.board-reference[aria-pressed="true"] {
  background: rgba(255, 184, 107, 0.15);
  border-color: rgba(255, 184, 107, 0.75);
}
.duration-buttons .duration-button.board-reference.active strong,
.duration-buttons .duration-button.board-reference[aria-pressed="true"] strong { color: var(--orange); }

/* Tighter between the board options than the authored control spacing: these
   sit four to a row and the old 8px read as four separate groups. */
.duration-buttons { gap: 5px; }

/* One tile per board in the "Your place" panel. The panel spans the full column
   and held a single rank with most of it empty, so each board gets its own
   tile and the board on screen is the one outlined. */
.place-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
/* `display: grid` above is an author rule and beats the user agent's
   `[hidden] { display: none }`, so hiding the grid needs saying again here.
   Without it a visitor with no stored run — every first visit — is shown four
   empty bordered tiles under the invitation to submit one. */
.place-grid[hidden] { display: none; }
.place-tile {
  padding: 9px 11px;
  background: rgba(3, 12, 23, 0.42);
  border: 1px solid var(--line);
  border-radius: 2px;
  min-width: 0;
}
.place-tile.is-viewed {
  border-color: rgba(93, 228, 255, 0.55);
  background: rgba(93, 228, 255, 0.07);
}
.place-tile[data-board="60s"] { border-color: rgba(255, 184, 107, 0.32); }
.place-tile[data-board="60s"].is-viewed {
  border-color: rgba(255, 184, 107, 0.7);
  background: rgba(255, 184, 107, 0.09);
}
.place-tile-label {
  margin: 0 0 4px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.place-tile strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
}
.place-tile[data-board="60s"] strong { color: var(--orange); }
.place-tile.is-viewed strong { color: var(--cyan); }
.place-tile[data-board="60s"].is-viewed strong { color: var(--orange); }
.place-tile-note {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .place-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The tiles are buttons now, so the browser's own button styling has to be taken
   back off before they look like the rest of the panel. */
.place-tile {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.place-tile:hover { border-color: rgba(93, 228, 255, 0.4); }
.place-tile:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
/* A board this browser has no row on is dimmed rather than emphasised, so the eye
   goes to the places that are real instead of to an empty box. */
.place-tile:not(.is-joined) { opacity: 0.5; }
.place-tile:not(.is-joined):hover { opacity: 0.85; }
.place-tile:not(.is-joined) strong { color: var(--dim); }

/* The visitor's own row. Marked with a word as well as a tint, so it does not
   depend on telling two colours apart, and the tint is the same gold the 60s
   reference board already uses so the page has one accent rather than two. */
.leaderboard-table tbody tr.is-you > td {
  background: rgba(255, 184, 107, 0.07);
  border-top-color: rgba(255, 184, 107, 0.22);
}
.leaderboard-table tbody tr.is-you > td:first-child {
  box-shadow: inset 3px 0 0 var(--orange);
}
.you-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid rgba(255, 184, 107, 0.45);
  border-radius: 2px;
  color: var(--orange);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}
