:root {
  color-scheme: light;
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-soft: #f5f5f4;
  --line: #e7e5e4;
  --line-soft: #f1f0ee;
  --text: #18181b;
  --muted: #6b7280;
  --dim: #a1a1aa;
  --accent: #15803d;
  --accent-strong: #166534;
  --accent-soft: rgba(21, 128, 61, 0.08);
  --halo: rgba(21, 128, 61, 0.10);
  --danger: #dc2626;
  --tooltip-bg: rgba(255, 255, 255, 0.98);
  --tooltip-border: rgba(0, 0, 0, 0.08);
  --tooltip-shadow: 0 12px 32px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.04);
  --control-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --control-shadow-hover: 0 2px 6px rgba(15, 23, 42, 0.06);
  --knob-shadow: 0 1px 2px rgba(15, 23, 42, 0.18), 0 1px 1px rgba(15, 23, 42, 0.08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0b;
  --surface: #121214;
  --surface-soft: #18181b;
  --line: #27272a;
  --line-soft: #1c1c1f;
  --text: #f4f4f5;
  --muted: #9ca3af;
  --dim: #52525b;
  --accent: #a3e635;
  --accent-strong: #bef264;
  --accent-soft: rgba(163, 230, 53, 0.12);
  --halo: rgba(163, 230, 53, 0.18);
  --danger: #f87171;
  --tooltip-bg: rgba(24, 24, 27, 0.98);
  --tooltip-border: rgba(255, 255, 255, 0.08);
  --tooltip-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  --control-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --control-shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.4);
  --knob-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body {
  min-width: 0;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 200ms ease, color 200ms ease;
}

button, input, select { font: inherit; }

.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;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 0 80px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 28px;
}

/* ---------- Masthead ---------- */

.masthead {
  width: min(1080px, calc(100% - 48px));
  justify-self: center;
  text-align: center;
}

h1, p { margin-top: 0; }

h1 {
  margin-bottom: 14px;
  font-size: 3.25rem;
  line-height: 1.02;
  letter-spacing: 0;
  font-weight: 700;
}

.accent {
  color: var(--accent);
  font-weight: 700;
}

.subtitle {
  max-width: 36rem;
  margin: 0 auto;
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-size: 1.05rem;
  font-weight: 450;
  line-height: 1.55;
  letter-spacing: 0;
}

/* ---------- Selector row ---------- */

.selector-row {
  justify-self: center;
  width: min(1280px, calc(100% - 48px));
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(220px, 300px) minmax(150px, auto) minmax(150px, auto) minmax(155px, auto) 40px;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.selector-wrap {
  position: relative;
  justify-self: center;
  width: 100%;
}

.selector-wrap:not(.search-selector)::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.search-selector::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 1.7px solid var(--muted);
  border-radius: 999px;
  transform: translateY(-58%);
  pointer-events: none;
}

.search-selector::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 50%;
  width: 6px;
  height: 1.7px;
  border-radius: 999px;
  background: var(--muted);
  transform: translateY(4px) rotate(45deg);
  pointer-events: none;
}

.benchmark-button,
input:not([type="checkbox"]) {
  width: 100%;
  height: 40px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 38px 0 16px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0;
  outline: none;
  cursor: pointer;
  box-shadow: var(--control-shadow);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.benchmark-button {
  display: block;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input:not([type="checkbox"]) { padding-left: 40px; cursor: text; }

.benchmark-button:hover,
input:not([type="checkbox"]):hover {
  border-color: color-mix(in srgb, var(--text) 22%, var(--line));
  box-shadow: var(--control-shadow-hover);
}

input:not([type="checkbox"]):focus-visible,
.benchmark-button:focus-visible {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: 0;
}

.benchmark-menu {
  position: absolute;
  z-index: 24;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--tooltip-shadow);
}

.benchmark-menu[hidden] { display: none; }

.benchmark-option {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 100ms ease, color 100ms ease;
}

.benchmark-option:hover,
.benchmark-option.is-active {
  background: var(--surface-soft);
}

.benchmark-option.is-selected {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.model-selector input {
  font-weight: 500;
  color: var(--text);
}

.model-selector input::placeholder { color: var(--muted); }

input::-webkit-search-cancel-button { display: none; }

/* ---------- Toggle (real switch) ---------- */

.mode-toggle {
  position: relative;
  min-width: 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--control-shadow);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.mode-toggle > span:not(.mode-toggle-switch):not(.info-dot) {
  min-width: 0;
}

.mode-toggle:hover {
  border-color: color-mix(in srgb, var(--text) 22%, var(--line));
  box-shadow: var(--control-shadow-hover);
}

.mode-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface));
  color: var(--text);
}

.mode-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: 0;
  border-color: var(--accent);
}

.mode-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.mode-toggle:disabled:hover {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--control-shadow);
}

/* Switch track */
.mode-toggle-switch {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 32%, var(--line));
  transition: background-color 180ms ease;
}

/* Switch knob */
.mode-toggle-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: var(--knob-shadow);
  transition: transform 180ms cubic-bezier(0.32, 0.72, 0.34, 1.10), background-color 180ms ease;
}

[data-theme="dark"] .mode-toggle-switch::before { background: #e4e4e7; }

.mode-toggle[aria-pressed="true"] .mode-toggle-switch {
  background: var(--accent);
}

.mode-toggle[aria-pressed="true"] .mode-toggle-switch::before {
  transform: translateX(12px);
  background: #ffffff;
}

[data-theme="dark"] .mode-toggle[aria-pressed="true"] .mode-toggle-switch::before {
  background: #0a0a0b;
}

.mode-toggle-switch::after { content: none; }

/* ---------- Info dot ---------- */

.info-dot {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  cursor: help;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.info-dot:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 30%, var(--line));
}

.mode-toggle[aria-pressed="true"] .info-dot {
  background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  color: color-mix(in srgb, var(--accent) 80%, var(--muted));
}

.mode-toggle[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 12px);
  width: min(260px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid var(--tooltip-border);
  border-radius: var(--radius-sm);
  background: var(--tooltip-bg);
  color: var(--text);
  box-shadow: var(--tooltip-shadow);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 450;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

#timeAdjustToggle::after { left: 0; }
#linearFrontierToggle::after { right: 0; }

.mode-toggle[data-tooltip]:hover::after,
.mode-toggle[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Model suggestions ---------- */

.model-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--tooltip-shadow);
}

.model-suggestions[hidden] { display: none; }

.model-suggestion {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 100ms ease;
}

.model-suggestion:hover,
.model-suggestion.is-active {
  background: var(--surface-soft);
}

.model-suggestion.muted {
  color: var(--muted);
  font-weight: 450;
}

/* ---------- Chart stage ---------- */

.chart-stage {
  position: relative;
  justify-self: center;
  width: 100%;
  min-height: 560px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 200ms ease, background-color 200ms ease;
}

#chart {
  display: block;
  width: 100%;
  height: 560px;
  overflow: visible;
}

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

.grid-line {
  stroke: var(--line-soft);
  stroke-width: 1;
}

.tick-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.axis-label {
  fill: color-mix(in srgb, var(--text) 70%, var(--muted));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.frontier-area { fill: url("#frontierFill"); }

.frontier-halo {
  fill: none;
  stroke: var(--halo);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.frontier-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.label-leader {
  stroke: color-mix(in srgb, var(--muted) 46%, transparent);
  stroke-width: 1;
  stroke-linecap: round;
  pointer-events: none;
}

.point {
  stroke: var(--bg);
  stroke-width: 2;
  cursor: pointer;
  transition: opacity 150ms ease, transform 150ms ease;
  transform-box: fill-box;
  transform-origin: center;
}

.point-hit {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
  pointer-events: all;
}

.point.frontier {
  stroke: var(--bg);
  stroke-width: 2.25;
}

.point.dominated { opacity: 0.28; }
.point.dominated.selected { opacity: 1; }

.point.selected {
  stroke: var(--text);
  stroke-width: 3;
  filter: drop-shadow(0 5px 12px rgba(21, 128, 61, 0.22));
}

.point:hover,
.point:focus-visible {
  opacity: 1;
  transform: scale(1.18);
}

.point:focus-visible {
  outline: none;
  stroke: var(--accent-strong);
  stroke-width: 4;
  filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0)) drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 40%, transparent));
}

.point-label {
  fill: var(--text);
  font-size: 11.2px;
  font-weight: 600;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

.selected-label {
  font-size: 13px;
  font-weight: 700;
  stroke-width: 5px;
}

/* ---------- Verdict ---------- */

.verdict {
  justify-self: center;
  width: min(960px, calc(100% - 48px));
  min-height: 92px;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 10px;
  padding: 26px 28px;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent-soft) 35%, var(--surface-soft)));
  box-shadow: 0 8px 24px rgba(21, 128, 61, 0.05), var(--control-shadow);
}

.verdict[hidden] { display: none; }

.verdict-main {
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: 14px;
  row-gap: 4px;
  color: var(--text);
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.08;
}

.verdict-question {
  color: color-mix(in srgb, var(--text) 80%, var(--muted));
  font-weight: 500;
}

.verdict-model {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 700;
}

.verdict-mark {
  color: inherit;
  font-weight: 600;
  margin-left: 1px;
}

.verdict-answer {
  color: var(--accent);
  font-size: 1.25em;
  font-weight: 800;
  letter-spacing: 0;
  padding-left: 4px;
}

.verdict-context {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
}

.source-details {
  width: min(520px, 100%);
  color: var(--muted);
  font-size: 0.78rem;
}

.source-details summary {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--muted) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, var(--accent-soft));
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.source-details summary::-webkit-details-marker { display: none; }

.source-details summary:hover,
.source-details summary:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  color: var(--accent-strong);
  background: var(--surface);
  outline: none;
}

.source-icon {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}

.source-grid {
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
  text-align: left;
}

.source-grid div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
}

.source-grid dt {
  color: color-mix(in srgb, var(--muted) 78%, var(--text));
  font-weight: 700;
}

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

.source-grid a {
  color: var(--accent-strong);
  text-decoration: none;
}

.source-grid a:hover { text-decoration: underline; }

.verdict[data-answer="no"] {
  border-color: color-mix(in srgb, var(--danger) 36%, var(--line));
  background:
    linear-gradient(180deg, var(--surface), color-mix(in srgb, rgba(220, 38, 38, 0.08) 50%, var(--surface-soft)));
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.06), var(--control-shadow);
}

.verdict[data-answer="no"] .verdict-answer { color: var(--danger); }

.verdict[data-answer="na"] {
  border-color: color-mix(in srgb, var(--muted) 28%, var(--line));
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04), var(--control-shadow);
}

.empty-state {
  fill: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Tooltip ---------- */

.tooltip {
  position: absolute;
  z-index: 2;
  width: 220px;
  padding: 12px 14px;
  border: 1px solid var(--tooltip-border);
  border-radius: var(--radius);
  background: var(--tooltip-bg);
  color: var(--text);
  box-shadow: var(--tooltip-shadow);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.tooltip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
}

.tooltip span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.tooltip span + span {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- Bottom copy ---------- */

.why,
.inspiration {
  justify-self: center;
  width: min(680px, calc(100% - 48px));
  margin: 0 auto;
  color: var(--text);
  text-align: center;
}

.why { padding: 36px 0 0; }
.inspiration { padding: 8px 0 0; }

.why h2,
.inspiration h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: none;
}


.why p {
  max-width: 38rem;
  margin: 0 auto;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 1.0625rem;
  font-weight: 450;
  line-height: 1.65;
  letter-spacing: 0;
}

.inspiration ul {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0 0 1.25rem;
  display: grid;
  gap: 10px;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 1.0625rem;
  font-weight: 450;
  line-height: 1.55;
  letter-spacing: 0;
  text-align: left;
}

.inspiration li::marker {
  color: var(--accent);
}

.tweet-inspiration .twitter-tweet {
  max-width: min(550px, 100%) !important;
  margin: 8px 0 0 !important;
}

.tweet-inspiration iframe {
  max-width: 100% !important;
  margin: 0 !important;
}

.inspiration a {
  color: var(--accent-strong);
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
}

.inspiration a:hover,
.inspiration a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.icon-button {
  justify-self: center;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--control-shadow);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.icon-button:hover {
  border-color: color-mix(in srgb, var(--text) 22%, var(--line));
  box-shadow: var(--control-shadow-hover);
}

.icon-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: 0;
  border-color: var(--accent);
}

.icon-button svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ---------- Theme toggle ---------- */

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Mobile ---------- */

@media (max-width: 1080px) and (min-width: 721px) {
  .selector-row {
    width: min(900px, calc(100% - 48px));
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #timeAdjustToggle {
    grid-column: 1;
    grid-row: 1;
  }

  #linearFrontierToggle {
    grid-column: 2;
    grid-row: 1;
  }

  #showAllToggle {
    grid-column: 3;
    grid-row: 1;
  }

  .benchmark-selector {
    grid-column: 1;
    grid-row: 2;
  }

  .search-selector {
    grid-column: 2 / 5;
    grid-row: 2;
  }

  .mode-toggle {
    width: 100%;
    justify-content: center;
  }

  .theme-toggle {
    grid-column: 4;
    grid-row: 1;
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: 100%;
    padding: 36px 0 72px;
    gap: 22px;
  }

  .masthead { width: min(100% - 24px, 1080px); }

  h1 { font-size: 2.4rem; letter-spacing: 0; }
  .subtitle { font-size: 0.925rem; }

  .selector-row {
    width: min(380px, calc(100% - 24px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .selector-wrap { grid-column: 1 / -1; }

  #timeAdjustToggle {
    grid-column: 1;
    grid-row: 1;
  }

  #linearFrontierToggle {
    grid-column: 2;
    grid-row: 1;
  }

  #showAllToggle {
    grid-column: 1;
    grid-row: 2;
  }

  .benchmark-selector {
    grid-row: 3;
  }

  .search-selector {
    grid-row: 4;
  }

  .mode-toggle {
    height: 38px;
    gap: 8px;
    padding: 0 12px;
    font-size: 0.825rem;
  }

  input:not([type="checkbox"]) {
    font-size: 16px;
  }

  .info-dot {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }

  .theme-toggle {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    align-self: center;
  }

  .chart-stage {
    width: 100%;
    min-height: 460px;
  }
  #chart { height: 460px; }

  .why,
  .inspiration {
    width: min(420px, calc(100% - 24px));
  }
  .why { padding-top: 28px; }
  .inspiration { padding-top: 4px; }

  .why h2,
  .inspiration h2 {
    font-size: 1.35rem;
    margin-bottom: 10px;
  }

  .why p,
  .inspiration ul {
    font-size: 0.92rem;
  }

  .axis-label { font-size: 9.5px; }
  .point-label { font-size: 10px; }
  .selected-label { font-size: 11.2px; }

  .verdict {
    width: min(420px, calc(100% - 24px));
    min-height: auto;
    gap: 8px;
    padding: 18px 16px 18px;
    border-radius: var(--radius);
  }
  .verdict-main {
    column-gap: 10px;
    row-gap: 2px;
    font-size: 1.5rem;
    line-height: 1.15;
  }
  .verdict-answer { font-size: 1.25em; }
  .verdict-context { font-size: 0.72rem; }
  .source-grid div {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
  }

  .icon-button {
    margin-top: 0;
  }
}

@media (max-width: 360px) {
  .selector-row {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  #timeAdjustToggle {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  #linearFrontierToggle {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #showAllToggle {
    grid-column: 1;
    grid-row: 3;
  }

  .benchmark-selector {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .search-selector {
    grid-column: 1 / -1;
    grid-row: 5;
  }

  .theme-toggle {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
  }
}
