@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/*
 * Two families and one accent, deliberately.
 *
 * Everything structural is neutral; the accent is spent only on the number
 * the product sells (what a turn did not cost) and on the SKU it chose. If
 * the accent shows up anywhere a reader is not meant to look, it stops
 * meaning anything.
 *
 * Mono is not decoration either. It is for figures, SKU names and the prompt
 * itself - anything the reader is meant to compare digit by digit or type
 * into. Prose stays in the sans.
 *
 * Ported from the reference app's styles.css + the StyleX classes its
 * components carried, with the same class names the Go templates use.
 */

:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --paper: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f4f4f2;
  --surface-3: #ecece9;

  --ink: #111113;
  --ink-2: #56565c;
  --ink-3: #8b8b92;

  /* Hairlines, not rules. `--line` separates, `--line-2` is only ever for
     the one edge in a block that should read as its top. */
  --line: rgba(17, 17, 19, 0.07);
  --line-2: rgba(17, 17, 19, 0.13);
  --line-focus: rgba(17, 17, 19, 0.2);

  /* Savings, and only savings. */
  --accent: #0b9a6d;
  --accent-ink: #077553;
  --accent-soft: rgba(11, 154, 109, 0.1);
  --accent-line: rgba(11, 154, 109, 0.28);

  /* The counterfactual: what a default-to-frontier habit would have cost. */
  --spend: #b0532a;
  --spend-soft: rgba(176, 83, 42, 0.12);

  --shadow-sm: 0 1px 2px rgba(17, 17, 19, 0.05);
  --shadow-md:
    0 1px 2px rgba(17, 17, 19, 0.04), 0 8px 24px rgba(17, 17, 19, 0.06);
  --shadow-lg:
    0 1px 2px rgba(17, 17, 19, 0.04), 0 24px 60px rgba(17, 17, 19, 0.1);

  --grid-line: rgba(17, 17, 19, 0.035);
}

:root[data-theme='dark'] {
  --paper: #08080a;
  --surface: #0e0e11;
  --surface-2: #16161a;
  --surface-3: #1e1e23;

  --ink: #f3f3f4;
  --ink-2: #9a9aa2;
  --ink-3: #6a6a73;

  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.11);
  --line-focus: rgba(255, 255, 255, 0.17);

  --accent: #35d39a;
  --accent-ink: #6fe3ba;
  --accent-soft: rgba(53, 211, 154, 0.12);
  --accent-line: rgba(53, 211, 154, 0.3);

  --spend: #e8875a;
  --spend-soft: rgba(232, 135, 90, 0.14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.5);

  --grid-line: rgba(255, 255, 255, 0.028);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #08080a;
    --surface: #0e0e11;
    --surface-2: #16161a;
    --surface-3: #1e1e23;

    --ink: #f3f3f4;
    --ink-2: #9a9aa2;
    --ink-3: #6a6a73;

    --line: rgba(255, 255, 255, 0.06);
    --line-2: rgba(255, 255, 255, 0.11);
    --line-focus: rgba(255, 255, 255, 0.17);

    --accent: #35d39a;
    --accent-ink: #6fe3ba;
    --accent-soft: rgba(53, 211, 154, 0.12);
    --accent-line: rgba(53, 211, 154, 0.3);

    --spend: #e8875a;
    --spend-soft: rgba(232, 135, 90, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.36);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.5);

    --grid-line: rgba(255, 255, 255, 0.028);
  }
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  overflow-x: hidden;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--ink);
  font-family: var(--font-sans);
  background-color: var(--paper);
  overflow-wrap: anywhere;
  /* A grid this faint is not decoration you notice, it is the reason a flat
     page does not read as flat. It fades out below the hero so the decision
     panel sits on plain paper. */
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(180deg, black, transparent 62%);
  mask-image: linear-gradient(180deg, black, transparent 62%);
}

.content { position: relative; z-index: 1; }

/* Tabular figures everywhere a number can change under the reader. */
[data-figure] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* The prompt console draws its own focus, on the parent, as a border one
   shade lighter. */
:where(input, textarea):focus-visible { outline: none; }

::selection { background: var(--accent-soft); }

a {
  /* No `color: inherit` here: anchors set their own colour. */
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-color: currentColor; }

code { font-family: var(--font-mono); font-size: 0.88em; }

/* Dialog entry and exit - @starting-style has no StyleX equivalent, which is
   why this lives here and not beside the modal's other styles. */
dialog {
  opacity: 0;
  transform: translateY(6px) scale(0.985);
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    overlay 220ms allow-discrete,
    display 220ms allow-discrete;
}
dialog[open] { opacity: 1; transform: none; }
@starting-style {
  dialog[open] { opacity: 0; transform: translateY(6px) scale(0.985); }
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0);
  transition:
    background-color 220ms ease,
    overlay 220ms allow-discrete,
    display 220ms allow-discrete;
}
dialog[open]::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
@starting-style {
  dialog[open]::backdrop { background: rgba(0, 0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  dialog, dialog::backdrop { transition-duration: 1ms; transform: none; }
}

/* --- Shared primitives ------------------------------------------------------ */

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

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

.eyebrow {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise-in {
  animation-name: rise-in;
  animation-duration: 520ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: both;
}
.delay-60 { animation-delay: 60ms; }
.delay-120 { animation-delay: 120ms; }
.delay-180 { animation-delay: 180ms; }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fade-in {
  animation-name: fade-in;
  animation-duration: 400ms;
  animation-timing-function: ease-out;
  animation-fill-mode: both;
}

@media (prefers-reduced-motion: reduce) {
  .rise-in, .fade-in { animation-name: none; }
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background-color: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px);
}

.nav {
  width: min(1060px, calc(100% - 2.5rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.8125rem;
}

.nav-link {
  color: var(--ink-2);
  text-decoration: none;
  transition: color 160ms;
}
.nav-link:hover { color: var(--ink); }

.nav-link-wide {
  display: none;
}
@media (min-width: 560px) {
  .nav-link-wide { display: inline; }
}

/* The one link that is a call to action, not a navigation. */
.nav-link-signin {
  color: var(--ink);
  font-weight: 600;
}
.nav-link-signin:hover { color: var(--accent-ink); }

.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.6875rem;
  background-color: transparent;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 160ms, color 160ms;
}
.theme-toggle:hover { border-color: var(--line-2); color: var(--ink); }

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  padding-block: 1.75rem;
}
@media (min-width: 640px) {
  .site-footer { margin-top: 6rem; }
}
.footer-row {
  width: min(1060px, calc(100% - 2.5rem));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.footer-brand {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
}
.footer-note { margin: 0; font-size: 0.75rem; color: var(--ink-3); }

/* --- Hero ---------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-top: 3.5rem;
  padding-bottom: 3rem;
}
@media (min-width: 640px) {
  .hero { padding-top: 5.5rem; padding-bottom: 4rem; }
}

.hero-inner {
  position: relative;
  width: min(1060px, calc(100% - 2.5rem));
  margin-inline: auto;
  text-align: center;
}

.hero-eyebrow { margin-bottom: 1.25rem; }

.hero-title {
  margin: 0 0 1.125rem;
  font-size: clamp(2.25rem, 9vw, 2.875rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.038em;
  color: var(--ink);
}
@media (min-width: 640px) {
  .hero-title { font-size: clamp(2.875rem, 5.6vw, 4rem); }
}

.hero-lead {
  margin: 0 auto 2.25rem;
  max-width: 34rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-2);
}
@media (min-width: 640px) {
  .hero-lead { font-size: 1.0625rem; }
}

.lead-strong {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
}

/* Wider than the prompt box, which sets its own measure. The receipt is a
   table and wants the room; the input does not. */
.console-wrap {
  width: min(1000px, 100%);
  margin-inline: auto;
}

/* --- The physics field ---------------------------------------------------- */

.provider-field-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* The headline sits on top of this, so the middle of the field is masked
     out rather than fought with a lower opacity everywhere. */
  -webkit-mask-image: radial-gradient(ellipse 42% 46% at 50% 46%, transparent 40%, black 78%);
  mask-image: radial-gradient(ellipse 42% 46% at 50% 46%, transparent 40%, black 78%);
  pointer-events: none;
}

provider-field {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

/* --- The prompt console ----------------------------------------------------- */

.console {
  /* A prompt is read as prose, so it keeps a comfortable measure even when
     its container widens for the receipt below. */
  width: min(720px, 100%);
  margin-inline: auto;
  border-radius: 16px;
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--line);
  background-color: var(--surface);
  box-shadow: var(--shadow-lg);
  /* Focus lives on this border and nowhere else: same 1px, one shade
     lighter. The field itself opts out of the global ring above. */
  transition: border-color 180ms, opacity 180ms;
}
.console:focus-within { border-color: var(--line-focus); }
.console-busy { opacity: 0.75; }

.field-wrap { position: relative; }

/* The ghost and the real field have to agree on every metric or the caret
   jumps the moment someone starts typing. One class, both elements. */
.type {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.55;
  letter-spacing: 0;
  padding: 0.375rem 0.5rem;
}
@media (min-width: 640px) {
  .type { font-size: 1rem; }
}

.field {
  display: block;
  position: relative;
  width: 100%;
  /* The box is the hero. A drag handle in its corner is the one affordance
     that makes it look like a form field instead. */
  resize: none;
  height: 3.25rem;
  border-width: 0;
  background-color: transparent;
  color: var(--ink);
}
.field::placeholder { color: var(--ink-3); }

/* While the typewriter is showing, the real placeholder must not. */
.field-ghosted::placeholder { color: transparent; }

.ghost {
  position: absolute;
  inset-inline: 0;
  top: 0;
  pointer-events: none;
  color: var(--ink-3);
  white-space: pre-wrap;
  overflow: hidden;
  max-height: 3.25rem;
}

@keyframes caret-blink {
  0%, 45% { opacity: 1; }
  50%, 95% { opacity: 0; }
  100% { opacity: 1; }
}
.caret {
  display: inline-block;
  width: 0.5rem;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background-color: var(--ink-3);
  animation: caret-blink 1.1s infinite;
}
@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}

.console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
  padding-inline: 0.5rem;
}

.hint {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-color: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.hint-text { margin-left: 0.25rem; }

.submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-width: 0;
  border-radius: 999px;
  padding: 0.5rem 1.125rem;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 1;
  transition: opacity 160ms, transform 160ms;
}
.submit:disabled { opacity: 0.35; }
.submit:hover:not(:disabled) { transform: translateY(-1px); }

.error-card {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  width: min(720px, 100%);
  margin-inline: auto;
}
.error-title {
  margin: 0 0 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}
.error-body {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-2);
}

/* --- The receipt section ------------------------------------------------ */

.receipt-section {
  width: min(1000px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* The previous decision stays up while the next is computed, dimmed so it is
   obviously not the answer to what was just typed. */
.receipt-stale {
  opacity: 1;
  transition: opacity 160ms;
}
.receipt-stale.is-stale { opacity: 0.5; }

/* The receipt panel (ported from DecisionPanel). */

.panel {
  margin-top: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  /* The hero centres its children. This is a data table living inside it, and
     centred prose in a receipt is unreadable - every row starts in a different
     place, so nothing scans down the left edge. */
  text-align: left;
}

.verdict {
  padding: 1.25rem;
  border-bottom: 1px solid var(--line);
  background-color: var(--surface-2);
}
@media (min-width: 640px) {
  .verdict { padding: 1.5rem 1.75rem; }
}

.verdict-head {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .verdict-head { flex-direction: row; gap: 1rem; }
}

.sku {
  margin: 0.375rem 0;
  display: flex;
  /* Not centred on narrow screens: a model id that wraps to two lines would
     float its mark into the middle of the gap. */
  align-items: flex-start;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  color: var(--ink);
}
@media (min-width: 480px) {
  .sku { font-size: 1.75rem; align-items: center; }
}
@media (min-width: 640px) {
  .sku { font-size: 2.125rem; }
}

.provider-mark {
  display: inline-flex;
  color: var(--ink);
  flex: none;
}
.sku .provider-mark { color: var(--ink); }

.verdict-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-2);
}

/* Stacked and right-aligned it reads as a second column, which is right on a
   desktop and wrong on a phone. Below 640 it is one line under the name. */
.saving {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.4375rem;
  text-align: left;
}
@media (min-width: 640px) {
  .saving { flex-direction: column; align-items: flex-end; gap: 0; text-align: right; }
}

.saving-value {
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent);
}
@media (min-width: 640px) {
  .saving-value { font-size: 2.125rem; }
}

.saving-label {
  margin-top: 0;
  font-size: 0.75rem;
  color: var(--ink-3);
}
@media (min-width: 640px) {
  .saving-label { margin-top: 0.375rem; }
}

.why {
  margin: 0.875rem 0 0;
  padding-top: 0.875rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-2);
}

/* Two columns once there is room: what it understood and what it costs on the
   left, every option priced on the right. */
.panel-body {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .panel-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .panel-body .panel-section:first-child { border-right: 1px solid var(--line); }
}

.panel-section {
  padding: 1.25rem;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) {
  .panel-section { padding: 1.5rem 1.75rem; }
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.panel-section-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-aside {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.read-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .read-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.read-cell {
  border-left: 2px solid var(--line-2);
  padding-left: 0.875rem;
}

.read-heading {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.read-value {
  margin: 0 0 0.375rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
}

.read-confidence {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-3);
}

.read-blurb {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.read-note {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--ink-3);
  font-style: italic;
}

.cost-rows {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.cost-row {
  display: grid;
  align-items: center;
  gap: 0.75rem;
  grid-template-columns: 1fr auto;
}
@media (min-width: 640px) {
  .cost-row { grid-template-columns: 16rem 1fr 5rem; }
}

.cost-label {
  font-size: 0.8125rem;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cost-model { font-family: var(--font-mono); color: var(--ink); }

.cost-track {
  display: none;
  height: 8px;
  border-radius: 999px;
  background-color: var(--surface-3);
  overflow: hidden;
}
@media (min-width: 640px) {
  .cost-track { display: block; }
}

.cost-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 520ms cubic-bezier(0.16, 1, 0.3, 1);
}
.cost-fill-spend { background-color: var(--spend); }
.cost-fill-accent { background-color: var(--accent); }

.cost-value {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-align: right;
  color: var(--ink);
}

.cost-foot {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.cost-foot-strong {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
}

.alt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.alt-row {
  display: grid;
  align-items: center;
  gap: 0.75rem;
  grid-template-columns: 1fr auto;
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--ink-2);
}
@media (min-width: 640px) {
  .alt-row { grid-template-columns: 14rem 8.5rem 4.5rem 1fr 5rem; }
}

.alt-row-picked { color: var(--ink); }

.alt-name {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  min-width: 0;
}

.alt-model {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Its own column rather than trailing the model name: the fallback tag used
   to wrap onto a second line and take the whole row's baseline with it. */
.alt-slot {
  display: none;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: var(--ink-3);
}
@media (min-width: 640px) {
  .alt-slot { display: flex; }
}

/* The benchmark score behind the rank. Small and unemphasised. */
.alt-score {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}

.alt-tag {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}

.alt-sticker {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: right;
  color: var(--ink-3);
}
@media (min-width: 640px) {
  .alt-sticker { display: block; }
}

.alt-track {
  display: none;
  height: 6px;
  border-radius: 999px;
  background-color: var(--surface-3);
  overflow: hidden;
}
@media (min-width: 640px) {
  .alt-track { display: block; }
}

.alt-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background-color: var(--line-2);
}
.alt-fill-picked { background-color: var(--accent); }

.alt-expected {
  font-family: var(--font-mono);
  text-align: right;
}
.alt-expected-picked {
  font-weight: 600;
  color: var(--accent);
}

.panel-note {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--ink-3);
}

/* Two rows, not three items fighting for one. The feedback is an ask and the
   rest is fine print; putting them on the same line meant the ask moved every
   time its own text changed length. */
.panel-footer {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem 1.25rem;
  background-color: var(--surface-2);
  font-size: 0.6875rem;
  color: var(--ink-3);
}
@media (min-width: 640px) {
  .panel-footer { padding: 0.875rem 1.75rem; }
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

.caveat { font-style: italic; }

/* --- Feedback ------------------------------------------------------------ */

.feedback-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feedback-ask {
  font-size: 0.75rem;
  color: var(--ink-3);
  margin-right: 0.125rem;
}

.feedback-thanks {
  margin: 0;
  font-size: 0.75rem;
  color: var(--accent);
}

.vote {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  background-color: transparent;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 1;
  transition: color 160ms, border-color 160ms;
}
.vote:hover:not(:disabled) { border-color: var(--line-2); color: var(--ink); }
.vote:disabled { opacity: 0.5; }

.feedback-dialog {
  width: min(30rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background-color: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) {
  .feedback-dialog { padding: 1.5rem; }
}

.dialog-title {
  margin: 0.5rem 0 0.375rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.dialog-lead {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.fieldset {
  border-width: 0;
  padding: 0;
  margin: 0 0 1.125rem;
}

.legend {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin-bottom: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.guessed {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3125rem 0.6875rem;
  background-color: transparent;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 160ms, border-color 160ms, color 160ms;
}
.chip:hover { border-color: var(--line-2); }
.chip-on {
  border-color: var(--accent-line);
  background-color: var(--accent-soft);
  color: var(--accent);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.primary {
  border-width: 0;
  border-radius: 999px;
  padding: 0.5rem 1.125rem;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 1;
}
.primary:disabled { opacity: 0.4; }

.secondary {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4375rem 1rem;
  background-color: transparent;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

/* --- Sections ----------------------------------------------------------- */

.section {
  width: min(1060px, calc(100% - 2.5rem));
  margin-inline: auto;
  padding-top: 3.5rem;
}
@media (min-width: 640px) {
  .section { padding-top: 5rem; }
}

.section-title {
  margin: 0.75rem 0 2rem;
  max-width: 32rem;
  /* Even lines instead of a long first line and one orphaned word, at every
     width rather than at the one a hard break was chosen for. */
  text-wrap: balance;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
}
@media (min-width: 640px) {
  .section-title { font-size: 1.75rem; }
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .steps { gap: 2.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.step {
  border-top: 1px solid var(--line-2);
  padding-top: 1rem;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.step-title {
  margin: 0.625rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.step-body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.standing {
  display: grid;
  gap: 2rem;
  /* auto-fit, not a fixed 3: empty tracks collapse, so two figures share the
     width instead of leaving a third column hanging. */
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .standing { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
}

.standing-cell {
  border-top: 1px solid var(--line-2);
  padding-top: 1rem;
}

.standing-figure {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.standing-label {
  margin: 0.5rem 0 0.625rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

[x-cloak] { display: none !important; }
