[hidden] { display: none !important; }
/* ============================================================
   Legible Navigation: Intent, Preview, Handoff
   Tokens: OKLCH. Ink levels are clamped so the least attended
   nav item never drops below 4.5:1 against paper.
   ============================================================ */
@property --panel-x { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --scrolled { syntax: '<number>'; inherits: true; initial-value: 0; }

:root, :root[data-theme] {
  --paper: var(--gray-20);
  --raised: var(--gray-10);
  --ink: var(--gray-830);
  --accent: var(--blue-550);
  --ok: var(--aqua-400);
  --warn: var(--yellow-300);
  --bad: var(--red-450);
  --term-bg: var(--gray-820);
  --term-ink: var(--gray-70);
  --shadow: color-mix(in oklch, var(--ink) 20%, transparent);
  --veil: color-mix(in oklch, var(--paper) 76%, transparent);

  --ink-2: color-mix(in oklch, var(--ink) 72%, var(--paper));
  --ink-3: color-mix(in oklch, var(--ink) 58%, var(--paper));
  --ink-4: color-mix(in oklch, var(--ink) 28%, var(--paper));
  --line: color-mix(in oklch, var(--ink) 11%, var(--paper));
  --line-soft: color-mix(in oklch, var(--ink) 6.5%, var(--paper));
  --fill: color-mix(in oklch, var(--ink) 3.5%, var(--paper));
  --accent-wash: color-mix(in oklch, var(--accent) 12%, var(--raised));

  --lv-rest: .66;   /* 6.28:1 */
  --lv-min: .57;    /* 4.69:1, the floor */
  --bar-h: 56px;
  --gutter: 24px;
  --page-gutter: clamp(20px, 4vw, 56px);

  --f-ui: var(--font);
  --f-display: var(--font);
  --f-mono: var(--font-mono);

  --ease-out: cubic-bezier(.2, 0, 0, 1);
  /* critically damped spring, sampled (no overshoot) */
  --spring: linear(0, 0.0499 3.8%, 0.1593 7.7%, 0.2881 11.5%, 0.4151 15.4%, 0.5297 19.2%, 0.628 23.1%, 0.7096 26.9%, 0.7756 30.8%, 0.8281 34.6%, 0.8693 38.5%, 0.9012 42.3%, 0.9257 46.2%, 0.9444 50%, 0.9585 53.8%, 0.9692 57.7%, 0.9772 61.5%, 0.9832 65.4%, 0.9876 69.2%, 0.9909 73.1%, 0.9933 76.9%, 0.9951 80.8%, 0.9964 84.6%, 0.9974 88.5%, 0.9981 92.3%, 0.9986 96.2%, 1);
  /* damping 0.78, peak 1.02 */
  --spring-soft: linear(0, 0.0268 2.9%, 0.0941 5.9%, 0.1855 8.8%, 0.2887 11.8%, 0.3948 14.7%, 0.4974 17.6%, 0.5926 20.6%, 0.6778 23.5%, 0.752 26.5%, 0.815 29.4%, 0.8672 32.4%, 0.9093 35.3%, 0.9426 38.2%, 0.9681 41.2%, 0.9871 44.1%, 1.0006 47.1%, 1.0098 50%, 1.0155 52.9%, 1.0187 55.9%, 1.0199 58.8%, 1.0197 61.8%, 1.0185 64.7%, 1.0168 67.6%, 1.0148 70.6%, 1.0127 73.5%, 1.0107 76.5%, 1.0087 79.4%, 1.0069 82.4%, 1.0054 85.3%, 1.0041 88.2%, 1.003 91.2%, 1.0021 94.1%, 1.0013 97.1%, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: var(--gray-880);
  --raised: var(--gray-840);
  --ink: var(--gray-60);
  --accent: var(--blue-250);
  --ok: var(--aqua-300);
  --warn: var(--yellow-200);
  --bad: var(--red-350);
  --term-bg: var(--gray-900);
  --shadow: color-mix(in srgb, var(--gray-900) 55%, transparent);
  --veil: color-mix(in oklch, var(--paper) 72%, transparent);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--accent-wash); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 100; left: 12px; top: -80px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

/* ------------------------------------------------------------
   The bar
   ------------------------------------------------------------ */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  view-transition-name: bar;
  --surface-h: var(--bar-h);
  --preview-top: 50px;
}
@supports (animation-timeline: scroll()) {
  .bar { animation: scrolled linear both; animation-timeline: scroll(root block); animation-range: 0px 40px; }
}
@keyframes scrolled { from { --scrolled: 0; } to { --scrolled: 1; } }
.bar[data-moving] { transition: --panel-x 420ms var(--spring); }

.bar-surface {
  position: absolute; inset: 0 0 auto 0;
  height: calc(var(--surface-h) + env(safe-area-inset-top, 0px));
  background: var(--paper);
  box-shadow: 0 1px 0 color-mix(in oklch, var(--line) calc(var(--scrolled) * 100%), transparent);
  transition: height 560ms var(--spring-soft), box-shadow 200ms;
}
.bar[data-open] .bar-surface, .bar[data-sheet] .bar-surface { box-shadow: 0 1px 0 var(--line); }
.bar[data-open] .bar-surface { transition: height 520ms var(--spring-soft); }
.bar:not([data-open]):not([data-sheet]) .bar-surface { transition: height 260ms var(--ease-out), box-shadow 200ms; }
.bar[data-instant], .bar[data-instant] * { transition: none !important; }

.bar-nav {
  position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: var(--bar-h); padding-inline: var(--gutter); margin-top: env(safe-area-inset-top, 0px);
}
.brand { justify-self: start; display: flex; align-items: center; min-width: 0; }
.wordmark {
  font-family: var(--font); font-weight: 450; font-size: 20px; line-height: 1;
  font-variation-settings: "opsz" 24; letter-spacing: -0.022em;
  padding: 6px 6px 9px; margin-left: -6px; border-radius: 8px; white-space: nowrap;
}
.crumb {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px;
  font-size: 13px; color: var(--ink-3); white-space: nowrap;
  opacity: 0; transform: translateY(5px); pointer-events: none; visibility: hidden;
  transition: opacity 180ms, transform 420ms var(--spring), visibility 0s linear 420ms;
}
.crumb::before { content: "/"; color: var(--ink-4); }
.bar[data-crumb] .crumb { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity 180ms, transform 420ms var(--spring), visibility 0s; }
.crumb:is(:hover, [data-hover]) { color: var(--ink); }

.menu { display: flex; list-style: none; margin: 0; padding: 0; }
.top, .sub-link {
  position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 12px;
  border: 0; background: none; cursor: default; white-space: nowrap; border-radius: 8px;
  font-family: var(--font); font-size: 13px; font-weight: 450; letter-spacing: 0em;
  color: color-mix(in oklch, var(--ink) calc(var(--lv, var(--lv-rest)) * 100%), var(--paper));
  font-variation-settings: "GRAD" var(--grad, 0);
  -webkit-tap-highlight-color: transparent;
}
.top::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px;
  background: var(--accent); transform-origin: left center; transform: scaleX(var(--att, 0)); opacity: 0;
}
html[data-inspect] .top::after { opacity: 1; }

.sub {
  position: absolute; top: var(--bar-h); left: var(--panel-x);
  display: flex; list-style: none; margin: 0; padding: 0; height: 40px; align-items: center;
  visibility: hidden; opacity: 0; transition: opacity 110ms, visibility 0s linear 110ms;
}
.sub[data-shown] { visibility: visible; opacity: 1; transition: opacity 200ms 60ms; }

.actions { justify-self: end; display: flex; align-items: center; gap: 4px; }
.link {
  display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.link:is(:hover, [data-hover]) { color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border: 0; border-radius: 8px; cursor: default;
  font-family: var(--font); font-weight: 500; font-size: 13px; line-height: 1; white-space: nowrap;
  transition: background-color 140ms;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:is(:hover, [data-hover]) { background: color-mix(in oklch, var(--ink) 84%, var(--paper)); }
.btn-quiet { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.btn-quiet:is(:hover, [data-hover]) { background: var(--fill); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.bar-nav .btn { height: 32px; padding: 0 13px; }
.menu-toggle { display: none; }

/* The preview: the only thing that ever appears below the line */
.preview {
  position: absolute; left: calc(var(--panel-x) + 12px);
  top: calc(env(safe-area-inset-top, 0px) + var(--bar-h) + var(--preview-top));
  width: var(--pw);
  visibility: hidden; opacity: 0; transform: translateY(-6px) scale(.985); transform-origin: 0 0;
  transition: opacity 120ms, transform 200ms var(--ease-out), visibility 0s linear 200ms;
}
.bar[data-open] .preview {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity 220ms 50ms var(--ease-out), transform 520ms 30ms var(--spring-soft), top 420ms var(--spring);
}
.window {
  position: relative; width: var(--pw); height: var(--ph); overflow: hidden; cursor: default;
  border-radius: 8px; background: var(--line);
  box-shadow: 0 0 0 1px var(--line), 0 28px 56px -30px var(--shadow);
}
.strip {
  position: absolute; left: 0; top: 0; display: flex; gap: 16px;
  opacity: 0; transition: opacity 150ms; will-change: transform;
}
.strip[data-active] { opacity: 1; }
.thumb { position: relative; flex: 0 0 var(--pw); height: var(--ph); overflow: hidden; background: var(--paper); }
.thumb-frame {
  position: absolute; left: 0; top: 0; width: var(--vw-px); height: var(--vh-px);
  transform: scale(var(--s)); transform-origin: 0 0; pointer-events: none; overflow: hidden;
  background: var(--paper);
}
.caption {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 10px;
  font: 12px/16px var(--font-mono); color: var(--ink-3);
}
.caption .path { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caption .host { color: var(--ink-3); }

.scrim {
  position: fixed; inset: 0; z-index: 40; background: var(--veil);
  opacity: 0; pointer-events: none; transition: opacity 260ms var(--ease-out);
}
html[data-menu] .scrim { opacity: 1; pointer-events: auto; }

/* thumbs carry a static copy of the bar at rest */
.fbar { position: absolute; left: 0; right: 0; top: 0; margin-top: 0; }
.fbar .top { cursor: default; }

/* ------------------------------------------------------------
   Mobile: the same model, driven by scroll instead of a pointer
   ------------------------------------------------------------ */
.sheet { display: none; }
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .bar-nav { grid-template-columns: 1fr auto; }
  .menu, .actions .link, .crumb, .preview { display: none; }
  .menu-toggle { display: inline-flex; }
  .bar-nav .bar-cta { padding: 0 11px; }
  .sheet {
    display: flex; flex-direction: column;
    position: absolute; left: 0; right: 0;
    top: calc(env(safe-area-inset-top, 0px) + var(--bar-h));
    height: calc(var(--sheet-h, 100vh) - var(--bar-h));
    visibility: hidden; opacity: 0; transition: opacity 140ms, visibility 0s linear 140ms;
  }
  .bar[data-sheet] .sheet { visibility: visible; opacity: 1; transition: opacity 260ms 110ms var(--ease-out); }
}
.tabs {
  flex: none; display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
  padding: 2px calc(var(--gutter) - 10px) 0;
  -webkit-mask-image: linear-gradient(90deg, var(--gray-900) calc(100% - 32px), transparent);
  mask-image: linear-gradient(90deg, var(--gray-900) calc(100% - 32px), transparent);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 44px; padding: 0 10px; border: 0; background: none; cursor: default;
  font-size: 15px; font-weight: 450;
  color: color-mix(in oklch, var(--ink) calc(var(--lv, var(--lv-rest)) * 100%), var(--paper));
  font-variation-settings: "GRAD" var(--grad, 0);
}
.tab[aria-selected="true"] { --lv: 1; --grad: 60; }
.deck { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.deck-track {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: calc((100% - var(--cw)) / 2); padding-block: 10px 6px; overscroll-behavior-x: contain;
  transition: opacity 180ms;
}
.deck-track::-webkit-scrollbar { display: none; }
.deck-track[data-swap] { opacity: 0; transition: none; }
.card { flex: 0 0 var(--cw); scroll-snap-align: center; display: flex; flex-direction: column; gap: 10px; -webkit-tap-highlight-color: transparent; }
.card-thumb {
  position: relative; display: block; width: var(--cw); height: var(--ch); overflow: hidden;
  border-radius: 12px; background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 22px 44px -28px var(--shadow);
}
.card-thumb .thumb-frame { transform: scale(var(--cs)); }
.card-meta { display: flex; flex-direction: column; gap: 2px; padding-inline: 2px; }
.card-label {
  font-size: 15px; font-weight: 450;
  color: color-mix(in oklch, var(--ink) calc(var(--lv, var(--lv-rest)) * 100%), var(--paper));
}
.card-path { font: 11px/15px var(--font-mono); color: var(--ink-3); }
@supports (animation-timeline: view()) {
  .card { animation: attend linear both; animation-timeline: view(inline); }
}
@keyframes attend {
  0%, 26% { opacity: .5; scale: .92; }
  50% { opacity: 1; scale: 1; }
  74%, 100% { opacity: .5; scale: .92; }
}
.sheet-actions { flex: none; display: flex; gap: 8px; padding: 12px var(--gutter) calc(16px + env(safe-area-inset-bottom, 0px)); }
.sheet-actions .btn { flex: 1; height: 46px; font-size: 15px; }

@supports (corner-shape: squircle) {
  .btn, .top, .sub-link, .link, .tab, .wordmark, .crumb { corner-shape: squircle; border-radius: 12px; }
  .btn.sm { border-radius: 12px; }
  .window, .card-thumb { corner-shape: squircle; border-radius: 12px; }
  .fig { corner-shape: squircle; border-radius: 12px; }
}

/* ------------------------------------------------------------
   View transitions: fade for plain links, handoff for previews
   ------------------------------------------------------------ */
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
/* the new snapshot is identical to the preview (same markup, same bar), so it can take over early and keep the morph sharp */
@keyframes vt-hold { 0%, 10% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes vt-reveal { 0% { opacity: 0; } 20%, 100% { opacity: 1; } }
html[data-vt="fade"]::view-transition-group(bar),
html[data-vt="fade"]::view-transition-new(bar) { animation: none; }
html[data-vt="fade"]::view-transition-old(bar) { animation: vt-out 160ms var(--ease-out) both; }
html[data-vt="fade"]::view-transition-old(root) { animation: vt-out 170ms var(--ease-out) both; }
html[data-vt="fade"]::view-transition-new(root) { animation: vt-in 260ms 70ms var(--ease-out) both; }

html[data-vt="handoff"]::view-transition-group(handoff) { z-index: 3; animation-duration: 660ms; animation-timing-function: var(--spring); }
html[data-vt="handoff"]::view-transition-old(handoff) { animation: vt-hold 660ms linear both; }
html[data-vt="handoff"]::view-transition-new(handoff) { animation: vt-reveal 660ms linear both; }
html[data-vt="handoff"]::view-transition-group(bar) { z-index: 2; animation: none; }
html[data-vt="handoff"]::view-transition-old(bar) { animation: vt-out 210ms var(--ease-out) both; }
html[data-vt="handoff"]::view-transition-new(bar) { animation: none; }
html[data-vt="handoff"]::view-transition-old(root) { animation: vt-out 320ms var(--ease-out) both; }
html[data-vt="handoff"]::view-transition-new(root) { animation: none; }

/* ------------------------------------------------------------
   Pages (rendered identically in main and in every preview)
   ------------------------------------------------------------ */
main { display: block; position: relative; outline: none; }
.fbar-capture { position: absolute; left: 0; right: 0; top: 0; height: var(--bar-h); z-index: 1; }
.page { padding-top: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); }
.wrap { max-width: 1280px; margin-inline: auto; padding-inline: var(--page-gutter); }
.hero {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px;
  align-items: start; padding-block: clamp(40px, 7vh, 88px) 64px;
}
.hero-text { grid-column: 1 / span 5; padding-top: 12px; }
.hero-fig { grid-column: 7 / span 6; min-width: 0; }
.eyebrow { margin: 0; font: 12px/16px var(--font-mono); color: var(--ink-3); letter-spacing: 0em; }
.page h1 {
  margin: 18px 0 20px; font-family: var(--font); font-weight: 400;
  font-size: clamp(40px, 4.5vw, 64px); line-height: 1.02; letter-spacing: -0.022em;
  font-variation-settings: "opsz" 72; text-wrap: balance;
}
.lede { margin: 0; max-width: 42ch; font-size: 17px; line-height: 1.56; color: var(--ink-2); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.try {
  margin: 28px 0 0; max-width: 40ch; padding-left: 14px; box-shadow: inset 2px 0 0 var(--accent);
  font-size: 13px; line-height: 1.5; color: var(--ink-2);
}
.details {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px;
  border-top: 1px solid var(--line); padding-block: 40px 88px;
}
.details h2 { margin: 0 0 8px; font: 400 20px/1.2 var(--font); font-variation-settings: "opsz" 24; letter-spacing: -0.01em; }
.details p { margin: 0; max-width: 36ch; color: var(--ink-2); font-size: 15px; }

.foot { border-top: 1px solid var(--line); background: var(--fill); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(5, minmax(0, 1fr)); gap: 24px; padding-block: 48px 40px; }
.foot-brand p { margin: 10px 0 0; color: var(--ink-3); font-size: 13px; max-width: 24ch; }
.foot h3 { margin: 4px 0 12px; font: 12px/16px var(--font-mono); color: var(--ink-3); font-weight: 400; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot a { font-size: 13px; color: var(--ink-2); }
.foot a:is(:hover, [data-hover]) { color: var(--ink); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 18px 28px; border-top: 1px solid var(--line); font: 12px/16px var(--font-mono); color: var(--ink-3); }

@media (max-width: 960px) {
  .hero-text { grid-column: 1 / -1; }
  .hero-fig { grid-column: 1 / -1; }
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .hero { padding-block: 32px 48px; }
  .page h1 { font-size: clamp(32px, 10vw, 40px); }
  .lede { font-size: 15px; }
  .details { grid-template-columns: 1fr; gap: 24px; padding-block: 32px 56px; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------
   Figures
   ------------------------------------------------------------ */
.fig { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
.fig-head, .fig-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; font: 12px/16px var(--font-mono); color: var(--ink-3);
}
.fig-head { border-bottom: 1px solid var(--line); }
.fig-foot { border-top: 1px solid var(--line); flex-wrap: wrap; justify-content: flex-start; }
.fig-foot .note { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border-radius: 99px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font: 11px/14px var(--font-mono); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.num { font-variant-numeric: tabular-nums; }

.plan { list-style: none; margin: 0; padding: 6px 0; }
.step { display: grid; grid-template-columns: 16px 20px minmax(0, 1fr) auto 56px; align-items: center; gap: 10px; padding: 11px 16px; }
.step + .step { border-top: 1px solid var(--line-soft); }
.step .g { width: 16px; height: 16px; display: block; }
.step-n { font: 11px var(--font-mono); color: var(--ink-3); text-align: right; }
.step-t { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step[data-s="plan"] .step-t { color: var(--ink-2); }
.scope { font: 11px/14px var(--font-mono); color: var(--ink-3); padding: 3px 7px; border-radius: 6px; background: var(--fill); white-space: nowrap; }
.step[data-s="wait"] .scope { background: color-mix(in oklch, var(--warn) 16%, var(--raised)); color: var(--ink-2); }
.step-m { font: 11px var(--font-mono); color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.g-run { animation: spin 1.1s linear infinite; transform-origin: 50% 50%; }
.thumb-frame .g-run, .card-thumb .g-run { animation: none; }
@keyframes spin { to { rotate: 360deg; } }

.wf-body { padding: 8px 0 4px; }
.wf-row { display: grid; grid-template-columns: 40% minmax(0, 1fr) 46px; align-items: center; gap: 12px; height: 27px; padding: 0 16px; }
.wf-name { font: 12px/16px var(--font-mono); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: calc(var(--d) * 14px); }
.wf-row[data-k="run"] .wf-name { color: var(--ink); }
.wf-track {
  position: relative; height: 100%;
  background: linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / calc(100% / 3) 100%;
  box-shadow: inset -1px 0 0 var(--line-soft);
}
.wf-bar { position: absolute; top: 50%; height: 9px; margin-top: -4.5px; border-radius: 4px; background: var(--ink-4); }
.wf-bar.k-model { background: var(--accent); }
.wf-bar.k-run { height: 3px; margin-top: -1.5px; background: var(--ink-3); }
.wf-bar.k-wait { background: repeating-linear-gradient(135deg, color-mix(in oklch, var(--warn) 70%, var(--raised)) 0 3px, color-mix(in oklch, var(--warn) 30%, var(--raised)) 3px 6px); }
.wf-dur { font: 11px var(--font-mono); color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.wf-axis { display: grid; grid-template-columns: 40% minmax(0, 1fr) 46px; gap: 12px; padding: 4px 16px 10px; }
.wf-ticks { position: relative; height: 14px; font: 9px/14px var(--font-mono); color: var(--ink-3); }
.wf-ticks i { position: absolute; font-style: normal; white-space: nowrap; transform: translateX(-50%); }
.wf-ticks i:first-child { transform: none; }
.wf-ticks i:last-child { transform: translateX(-100%); }
.legend { display: flex; gap: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 8px; border-radius: 2px; background: var(--c); }

.q-stack { position: relative; padding: 26px 22px 22px; }
.q-card { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; }
.q-back { position: absolute; left: 22px; right: 22px; height: 40px; }
.q-back.b1 { top: 16px; transform: scale(.96); opacity: .7; }
.q-back.b2 { top: 8px; transform: scale(.92); opacity: .4; }
.q-front { position: relative; padding: 16px 18px; box-shadow: 0 14px 30px -22px var(--shadow); }
.q-top { display: flex; justify-content: space-between; font: 11px/14px var(--font-mono); color: var(--ink-3); }
.q-title { margin: 10px 0 6px; font: 400 20px/1.2 var(--font); letter-spacing: -0.01em; }
.q-reason { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.q-reason b { font-weight: 500; color: var(--ink); }
.q-diff { font: 12px/20px var(--font-mono); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.q-diff div { padding: 2px 10px; display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.q-diff .del { background: color-mix(in oklch, var(--bad) 10%, var(--raised)); }
.q-diff .add { background: color-mix(in oklch, var(--ok) 12%, var(--raised)); }
.q-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.q-actions .who { margin-left: auto; font: 11px var(--font-mono); color: var(--ink-3); }

.code { margin: 0; padding: 16px 18px 18px; font: 12px/20px var(--font-mono); color: var(--ink-2); white-space: pre; overflow: hidden; }
.code .c { color: var(--ink-3); }
.code .k { color: var(--ink); }
.code .s { color: var(--accent); }
.code .n { color: color-mix(in oklch, var(--ok) 70%, var(--ink)); }
.code .m { color: var(--ink); font-weight: 500; }

.hm { display: grid; grid-template-columns: 116px repeat(12, minmax(0, 1fr)); gap: 3px; padding: 14px 16px 6px; }
.hm-tok { height: 58px; display: flex; align-items: flex-end; justify-content: center; font: 11px/1 var(--font-mono); color: var(--ink-3); white-space: pre; }
.hm-tok span { writing-mode: vertical-rl; transform: rotate(180deg); }
.hm-lab { display: flex; align-items: center; gap: 6px; font: 11px/1 var(--font-mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.hm-lab b { font-weight: 400; color: var(--ink-2); }
.hm-cell { aspect-ratio: 1 / 1; border-radius: 4px; background: color-mix(in oklch, var(--accent) calc(var(--v) * 100%), var(--fill)); }
.hm-row-on .hm-lab b { color: var(--accent); }
.hm-row-on.hm-cell, .hm-cell.on { box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent) 50%, transparent); }
.hm-note { padding: 8px 16px 14px; font-size: 12px; color: var(--ink-2); }

.ev { padding: 10px 16px 4px; }
.ev-row { display: grid; grid-template-columns: 34% minmax(0, 1fr) 52px 44px; align-items: center; gap: 12px; height: 34px; }
.ev-name { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-track { position: relative; height: 10px; background: linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 25% 100%; box-shadow: inset -1px 0 0 var(--line-soft); }
.ev-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--accent); }
.ev-prev { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 2px; }
.ev-val { font: 12px var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.ev-d { font: 11px var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; color: color-mix(in oklch, var(--ok) 62%, var(--ink)); }
.ev-d.neg { color: color-mix(in oklch, var(--bad) 75%, var(--ink)); }
.ev-axis { display: grid; grid-template-columns: 34% minmax(0, 1fr) 52px 44px; gap: 12px; padding: 2px 16px 12px; }
.ev-axis .wf-ticks { height: 14px; }

.rows { list-style: none; margin: 0; padding: 4px 0; }
.row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: baseline; gap: 16px; padding: 13px 16px; }
.row + .row { border-top: 1px solid var(--line-soft); }
.row-a { font: 11px/16px var(--font-mono); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-b { font-size: 13px; color: var(--ink); }
.rows.serif .row-b { font-family: var(--font); font-size: 17px; line-height: 1.25; letter-spacing: -0.005em; }
.row-c { font: 11px/16px var(--font-mono); color: var(--ink-3); white-space: nowrap; }

.rules { list-style: none; margin: 0; padding: 4px 0; counter-reset: r; }
.rule { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 14px 16px; counter-increment: r; }
.rule + .rule { border-top: 1px solid var(--line-soft); }
.rule::before { content: counter(r); font: 12px var(--font-mono); color: var(--accent); }
.rule p { margin: 0; font: 400 17px/1.3 var(--font); letter-spacing: -0.005em; }
.rule .row-c { align-self: center; }

.docs { display: grid; grid-template-columns: 152px minmax(0, 1fr); min-height: 300px; }
.docs-nav { border-right: 1px solid var(--line); padding: 14px 12px; font-size: 12px; }
.docs-nav h4 { margin: 12px 0 6px; font: 11px/14px var(--font-mono); color: var(--ink-3); font-weight: 400; }
.docs-nav h4:first-child { margin-top: 0; }
.docs-nav div { padding: 4px 8px; border-radius: 6px; color: var(--ink-2); }
.docs-nav .on { background: var(--fill); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.docs-main { padding: 16px 20px; }
.docs-main h3 { margin: 6px 0 8px; font: 400 24px/1.1 var(--font); letter-spacing: -0.015em; }
.docs-main p { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); max-width: 52ch; }
.docs-main pre { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--fill); border: 1px solid var(--line); font: 11px/18px var(--font-mono); color: var(--ink-2); }

.term { background: var(--term-bg); color: var(--term-ink); border-color: transparent; }
.term .fig-head { color: color-mix(in oklch, var(--term-ink) 55%, var(--term-bg)); border-bottom-color: color-mix(in oklch, var(--term-ink) 12%, var(--term-bg)); }
.term .dots { display: inline-flex; gap: 6px; }
.term .dots i { width: 9px; height: 9px; border-radius: 50%; background: color-mix(in oklch, var(--term-ink) 22%, var(--term-bg)); }
.term pre { margin: 0; padding: 14px 18px 18px; font: 12px/21px var(--font-mono); white-space: pre; overflow: hidden; }
.term .p { color: color-mix(in oklch, var(--term-ink) 50%, var(--term-bg)); }
.term .o { color: color-mix(in oklch, var(--term-ink) 70%, var(--term-bg)); }
.term .w { color: var(--yellow-200); }
.term .a { color: var(--blue-250); }

.up { padding: 10px 16px 14px; display: grid; gap: 14px; }
.up-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.up-head span:last-child { font: 12px var(--font-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.days { display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 1.5px; height: 26px; }
.days i { border-radius: 2px; background: color-mix(in oklch, var(--ok) 72%, var(--raised)); }
.days i.w { background: var(--warn); }
.up-axis { display: flex; justify-content: space-between; font: 9px var(--font-mono); color: var(--ink-3); }

.statement { padding: 28px 26px 24px; }
.statement blockquote { margin: 0; font: 400 clamp(22px, 2.2vw, 30px)/1.22 var(--f-display); letter-spacing: -0.012em; text-wrap: balance; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.people b { display: block; font-weight: 500; font-size: 13px; }
.people span { font-size: 12px; color: var(--ink-3); }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-col { padding: 18px 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.plan-col + .plan-col { border-left: 1px solid var(--line); }
.plan-col.hi { background: var(--accent-wash); }
.plan-name { font: 12px var(--font-mono); color: var(--ink-3); }
.plan-price { font: 400 32px/1.1 var(--font); letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.plan-unit { font-size: 12px; color: var(--ink-2); }
.plan-col ul { list-style: none; margin: 14px 0 16px; padding: 0; display: grid; gap: 7px; font-size: 12px; color: var(--ink-2); }
.plan-col li::before { content: "✓"; color: var(--accent); margin-right: 7px; font-size: 11px; }
.plan-col .btn { margin-top: auto; align-self: flex-start; }

.form { padding: 22px 22px 24px; display: grid; gap: 12px; }
.form label { font-size: 13px; color: var(--ink-2); }
.field { height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; padding: 0 14px; font-size: 15px; color: var(--ink-3); }
.form input.field { width: 100%; font: inherit; color: var(--ink); }
.form .btn { height: 44px; }
.form small { font-size: 12px; color: var(--ink-3); }

@media (max-width: 760px) {
  .step { grid-template-columns: 16px minmax(0, 1fr) auto; }
  .step-n, .step-m { display: none; }
  .wf-row, .wf-axis { grid-template-columns: 46% minmax(0, 1fr); }
  .wf-dur, .wf-axis > span:last-child { display: none; }
  .hm { grid-template-columns: 84px repeat(12, minmax(0, 1fr)); gap: 2px; }
  .hm-lab { font-size: 9px; }
  .ev-row, .ev-axis { grid-template-columns: 38% minmax(0, 1fr) 48px; }
  .ev-d, .ev-axis > span:last-child { display: none; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { display: none; }
  .plans { grid-template-columns: 1fr; }
  .plan-col + .plan-col { border-left: 0; border-top: 1px solid var(--line); }
  .people { grid-template-columns: 1fr; }
  .code, .term pre { font-size: 11px; line-height: 18px; }
}

/* ------------------------------------------------------------
   Reasoning panel (optional, shows what the model sees)
   ------------------------------------------------------------ */
.inspect-toggle {
  position: fixed; z-index: 60; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  height: 32px; padding: 0 12px; border-radius: 8px; border: 0; cursor: default;
  background: var(--raised); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line), 0 10px 24px -18px var(--shadow);
  font: 12px var(--font-mono);
}
.inspect-toggle[aria-pressed="true"] { color: var(--ink); box-shadow: 0 0 0 1px var(--accent), 0 10px 24px -18px var(--shadow); }
.inspector {
  position: fixed; z-index: 60; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 330px;
  background: var(--raised); color: var(--ink-2); border-radius: 12px; padding: 12px 14px 14px;
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px -30px var(--shadow);
  font: 11px/18px var(--font-mono); font-variant-numeric: tabular-nums;
}
.inspector h2 { margin: 0 0 8px; font: 12px/16px var(--font-mono); color: var(--ink); font-weight: 400; display: flex; justify-content: space-between; }
.ins-row { display: flex; justify-content: space-between; gap: 12px; }
.ins-row b { font-weight: 400; color: var(--ink); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-att { margin: 8px 0; padding: 8px 0; border-block: 1px solid var(--line-soft); display: grid; gap: 3px; }
.ins-att div { display: grid; grid-template-columns: 84px minmax(0, 1fr) 38px; gap: 8px; align-items: center; }
.ins-att i { height: 6px; border-radius: 4px; background: var(--accent); transform-origin: left; transform: scaleX(var(--w, 0)); }
.ins-att div.sink i { background: var(--ink-4); }
.ins-att span:last-child { text-align: right; color: var(--ink); }
@media (max-width: 760px) { .inspect-toggle, .inspector { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .bar-surface, .bar[data-open] .bar-surface, .bar:not([data-open]):not([data-sheet]) .bar-surface { transition: box-shadow 200ms; }
  .preview, .bar[data-open] .preview { transform: none; transition-property: opacity, visibility; }
  .bar[data-moving] { transition: none; }
  .crumb { transform: none; }
  .card { animation: none; }
  .g-run { animation: none; }
}
@media (forced-colors: active) {
  .top, .sub-link, .tab, .card-label { color: LinkText; }
  .top[aria-expanded="true"], .sub-link[aria-current="page"], .tab[aria-selected="true"] { text-decoration: underline; }
  .window, .card-thumb, .fig { border: 1px solid CanvasText; }
}
