/* Workspaces: rail + main column over a dimmed globe. Hairlines, not cards. */

.workspace { min-height: 100vh; font-size: 15px; line-height: 1.55; }

.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.backdrop-canvas { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.6s var(--ease); }
.backdrop-canvas.is-ready { opacity: .38; }
.handoff .backdrop-canvas { transition-duration: .3s; }       /* the landing page already dimmed it */
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, #050505 0%, rgba(5,5,5,.92) 38%, rgba(5,5,5,.55) 100%);
}

.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--pill); color: var(--pill-ink); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 16px; }

.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; }

/* ── rail ──────────────────────────────────────────────────────────────── */

.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 28px 24px 28px 28px;
  border-right: 1px solid var(--line);
  /* Glass: translucent tint, blur, and a faint light catching the top edge. */
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,0) 32%),
    rgba(8,8,8,.58);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.04);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  display: flex; flex-direction: column; gap: 28px;
  animation: fade .8s var(--ease) both;
}
.rail-brand { display: flex; align-items: center; gap: 12px; }
.rail-mark { width: 36px; height: 36px; flex: none; }
.rail-name { display: block; font-size: 18px; font-weight: 600; letter-spacing: .01em; }
.rail-tag { display: block; font-size: 12px; color: var(--strip); line-height: 1.35; }
.rail-heading { margin: 0 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--strip); }

.switcher { position: relative; display: flex; flex-direction: column; }
.switcher-indicator {
  position: absolute; left: -14px; right: 0; top: 0; height: 0; z-index: 0;
  border-radius: 0 12px 12px 0; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  box-shadow: inset 1px 0 0 var(--ink), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .55s var(--ease), height .55s var(--ease), opacity .3s;
}
.switcher-indicator.is-placed { opacity: 1; }
.switcher a { position: relative; z-index: 1; }
.switcher a {
  display: block; padding: 11px 12px 11px 14px; margin-left: -14px;
  border-left: 1px solid transparent; border-radius: 0 10px 10px 0;
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.switcher a b { display: block; font-weight: 500; color: var(--nav); transition: color .3s; }
.switcher a span { display: block; font-size: 12px; color: var(--faint); }
.switcher a:hover b { color: var(--ink); }
.switcher a[aria-current="page"] { border-left-color: transparent; }
.switcher a[aria-current="page"] b { color: var(--ink); }

.settings { display: flex; flex-direction: column; gap: 14px; }
.settings .rail-heading:not(:first-child) { margin-top: 10px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--nav); }
.field-tools { display: inline-flex; align-items: center; gap: 8px; }
.slider-value { font-variant-numeric: tabular-nums; color: var(--ink); font-size: 13px; }
.help-btn {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: none; color: var(--strip); font-size: 11px; line-height: 1; cursor: pointer; padding: 0; flex: none;
}
.help-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--ink); }
.help-body, .help-inline { margin: 0; font-size: 12px; color: var(--strip); line-height: 1.5; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--line-strong); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-strong); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: var(--ink); border: 0; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 0; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--nav); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 30px; height: 18px; border-radius: 999px; background: var(--line-strong); transition: background-color .3s var(--ease); flex: none; }
.switch-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform .35s var(--ease), background-color .3s; }
.switch input:checked + .switch-track { background: var(--ink); }
.switch input:checked + .switch-track::after { transform: translateX(12px); background: var(--pill-ink); }
.switch input:focus-visible + .switch-track { outline: 1px solid var(--ink); outline-offset: 3px; }

.palette-hint {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px 9px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--strip); font-size: 13px;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.palette-hint:hover { border-color: var(--line-strong); color: var(--ink); }
kbd {
  font-family: var(--mono); font-size: 11px; color: var(--nav);
  padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.04);
}
.chips { margin-top: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; color: var(--strip); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.chip b { color: var(--ink); font-weight: 500; }

/* ── main ──────────────────────────────────────────────────────────────── */

.main { padding: 0 clamp(20px, 5vw, 72px) 40px; min-width: 0; outline: none; }

/* Top bar: breadcrumb and engine state; tightens and frosts once scrolled. */
.app-bar {
  position: sticky; top: 0; z-index: 20;
  margin: 0 calc(-1 * clamp(20px, 5vw, 72px)) 36px; padding: 22px clamp(20px, 5vw, 72px) 18px;
  transition: padding .45s var(--ease), background-color .45s var(--ease), box-shadow .45s var(--ease);
}
.app-bar.is-condensed {
  padding-top: 12px; padding-bottom: 12px;
  background: rgba(8,8,8,.62);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
}
.app-bar-inner { max-width: 1120px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-bar-crumb { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--strip); }
.app-bar-crumb a { color: var(--nav); transition: color .3s; }
.app-bar-crumb a:hover { color: var(--ink); }
.app-bar-crumb i { font-style: normal; color: var(--faint); }
.app-bar-crumb span { color: var(--ink); }
.app-bar-tools { display: flex; align-items: center; gap: 12px; }
.app-bar-engine {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px; color: var(--strip); font-family: var(--mono);
}
.app-bar-engine i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.app-bar-engine.is-ready i { background: var(--verified); box-shadow: 0 0 8px var(--verified); }
.app-bar-engine.is-error i { background: var(--rejected); }
.ws, .engine-status { max-width: 1120px; }
.ws:not([hidden]) { animation: rise .7s var(--ease) both; --u: 1px; }

.ws-head { margin-bottom: 28px; }
.eyebrow { margin: 0 0 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--strip); font-variant-numeric: tabular-nums; }
.ws-head h1 { margin: 0 0 14px; font-size: clamp(34px, 4.2vw, 54px); font-weight: 400; line-height: 1.08; letter-spacing: .005em; }
.lede { margin: 0; max-width: 780px; font-size: 16px; color: var(--muted); }
.lede b, .note b, .caption b { color: var(--ink); font-weight: 600; }

.block-title { margin: 32px 0 12px; font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--nav); }
h3 { font-weight: 500; font-size: 16px; margin: 0 0 10px; }

.caption { margin: 8px 0 0; font-size: 13px; color: var(--strip); line-height: 1.5; }
code, .code { font-family: var(--mono); font-size: .92em; }
code { background: var(--wash); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }

/* Notes: a hairline and a mark, colour kept for data states only. */
.note {
  position: relative; margin: 14px 0 0; padding: 12px 14px 12px 18px;
  border-left: 2px solid var(--line-strong); background: var(--wash);
  border-radius: 0 10px 10px 0; font-size: 14px; color: var(--muted);
}
.note p { margin: 0; }
.note p + p { margin-top: 8px; }
.note .ghost { margin-top: 10px; font-size: 14px; }
.note-success { border-left-color: var(--verified); color: var(--nav); }
.note-warn { border-left-color: var(--amber); }
.note-error { border-left-color: var(--rejected); color: var(--nav); }
.note-info { border-left-color: var(--strip); }
.note[hidden] { display: none; }

.spinner {
  display: inline-block; width: 12px; height: 12px; margin-right: 10px; vertical-align: -1px;
  border: 1.5px solid var(--line-strong); border-top-color: var(--ink); border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Figures. */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 22px; }
.triple { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.fig { margin: 0; }
.fig-frame {
  position: relative; overflow: hidden; border-radius: 12px;
  background: #0b0b0b; border: 1px solid var(--line);
}
.fig-frame img, .fig-frame canvas { width: 100%; height: auto; display: block; }
/* Skeleton shimmer while an image loads. */
.fig-frame.is-loading { min-height: 220px; }
.fig-frame.is-loading img { opacity: 0; }
.fig-frame img { transition: opacity .5s var(--ease); }
.fig-frame.is-loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.06) 50%, transparent 70%) 0 0 / 220% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.fig-empty { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--faint); font-size: 13px; }
.fig figcaption { margin-top: 8px; font-size: 13px; color: var(--strip); }
.fig-wide .fig-frame { max-width: 720px; }
.canvas-fill { width: 100%; height: auto; display: block; }

.actions { display: flex; align-items: center; gap: 22px; margin-top: 26px; flex-wrap: wrap; }
.pill-run { height: 48px; padding: 0 26px; font-size: 16px; }
.pill-small { height: 40px; padding: 0 20px; font-size: 14px; }
.pill span { transform: none; }

/* Progress. */
.progress-slot:empty { display: none; }
.progress { margin-top: 22px; padding: 16px 0 4px; border-top: 1px solid var(--line); }
.progress-status { margin: 0 0 10px; font-size: 15px; }
.progress[data-state="complete"] .progress-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--verified); margin-right: 10px; vertical-align: 2px; }
.progress[data-state="error"] .progress-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--rejected); margin-right: 10px; vertical-align: 2px; }
.progress { display: flex; align-items: flex-start; gap: 28px; }
.progress-text { flex: 1; min-width: 0; padding-top: 6px; }
.ring-row { display: flex; gap: 22px; flex: none; }
.ring-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring-caption { font-size: 11px; color: var(--strip); max-width: 110px; text-align: center; line-height: 1.3; }
.ring { position: relative; flex: none; line-height: 0; }
.ring-arc { fill: none; stroke: var(--line-strong); stroke-width: 4; stroke-linecap: round; transition: stroke .4s var(--ease); }
.ring-arc.is-done { stroke: var(--ink); }
.ring-arc.is-active { stroke: var(--verified); stroke-dasharray: 6 5; animation: ring-flow .9s linear infinite; filter: drop-shadow(0 0 4px rgba(232,241,255,.6)); }
.ring[data-state="error"] .ring-arc.is-done { stroke: var(--rejected); }
@keyframes ring-flow { to { stroke-dashoffset: -22; } }
.ring-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; line-height: 1.1; }
.ring-count { font-family: var(--mono); font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ring-name { font-size: 10.5px; color: var(--strip); letter-spacing: .06em; text-transform: uppercase; }
.ring-row.is-multi .ring-count { font-size: 14px; }
.progress-bar { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; transform: scaleX(var(--f, 0)); transition: transform .6s var(--ease); }
.progress[data-state="error"] .progress-bar span { background: var(--rejected); }
.progress-lines { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; color: var(--strip); }
.progress-lines li { padding: 3px 0; animation: rise .5s var(--ease) both; --u: .6px; }
.progress-lines b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── report ────────────────────────────────────────────────────────────── */

.results-slot:empty { display: none; }
.report { margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--line-strong); animation: rise .7s var(--ease) both; --u: 1px; }
.report-head { margin-bottom: 6px; }
.report-title { margin: 0; font-size: clamp(24px, 2.6vw, 32px); font-weight: 400; }
.report-notes:empty { display: none; }

.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.metric { padding: 16px 18px 14px 0; }
.metric + .metric { padding-left: 18px; border-left: 1px solid var(--line); }
.metric-label { margin: 0; font-family: var(--mono); font-size: 11.5px; color: var(--strip); letter-spacing: .04em; }
.metric-value { margin: 4px 0 2px; font-size: 26px; font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: -.005em; white-space: nowrap; }
.metric-delta { margin: 0; font-size: 12px; color: var(--strip); }
.tone-good { color: var(--verified); }
.tone-good::before { content: "↑ "; }
.tone-bad { color: var(--rejected); }
.tone-bad::before { content: "↓ "; }

.downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: 18px; font-size: 14px; }
.downloads .caption { flex-basis: 100%; margin: 0; }

.tabs { display: flex; gap: 4px; margin-top: 30px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; background: none; border: 0; padding: 12px 14px; cursor: pointer; white-space: nowrap;
  color: var(--strip); font-size: 14px; transition: color .3s;
}
.tab:hover { color: var(--nav); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 1px; background: var(--ink); }
.tab-panel { padding-top: 22px; }
.view { animation: fade .5s var(--ease) both; }

.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; margin-top: 18px; }
.split-wide { align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.why-title { margin: 0 0 8px; font-weight: 600; }
.why ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.why li + li { margin-top: 8px; }
.why b { color: var(--ink); }

.chart { width: 100%; height: auto; display: block; }
.chart-title, .chart-title-html { fill: var(--nav); color: var(--nav); font-size: 13px; margin: 0 0 10px; }
.chart-grid { stroke: var(--line); }
.chart-tick { fill: var(--strip); font-size: 11px; }
.chart-axis { fill: var(--strip); font-size: 12px; }
.chart-bar { fill: #bdbcbc; }
.chart-mark { stroke: var(--amber); stroke-dasharray: 4 3; stroke-width: 1.2; }
.chart-mark-label { fill: var(--amber); font-size: 11px; }

.grid4 { display: grid; gap: 4px; align-items: center; font-variant-numeric: tabular-nums; }
.grid4-label { font-size: 11px; color: var(--strip); text-align: center; padding: 0 4px; }
.grid4-cell { aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; font-size: 13px; font-weight: 600; }

.table-wrap { overflow-x: auto; margin-top: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 500; color: var(--strip); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); color: var(--nav); }
td:first-child { color: var(--ink); }
.code { margin: 0 0 22px; padding: 14px 16px; background: var(--wash); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.6; color: var(--nav); }

/* Before / after. */
.ba { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #0b0b0b; aspect-ratio: 1; max-width: 860px; }
.ba-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.ba-before { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--split); width: 1px; background: var(--ink); pointer-events: none; }
.ba-handle span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pill); color: var(--pill-ink); font-size: 15px;
}
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba-range:focus-visible + .ba-handle, .ba:focus-within .ba-handle span { outline: 1px solid var(--ink); outline-offset: 3px; }

/* Disclosure panels. */
.disclosure { margin-top: 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.disclosure summary {
  list-style: none; cursor: pointer; padding: 16px 0; display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; color: var(--nav); transition: color .3s;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .4s var(--ease); margin-right: 4px; }
.disclosure[open] summary::after { transform: rotate(225deg); }
.disclosure summary:hover { color: var(--ink); }
.disclosure-body { padding: 4px 0 24px; }

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 20px; }
.gallery-item .ghost { margin-top: 10px; font-size: 14px; }

/* Upload zones. */
.drop {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 4px;
  min-height: 118px; padding: 18px 20px; border: 1px dashed var(--line-strong); border-radius: 12px;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--ink); background: var(--wash); }
.drop.has-file { border-style: solid; }
.drop-label { font-size: 15px; }
.drop-name { font-size: 13px; color: var(--strip); overflow-wrap: anywhere; }
.drop-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-clear { position: absolute; top: 10px; right: 10px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--stage); cursor: pointer; }

select, input[type="number"] {
  height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.03); color: var(--ink); font-size: 14px; width: 100%;
}
select:focus-visible, input[type="number"]:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
select option { background: #111; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.field-inline { max-width: 200px; margin-top: 12px; }
.disclosure-body > .field { margin-bottom: 8px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; align-self: flex-start; flex-wrap: wrap; }
.seg button { background: none; border: 0; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--strip); font-size: 13px; transition: background-color .3s, color .3s; }
.seg button.is-on { background: var(--pill); color: var(--pill-ink); }
.seg button:not(.is-on):hover { color: var(--ink); }

.toggles { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--nav); cursor: pointer; }
.check input { accent-color: #fafafa; width: 15px; height: 15px; }

.app-footer {
  max-width: 1120px; margin-top: 80px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 12px; color: var(--faint);
}

/* ── narrow ────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; gap: 20px; }
  .switcher { flex-direction: row; overflow-x: auto; gap: 4px; }
  .switcher .rail-heading { display: none; }
  .switcher a { margin-left: 0; border-left: 0; border-radius: 999px; padding: 8px 14px; white-space: nowrap; }
  .switcher a span { display: none; }
  .switcher a[aria-current="page"] { background: var(--pill); }
  .switcher a[aria-current="page"] b { color: var(--pill-ink); }
  .main { padding: 32px 16px; }
  .pair, .split, .row2 { grid-template-columns: minmax(0, 1fr); }
  .triple, .gallery { grid-template-columns: minmax(0, 1fr); }
  .row3 { grid-template-columns: minmax(0, 1fr); }
  .metric + .metric { padding-left: 0; border-left: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
}
@media (min-width: 560px) and (max-width: 900px) {
  .triple, .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── toasts ────────────────────────────────────────────────────────────── */

.toasts {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 380px;
  padding: 12px 16px; border-radius: 14px; font-size: 14px; color: var(--ink);
  background: rgba(14,14,14,.72); border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  opacity: 0; transform: translateY(12px) scale(.98);
  transition: opacity .35s var(--ease), transform .45s var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }
.toast i { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--strip); }
.toast-success i { background: var(--verified); box-shadow: 0 0 8px var(--verified); }
.toast-error i { background: var(--rejected); }

/* ── command palette ───────────────────────────────────────────────────── */

.palette {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh; background: rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s var(--ease);
}
.palette.is-open { opacity: 1; }
.palette-box {
  width: min(640px, calc(100vw - 32px)); border-radius: 18px; overflow: hidden;
  background: rgba(16,16,16,.82); border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 40px 120px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  transform: translateY(-8px) scale(.985); transition: transform .35s var(--ease);
}
.palette.is-open .palette-box { transform: none; }
.palette-field { border-bottom: 1px solid var(--line); }
.palette-input {
  width: 100%; height: 58px; padding: 0 22px; border: 0; background: transparent; outline: none;
  font-size: 17px; color: var(--ink);
}
.palette-input::placeholder { color: var(--faint); }
.palette-input:focus-visible { box-shadow: inset 0 -1px 0 var(--verified); }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: 360px; overflow-y: auto; }
.palette-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 14px; border-radius: 10px; cursor: pointer; color: var(--nav); font-size: 14.5px;
}
.palette-item[aria-selected="true"] { background: rgba(255,255,255,.07); color: var(--ink); box-shadow: inset 2px 0 0 var(--verified); }
.palette-tag { font-size: 11px; font-family: var(--mono); color: var(--strip); letter-spacing: .06em; text-transform: uppercase; }
.palette-empty { padding: 18px 14px; color: var(--strip); font-size: 14px; }
.palette-foot { margin: 0; display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); font-family: var(--mono); }

/* ── 3D results view ───────────────────────────────────────────────────── */

.r3d {
  position: relative; width: 100%; aspect-ratio: 16 / 10; max-height: 640px; margin-top: 14px;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #070707;
}
.r3d-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.r3d-canvas:active { cursor: grabbing; }
.r3d-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.r3d-hint { font-size: 12px; color: var(--strip); font-family: var(--mono); }
