/* Spark the EVA! web UI stylesheet.
   The design system behind this file is documented in DESIGN.md at the repo
   root. Key rules: 15px body type (16px prose), nothing below 12px, sans-serif for UI,
   monospace reserved for data (times, hashes, code, metrics). */

:root {
  --ink: #111114;
  --ink-soft: #34353a;
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f5f6;
  --muted: #67696e;
  --line: #e8e8ea;
  --line-strong: #d5d5d9;
  --accent: #111114;
  --accent-ink: #111114;
  --accent-strong: #000000;
  --accent-soft: #f1f1f3;
  --success: #1f7a4d;
  --success-soft: #e7f5ee;
  --danger: #b3392f;
  --danger-soft: #faecea;
  --warning-soft: #fbf5df;
  --radius-sm: 10px;
  --radius: 12px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.035);
  --shadow-lg: 0 18px 48px rgba(17, 17, 20, 0.1);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #dbdfe4;
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

:focus-visible {
  outline: 3px solid rgba(20, 23, 30, 0.35);
  outline-offset: 3px;
}

small {
  color: var(--muted);
  font-size: 13px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: var(--shadow-lg);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

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

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

/* The rehearsal deployment announces itself on every page so a practice run
   can never be mistaken for an official attempt. Ink ribbon, no accent hue. */
.practice-banner {
  background: var(--ink);
  color: #ffffff;
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  padding: 7px 16px;
}

.practice-banner strong {
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 4px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(12px);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  width: min(1080px, calc(100% - 48px));
  min-height: 60px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
}

.brand-mark img {
  display: block;
  width: 16px;
  height: 16px;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.primary-nav,
.account-nav {
  display: flex;
  align-items: center;
}

.primary-nav {
  gap: 24px;
}

.primary-nav a {
  position: relative;
  padding: 19px 0 18px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 150ms ease;
}

.primary-nav a::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 150ms ease, transform 150ms ease;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  color: var(--ink);
}

.primary-nav a.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.account-nav {
  gap: 8px;
  justify-self: end;
}

.account-tab,
.link-button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.account-tab {
  padding: 10px 15px;
}

.account-tab:hover,
.account-tab.is-active {
  background: var(--surface-soft);
  color: var(--ink);
}

.account-tab--primary {
  background: var(--ink);
  color: #fff;
}

.account-tab--primary:hover,
.account-tab--primary.is-active {
  background: var(--accent-strong);
  color: #fff;
}

.inline {
  display: inline;
}

.link-button {
  min-height: 36px;
  padding: 10px 14px;
}

.link-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.user-name {
  max-width: 160px;
  overflow: hidden;
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-main {
  width: min(1080px, calc(100% - 48px));
  min-height: calc(100vh - 160px);
  margin: 0 auto;
}

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

.hero {
  padding: clamp(54px, 7vw, 72px) 0 0;
  text-align: center;
}

.hero h1,
.page-heading h1,
.form-page h1,
.prose h1,
.auth-aside h1 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero h1 {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(40px, 5.2vw, 58px);
  font-weight: 600;
  line-height: 1.08;
}

.hero-copy {
  max-width: 760px;
  margin: 0 auto;
}

.lede {
  max-width: 650px;
  margin: 17px auto 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.65;
  letter-spacing: -0.005em;
}

.model-name {
  color: var(--ink);
  font: 500 0.94em/1 var(--font-mono);
  letter-spacing: -0.02em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  padding: 11px 18px;
  transition: background 160ms ease, transform 160ms ease;
}

.button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button.small {
  min-height: 40px;
  padding: 9px 15px;
  font-size: 14px;
}

.button.full {
  width: 100%;
  margin-top: 28px;
}

.button.danger {
  background: var(--danger);
}

.button.danger:hover {
  background: #922e26;
}

.text-link {
  padding: 10px 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.text-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----------------------------------------------------------- record card */

.record-card {
  overflow: hidden;
  margin-top: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.record-card__main {
  padding: 36px 24px 32px;
  text-align: center;
}

.record-card__label,
.record-card__meta,
.record-fact p,
.record-fact small {
  margin: 0;
  color: var(--muted);
}

.record-card__label,
.record-fact p {
  font-size: 12.5px;
  font-weight: 500;
}

.record-card__value {
  margin: 7px 0 0;
  color: var(--ink);
  font: 600 clamp(48px, 7vw, 76px)/1.08 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
}

.record-card__value span {
  margin-left: 0.35em;
  color: var(--muted);
  font-size: 0.3em;
  font-weight: 500;
  letter-spacing: 0;
}

.record-card__meta {
  margin-top: 8px;
  font-size: 13.5px;
}

.record-card__meta strong {
  color: var(--ink);
  font-weight: 500;
}

.record-card__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.record-fact {
  min-width: 0;
  padding: 17px 22px 18px;
}

.record-fact + .record-fact {
  border-left: 1px solid var(--line);
}

.record-fact strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font: 600 17px/1.35 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.record-fact strong span {
  margin-left: 5px;
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0;
}

.record-fact small {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
}

.record-card--empty .record-card__value {
  color: #b7b9be;
  letter-spacing: 0;
}

/* -------------------------------------------------- panels and headings */

.panel,
.auth-card,
.form-page,
.prose {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel {
  margin-bottom: 28px;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* A breadcrumb in the eyebrow is the only way back from a nested run page,
   so it has to read as a link rather than as more heading text. */
.eyebrow a {
  text-decoration: underline;
  text-decoration-color: #c3c9d0;
  text-underline-offset: 3px;
}

.section-heading,
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2,
.panel h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.section-intro {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-heading {
  padding: 56px 0 34px;
}

.page-heading h1,
.form-page h1,
.prose h1 {
  color: var(--ink);
  font-size: clamp(34px, 4.2vw, 50px);
  line-height: 1.06;
}

.page-heading p {
  margin: 12px 0 0;
  color: var(--muted);
}

/* ------------------------------------------------------------ leaderboard */

.home-section {
  padding-top: 54px;
}

.home-section:last-of-type {
  margin-bottom: 68px;
}

.home-section__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.home-section__heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.home-section__heading .section-intro {
  max-width: 720px;
  margin-top: 5px;
}

.home-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.chart-direction {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.ranking-chart-enhancement[hidden] {
  display: none;
}

.ranking-chart {
  position: relative;
  min-height: 424px;
  margin: 12px 16px 0;
  overflow: hidden;
  background: var(--surface);
}

.ranking-chart__svg {
  display: block;
  width: 100%;
  height: 420px;
}

.ranking-chart--single {
  min-height: 284px;
}

.ranking-chart--single .ranking-chart__svg {
  height: 280px;
}

.ranking-chart__svg[hidden] {
  display: none;
}

.ranking-chart__status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 30px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.ranking-chart__status[hidden] {
  display: none;
}

.ranking-chart--error {
  min-height: 180px;
}

.ranking-chart__grid line {
  stroke: #f0f0f2;
  stroke-width: 1;
}

.ranking-chart__grid .ranking-chart__vertical-grid {
  stroke: #f4f4f5;
  stroke-dasharray: 3 5;
}

.ranking-chart__tick-label,
.ranking-chart__axis-title {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.ranking-chart__axis-title {
  fill: var(--ink-soft);
  font-family: var(--font-sans);
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ranking-chart__series {
  --series-color: #14171e;
  --series-dash: none;
}

.ranking-chart__series--0 {
  --series-color: #111114;
  --series-dash: none;
}

.ranking-chart__series--1 {
  --series-color: #77797f;
  --series-dash: 9 4;
}

.ranking-chart__series--2 {
  --series-color: #9a9ca1;
  --series-dash: 3 3;
}

.ranking-chart__series--3 {
  --series-color: #5d5f65;
  --series-dash: 12 4 3 4;
}

.ranking-chart__series--4 {
  --series-color: #afb1b5;
  --series-dash: 7 3;
}

.ranking-chart__series--5 {
  --series-color: #6b6d73;
  --series-dash: 2 3;
}

.ranking-chart__series--6 {
  --series-color: #bfc0c4;
  --series-dash: 11 4;
}

.ranking-chart__series--7 {
  --series-color: #85878c;
  --series-dash: 5 3 2 3;
}

.ranking-chart__series--8 {
  --series-color: #a2a4a9;
  --series-dash: 14 5;
}

.ranking-chart__series--9 {
  --series-color: #73757a;
  --series-dash: 3 2 9 3;
}

.ranking-chart__line {
  fill: none;
  stroke: var(--series-color);
  stroke-dasharray: var(--series-dash);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.ranking-chart__point {
  fill: #fff;
  stroke: var(--series-color);
  stroke-width: 2;
}

.ranking-chart__hit-target {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
  cursor: pointer;
}

.ranking-chart__hit-target:focus {
  outline: none;
  fill: rgba(255, 255, 255, 0.8);
  stroke: var(--series-color);
}

.ranking-chart__tooltip {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
  display: flex;
  width: min(270px, calc(100% - 36px));
  flex-direction: column;
  gap: 3px;
  padding: 15px 17px;
  border-radius: var(--radius-sm);
  background: rgba(11, 13, 18, 0.96);
  color: #fff;
  box-shadow: 0 14px 34px rgba(11, 13, 18, 0.22);
  pointer-events: none;
}

.ranking-chart__tooltip[hidden] {
  display: none;
}

.ranking-chart__tooltip-title {
  font-size: 14px;
}

.ranking-chart__tooltip-date,
.ranking-chart__tooltip-meta,
.ranking-chart__tooltip-gain {
  color: #bfc5cc;
  font: 500 12px/1.45 var(--font-mono);
}

.ranking-chart__tooltip-score {
  margin: 7px 0 3px;
  color: #fff;
  font: 650 22px/1.1 var(--font-mono);
  letter-spacing: -0.04em;
}

.ranking-chart__tooltip-gain {
  margin-top: 7px;
  color: #82d6aa;
}

.ranking-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin: 0;
  padding: 14px 22px 16px;
  border-top: 1px solid var(--line);
}

.ranking-chart__legend:empty {
  display: none;
}

.ranking-chart__legend-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ranking-chart__legend-swatch {
  display: block;
  width: 24px;
  height: 10px;
  overflow: visible;
}

.ranking-chart__legend-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.25;
}

.ranking-chart__legend-identity strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-chart__legend-score {
  color: var(--muted);
  font: 500 12px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

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

.table-wrap {
  overflow-x: auto;
  scrollbar-color: var(--line-strong) transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.table-card table {
  min-width: 760px;
}

th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: left;
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  letter-spacing: -0.005em;
}

td small {
  font-size: 12px;
}

th:first-child,
td:first-child {
  padding-left: 22px;
}

th:last-child,
td:last-child {
  padding-right: 22px;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #fafafa;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.right {
  text-align: right;
}

.rank {
  color: var(--muted);
  font: 500 13px/1 var(--font-mono);
}

.is-record {
  background: var(--surface-soft);
}

.is-record:hover {
  background: var(--surface-soft);
}

.is-record td {
  border-bottom-color: transparent;
}

.record-badge {
  display: inline-block;
  margin-left: 9px;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  vertical-align: 1px;
}

.submission-cell,
.data-cell {
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.data-cell.strong {
  color: var(--ink);
  font-weight: 600;
}

.pass-check {
  margin-left: 3px;
  color: var(--success);
}

.time {
  color: var(--ink);
  font: 600 13px/1.2 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 52px 18px;
  color: var(--muted);
  text-align: center;
}

.empty strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.empty p {
  margin: 8px auto 0;
}

/* ------------------------------------------------------------------ auth */

.auth-page .site-main {
  display: flex;
  align-items: center;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(440px, 1.1fr);
  width: min(1080px, 100%);
  min-height: 560px;
  margin: 64px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.auth-aside {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 5vw, 60px);
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.auth-aside h1 {
  font-size: clamp(34px, 3.4vw, 46px);
  line-height: 1.08;
}

.auth-aside > p {
  max-width: 420px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.auth-steps {
  display: grid;
  gap: 0;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.auth-steps li {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 0;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 14px;
}

.auth-steps li:last-child {
  border-bottom: 1px solid var(--line-strong);
}

.auth-steps span {
  color: var(--muted);
  font: 650 12px/1 var(--font-mono);
}

.auth-shell .auth-card {
  grid-column: 2;
  grid-row: 1;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 60px;
  border-bottom: 1px solid var(--line);
}

.auth-tabs a {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.auth-tabs a + a {
  border-left: 1px solid var(--line);
}

.auth-tabs a:only-child {
  grid-column: 1 / -1;
}

.auth-tabs a::after {
  position: absolute;
  right: 22%;
  bottom: -1px;
  left: 22%;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  content: "";
  opacity: 0;
}

.auth-tabs a:hover,
.auth-tabs a.is-active {
  background: #fbfbfc;
  color: var(--ink);
}

.auth-tabs a.is-active::after {
  opacity: 1;
}

.auth-card__body {
  padding: clamp(34px, 5vw, 56px);
}

.auth-card__body h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.auth-intro {
  margin: 12px 0 28px;
  color: var(--muted);
  font-size: 15px;
}

.auth-footnote {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.auth-footnote a {
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-main > .auth-card,
.form-page,
.prose {
  max-width: 780px;
  margin: 64px auto;
  padding: clamp(30px, 5vw, 52px);
}

.site-main > .auth-card h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* ----------------------------------------------------------------- forms */

form label {
  display: block;
  margin: 20px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

form label > span {
  display: inline-block;
  margin-bottom: 7px;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  font-size: 15px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

form label > span + input,
form label > span + textarea,
form label > span + select {
  margin-top: 0;
}

input,
select {
  min-height: 48px;
}

input::placeholder,
textarea::placeholder {
  color: #798088;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #a4abb3;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(20, 23, 30, 0.14);
}

input[type="checkbox"] {
  min-height: 0;
}

input[type="file"] {
  padding: 10px 11px;
}

textarea,
pre,
.mono {
  font-family: var(--font-mono);
}

form label small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 450;
  line-height: 1.5;
}

.form-error,
.warning,
.flash {
  padding: 14px 16px;
  border: 1px solid #e8c8c4;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: #71302b;
  font-size: 14px;
}

.form-error,
.warning {
  margin: 20px 0;
}

.warning {
  border-color: #e7d79d;
  border-left-color: #ad852c;
  background: var(--warning-soft);
  color: #70571e;
}

.flash {
  width: min(920px, 100%);
  margin: 18px auto;
}

.flash.info {
  border-color: #ccd2d9;
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.flash.success {
  border-color: #bcdcca;
  border-left-color: var(--success);
  background: var(--success-soft);
  color: #245d45;
}

/* ------------------------------------------------------- lists and data */

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

.list {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 5px;
  border-bottom: 1px solid var(--line);
}

a.list-row {
  border-radius: 6px;
  transition: background 120ms ease, padding 120ms ease;
}

a.list-row:hover {
  margin: 0 -8px;
  padding-right: 13px;
  padding-left: 13px;
  background: #f7f8f9;
}

.list-row small {
  display: block;
  margin-top: 3px;
}

.status {
  display: inline-block;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 99px;
  background: var(--surface-soft);
  color: #525a63;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status.large {
  padding: 10px 15px;
  font-size: 13px;
}

.status.ready,
.status.passed {
  border-color: #bde0cb;
  background: var(--success-soft);
  color: #1f6747;
}

.status.failed,
.status.runtime_failed,
.status.build_failed,
.status.accuracy_failed {
  border-color: #ebc5c1;
  background: var(--danger-soft);
  color: #8a332d;
}

.status.running,
.status.building,
.status.preparing,
.status.validating,
.status.queued {
  border-color: #ccd2d9;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status.infra_failed,
.status.canceled {
  border-color: var(--line);
  background: var(--surface-soft);
  color: #5f6771;
}

.quota {
  display: flex;
  min-width: 200px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid #ccd2d9;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.quota strong {
  color: var(--accent-strong);
  font: 650 32px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.quota span {
  max-width: 140px;
  color: #4a5058;
  font-size: 13px;
  line-height: 1.4;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.metric-grid div {
  min-width: 0;
  padding: 22px;
  background: var(--surface);
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-grid strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 8px;
  color: var(--ink);
  font: 650 20px/1.3 var(--font-mono);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

dl {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  margin: 22px 0;
  font-size: 15px;
}

dt {
  color: var(--muted);
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

pre {
  overflow: auto;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: #14171e;
  color: #e0e4e9;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.log {
  min-height: 90px;
  max-height: 420px;
}

/* ----------------------------------------------------------------- admin */

.tiny {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
}

.tiny:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.tiny.danger {
  border-color: #dfb8b4;
  color: var(--danger);
}

.settings {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-weight: 450;
}

.settings input {
  width: 90px;
  min-height: 32px;
  margin: 0;
  padding: 5px 8px;
  font-size: 13px;
}

.settings input[type="checkbox"] {
  width: auto;
}

.review-form {
  display: grid;
  grid-template-columns: 130px 200px auto;
  gap: 5px;
  margin-top: 8px;
}

.review-form input,
.review-form select {
  min-height: 32px;
  margin: 0;
  padding: 5px 8px;
  font-size: 12px;
}

/* ----------------------------------------------------------------- prose */

.form-page,
.prose {
  color: var(--ink-soft);
}

.form-page > p:not(.eyebrow),
.prose > p {
  line-height: 1.72;
}

.prose {
  max-width: 900px;
  font-size: 16px;
}

.prose h2 {
  margin: 42px 0 12px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.prose pre {
  margin: 20px 0;
}

.prose ul {
  margin: 14px 0 26px;
  padding-left: 22px;
}

.prose ul li {
  margin: 10px 0;
  line-height: 1.65;
}

.prose a:not(.button),
.form-page p a,
.form-page small a,
.empty p a,
.panel dd a,
.panel > a:not(.button),
td > a:not(.button) {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #c3c9d0;
  text-underline-offset: 3px;
}

.starter-page {
  max-width: 920px;
}

.starter-page h1 {
  font-size: clamp(38px, 5vw, 58px);
}

.starter-page .button {
  color: #fff;
  text-decoration: none;
}

.starter-hash {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* ------------------------------------------------------------ model page */

.model-page {
  max-width: 920px;
}

.model-page h1 {
  font-size: clamp(38px, 5vw, 58px);
}

.model-page .metric-grid {
  margin: 28px 0 6px;
}

.model-page pre {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.model-page ol {
  padding-left: 22px;
}

.model-page ol li {
  margin: 10px 0;
  line-height: 1.6;
}

.model-chart {
  margin: 24px 0 32px;
}

.model-chart figcaption strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.model-chart figcaption span {
  display: block;
  margin: 3px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.model-chart__row {
  display: grid;
  align-items: center;
  grid-template-columns: 148px minmax(0, 1fr) 64px;
  gap: 0 14px;
  padding: 7px 0;
}

.model-chart__row + .model-chart__row {
  border-top: 1px solid var(--line);
}

.model-chart__label {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.35;
}

.model-chart__label small {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.model-chart__track {
  position: relative;
  height: 20px;
}

.model-chart__bar {
  position: absolute;
  inset: 1px auto 1px 0;
  min-width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.model-chart__bar--context {
  background: #bec4cb;
}

.model-chart__value {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Bar lengths are utility classes because the CSP forbids inline styles. */
.model-chart__bar--w1000 { width: 100%; }
.model-chart__bar--w911 { width: 91.1%; }
.model-chart__bar--w900 { width: 90%; }
.model-chart__bar--w899 { width: 89.9%; }
.model-chart__bar--w877 { width: 87.7%; }
.model-chart__bar--w824 { width: 82.4%; }
.model-chart__bar--w701 { width: 70.1%; }
.model-chart__bar--w625 { width: 62.5%; }
.model-chart__bar--w563 { width: 56.3%; }
.model-chart__bar--w500 { width: 50%; }
.model-chart__bar--w305 { width: 30.5%; }
.model-chart__bar--w250 { width: 25%; }
.model-chart__bar--w188 { width: 18.8%; }
.model-chart__bar--w152 { width: 15.2%; }
.model-chart__bar--w125 { width: 12.5%; }

@media (max-width: 640px) {
  .model-chart__row {
    grid-template-columns: 104px minmax(0, 1fr) 58px;
  }
}

/* ------------------------------------------------------- reference target */

.target-page {
  max-width: 920px;
  margin: 64px auto 76px;
}

.target-section,
.reference-proof {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.target-section {
  padding: clamp(32px, 5vw, 52px);
}

.target-header {
  max-width: 720px;
  padding-bottom: 32px;
}

.target-header h1,
.reference-proof__header h2 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.target-header h1 {
  font-size: clamp(38px, 5vw, 52px);
}

.target-header > p:last-child,
.reference-proof__header > p:last-child {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.target-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--line);
  gap: 1px;
}

.target-metrics > div {
  min-width: 0;
  padding: 21px 18px;
  background: var(--surface-soft);
}

.target-metrics dt,
.target-identifier > span,
.reference-artifacts dt,
.reference-recipe dt,
.reference-sources > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.target-metrics dd {
  overflow-wrap: anywhere;
  margin: 8px 0 0;
  color: var(--ink);
  font: 650 clamp(18px, 2.2vw, 23px)/1.2 var(--font-mono);
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.target-metrics small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.target-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  margin-top: 38px;
}

.target-detail {
  min-width: 0;
  padding-top: 23px;
  border-top: 1px solid var(--line-strong);
}

.target-detail h2 {
  margin: 0 0 13px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.target-spec-list {
  display: block;
  margin: 0;
}

.target-spec-list > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.target-spec-list > div:last-child {
  border-bottom: 0;
}

.target-spec-list dt {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.target-spec-list dd {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.target-identifier {
  margin-top: 38px;
  padding: 23px 24px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.target-identifier > code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
}

.target-identifier > dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 20px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line-strong);
}

.target-identifier dl > div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.target-identifier dt {
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 650;
}

.target-identifier dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.reference-proof {
  margin-top: 28px;
  padding: clamp(32px, 5vw, 48px);
  background: var(--surface-soft);
}

.reference-proof__header {
  max-width: 700px;
}

.reference-proof__header h2 {
  font-size: clamp(30px, 4vw, 40px);
}

.reference-artifacts {
  display: block;
  margin: 30px 0 0;
}

.reference-artifacts > div {
  padding: 18px 0;
  border-top: 1px solid var(--line-strong);
}

.reference-artifacts dd {
  margin: 7px 0 0;
}

.reference-artifacts code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.reference-recipe {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  margin: 12px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--line-strong);
  gap: 1px;
}

.reference-recipe > div {
  min-width: 0;
  padding: 17px 19px;
  background: var(--surface);
}

.reference-recipe dd {
  overflow-wrap: anywhere;
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.reference-recipe code {
  color: var(--ink);
  font-size: 0.94em;
}

.reference-note {
  margin: 24px 0 0;
  padding: 16px 18px;
  border-left: 2px solid var(--ink);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.reference-note strong {
  color: var(--ink);
}

.reference-note a,
.reference-sources a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.reference-sources {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 25px;
}

.reference-sources a {
  font-size: 13px;
}

@media (max-width: 800px) {
  .target-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .target-detail-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .target-identifier > dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .target-page {
    margin: 34px auto 54px;
  }

  .target-section,
  .reference-proof {
    padding: 28px 23px;
  }

  .target-header h1 {
    font-size: 36px;
  }

  .target-metrics,
  .reference-recipe {
    grid-template-columns: 1fr;
  }

  .target-identifier {
    padding: 21px 18px;
  }

  .target-identifier dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .reference-sources {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ---------------------------------------------------------- machine page */

.machine-diagram {
  margin: 30px 0 34px;
}

.machine-diagram__chip {
  max-width: 560px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.machine-diagram__chip-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.machine-diagram__compute {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
}

.machine-diagram__block {
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.machine-diagram__block strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.machine-diagram__block span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.machine-diagram__link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
}

.machine-diagram__link::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  border-top: 2px dashed var(--line-strong);
}

.machine-diagram__link span {
  position: relative;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.machine-diagram__memory {
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.machine-diagram__memory strong {
  display: block;
  font-size: 14px;
}

.machine-diagram__memory span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.machine-diagram figcaption {
  max-width: 640px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 520px) {
  .machine-diagram__compute {
    grid-template-columns: minmax(0, 1fr);
  }

  .machine-diagram__link {
    padding: 7px 0;
  }

  .machine-diagram__link::before {
    inset: 0 auto 0 50%;
    border-top: 0;
    border-left: 2px dashed var(--line-strong);
  }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer__inner {
  display: flex;
  width: min(1080px, calc(100% - 48px));
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 0 auto;
}

.site-footer strong {
  font-size: 15px;
}

.site-footer p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

@media (max-width: 1040px) {
  .site-header__inner {
    gap: 28px;
  }

  .primary-nav {
    gap: 22px;
  }

  .auth-shell {
    grid-template-columns: minmax(0, 0.85fr) minmax(410px, 1.15fr);
  }
}

@media (max-width: 880px) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 22px;
    padding-top: 12px;
  }

  .account-nav {
    grid-column: 2;
    grid-row: 1;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 26px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .primary-nav a {
    padding: 15px 0 13px;
  }

  .hero {
    padding-top: 60px;
  }

  .auth-page .site-main {
    display: block;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    width: min(650px, 100%);
  }

  .auth-shell .auth-card,
  .auth-aside {
    grid-column: 1;
    grid-row: auto;
  }

  .auth-aside {
    min-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .site-header__inner,
  .site-main,
  .site-footer__inner {
    width: min(100% - 28px, 1080px);
  }

  .site-header__inner {
    column-gap: 12px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }

  .brand-mark img {
    width: 16px;
    height: 16px;
  }

  .brand-name {
    font-size: 15px;
  }

  .account-tab {
    padding: 10px 12px;
  }

  .user-name {
    display: none;
  }

  .primary-nav {
    gap: 22px;
  }

  .primary-nav a {
    font-size: 13px;
  }

  .hero {
    padding: 48px 0 0;
  }

  .hero h1 {
    font-size: clamp(36px, 11vw, 52px);
  }

  .lede {
    margin-top: 18px;
    font-size: 16px;
  }

  .hero-actions {
    align-items: center;
    flex-direction: column;
    gap: 12px;
    margin-top: 26px;
  }

  .record-card {
    margin-top: 38px;
  }

  .record-card__main {
    padding: 30px 17px 28px;
  }

  .record-card__value {
    font-size: clamp(38px, 12vw, 56px);
  }

  .record-card__meta {
    font-size: 12.5px;
  }

  .record-card__facts {
    grid-template-columns: 1fr;
  }

  .record-fact + .record-fact {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .home-section {
    padding-top: 46px;
  }

  .home-section:last-of-type {
    margin-bottom: 48px;
  }

  .home-section__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .panel {
    padding: 21px;
  }

  .ranking-chart {
    min-height: 364px;
    margin: 18px 14px 0;
  }

  .ranking-chart__svg {
    height: 360px;
  }

  .ranking-chart--single {
    min-height: 244px;
  }

  .ranking-chart--single .ranking-chart__svg {
    height: 240px;
  }

  .ranking-chart__tooltip {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    margin: 0 12px 12px;
  }

  .ranking-chart__legend {
    gap: 12px 18px;
    margin: 0;
    padding: 14px 16px 16px;
  }

  .ranking-chart__legend-item {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .ranking-chart__legend-score {
    font-size: 12px;
  }

  th:first-child,
  td:first-child {
    padding-left: 21px;
  }

  th:last-child,
  td:last-child {
    padding-right: 21px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    padding: 42px 0 26px;
  }

  .page-heading h1,
  .form-page h1,
  .prose h1 {
    font-size: 34px;
  }

  .quota {
    min-width: 0;
  }

  .auth-shell {
    min-height: 0;
    margin: 34px auto;
    border-radius: var(--radius);
  }

  .auth-aside {
    min-height: 300px;
    padding: 32px 27px;
  }

  .auth-aside h1 {
    font-size: 32px;
  }

  .auth-card__body {
    padding: 32px 24px 36px;
  }

  .site-main > .auth-card,
  .form-page,
  .prose {
    margin: 34px auto;
    padding: 28px 23px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  dd + dt {
    margin-top: 9px;
  }

  .list-row {
    align-items: flex-start;
  }

  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 30px 0;
  }
}

/* ------------------------------------------- model context & inspiration */
/* The two narrative sections on /model between the spec sheet and the
   digest proof. Figures are native monochrome redrawings: series identity is
   carried by gray value plus mark shape (filled vs hollow), never hue, so
   they survive color-blindness and grayscale printing like the leaderboard
   chart does. */

.model-context,
.model-inspiration {
  margin-top: 28px;
  padding: clamp(32px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.model-context__header,
.model-inspiration__header {
  max-width: 720px;
}

.model-context__header h2,
.model-inspiration__header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.model-context__header > p:last-child,
.model-inspiration__header > p:last-child {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.model-context h3 {
  margin: 42px 0 0;
  color: var(--ink);
  font-size: 19px;
  letter-spacing: -0.01em;
}

.model-context p,
.model-inspiration p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

/* Condensed narrative: the context and origin sections carry their prose as
   compact bullet lists, matching the .prose list rhythm on the rules page. */
.model-bullets {
  max-width: 760px;
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 15px;
}

.model-bullets li {
  margin: 10px 0;
  line-height: 1.65;
}

.model-context p a,
.model-inspiration p a,
.model-bullets a,
.paper-figure__source a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

/* ----------------------------------------------------- redrawn figures */

.paper-figure {
  margin: 30px 0 0;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.paper-figure > figcaption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.paper-figure > figcaption strong {
  color: var(--ink);
  font-size: 15px;
}

.paper-figure > figcaption span {
  color: var(--muted);
  font-size: 13px;
}

.paper-figure__legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 14px 0 4px;
  color: var(--ink-soft);
  font-size: 13px;
}

.paper-figure__legend > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.paper-figure__swatch {
  display: inline-block;
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.paper-figure__swatch--family {
  background: var(--ink);
}

.paper-figure__swatch--context {
  border: 2px solid var(--muted);
  background: var(--surface);
}

/* Rotated square = the hollow-diamond mark for private-corpus models. */
.paper-figure__swatch--private {
  width: 9px;
  height: 9px;
  border: 2px solid var(--muted);
  border-radius: 1px;
  background: var(--surface);
  transform: rotate(45deg);
}

.paper-figure__source {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Scatter SVG. 11px tick text is the documented SVG exemption from the 12px
   floor (DESIGN.md); everything else in the plot is 12px or larger. */

.paper-scatter {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 6px;
}

.paper-scatter__grid {
  stroke: var(--line);
  stroke-width: 1;
}

.paper-scatter__grid--ref {
  stroke: var(--line-strong);
  stroke-dasharray: 5 4;
}

.paper-scatter__axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.paper-scatter__tick {
  fill: var(--muted);
  font: 11px var(--font-mono);
}

.paper-scatter__family-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}

.paper-scatter__halo {
  fill: var(--surface);
}

.paper-scatter__context {
  fill: var(--surface);
  stroke: var(--muted);
  stroke-width: 1.8;
}

.paper-scatter__family {
  fill: var(--ink);
}

.paper-scatter__lbl {
  fill: var(--ink-soft);
  font: 12px var(--font-sans);
}

.paper-scatter__lbl--family {
  fill: var(--ink);
  font-weight: 650;
}

.paper-scatter__val {
  fill: var(--muted);
  font: 11px var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* MIM pretraining diagram: student lane, teacher lane, loss rule. */

.mim-diagram__lane {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1.2fr) max-content minmax(0, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.mim-diagram__block {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.mim-diagram__block--strong {
  border-color: var(--ink);
  background: var(--surface);
}

.mim-diagram__block strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.mim-diagram__block span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mim-diagram__arrow {
  align-self: center;
  color: var(--muted);
  font-size: 15px;
}

.mim-diagram__loss {
  margin: 16px 0 0;
  padding: 13px 16px;
  border-left: 2px solid var(--ink);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.mim-diagram__chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mim-diagram__chain > span {
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.mim-diagram__chain > span.mim-diagram__chain-final {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
  font-weight: 650;
}

/* TrV block diagram: the 2020 ViT block next to EVA-02's block. */

.trv-diagram__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 14px;
}

.trv-diagram__name {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.trv-diagram__cell {
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.trv-diagram__cell + .trv-diagram__cell {
  margin-top: 6px;
}

.trv-diagram__cell small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.trv-diagram__cell--new {
  border-color: var(--ink);
  background: var(--surface-soft);
}

.trv-diagram__cell--sum {
  padding: 6px 14px;
  border-style: dashed;
  border-color: var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.trv-diagram__ladder {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.trv-diagram__ladder code {
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* Mirror card in the inspiration section. */

.inspiration-mirror {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  margin: 26px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--line-strong);
  gap: 1px;
}

.inspiration-mirror > div {
  min-width: 0;
  padding: 19px 21px;
  background: var(--surface);
}

.inspiration-mirror dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inspiration-mirror dd {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.inspiration-mirror dd strong {
  color: var(--ink);
}

@media (max-width: 800px) {
  .mim-diagram__lane {
    grid-template-columns: 1fr;
  }

  .mim-diagram__arrow {
    align-self: start;
    transform: rotate(90deg);
    margin-left: 14px;
  }

  .trv-diagram__cols,
  .inspiration-mirror {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .model-context,
  .model-inspiration {
    padding: 28px 23px;
  }

  .paper-figure {
    padding: 16px 14px 14px;
  }
}

/* ------------------------------------------------------ admin copy editor */

.copy-editor-intro p {
  max-width: 860px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.copy-editor-intro code {
  font-size: 13px;
}

.copy-editor > summary {
  display: flex;
  align-items: baseline;
  gap: 14px;
  cursor: pointer;
  font-weight: 700;
}

.copy-editor > summary::marker {
  color: var(--muted);
}

.copy-editor__page {
  color: var(--ink);
  font-size: 19px;
}

.copy-editor > summary small {
  color: var(--muted);
  font-size: 13px;
}

.copy-slot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.copy-slot__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.copy-slot__head strong {
  color: var(--ink);
  font-size: 14px;
}

.copy-slot__head code {
  color: var(--muted);
  font-size: 12px;
}

.copy-slot__kind,
.copy-slot__edited {
  padding: 1px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.copy-slot__edited {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.copy-slot textarea {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: 13px/1.55 var(--font-mono);
  resize: vertical;
}

.copy-slot textarea:focus-visible {
  outline: 3px solid rgba(20, 23, 30, 0.35);
  outline-offset: 1px;
}

.copy-slot__actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

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

/* ------------------------------------------------------- pre-submit check */

/* The browser-side archive report. Advisory only: the server re-validates
   every upload, so this states facts and never blocks the submit button. */
.archive-check {
  margin: 12px 0 4px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1.5;
}

.archive-check ul {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}

.archive-check li {
  color: var(--ink-soft);
}

.archive-check li:first-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.archive-check.is-ok {
  border-left-color: var(--success);
}

.archive-check.is-ok li:last-child {
  color: var(--success);
  font-weight: 600;
}

.archive-check.is-bad {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.archive-check.is-bad li:not(:first-child) {
  color: var(--danger);
  font-weight: 600;
}

/* ------------------------------------------------------------- practice */

/* A secondary button for the cohort download: the practice tab already has a
   primary action (run it), so the self-scoring path must not compete. */
.button.secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.button.secondary:hover {
  background: var(--surface-soft);
}

/* Failure detail sits in its own full-width row under the run it explains,
   so the table keeps five aligned columns. */
.practice-failure td {
  color: var(--danger);
  font-size: 13px;
  padding-top: 0;
  border-top: 0;
}

.practice-failure strong {
  font-family: var(--font-mono);
  margin-right: 6px;
}
