/* ==========================================================================
   SMALL MACHINES — a field guide to algorithms
   Paper, ink, rust, and a little blue. No frameworks.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("assets/fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("assets/fonts/dmmono-300.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/dmmono-400.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/dmmono-500.woff2") format("woff2");
}

:root {
  --paper: #f1ede2;
  --paper-raised: #f8f4e9;
  --paper-deep: #e7e0cf;
  --stage: #f6f2e7;
  --ink: #1c1b17;
  --ink-soft: #3d392f;
  --muted: #756e5d;
  --faint: #a59b85;
  --rule: rgba(28, 27, 23, 0.17);
  --rule-strong: rgba(28, 27, 23, 0.36);
  --rust: #b5412a;
  --rust-deep: #8f2f1d;
  --blue: #2c4e78;
  --moss: #566447;
  --ochre: #b08434;
  --cream: #fbf8ef;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: "DM Mono", "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --max: 1480px;
  --pad: clamp(18px, 3.3vw, 52px);
  --mast-h: 70px;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 76% -8%, rgba(181, 65, 42, 0.045), transparent 68%),
    var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(28, 27, 23, 0.16) 0.55px, transparent 0.75px);
  background-size: 23px 23px;
  opacity: 0.2;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 80%);
}

::selection { background: var(--rust); color: var(--cream); }

a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
canvas { display: block; }
svg { display: block; }

button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.grain {
  position: fixed;
  inset: -20%;
  z-index: 100;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--mast-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--rule-strong);
  background: rgba(241, 237, 226, 0.91);
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--ink);
}
.brand-mark circle,
.brand-mark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
}
.brand-mark .mark-fill { fill: var(--rust); stroke: none; }
.brand-mark .mark-ticks { opacity: 0.75; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title {
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 500;
  letter-spacing: -0.012em;
}
.brand-sub {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.mast-meta {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
.mast-edition span { color: var(--faint); padding: 0 2px; }
.mast-live { display: inline-flex; align-items: center; gap: 7px; }
.mast-live i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 0 3px rgba(181, 65, 42, 0.12);
}

/* ==========================================================================
   Index hero
   ========================================================================== */

.index-view { display: block; }

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(44px, 7vw, 98px) var(--pad) clamp(32px, 4vw, 52px);
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(280px, 0.62fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: end;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  right: 8%;
  top: 7%;
  width: min(44vw, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(28, 27, 23, 0.085);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  right: calc(8% + min(22vw, 310px));
  top: calc(7% + min(22vw, 310px));
  width: 9px;
  height: 9px;
  border: 1px solid rgba(28, 27, 23, 0.32);
  background: var(--paper);
  transform: translate(-50%, -50%) rotate(45deg);
  pointer-events: none;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--rust);
}
.kicker-rule {
  display: inline-block;
  width: 34px;
  height: 1px;
  background: var(--rust);
}

.hero h1 {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-weight: 360;
  font-size: clamp(4.6rem, 10.7vw, 10.2rem);
  line-height: 0.79;
  letter-spacing: -0.048em;
  font-variation-settings: "opsz" 144, "SOFT" 40;
}
.hero h1 em {
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.055em;
}
.title-dot { color: var(--rust); }

.hero-lede {
  max-width: 560px;
  margin: 0;
  font-family: var(--body);
  font-size: clamp(1rem, 1.25vw, 1.13rem);
  line-height: 1.62;
  color: var(--ink-soft);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 34px;
  margin: 30px 0 26px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-meta b {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-right: 4px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}
.hero-cta svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  transition: transform 200ms ease;
}
.hero-cta:hover { color: var(--rust); border-color: var(--rust); }
.hero-cta:hover svg { transform: translateX(4px); }

/* Contents index */

.hero-index {
  position: relative;
  z-index: 1;
  padding-left: clamp(20px, 3vw, 42px);
  border-left: 1px solid var(--rule);
  align-self: end;
}
.hero-index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-strong);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.contents {
  list-style: none;
  margin: 0;
  padding: 0;
}
.contents li { border-bottom: 1px solid var(--rule); }
.contents a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  padding: 11px 0 10px;
  text-decoration: none;
  transition: color 150ms ease, padding 150ms ease;
}
.contents a:hover { color: var(--rust); padding-left: 4px; }
.c-num {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.c-name {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 450;
  letter-spacing: -0.01em;
}
.c-tag {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
}
.hero-index-note {
  margin: 18px 0 0;
  max-width: 320px;
  font-family: var(--serif);
  font-size: 0.86rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--muted);
}

/* ==========================================================================
   Cabinet cards
   ========================================================================== */

.cabinet-head {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--pad) 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--rule);
}
.mini-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--rust);
  white-space: nowrap;
}
.cabinet-head p:last-child {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
}
.cabinet {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(56px, 7vw, 96px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.7vw, 26px);
}

.specimen-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  text-decoration: none;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 180ms ease, background 180ms ease;
}
.specimen-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 180ms ease;
}
.specimen-card:hover,
.specimen-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--ink);
  background: var(--cream);
}
.specimen-card:hover::after { border-color: rgba(181, 65, 42, 0.22); }

.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 31px;
  padding: 0 12px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-num { color: var(--rust); font-weight: 500; }
.card-family { flex: 1; }
.card-live { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font-size: 7px; }
.card-live i {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--rust);
  animation: pulse-live 3.4s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 0.35; box-shadow: 0 0 0 0 rgba(181, 65, 42, 0); }
  50% { opacity: 1; box-shadow: 0 0 0 3px rgba(181, 65, 42, 0.09); }
}

.card-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(circle at 78% 20%, rgba(181, 65, 42, 0.055), transparent 42%),
    var(--stage);
}
.card-preview canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.card-plate {
  position: absolute;
  right: 9px;
  bottom: 7px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  opacity: 0.85;
}
.card-body { padding: 17px 16px 15px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 1.7vw, 1.7rem);
  font-weight: 480;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.card-body p {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}
.card-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 160ms ease, gap 160ms ease;
}
.card-open span { font-size: 11px; line-height: 1; }
.specimen-card:hover .card-open { color: var(--rust); gap: 10px; }

/* ==========================================================================
   Index footer
   ========================================================================== */

.index-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px var(--pad) 44px;
  border-top: 1px solid var(--rule-strong);
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 32px;
}
.footer-mark {
  margin: 0 0 3px;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 480;
  letter-spacing: -0.02em;
}
.index-footer p {
  margin: 0;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-colophon { text-align: right; }
.footer-next {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
}
.footer-next:hover { color: var(--rust); border-color: var(--rust); }

/* ==========================================================================
   Specimen shell
   ========================================================================== */

.specimen-view {
  max-width: none;
  padding: 14px clamp(12px, 2vw, 28px) 18px;
  height: calc(100vh - var(--mast-h));
  height: calc(100dvh - var(--mast-h));
  display: flex;
  flex-direction: column;
}

.specimen-topline {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 31px;
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.crumb {
  text-decoration: none;
  white-space: nowrap;
  transition: color 140ms ease;
}
.crumb span { display: inline-block; margin-right: 3px; }
.crumb:hover { color: var(--rust); }
.topline-num { color: var(--rust); }
.topline-title {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  text-transform: none;
  color: var(--ink);
}
.topline-family { color: var(--faint); }
.topline-nav { margin-left: auto; display: flex; gap: 18px; }
.topline-nav a {
  text-decoration: none;
  transition: color 140ms ease;
}
.topline-nav a:hover { color: var(--rust); }

.specimen-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 372px);
  gap: clamp(12px, 1.5vw, 22px);
}

.stage-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.stage-chrome {
  flex: 0 0 auto;
  height: 39px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
  background: var(--paper-raised);
}
.stage-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
}
.stage-status #stageStatus {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--rust);
  flex: 0 0 auto;
  transition: background 160ms ease, box-shadow 160ms ease;
}
.stage-chrome.is-running .status-dot {
  box-shadow: 0 0 0 4px rgba(181, 65, 42, 0.1);
  animation: status-blink 1.8s ease-in-out infinite;
}
.stage-chrome.is-done .status-dot { background: var(--moss); }
@keyframes status-blink {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.transport { display: flex; align-items: stretch; }
.transport-btn {
  appearance: none;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  padding: 0 13px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: background 130ms ease, color 130ms ease;
}
.transport-btn:hover { background: var(--ink); color: var(--cream); }
.transport-btn.is-primary { color: var(--rust); }
.transport-btn.is-primary:hover { background: var(--rust); color: var(--cream); }
.transport-btn:disabled { opacity: 0.35; cursor: default; }
.transport-btn:disabled:hover { background: transparent; color: var(--muted); }

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--rule-strong);
  background: var(--stage);
  overflow: hidden;
  isolation: isolate;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(28, 27, 23, 0.2) 0.55px, transparent 0.7px);
  background-size: 18px 18px;
  opacity: 0.25;
}
.stage > * { position: relative; z-index: 1; }

.stage-foot {
  flex: 0 0 auto;
  min-height: 27px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-top: 6px;
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.stage-foot span { max-width: 70%; }
.stage-caption { text-align: right; color: var(--faint); white-space: nowrap; }

/* ==========================================================================
   Specimen panel
   ========================================================================== */

.panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--rule-strong);
  background: var(--paper-raised);
  padding: clamp(17px, 1.8vw, 24px) clamp(16px, 1.7vw, 23px) 17px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.panel::-webkit-scrollbar { width: 5px; }
.panel::-webkit-scrollbar-thumb { background: var(--rule-strong); }

.panel-head { position: relative; }
.panel-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
}
.panel-slash { color: var(--faint); }
.panel-head h2 {
  margin: 11px 0 1px;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 2.8vw, 2.9rem);
  font-weight: 380;
  font-variation-settings: "opsz" 80, "SOFT" 40;
  line-height: 0.94;
  letter-spacing: -0.04em;
}
.panel-latin {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.83rem;
  color: var(--faint);
  letter-spacing: 0.01em;
}
.panel-lede {
  margin: 14px 0 0;
  font-family: var(--body);
  font-size: 0.92rem;
  line-height: 1.58;
  color: var(--ink-soft);
}

.panel-controls {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.control-group { min-width: 0; }
.control-label {
  display: block;
  margin: 0 0 7px;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.control-label .cl-hint {
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 400;
  margin-left: 5px;
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  appearance: none;
  border: 1px solid var(--rule);
  background: transparent;
  padding: 5px 8px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.chip.is-accent.is-active {
  background: var(--rust);
  border-color: var(--rust);
}
.chip small { display: block; font-size: 6.5px; opacity: 0.6; letter-spacing: 0.02em; }

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--rule);
}
.seg .chip {
  border: 0;
  border-right: 1px solid var(--rule);
  text-align: center;
  padding: 6px 3px;
}
.seg .chip:last-child { border-right: 0; }
.seg .chip.is-active { background: var(--ink); }

.range-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted);
}
.range-row + .range-row { margin-top: 8px; }
.range-row output {
  text-align: right;
  color: var(--ink);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 14px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--rule-strong);
}
input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--rule-strong);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 9px;
  height: 13px;
  margin-top: -6px;
  border: 1px solid var(--ink);
  background: var(--paper-raised);
  border-radius: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 8px;
  height: 12px;
  border: 1px solid var(--ink);
  background: var(--paper-raised);
  border-radius: 0;
}
input[type="range"]:focus-visible { outline-offset: 5px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  cursor: pointer;
}
.check-row input {
  appearance: none;
  width: 11px;
  height: 11px;
  margin: 0;
  border: 1px solid var(--rule-strong);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.check-row input::after {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--rust);
  transform: scale(0);
  transition: transform 100ms ease;
}
.check-row input:checked::after { transform: scale(1); }

.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.btn {
  appearance: none;
  border: 1px solid var(--rule);
  background: transparent;
  padding: 6px 9px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn.is-accent { border-color: var(--rust); color: var(--rust); }
.btn.is-accent:hover { background: var(--rust); color: var(--cream); }
.btn:disabled { opacity: 0.35; pointer-events: none; }

.control-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.panel-stats {
  margin-top: 19px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.stat { min-width: 0; }
.stat-label {
  display: block;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-value {
  display: block;
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 430;
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.stat-value small { font-family: var(--mono); font-size: 8px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.stat-value.is-rust { color: var(--rust); }
.stat-value.is-moss { color: var(--moss); }
.stat-value.is-blue { color: var(--blue); }

.leaderboard { margin-top: 13px; border-top: 1px dotted var(--rule); }
.lb-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--rule);
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink-soft);
}
.lb-row .lb-rank { color: var(--faint); font-size: 7px; }
.lb-row .lb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row .lb-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-row.is-done .lb-rank { color: var(--rust); }
.lb-row.is-done .lb-name { color: var(--ink); }

.result-table-wrap { margin-top: 10px; overflow-x: auto; }
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 7.5px;
  font-variant-numeric: tabular-nums;
}
.result-table th {
  text-align: left;
  font-weight: 400;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 4px 4px 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.result-table td {
  padding: 4px 4px 4px 0;
  border-bottom: 1px dotted var(--rule);
  color: var(--ink-soft);
  white-space: nowrap;
}
.result-table tr.is-best td { color: var(--rust); }

.field-note {
  margin: 18px 0 0;
  padding: 10px 0 10px 13px;
  border-left: 2px solid var(--rust);
  background: linear-gradient(90deg, rgba(181, 65, 42, 0.045), transparent 80%);
}
.note-label {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--rust);
}
.field-note p {
  margin: 0;
  font-family: var(--body);
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.method {
  margin-top: 15px;
  padding-top: 11px;
  border-top: 1px solid var(--rule);
}
.method summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.method summary::-webkit-details-marker { display: none; }
.method-mark { font-size: 12px; line-height: 1; color: var(--faint); transition: transform 140ms ease; }
.method[open] .method-mark { transform: rotate(45deg); }
.method p {
  margin: 9px 0 0;
  font-family: var(--body);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}
.method code {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--paper-deep);
  padding: 1px 3px;
}

.panel-end {
  margin-top: 18px;
  padding-top: 11px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.panel-end a { text-decoration: none; color: var(--muted); }
.panel-end a:hover { color: var(--rust); }

/* ==========================================================================
   Toast / noscript
   ========================================================================== */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 150;
  max-width: min(340px, calc(100vw - 32px));
  padding: 9px 13px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-on { opacity: 1; transform: none; }

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 200;
  padding: 16px;
  background: var(--rust);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 11px;
}

/* ==========================================================================
   Module-specific styles
   ========================================================================== */

/* --- Comparator --------------------------------------------------------- */

.race {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 7px 0 5px;
}
.lane {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(82px, 11%, 132px) minmax(0, 1fr) clamp(48px, 7%, 78px);
  align-items: stretch;
  border-bottom: 1px solid rgba(28, 27, 23, 0.08);
}
.lane:last-child { border-bottom: 0; }
.lane-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 7px 0 13px;
  min-width: 0;
}
.lane-name {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lane-complexity {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.02em;
  color: var(--faint);
  margin-top: 1px;
}
.lane-canvas { width: 100%; height: 100%; min-width: 0; }
.lane-plot { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.lane-plot .lane-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lane-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding-right: 11px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.lane-ops { font-size: 7.5px; color: var(--muted); }
.lane-rank {
  font-size: 6.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.lane.is-done .lane-name { color: var(--moss); }
.lane.is-done .lane-rank { color: var(--rust); }
.lane.is-leader .lane-name { color: var(--rust); }

@media (max-width: 620px) {
  .lane {
    grid-template-columns: 70px minmax(0, 1fr) 46px;
  }
  .lane-label { padding-left: 9px; padding-right: 3px; }
  .lane-complexity { display: none; }
  .lane-ops { font-size: 6.5px; }
  .lane-stats { padding-right: 7px; }
}

/* --- Forager ------------------------------------------------------------ */

.map-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-wrap canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.map-tip {
  position: absolute;
  pointer-events: none;
  padding: 4px 6px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -130%);
  transition: opacity 100ms ease;
  z-index: 3;
}
.map-tip.is-on { opacity: 1; }

/* --- Cartographer ------------------------------------------------------- */

.graph-wrap {
  position: absolute;
  inset: 0;
}
.graph-wrap canvas { width: 100%; height: 100%; cursor: grab; touch-action: none; }
.graph-wrap canvas.is-dragging { cursor: grabbing; }
.graph-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 5px 7px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1.5;
  letter-spacing: 0.03em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -125%);
  transition: opacity 90ms ease;
}
.graph-tip.is-on { opacity: 1; }
.graph-tip b { color: #f0c9b8; font-weight: 500; }
.graph-legend {
  position: absolute;
  left: 12px;
  bottom: 9px;
  display: flex;
  gap: 12px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}
.graph-legend span { display: inline-flex; align-items: center; gap: 4px; }
.graph-legend i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.graph-legend .lg-frontier { background: var(--rust); }
.graph-legend .lg-visited { background: var(--blue); }
.graph-legend .lg-tree { background: var(--ochre); }

.xml-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(86vh, 760px);
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: 18px 18px 0 rgba(28, 27, 23, 0.13);
}
.xml-dialog::backdrop {
  background: rgba(28, 27, 23, 0.48);
  backdrop-filter: blur(2px);
}
.xml-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--rule-strong);
}
.xml-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 450;
  letter-spacing: -0.025em;
}
.xml-close {
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}
.xml-body { padding: 15px 17px 17px; overflow-y: auto; max-height: calc(min(86vh, 760px) - 58px); }
.xml-body > p {
  margin: 0 0 11px;
  font-family: var(--body);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}
.xml-sample-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.xml-textarea {
  display: block;
  width: 100%;
  min-height: 230px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--rule-strong);
  background: var(--stage);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
  outline: none;
}
.xml-textarea:focus { border-color: var(--ink); }
.xml-error {
  min-height: 15px;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.5;
  color: var(--rust);
}
.xml-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}
.xml-file {
  position: relative;
  overflow: hidden;
  display: inline-flex;
}
.xml-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.xml-actions .spacer { flex: 1; }

/* --- Grammarian --------------------------------------------------------- */

.automaton-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
.automaton-canvas-wrap { position: relative; flex: 1 1 auto; min-height: 0; }
.automaton-canvas-wrap canvas { width: 100%; height: 100%; }
.automaton-legend {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  display: flex;
  gap: 12px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  pointer-events: none;
}
.automaton-legend span { display: inline-flex; align-items: center; gap: 4px; }
.automaton-legend i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--ink); }
.automaton-legend .alg-active { background: var(--rust); border-color: var(--rust); }
.automaton-legend .alg-accept { border: 2px double var(--ochre); }
.automaton-legend .alg-eps { width: 9px; height: 0; border: 0; border-top: 1px dashed var(--ink); border-radius: 0; }
.regex-strip {
  flex: 0 0 auto;
  min-height: 55px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border-top: 1px solid var(--rule);
  background: rgba(248, 244, 233, 0.7);
  overflow-x: auto;
}
.strip-label {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.char-strip { display: flex; align-items: center; gap: 3px; min-height: 28px; }
.char-box {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 25px;
  padding: 0 4px;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  color: var(--ink-soft);
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
.char-box.is-done { background: var(--paper-deep); color: var(--faint); }
.char-box.is-now { border-color: var(--rust); background: var(--rust); color: var(--cream); }
.char-box.is-empty { color: var(--faint); font-size: 8px; border-style: dashed; }
.strip-verdict {
  margin-left: auto;
  padding: 4px 7px;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.strip-verdict.is-accept { border-color: var(--moss); color: var(--moss); }
.strip-verdict.is-reject { border-color: var(--rust); color: var(--rust); }
.automaton-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.8;
  color: var(--rust);
  background: rgba(246, 242, 231, 0.9);
}
.regex-input, .string-input {
  width: 100%;
  border: 1px solid var(--rule-strong);
  background: var(--stage);
  color: var(--ink);
  padding: 6px 7px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.4;
  outline: none;
}
.regex-input:focus, .string-input:focus { border-color: var(--ink); }
.regex-input.is-error { border-color: var(--rust); }

/* --- Botanist ----------------------------------------------------------- */

.botanist-wrap { position: absolute; inset: 0; }
.botanist-wrap canvas { width: 100%; height: 100%; }
.grammar-box {
  margin-top: 4px;
  padding: 7px 8px;
  background: var(--stage);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1.65;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 83px;
  overflow: auto;
}
.grammar-box b { color: var(--ink-soft); font-weight: 500; }

/* --- Flock -------------------------------------------------------------- */

.flock-wrap { position: absolute; inset: 0; }
.flock-wrap canvas { width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.flock-key {
  position: absolute;
  top: 11px;
  left: 12px;
  display: flex;
  gap: 12px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  pointer-events: none;
}
.flock-key span { display: inline-flex; align-items: center; gap: 4px; }
.flock-key i { width: 5px; height: 5px; background: var(--ink); }
.flock-key .fk-rust { background: var(--rust); }
.meter-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.meter-label { font-family: var(--mono); font-size: 7px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.meter { flex: 1; height: 2px; background: var(--rule); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--rust); transition: width 180ms linear; }
.meter-val { font-family: var(--mono); font-size: 7px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- Shared module misc -------------------------------------------------- */

.panel .panel-controls > .control-group:first-child { margin-top: 0; }
.control-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.control-inline .check-row { margin-left: auto; }
.control-span { grid-column: 1 / -1; }
.kbd-hint {
  display: inline-block;
  padding: 0 3px;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 6.5px;
  color: var(--muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr); gap: 40px; }
  .hero::before, .hero::after { display: none; }
  .cabinet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specimen-layout { grid-template-columns: minmax(0, 1fr) 330px; }
}

@media (max-width: 960px) {
  .specimen-view {
    height: auto;
    min-height: calc(100dvh - var(--mast-h));
    padding-bottom: 28px;
  }
  .specimen-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage-column { min-height: 0; }
  .stage { flex: 0 0 auto; height: min(66vh, 620px); min-height: 380px; }
  .panel { overflow: visible; height: auto; }
  .panel-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 22px; }
  .panel-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .field-note, .method { grid-column: 1 / -1; }
  .index-footer { grid-template-columns: 1fr 1fr; }
  .footer-next { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    align-items: start;
  }
  .hero-index {
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding: 20px 0 0;
  }
  .hero-index-note { max-width: 520px; }
  .contents { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .contents li:nth-child(odd) { border-right: 1px solid var(--rule); padding-right: 10px; }
  .contents a { padding: 9px 0; }
  .cabinet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cabinet-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .mast-edition { display: none; }
  .stage-chrome { height: 37px; }
}

@media (max-width: 680px) {
  :root { --mast-h: 61px; }
  .brand-mark { width: 29px; height: 29px; }
  .brand-title { font-size: 1.05rem; }
  .brand-sub { font-size: 7px; }
  .mast-meta { font-size: 7.5px; }
  .mast-live { font-size: 0; gap: 0; }
  .mast-live i { width: 6px; height: 6px; }
  .hero { padding-top: 36px; padding-bottom: 26px; }
  .hero h1 { font-size: clamp(4.1rem, 20vw, 7.4rem); }
  .hero-meta { margin-top: 24px; }
  .contents { grid-template-columns: 1fr; }
  .contents li:nth-child(odd) { border-right: 0; padding-right: 0; }
  .cabinet { grid-template-columns: 1fr; }
  .card-preview { aspect-ratio: 16 / 9; }
  .card-body h3 { font-size: 1.7rem; }
  .index-footer { grid-template-columns: 1fr; gap: 20px; }
  .footer-colophon { text-align: left; }
  .specimen-view { padding: 10px 10px 22px; }
  .specimen-topline { gap: 8px; flex-wrap: wrap; padding-bottom: 7px; margin-bottom: 8px; }
  .topline-family { display: none; }
  .topline-nav { gap: 12px; }
  .stage { height: min(58vh, 480px); min-height: 330px; }
  .stage-foot { font-size: 7px; gap: 2px; flex-direction: column; padding-top: 4px; }
  .stage-foot span { max-width: 100%; }
  .stage-caption { max-width: 100% !important; white-space: normal; text-align: left; }
  .transport-btn { padding: 0 9px; font-size: 7.5px; }
  .stage-status { font-size: 7.5px; padding: 0 9px; }
  .panel { padding: 17px 15px; }
  .panel-controls { grid-template-columns: 1fr; gap: 15px; }
  .panel-stats { grid-template-columns: 1fr 1fr; }
  .panel-head h2 { font-size: 2.25rem; }
  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; text-align: center; }
}

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