/*
 * TokenScope stylesheet.
 * Art direction: precision instrument. Graphite ground, one electric cyan
 * signal accent, hairline rules, mono readouts, tabular numerals, register
 * mark corners. System fonts only, no external assets, no network requests.
 */

:root {
  --bg: #0b0e12;
  --bg-raise: #0d1016;
  --panel: #10141b;
  --panel-2: #151b24;
  --well: #0a0d12;
  --line: #252c36;
  --line-soft: #1a2027;
  --ink: #e9edf2;
  --muted: #9aa4b1;
  --faint: #7d8794;
  --accent: #3ad6e8;
  --accent-bright: #6ee6f2;
  --accent-dark: #062229;
  --accent-dim: rgba(58, 214, 232, 0.08);
  --accent-line: rgba(58, 214, 232, 0.4);
  --ok: #55d98a;
  --warn: #e6b450;
  --danger: #ef7b7b;
  --radius: 3px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-data: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(58, 214, 232, 0.28);
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

h1, h2, h3, h4 {
  margin: 0;
}

/* ---------- utilities ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-dark);
  font: 600 0.85rem var(--font-data);
  text-decoration: none;
  transition: top 0.15s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

.noscript-note {
  margin: 16px auto;
  max-width: 720px;
  padding: 14px 18px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  color: var(--warn);
  font: 500 0.85rem var(--font-data);
}

/* ---------- register mark corners ---------- */

.corner-ticks {
  position: relative;
}

.corner-ticks::before,
.corner-ticks::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.corner-ticks::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--accent-line);
  border-left: 2px solid var(--accent-line);
}

.corner-ticks::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--accent-line);
  border-right: 2px solid var(--accent-line);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 8px clamp(16px, 4vw, 36px);
  background: rgba(11, 14, 18, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.brand-mark {
  flex: none;
  border-radius: 6px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font: 650 1rem/1.2 var(--font-ui);
  letter-spacing: -0.01em;
}

.brand-sub {
  font: 500 0.68rem/1.2 var(--font-data);
  color: var(--faint);
  margin-top: 2px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 500 0.72rem var(--font-data);
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: led 2.6s ease-in-out infinite;
}

@keyframes led {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- hero ---------- */

main {
  padding: 0 clamp(16px, 4vw, 36px);
}

.hero {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) 0 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 94%;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 94%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 94%);
  pointer-events: none;
}

.hero-copy,
.readout-rail {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 720px;
}

.hero h1 {
  font: 600 clamp(1.8rem, 5vw, 3.1rem)/1.12 var(--font-data);
  letter-spacing: -0.03em;
  max-width: 17ch;
  margin: 0 0 20px;
}

.accent-word {
  color: var(--accent);
}

.lede {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 22px;
}

.spec-row {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.spec-row li {
  font: 500 0.76rem var(--font-data);
  color: var(--faint);
  padding: 0 14px;
  border-left: 1px solid var(--line);
}

.spec-row li:first-child {
  padding-left: 0;
  border-left: none;
}

.spec-row li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: 2px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- bench readout rail ---------- */

.readout-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(13, 17, 23, 0.88);
  margin-top: clamp(36px, 6vw, 64px);
}

.readout {
  padding: 20px 22px 22px;
  border-left: 1px solid var(--line-soft);
  min-width: 0;
}

.readout:first-child {
  border-left: none;
}

.readout-label {
  display: block;
  font: 500 0.72rem var(--font-data);
  color: var(--muted);
  margin-bottom: 12px;
}

.readout-value {
  display: block;
  font: 600 clamp(1.7rem, 3.4vw, 2.6rem)/1 var(--font-data);
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.readout:first-child .readout-value {
  color: var(--accent);
}

.readout-sub {
  display: block;
  margin-top: 10px;
  font: 500 0.72rem var(--font-data);
  color: var(--faint);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 2px;
  border: 1px solid transparent;
  font: 600 0.85rem var(--font-data);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.btn-primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-ghost:active {
  transform: translateY(1px);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

/* ---------- tab rail ---------- */

.tabs-wrap {
  position: sticky;
  top: 58px;
  z-index: 30;
  margin-top: 28px;
  background: rgba(11, 14, 18, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
}

.tabs {
  position: relative;
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 8px;
}

.tab {
  appearance: none;
  background: none;
  border: none;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 13px 18px 14px;
  font: 500 0.86rem var(--font-data);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 150ms var(--ease);
}

.tab:hover {
  color: var(--ink);
}

.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tab[aria-selected="true"] {
  color: var(--ink);
}

.tab-index {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.tab[aria-selected="true"] .tab-index {
  color: var(--accent);
}

.tab-indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: transform 220ms var(--ease), width 220ms var(--ease);
}

/* ---------- panels and modules ---------- */

.panel {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 30px;
  animation: panel-in 240ms var(--ease) both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel[hidden] {
  display: none;
}

.panel-head {
  max-width: 760px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h2 {
  font: 600 clamp(1.3rem, 2.6vw, 1.7rem)/1.2 var(--font-data);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.panel-head p {
  color: var(--muted);
  margin: 0;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mod {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}

.mod-wide {
  grid-column: 1 / -1;
}

.mod h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 500 0.92rem var(--font-data);
  margin: 0 0 14px;
}

.mod h3::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.fixture-note {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font: 600 0.68rem var(--font-data);
  letter-spacing: 0.02em;
}

.hint {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--faint);
}

/* ---------- fields ---------- */

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  min-width: 0;
}

.field label {
  font: 500 0.74rem var(--font-data);
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--ink);
  font: 500 0.9rem var(--font-data);
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.field input:focus-visible,
.field select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* ---------- tables ---------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
}

.table-tall {
  max-height: 420px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.data-table caption {
  text-align: left;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 10px 12px;
  font: 500 0.7rem var(--font-data);
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  font: 500 0.82rem var(--font-data);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.04);
}

.data-table .num-input {
  width: 92px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 500 0.82rem var(--font-data);
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}

.data-table .num-input:hover {
  border-bottom-color: var(--muted);
}

.data-table .num-input:focus-visible {
  outline: none;
  border-bottom-color: var(--accent);
  background: var(--well);
  box-shadow: 0 1px 0 0 var(--accent);
}

/* ---------- channel rack (planner estimates) ---------- */

.channel-rack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.channel {
  background: var(--panel);
  padding: 16px;
  min-width: 0;
}

.channel.is-best {
  background: var(--panel-2);
  box-shadow: inset 2px 0 0 var(--accent);
}

.channel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.channel-name {
  font: 650 0.95rem var(--font-ui);
  letter-spacing: -0.01em;
}

.tier-ticks {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
}

.tier-ticks .tick {
  width: 3px;
  height: 10px;
  background: var(--line);
}

.tier-ticks .tick.is-on {
  background: var(--accent);
}

.channel-cost {
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.channel-cost-value {
  font: 600 1.7rem/1 var(--font-data);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.channel.is-best .channel-cost-value {
  color: var(--accent);
}

.channel-cost-unit {
  font-size: 0.75rem;
  color: var(--faint);
}

.channel-specs {
  margin: 0;
}

.channel-specs > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}

.channel-specs dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.channel-specs dd {
  margin: 0;
  font: 500 0.82rem var(--font-data);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.channel-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
}

.flag {
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid var(--line);
  font: 600 0.68rem var(--font-data);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.flag-accent {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  color: var(--accent);
}

/* ---------- readout wells (stat blocks) ---------- */

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.stat {
  background: var(--well);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 12px 14px;
  min-width: 0;
}

.stat-label {
  display: block;
  font: 500 0.7rem var(--font-data);
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-value {
  display: block;
  font: 600 1.3rem/1.15 var(--font-data);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.stat-hero .stat-value {
  font-size: 2.1rem;
  color: var(--accent);
}

/* ---------- worked derivation (memory fit) ---------- */

.proof {
  list-style: none;
  margin: 0;
  padding: 0;
}

.proof-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 12px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line-soft);
}

.proof-body {
  min-width: 0;
}

.proof-final {
  border-bottom: none;
  border-top: 1px solid var(--line);
  background: var(--well);
  border-radius: 2px;
}

.proof-index {
  grid-row: 1 / span 2;
  font: 500 0.7rem/1.9 var(--font-data);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.proof-label {
  margin: 0;
  font: 600 0.88rem/1.4 var(--font-ui);
}

.proof-expr {
  margin: 2px 0 0;
  font: 500 0.8rem/1.6 var(--font-data);
  overflow-wrap: anywhere;
}

.proof-lhs {
  color: var(--muted);
}

.proof-eq {
  color: var(--faint);
  padding: 0 6px;
}

.proof-result {
  color: var(--ink);
  font-weight: 600;
}

.proof-final .proof-result {
  color: var(--accent);
}

/* ---------- verdict ---------- */

.verdict {
  margin: 16px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--well);
  color: var(--muted);
  font: 500 0.86rem/1.5 var(--font-data);
}

.verdict::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  margin-right: 10px;
  animation: led 2.6s ease-in-out infinite;
}

.verdict.is-ok {
  border-color: rgba(85, 217, 138, 0.35);
  color: var(--ok);
}

.verdict.is-ok::before {
  background: var(--ok);
}

.verdict.is-over {
  border-color: rgba(239, 123, 123, 0.35);
  color: var(--danger);
}

.verdict.is-over::before {
  background: var(--danger);
}

.verdict.is-tight {
  border-color: rgba(230, 180, 80, 0.35);
  color: var(--warn);
}

.verdict.is-tight::before {
  background: var(--warn);
}

/* ---------- batch simulator chart ---------- */

#sim-chart {
  display: block;
  width: 100%;
  height: 300px;
  background: var(--well);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  cursor: crosshair;
}

#sim-chart:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.crosshair-readout {
  margin: 10px 0 0;
  font: 500 0.76rem/1.5 var(--font-data);
  color: var(--muted);
  min-height: 1.2em;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 10px 0 0;
  font: 500 0.76rem var(--font-data);
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px solid var(--accent);
}

.swatch-p95 {
  border-top-style: dashed;
  border-top-color: rgba(233, 237, 242, 0.85);
}

/* ---------- route builder ---------- */

.rule-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.rule-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1.1fr 0.9fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--well);
}

.rule-row .field {
  margin: 0;
}

.log-summary {
  margin-top: 14px;
  font: 500 0.78rem/1.7 var(--font-data);
  color: var(--muted);
}

.log-summary p {
  margin: 0 0 6px;
}

.result-ok {
  color: var(--ok);
  font-weight: 600;
}

.result-miss {
  color: var(--danger);
  font-weight: 600;
}

.route-arrow {
  color: var(--faint);
  padding: 0 2px;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 72px;
  padding: 36px clamp(16px, 4vw, 36px) 56px;
  background: var(--bg-raise);
}

#footer-note {
  max-width: 1200px;
  margin: 0 auto;
}

#footer-note p {
  max-width: 76ch;
  margin: 0 0 8px;
  font: 500 0.78rem/1.75 var(--font-data);
  color: var(--faint);
}

#footer-note .footer-lead {
  color: var(--muted);
}

#footer-note a {
  color: var(--accent);
}

/* ---------- guided tour ---------- */

#tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

#tour-overlay:not(.open) {
  display: none;
}

#tour-spotlight {
  position: fixed;
  border-radius: 6px;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 200vmax rgba(5, 7, 10, 0.8);
  transition: top 0.2s var(--ease), left 0.2s var(--ease), width 0.2s var(--ease), height 0.2s var(--ease);
}

#tour-card {
  position: fixed;
  pointer-events: auto;
  width: min(380px, calc(100vw - 32px));
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 64px rgba(2, 4, 8, 0.7);
  transition: top 0.2s var(--ease), left 0.2s var(--ease);
}

#tour-card.is-centered {
  transform: translate(-50%, -50%);
}

.tour-progress {
  margin: 0 0 6px;
  font: 600 0.7rem var(--font-data);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

#tour-title {
  font: 650 1rem/1.3 var(--font-ui);
  margin-bottom: 6px;
}

#tour-body {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.tour-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tour-actions #tour-next {
  margin-left: auto;
}

/* ---------- focus rings ---------- */

a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .rule-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .header-status {
    display: none;
  }

  .readout-rail {
    grid-template-columns: 1fr;
  }

  .readout {
    border-left: none;
    border-top: 1px solid var(--line-soft);
    padding: 16px 18px 18px;
  }

  .readout:first-child {
    border-top: none;
  }

  .tabs-wrap {
    top: 56px;
  }

  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .field-pair {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }

  .rule-row {
    grid-template-columns: 1fr;
  }

  .stat-hero .stat-value {
    font-size: 1.8rem;
  }

  .mod {
    padding: 16px;
  }

  .tour-actions #tour-next {
    margin-left: 0;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
