/* ME brand — Language Model Lab
   Fonts: Archivo (display), Source Serif 4 (serif), IBM Plex Mono (mono)
   Tokens from: ME brand-kit / web/me-tokens.css */
@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;700;800&family=IBM+Plex+Mono:wght@400;500&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap");

:root {
  /* ── ME colour tokens ───────────────────── */
  --paper:       #fafaf8;
  --paper-2:     #f0f0ec;
  --ink:         #0b0b0c;
  --ink-muted:   #55555a;
  --rule:        #d6d6d1;
  --signal:      #1d4e63;   /* petrol blue accent */
  --on-signal:   #fafaf8;
  --focus:       #0b0b0c;
  --signal-tint: #d8eaf1;   /* light petrol tint */
  --signal-mid:  #4d8fa6;   /* mid petrol */

  /* ── ME spacing tokens ──────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  --space-7: 104px;

  /* ── ME font stacks ─────────────────────── */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-serif:   "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* ── Shims so existing var() refs still resolve ── */
  --card:   var(--paper-2);
  --line:   var(--rule);
  --green:  var(--signal);
  --muted:  var(--ink-muted);
  --mono:   var(--font-mono);
  --radius: 2px;   /* square corners per brand guide */
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:       #0e0e0f;
    --paper-2:     #18181a;
    --ink:         #f2f2ef;
    --ink-muted:   #a3a3a0;
    --rule:        #2e2e31;
    --signal:      #7db8cf;
    --on-signal:   #0b0b0c;
    --focus:       #7db8cf;
    --signal-tint: #1a3340;
    --signal-mid:  #4a8aa3;
  }
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box }
html { scroll-behavior: smooth }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
}
button, input { font: inherit }
button, a, input, summary { -webkit-tap-highlight-color: transparent }
button { cursor: pointer }
button:disabled { cursor: default; opacity: .42 }
button:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
a { color: inherit }
button { color: inherit }
h1, h2, h3, p { margin: 0 }
h2 { font-size: 19px; font-weight: 600 }
h3 { font-size: 19px }

/* ── Layout shell ───────────────────────────────── */
.site-header, main, footer {
  max-width: 1220px;
  margin: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}
.site-header {
  height: 102px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}

/* ── Brand ──────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--ink);
}
.brand-icon {
  width: 37px;
  height: 37px;
  border-radius: 0;             /* square per brand guide */
  background: var(--signal);
  color: var(--on-signal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-icon svg { display: block }

/* ── Local badge ────────────────────────────────── */
.local-badge {
  font: 12px var(--font-mono);
  color: var(--ink-muted);
  display: flex;
  gap: 9px;
  align-items: center;
}
.local-badge i, .live-dot i {
  width: 6px;
  height: 6px;
  background: var(--signal);
  border-radius: 50%;
  display: inline-block;
}

/* ── Intro ──────────────────────────────────────── */
.intro {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: end;
  gap: 60px;
  padding: 58px 0 45px;
}
.eyebrow {
  font: 12px var(--font-mono);
  letter-spacing: 1.6px;
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 15px;
  color: var(--ink-muted);
}
.intro h1 {
  font-family: var(--font-display);
  font-size: 58px;
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -1.9px;
  text-wrap: balance;
}
/* Petrol-blue underline on the emphasised phrase — the ME signature device */
.intro h1 em {
  font-style: normal;
  font-weight: 800;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}
.intro-copy {
  max-width: 340px;
  justify-self: end;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-muted);
  padding-bottom: 4px;
}
.text-link {
  display: inline-block;
  margin-top: 19px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--signal);
  padding-bottom: 3px;
  color: var(--ink);
}
.text-link span { margin-left: 22px }

/* ── Section header line ────────────────────────── */
.section-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0 16px;
  gap: 15px;
}
.section-line > span { font-size: 12px; color: var(--ink-muted) }
.section-number {
  font: 12px var(--font-mono);
  color: var(--ink-muted);
  margin-right: 10px;
}

/* ── Model picker ───────────────────────────────── */
.model-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.model-option {
  text-align: left;
  padding: 20px 22px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  transition: border-color .18s, background .18s;
}
.model-option:hover:not(:disabled) { border-color: var(--signal) }
.model-option[aria-pressed=true] {
  background: var(--signal);
  color: var(--on-signal);
  border-color: var(--signal);
}
.model-index {
  display: block;
  font: 12px var(--font-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: 9px;
}
.model-option strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 9px;
}
.model-option > span:last-child {
  font-size: 12px;
  opacity: .83;
  line-height: 1.6;
  display: block;
}
.selected-dot { visibility: hidden; color: var(--on-signal) }
[aria-pressed=true] .selected-dot { visibility: visible }

/* ── Workspace ──────────────────────────────────── */
.workspace {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.generation-card, .probability-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 25px;
  height: 100%;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.card-heading h2 { font-size: 15px }
.mini-label {
  font: 12px var(--font-mono);
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 5px 8px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.live-dot {
  font: 12px var(--font-mono);
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--signal);
  text-transform: uppercase;
}

/* ── Prefix form ────────────────────────────────── */
.prefix-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.input-row { display: flex; gap: 9px }
input[type=text],
input:not([type]),
input[type=number] {
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 13px;
  background: var(--paper);
  color: var(--ink);
}
#prefix {
  flex: 1;
  width: 100%;
  font: 16px var(--font-mono);
  height: 43px;
}

/* ── Buttons ────────────────────────────────────── */
.button {
  border-radius: var(--radius);
  padding: 11px 15px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  white-space: nowrap;
  transition: background .15s;
}
.primary {
  background: var(--signal);
  color: var(--on-signal);
  border: 1px solid var(--signal);
}
.primary:hover:not(:disabled) { background: #163a4a }
.secondary {
  background: transparent;
  border: 1px solid var(--rule);
}
.secondary:hover:not(:disabled) { background: var(--paper-2) }
.small { font-size: 12px; line-height: 1.65 }
.muted { color: var(--ink-muted) }
#prefix-help { margin-top: 7px }

/* ── Sequence ───────────────────────────────────── */
.sequence-area { margin-top: 26px; margin-bottom: 23px }
.sequence-label {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  font: 12px var(--font-mono);
  color: var(--ink-muted);
  text-transform: uppercase;
}
#sequence-status { font-family: inherit; text-align: right }
.sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 94px;
  padding: 20px 0;
}
.character {
  font: 32px/1.2 var(--font-mono);
  min-width: 32px;
  text-align: center;
  padding: 6px 6px 8px;
  border-bottom: 2px solid var(--rule);
}
.character.generated {
  color: var(--signal);
  background: var(--signal-tint);
  border-radius: 0;
  border-bottom-color: transparent;
  animation: appear .22s ease-out;
}
.character.ignored { opacity: .5 }
.character.end {
  font: 12px var(--font-mono);
  align-self: center;
  border: 1px solid var(--signal);
  border-radius: var(--radius);
  padding: 8px;
  color: var(--signal);
  margin-left: 4px;
  text-transform: uppercase;
}
.cursor {
  width: 2px;
  height: 35px;
  background: var(--signal);
  opacity: .6;
  margin-left: 3px;
  animation: blink 1.4s ease infinite;
}
.sequence-key { display: flex; gap: 18px; font-size: 12px; color: var(--ink-muted) }
.sequence-key span { display: flex; align-items: center; gap: 6px }
.sequence-key i { width: 8px; height: 8px; border-radius: 0 }
.prefix-swatch { background: var(--rule) }
.generated-swatch { background: var(--signal-tint); border: 1px solid var(--signal-mid) }

/* ── Action row ─────────────────────────────────── */
.action-row { display: flex; gap: 9px }
.action-row .primary { flex: 1; justify-content: space-between }
.utility-row { display: flex; gap: 20px; margin-top: 11px }
.text-button {
  border: 0;
  background: none;
  padding: 7px 0;
  font-size: 12px;
  color: var(--ink-muted);
}
.text-button:hover:not(:disabled) {
  color: var(--signal);
  text-decoration: underline;
}
.utility-row #copy { margin-left: auto }

/* ── Temperature ────────────────────────────────── */
.temperature-box {
  border-top: 1px solid var(--rule);
  margin-top: 24px;
  padding-top: 20px;
}
.control-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}
.control-heading output {
  font: 12px var(--font-mono);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 4px 7px;
  border-radius: var(--radius);
}
input[type=range] {
  width: 100%;
  margin: 17px 0 7px;
  accent-color: var(--signal);
  cursor: pointer;
  height: 18px;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 12px;
}
.temperature-box p { margin-top: 12px }

/* ── Seed ───────────────────────────────────────── */
.seed-details {
  margin-top: 20px;
  border-top: 1px solid var(--rule);
  padding-top: 15px;
}
.seed-details summary { font-size: 12px; cursor: pointer; color: var(--ink-muted) }
.seed-row { display: flex; align-items: center; gap: 10px; margin: 12px 0 }
.seed-row label { font-size: 12px }
.seed-row input { width: 95px; font: 12px var(--font-mono) }
.compact { padding: 7px 10px; min-height: 34px; font-size: 12px }

/* ── Probability card ───────────────────────────── */
.probability-card > .card-heading { margin-bottom: 10px }
.probability-bars {
  margin-top: 21px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 254px;
}
.probability-row {
  display: grid;
  grid-template-columns: 30px 1fr 53px;
  align-items: center;
  gap: 10px;
  font: 12px var(--font-mono);
}
.probability-track {
  height: 19px;
  background: var(--paper);
  border-radius: 0;
  overflow: hidden;
}
.probability-fill {
  height: 100%;
  background: var(--signal-mid);
  border-radius: 0;
  min-width: 1px;
  transition: width .2s ease-out;
}
.probability-row:first-child .probability-fill { background: var(--signal) }
.probability-value { text-align: right; font-size: 12px; color: var(--ink-muted) }
.show-all { width: 100%; text-align: center; margin-top: 12px }

/* ── Prediction note ────────────────────────────── */
.prediction-note {
  display: flex;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 0;
  background: var(--paper-2);
  border-left: 2px solid var(--signal);
  margin: 13px 0 21px;
}
.prediction-note p { font-size: 12px; color: var(--ink-muted); line-height: 1.6 }
.prediction-note strong { color: var(--ink); font-weight: 700 }
.note-symbol { font-size: 18px }

/* ── Context box ────────────────────────────────── */
.context-box { border-top: 1px solid var(--rule); padding-top: 18px }
.context-box .eyebrow { font-size: 12px; margin-bottom: 11px }
.context-tokens { display: flex; gap: 6px; margin-bottom: 10px }
.context-token {
  font: 15px var(--font-mono);
  width: 34px;
  height: 33px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.context-token.padding {
  color: var(--ink-muted);
  background: transparent;
  border-style: dashed;
}

/* ── Attention panel ────────────────────────────── */
.attention-panel {
  margin-top: 20px;
  padding: 23px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.attention-panel[hidden] { display: none }
.attention-panel .eyebrow { margin-bottom: 8px }
.attention-panel p.small { margin-top: 8px; max-width: 410px }
.attention-grid { display: grid; gap: 7px; align-content: center }
.attention-row {
  display: grid;
  grid-template-columns: 48px repeat(6, 1fr);
  gap: 5px;
  align-items: center;
}
.attention-row > span:first-child { font: 12px var(--font-mono) }
.attention-cell {
  text-align: center;
  border-radius: 0;
  padding: 8px 3px;
  font: 12px var(--font-mono);
}
.attention-cell small { display: block; font-size: 12px; margin-top: 3px }

/* ── History panel ──────────────────────────────── */
.history-panel {
  margin-top: 20px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper-2);
}
.history-panel summary { padding: 17px 20px; font-size: 12px; cursor: pointer }
.history-panel summary span {
  float: right;
  font: 12px var(--font-mono);
  color: var(--ink-muted);
  margin-top: 2px;
}
.table-wrap { overflow: auto }
table {
  border-collapse: collapse;
  width: 100%;
  font: 12px var(--font-mono);
  text-align: left;
}
th, td {
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  white-space: nowrap;
}
th {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Comparison section ─────────────────────────── */
.compare-section { margin: 44px 0 }
.comparison {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 13px;
}
.compare-card {
  padding: 19px;
  border: 1px solid var(--rule);
  border-radius: 0;
}
.compare-card.selected {
  border-color: var(--signal);
  background: var(--signal-tint);
}
.compare-card h3 {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.compare-card h3 small {
  font: 12px var(--font-mono);
  font-weight: 400;
  color: var(--ink-muted);
}
.compare-options { display: flex; gap: 13px; margin: 16px 0 }
.compare-item { flex: 1 }
.compare-item b { display: block; font: 700 23px var(--font-display) }
.compare-item small { font: 12px var(--font-mono); color: var(--ink-muted) }
.compare-meta { font-size: 12px; color: var(--ink-muted) }

/* ── Guide / how-it-works section ──────────────── */
.guide {
  border-top: 1px solid var(--rule);
  padding-top: 45px;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 80px;
  margin-bottom: 40px;
}
.guide h2 {
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1px;
}
.guide > div > p:last-child {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ink-muted);
  margin-top: 17px;
  max-width: 320px;
  line-height: 1.65;
}
.guide ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.guide li { display: flex; gap: 20px }
.guide li > span { font: 12px var(--font-mono); color: var(--signal); padding-top: 3px }
.guide h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px }
.guide li p {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ── Tab bar ─────────────────────────────────────── */
.tab-bar {
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--rule);
}
.tab-btn {
  border: 0;
  background: none;
  padding: 14px 0;
  margin-right: 30px;
  font: 500 12px var(--font-mono);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--ink) }
.tab-btn[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--signal);
}
[role="tabpanel"] { padding-top: 36px }

/* Guide inside its own panel — remove the top rule, panel padding is enough */
#panel-guide .guide {
  border-top: none;
  padding-top: 0;
  margin-bottom: 44px;
}

/* ── About panel ─────────────────────────────────── */
.about-panel {
  padding-bottom: 48px;
  max-width: 850px;
}
.about-panel p {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-top: 10px;
  max-width: 850px;
}
.about-panel > .eyebrow:first-child { margin-bottom: 4px }
.about-subhead { margin-top: 36px; margin-bottom: 4px }
.about-panel #model-facts p { margin-top: 8px }

/* ── Footer ─────────────────────────────────────── */
footer {
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 30px;
  font: 12px var(--font-mono);
  letter-spacing: .6px;
  color: var(--ink-muted);
  gap: 15px;
  text-transform: uppercase;
}
.footer-separator { margin: 0 10px }

/* ── Notice / error ─────────────────────────────── */
.notice {
  padding: 13px 15px;
  background: var(--paper-2);
  font-size: 12px;
  border-radius: 0;
  margin-bottom: 20px;
  border-left: 2px solid var(--signal);
}
.error {
  padding: 14px;
  background: #fbece5;
  color: #85391e;
  border: 1px solid #ddbea9;
  border-radius: 0;
  margin: 15px 0;
  font-size: 13px;
}

/* ── Utility ────────────────────────────────────── */
[hidden] { display: none !important }
.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: absolute; left: 20px; top: -60px;
  background: var(--ink); color: var(--on-signal);
  padding: 10px; z-index: 2;
}
.skip-link:focus { top: 10px }

/* ── Animations ─────────────────────────────────── */
@keyframes appear {
  from { transform: translateY(5px); opacity: .1 }
  to   { transform: translateY(0);   opacity: 1  }
}
@keyframes blink { 50% { opacity: 0 } }

/* ── Model explainers ───────────────────────────── */
.model-explainers { margin-bottom: 44px }
.explainer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 4px;
}
.explainer-card {
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.explainer-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 8px 0 14px;
}
.explainer-lead {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 16px;
}
.explainer-card dl { margin: 0 }
.explainer-card dt {
  font: 700 12px var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--signal);
  margin-top: 14px;
  margin-bottom: 4px;
}
.explainer-card dt:first-child { margin-top: 0 }
.explainer-card dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.65;
}
.explainer-card dd em { font-style: italic }

/* ── Sampling explainer ──────────────────────────── */
.sampling-explainer {
  border-top: 1px solid var(--rule);
  padding-top: 36px;
  margin-bottom: 48px;
}
.sampling-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 20px;
}
.sampling-grid > div > p {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-top: 16px;
}
.sampling-grid > div > p:first-child { margin-top: 0 }
.sampling-grid > div > p strong { color: var(--ink) }
.sampling-comparison { margin: 0 }
.sampling-comparison dt {
  font: 700 12px var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--signal);
  margin-top: 20px;
  margin-bottom: 5px;
}
.sampling-comparison dt:first-child { margin-top: 0 }
.sampling-comparison dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-muted);
  line-height: 1.65;
}

/* ── Responsive — wide ──────────────────────────── */
@media (min-width: 1400px) {
  .intro { padding-top: 65px; padding-bottom: 52px }
  .intro h1 { font-size: 64px }
}

/* ── Responsive — tablet ────────────────────────── */
@media (max-width: 850px) {
  .site-header, main, footer { padding-left: var(--space-4); padding-right: var(--space-4) }
  .intro { gap: 30px }
  .intro h1 { font-size: 48px }
  .intro-copy { font-size: 16px }
  .workspace { grid-template-columns: 1fr 1fr; gap: 12px }
  .generation-card, .probability-card { padding: 18px }
  .card-heading { align-items: flex-start }
  .card-heading h2 { font-size: 12px }
  .mini-label { font-size: 12px }
  .input-row { flex-wrap: wrap }
  .input-row .button { width: 100% }
  .model-option { padding: 17px }
  .model-option strong { font-size: 16px }
  .seed-row { flex-wrap: wrap }
  .attention-panel { gap: 20px }
  .guide { gap: 35px }
  .explainer-grid { grid-template-columns: 1fr; gap: 10px }
  .sampling-grid { grid-template-columns: 1fr; gap: 32px }
}

/* ── Responsive — mobile ────────────────────────── */
@media (max-width: 620px) {
  .site-header, main, footer { padding-left: var(--space-3); padding-right: var(--space-3) }
  .site-header { height: 77px }
  .brand { font-size: 12px; letter-spacing: 1px; gap: 9px }
  .brand-icon { width: 31px; height: 31px }
  .local-badge { font-size: 0; gap: 0 }
  .local-badge i { width: 7px; height: 7px }
  .intro { grid-template-columns: 1fr; gap: 22px; padding: 33px 0 }
  .intro h1 { font-size: 45px }
  .intro-copy { justify-self: start; max-width: 340px; font-size: 16px }
  .intro-copy .text-link { margin-top: 12px }
  .section-line { align-items: flex-start }
  .section-line h2 { font-size: 14px }
  .section-line > span { display: none }
  .model-picker { gap: 7px; margin-bottom: 17px }
  .model-option { padding: 13px 10px }
  .model-index { font-size: 12px; letter-spacing: 0; margin-bottom: 8px }
  .model-option strong { font-size: 12px; gap: 4px }
  .model-option > span:last-child { font-size: 12px; line-height: 1.5 }
  .model-option > span:last-child br { display: none }
  .selected-dot { display: none }
  .workspace { grid-template-columns: 1fr; gap: 14px }
  .generation-card, .probability-card { padding: 20px }
  .card-heading h2 { font-size: 14px }
  .input-row { flex-wrap: nowrap }
  .input-row .button { width: auto; gap: 8px; font-size: 12px; padding: 10px }
  .input-row .button span { display: none }
  .sequence-label { font-size: 12px }
  .sequence { min-height: 90px }
  .probability-bars { min-height: 240px }
  .comparison { grid-template-columns: 1fr; gap: 9px }
  .compare-card { padding: 16px }
  .compare-options { margin: 12px 0; max-width: 240px }
  .compare-section { margin: 32px 0 }
  .attention-panel { grid-template-columns: 1fr; gap: 18px; padding: 20px }
  .guide { grid-template-columns: 1fr; gap: 28px; padding-top: 30px; margin-bottom: 28px }
  .guide h2 { font-size: 34px }
  .guide > div > p:last-child { max-width: none }
  .guide ol { gap: 20px }
  footer { flex-direction: column; gap: 8px }
  .history-panel summary { padding: 16px }
  .table-wrap th, .table-wrap td { padding: 11px 15px }
  .seed-row { flex-wrap: nowrap; gap: 8px }
  .seed-row input { width: 85px }
  .character { font-size: 29px; min-width: 29px }
  .action-row .button { font-size: 12px }
  .tab-btn { font-size: 12px; letter-spacing: .7px; margin-right: 16px }
  [role="tabpanel"] { padding-top: 28px }
}

/* ── Reduced motion ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
