/* ────────────────────────────────────────────────────────────
 * Forkit design system — single source of truth.
 * Tokens flip via [data-theme="dark|light"] on <html>.
 * Order: tokens → reset → typography → utilities → components.
 * ──────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Geist';
  src: url('/static/geist-sans.2ffebe99.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/static/geist-mono.afaacc4c.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Doto';
  src: url('/static/doto.558a7d80.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'Fira Code', monospace;
  --font-display: 'Doto', 'Geist Mono', ui-monospace, monospace;

  /* Spacing (4px base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  /* Radii */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;

  /* Type scale */
  --type-display-size:   clamp(2.75rem, 6vw, 4.5rem);
  --type-h1-size:        clamp(2rem, 4vw, 3rem);
  --type-h2-size:        1.625rem;
  --type-h3-size:        1.125rem;
  --type-body-size:      1rem;
  --type-small-size:     0.875rem;
  --type-mono-size:      0.8125rem;
  --type-eyebrow-size:   0.75rem;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;

  /* Container widths */
  --w-prose: 640px;
  --w-content: 960px;
  --w-wide: 1200px;
}

/* Black only: the brand has one theme. The light selector maps to the same values so a
 * saved "light" preference from before the rebrand still renders correctly. */
:root,
[data-theme="dark"],
[data-theme="light"] {
  --bg: #000000;
  --surface-1: #0A0A0A;
  --surface-2: #111111;
  --fg: #EDEDED;
  --fg-muted: #8F8F8F;
  --fg-faint: #8A8A8A;
  --border: #1C1C1C;
  --border-strong: #2A2A2A;
  --accent: #EDEDED;
  --accent-fg: #000000;
  --brand: #EDEDED;
  --brand-fg: #000000;

  /* colour only ever marks an agent's state */
  --state-ok: #3DD68C;
  --state-warn: #F5A524;
  --state-err: #FF6369;
  --state-info: #7AA2FF;
  color-scheme: dark;
}



/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: var(--type-body-size);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }

/* Typography utilities */
.t-display  { font-size: var(--type-display-size); line-height: 1.04; letter-spacing: -0.035em; font-weight: 500; }
.t-h1       { font-size: var(--type-h1-size);      line-height: 1.10; letter-spacing: -0.030em; font-weight: 500; }
.t-h2       { font-size: var(--type-h2-size);      line-height: 1.20; letter-spacing: -0.025em; font-weight: 500; }
.t-h3       { font-size: var(--type-h3-size);      line-height: 1.35; letter-spacing: -0.015em; font-weight: 600; }
.t-body     { font-size: var(--type-body-size);    line-height: 1.65; }
.t-small    { font-size: var(--type-small-size);   line-height: 1.55; }
.t-mono     { font-family: var(--font-mono); font-size: var(--type-mono-size); line-height: 1.50; }
.t-eyebrow  { font-family: var(--font-mono); font-size: var(--type-eyebrow-size); line-height: 1; letter-spacing: 0.08em; font-weight: 600; text-transform: uppercase; color: var(--fg-muted); }
.t-muted    { color: var(--fg-muted); }
.t-faint    { color: var(--fg-faint); }
.t-info     { color: var(--state-info); }
.t-link     { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

/* ── Logo & wordmark ── */
.logo { display: inline-block; vertical-align: middle; color: var(--brand); }
.wordmark { font-family: var(--font-display); font-weight: 900; letter-spacing: 0; line-height: 1; color: var(--fg); }

/* ── Nav ── */
.nav { position: sticky; top: 0; z-index: 100; background: color-mix(in oklab, var(--bg) 80%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: var(--w-content); margin: 0 auto; padding: 0 var(--s-5); height: 56px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: var(--s-2); color: var(--fg); }
.nav-links { display: flex; align-items: center; gap: var(--s-5); }
.nav-link { font-size: var(--type-small-size); color: var(--fg-muted); transition: color var(--dur-fast) var(--ease); }
.nav-link:hover { color: var(--fg); }
.nav-cta { background: var(--brand); color: var(--brand-fg); padding: var(--s-2) var(--s-4); border-radius: var(--r-md); font-size: var(--type-small-size); font-weight: 600; }
.nav-cta:hover { background: color-mix(in oklab, var(--brand) 88%, black); }
@media (max-width: 480px) { .nav-link { display: none; } }

/* ── Theme toggle ── */
.theme-toggle { display: none !important; background: transparent; border: 1px solid var(--border); color: var(--fg-muted); width: 32px; height: 32px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.theme-toggle:hover { color: var(--fg); border-color: var(--border-strong); }
.theme-toggle .ti-sun { display: none; }
[data-theme="dark"] .theme-toggle .ti-sun { display: block; }
[data-theme="dark"] .theme-toggle .ti-moon { display: none; }
[data-theme="light"] .theme-toggle .ti-sun { display: none; }
[data-theme="light"] .theme-toggle .ti-moon { display: block; }

/* ── Site footer ── */
.site-footer { border-top: 1px solid var(--border); padding: var(--s-5) var(--s-5); font-size: var(--type-small-size); color: var(--fg-faint); text-align: center; margin-top: var(--s-9); }

/* ── Cards ── */
.card { background: var(--surface-1); border-radius: var(--r-lg); }
.card--padded { padding: var(--s-6); }
.card--bordered { border: 1px solid var(--border); }
.card--emphasized { border: 1px solid var(--border-strong); }

/* ── Badges ── */
.badge { display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; padding: var(--s-1) var(--s-2); border-radius: var(--r-sm); border: 1px solid var(--border); color: var(--fg-muted); }
.badge--ok      { color: var(--state-ok); border-color: color-mix(in oklab, var(--state-ok) 35%, var(--border)); }
.badge--warn    { color: var(--state-warn); border-color: color-mix(in oklab, var(--state-warn) 35%, var(--border)); }
.badge--err     { color: var(--state-err); border-color: color-mix(in oklab, var(--state-err) 35%, var(--border)); }
.badge--info    { color: var(--state-info); border-color: color-mix(in oklab, var(--state-info) 35%, var(--border)); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-radius: var(--r-md); font-size: var(--type-small-size); font-weight: 600; border: none; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.btn--primary { background: var(--brand); color: var(--brand-fg); }
.btn--primary:hover { background: color-mix(in oklab, var(--brand) 88%, black); color: var(--brand-fg); }
.btn--ghost { background: transparent; color: var(--fg-muted); border: 1px solid var(--border); }
.btn--ghost:hover { color: var(--fg); border-color: var(--border-strong); }
.btn--icon { padding: var(--s-2); width: 32px; height: 32px; background: transparent; border: 1px solid var(--border); color: var(--fg-muted); }

/* ── Inline ── */
.kbd { font-family: var(--font-mono); font-size: 0.75rem; padding: var(--s-1) var(--s-2); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--fg-muted); }

/* ── Landing layout ── */
.lp { max-width: var(--w-content); margin: 0 auto; padding: 0 var(--s-5); }
.section { padding: var(--s-9) 0; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: none; }
.section-sub { color: var(--fg-muted); max-width: var(--w-prose); margin-bottom: var(--s-6); margin-top: var(--s-3); line-height: 1.7; }

/* ── Hero ── */
.hero { text-align: center; padding: var(--s-10) 0 var(--s-9); background: radial-gradient(ellipse 80% 50% at 50% 0%, color-mix(in srgb, var(--brand) 7%, transparent) 0%, transparent 70%); }
[data-theme="light"] .hero { background: radial-gradient(ellipse 80% 50% at 50% 0%, color-mix(in srgb, var(--brand) 10%, transparent) 0%, transparent 70%); }
.hero-eyebrow { display: inline-block; font-family: var(--font-mono); font-size: var(--type-eyebrow-size); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); border: 1px solid var(--brand); background: color-mix(in oklab, var(--brand) 12%, transparent); border-radius: var(--r-pill); padding: var(--s-2) var(--s-4); margin-bottom: var(--s-5); }
.hero h1 { margin-bottom: var(--s-4); }
.hero h1 em {
  font-style: normal;
  background-image: linear-gradient(135deg, var(--brand) 0%, color-mix(in oklab, var(--brand) 55%, var(--fg)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.035em;
}
.hero-sub { color: var(--fg-muted); font-size: 1.05rem; max-width: var(--w-prose); margin: 0 auto var(--s-6); line-height: 1.7; }
.hero-cta { display: flex; gap: var(--s-4); justify-content: center; flex-wrap: wrap; margin-bottom: var(--s-5); }
.hero-footnote { text-align: center; margin-top: var(--s-3); font-size: var(--type-small-size); color: var(--fg-muted); }
.hero-footnote code { font-family: var(--font-mono); font-size: 0.85em; padding: 2px 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--fg); }
/* ── Directory logo bar ── */
.dir-bar { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-5); overflow: hidden; max-width: 480px; margin-left: auto; margin-right: auto; }
.dir-bar-label { flex-shrink: 0; color: var(--fg-faint); font-size: var(--type-small-size); white-space: nowrap; }
.dir-bar-track-wrap { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%); mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%); }
.dir-bar-track { display: flex; align-items: center; gap: var(--s-6); width: max-content; animation: dir-marquee 12s linear infinite; }
.dir-bar-track:hover { animation-play-state: paused; }
@keyframes dir-marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.dir-bar-item { display: inline-flex; align-items: center; text-decoration: none; color: var(--fg-muted); opacity: 0.8; transition: opacity 0.15s; flex-shrink: 0; }
.dir-bar-item:hover { opacity: 1; }
.dir-bar-item svg { display: block; }

/* ── Proof grid ── */
.proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
@media (max-width: 600px) { .proof-grid { grid-template-columns: 1fr; } }
.proof-col { background: var(--surface-1); padding: var(--s-6); }
.proof-label { font-family: var(--font-mono); font-size: var(--type-eyebrow-size); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--s-5); color: var(--fg-muted); }
.proof-col--bad .proof-label { color: var(--state-err); }
.proof-col--good .proof-label { color: var(--state-ok); }
.proof-metric { font-size: var(--type-display-size); font-weight: 700; line-height: 1; letter-spacing: -0.035em; margin-bottom: var(--s-2); color: var(--fg); }
.proof-desc { color: var(--fg-muted); font-size: var(--type-small-size); line-height: 1.6; margin-bottom: var(--s-5); max-width: 360px; }
.proof-log { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-family: var(--font-mono); font-size: var(--type-mono-size); line-height: 1.7; color: var(--fg-faint); }

/* ── Pillars ── */
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
@media (max-width: 680px) { .pillars { grid-template-columns: 1fr; } }
.pillar { background: var(--surface-1); padding: var(--s-6); }
.pillar-tag { display: inline-block; font-family: var(--font-mono); font-size: var(--type-eyebrow-size); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s-1) var(--s-2); margin-bottom: var(--s-4); }
.pillar-icon { font-size: 1.25rem; color: var(--fg); margin-bottom: var(--s-3); }
.pillar h3 { margin-bottom: var(--s-2); }
.pillar-body { color: var(--fg-muted); font-size: var(--type-small-size); line-height: 1.65; }

/* ── Pricing ── */
.pricing-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 600px) { .pricing-row { grid-template-columns: 1fr; } }
.tier { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-6); position: relative; }
.tier--featured { border-color: var(--border-strong); }
.tier-tagline { position: absolute; top: -10px; left: var(--s-5); background: var(--bg); padding: 0 var(--s-2); font-family: var(--font-mono); font-size: var(--type-eyebrow-size); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg); }
.tier-name { font-family: var(--font-mono); font-size: var(--type-eyebrow-size); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: var(--s-3); }
.tier-price { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1; color: var(--fg); margin-bottom: var(--s-2); font-variant-numeric: tabular-nums; }
.tier-sub { color: var(--fg-faint); font-size: var(--type-small-size); margin-bottom: var(--s-5); }
.tier-items { list-style: none; display: flex; flex-direction: column; gap: var(--s-2); }
.tier-items li { color: var(--fg-muted); font-size: var(--type-small-size); line-height: 1.5; padding-left: var(--s-4); position: relative; }
.tier-items li::before { content: "✓"; color: var(--fg); position: absolute; left: 0; }

/* ── Command block (terminal-style) ── */
.cmd-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); position: relative; overflow: hidden; }
.cmd-titlebar { display: flex; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.cmd-titlebar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.cmd-body { margin: 0; padding: var(--s-4); font-family: var(--font-mono); font-size: var(--type-mono-size); line-height: 1.6; color: var(--fg); white-space: pre-wrap; word-break: break-all; }
.cmd-copy { position: absolute; top: var(--s-3); right: var(--s-3); background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--fg-muted); font-size: 0.7rem; padding: var(--s-1) var(--s-2); }
.cmd-copy:hover { color: var(--fg); border-color: var(--border-strong); }
.cmd-copy.copied { color: var(--state-ok); }

/* ── Badge row ── */
.badge-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.badge-chip { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; padding: var(--s-1) var(--s-3); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--fg-muted); }

/* ── Agent tabs (setup snippets per MCP client) ── */
.agent-tabs-group { margin-top: var(--s-5); }
.agent-tabs { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-3); }
.agent-tab { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--fg-muted); font-size: var(--type-small-size); font-weight: 500; padding: var(--s-2) var(--s-4); transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.agent-tab:hover { color: var(--fg); border-color: var(--border-strong); }
.agent-tab--active { color: var(--brand); border-color: var(--brand); background: color-mix(in oklab, var(--brand) 10%, transparent); }
.agent-panel { display: block; }
.agent-panel--hidden { display: none; }
.agent-hint { font-size: var(--type-small-size); color: var(--fg-muted); margin-bottom: var(--s-2); }
.agent-hint code { font-family: var(--font-mono); font-size: 0.85em; padding: 2px 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--fg); }
.agent-hint strong { color: var(--fg); font-weight: 600; }

/* ── Compliance strip ── */
.compliance { display: flex; gap: var(--s-6); flex-wrap: wrap; justify-content: center; padding: var(--s-5) var(--s-5); border-top: 1px solid var(--border); }
.compliance-item { font-family: var(--font-mono); font-size: var(--type-eyebrow-size); color: var(--fg-faint); letter-spacing: 0.04em; }

/* ── App shell ── */
.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--surface-1); border-right: 1px solid var(--border); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-5); position: sticky; top: 0; height: 100vh; }
.rail-brand { display: flex; align-items: center; gap: var(--s-2); padding-bottom: var(--s-3); border-bottom: 1px solid var(--border); }
.rail-workspace { font-family: var(--font-mono); font-size: var(--type-small-size); color: var(--fg-muted); }
.rail-nav { display: flex; flex-direction: column; gap: var(--s-1); flex: 1; }
.rail-link { padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); color: var(--fg-muted); font-size: var(--type-small-size); }
.rail-link:hover { background: var(--surface-2); color: var(--fg); }
.rail-link--active { background: color-mix(in oklab, var(--brand) 10%, transparent); color: var(--brand); font-weight: 600; box-shadow: inset 2px 0 0 var(--brand); }
.rail-user { display: flex; align-items: center; gap: var(--s-2); font-size: var(--type-small-size); color: var(--fg-muted); padding-top: var(--s-3); border-top: 1px solid var(--border); }
.user-avatar { border-radius: 50%; }
.user-avatar--placeholder { width: 24px; height: 24px; background: var(--surface-2); }
.app-main { padding: var(--s-6) var(--s-7); max-width: var(--w-wide); min-width: 0; }

@media (max-width: 768px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: relative; height: auto; flex-direction: row; flex-wrap: wrap; gap: var(--s-3); padding: var(--s-3) var(--s-5); min-width: 0; }
  .rail-nav { order: 9; flex: 1 0 100%; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; min-width: 0; }
  .rail-nav .rail-link { white-space: nowrap; }
  .app-main { padding: var(--s-5); }
}

/* ── App section ── */
.app-section { margin-bottom: var(--s-7); }
.app-section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: var(--s-5); flex-wrap: wrap; gap: var(--s-3); }
.app-section-title { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; }
.app-section-sub { color: var(--fg-muted); font-size: var(--type-small-size); margin-top: var(--s-1); }

/* ── Section sub-tabs (under section header, above body) ── */
.section-tabs { display: flex; gap: var(--s-1); margin: calc(var(--s-5) * -1) 0 var(--s-5); border-bottom: 1px solid var(--border); }
.section-tab { padding: var(--s-3) var(--s-4); color: var(--fg-muted); font-size: var(--type-small-size); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.section-tab:hover { color: var(--fg); }
.section-tab--active { color: var(--brand); border-bottom-color: var(--brand); }

/* ── Project filter select ── */
.filter-select { font-family: var(--font-mono); font-size: var(--type-small-size); color: var(--fg); background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-1) var(--s-3); cursor: pointer; }
.filter-select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ── Summary strip ── */
.summary-strip { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-6); padding: var(--s-4) var(--s-5); background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); flex-wrap: wrap; }
.summary-stats { display: flex; gap: var(--s-7); flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: var(--s-1); }
.stat-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 900; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; }
.stat-value--ok { color: var(--state-ok); }
.stat-value--warn { color: var(--state-warn); }
.stat-value--err { color: var(--state-err); }
.stat-value--info { color: var(--state-info); }
.stat-label { font-family: var(--font-mono); font-size: var(--type-eyebrow-size); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); }
.summary-updated { font-size: var(--type-small-size); color: var(--fg-faint); }

/* ── Data table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--type-small-size); }
.data-table th { text-align: left; font-family: var(--font-mono); font-size: var(--type-eyebrow-size); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); font-weight: 500; padding: 0 var(--s-4) var(--s-3); }
.data-table td { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); vertical-align: middle; color: var(--fg); }
.data-table tbody tr { transition: background var(--dur-fast) var(--ease); }
.data-table tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.data-table tbody tr:focus { outline: 2px solid var(--border-strong); outline-offset: -2px; background: var(--surface-2); }
@media (max-width: 768px) {
  .data-table thead { display: none; }
  .data-table tr { display: block; padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); }
  .data-table td { display: block; padding: var(--s-1) 0; border: none; }
}

/* ── Drawer ── */
.drawer { position: fixed; inset: 0; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity var(--dur-base) var(--ease); }
.drawer[data-open="true"] { pointer-events: auto; opacity: 1; }
.drawer-backdrop { position: absolute; inset: 0; background: color-mix(in oklab, var(--bg) 60%, transparent); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(440px, 90vw); background: var(--surface-1); border-left: 1px solid var(--border); display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--dur-slow) var(--ease); }
.drawer[data-open="true"] .drawer-panel { transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-5); border-bottom: 1px solid var(--border); }
.drawer-title { font-size: 1rem; font-weight: 600; flex: 1; }
.drawer-meta { font-family: var(--font-mono); font-size: var(--type-small-size); color: var(--fg-muted); }
.drawer-close { background: transparent; border: none; color: var(--fg-muted); font-size: 1.5rem; line-height: 1; padding: 0 var(--s-2); }
.drawer-close:hover { color: var(--fg); }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s-5); }
@media (max-width: 768px) {
  .drawer-panel { width: 100vw; transform: translateY(100%); }
  .drawer[data-open="true"] .drawer-panel { transform: translateY(0); }
}

/* ── Empty state ── */
.empty { text-align: center; padding: var(--s-9) var(--s-5); }
.empty-title { font-size: 1rem; font-weight: 600; margin-bottom: var(--s-2); }
.empty-sub { color: var(--fg-muted); font-size: var(--type-small-size); margin-bottom: var(--s-4); }

/* ── Landing helper styles (proof savings, pricing note, setup CTA) ── */
.proof-savings { text-align: center; padding: var(--s-3) var(--s-4); margin-top: var(--s-3); border-top: 1px solid var(--border); font-size: var(--type-small-size); color: var(--fg-muted); }
.proof-savings strong { color: var(--brand); font-weight: 700; font-size: 1.05rem; }
.pricing-note { color: var(--fg-faint); font-size: var(--type-small-size); text-align: center; margin-top: var(--s-3); }
.setup-cta { margin-top: var(--s-5); margin-bottom: var(--s-5); display: flex; justify-content: center; }

/* ── Fork graph demo (landing) ── */
.fork-graph { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-1); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.fork-graph-svg { width: 100%; height: auto; max-height: 480px; }
.fg-line { fill: none; stroke: var(--border-strong); stroke-width: 2; stroke-linecap: round; }
.fg-line--bad  { stroke: var(--state-err); stroke-dasharray: 4 4; opacity: 0.75; }
.fg-line--good { stroke: var(--brand); }
.fg-node { fill: var(--surface-1); stroke: var(--border-strong); stroke-width: 2; }
.fg-node--trunk { fill: var(--fg); stroke: var(--fg); }
.fg-node--fork  { fill: var(--surface-2); stroke: var(--border-strong); }
.fg-node--bad   { fill: var(--state-err); stroke: var(--state-err); }
.fg-node--good  { fill: var(--brand); stroke: var(--brand); }
.fg-label { font-family: var(--font-mono); font-size: 13px; fill: var(--fg); dominant-baseline: middle; }
.fg-label--right { text-anchor: end; }
.fg-label--dim { fill: var(--fg-muted); }
.fork-graph-legend { display: flex; gap: var(--s-5); flex-wrap: wrap; padding-top: var(--s-3); border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: var(--type-small-size); color: var(--fg-muted); }
.fg-legend-item { display: inline-flex; align-items: center; gap: var(--s-2); }
.fg-swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.fg-swatch--trunk { background: var(--fg); }
.fg-swatch--bad   { background: var(--state-err); }
.fg-swatch--good  { background: var(--brand); }

/* ── Terminals collaboration demo (landing) ── */
.terminals-demo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: var(--s-4); }
.tx-term { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.tx-term-head {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--surface-1) 92%, var(--brand) 8%),
    var(--surface-1));
  border-bottom: 1px solid color-mix(in oklab, var(--brand) 22%, var(--border));
  box-shadow: inset 0 -1px 0 color-mix(in oklab, var(--brand) 12%, transparent);
}
.tx-term-dots { display: flex; gap: 6px; }
.tx-term-dots span {
  width: 11px; height: 11px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, black 25%, transparent);
}
.tx-term-dots span:nth-child(1) { background: #FF5F57; }
.tx-term-dots span:nth-child(2) { background: #FEBC2E; }
.tx-term-dots span:nth-child(3) { background: #28C840; }
.tx-term-title {
  flex: 1; font-family: var(--font-mono); font-size: var(--type-small-size);
  color: var(--fg); font-weight: 600; letter-spacing: 0.01em;
}
.tx-term-status {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--brand); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
  padding: 2px var(--s-2);
  border: 1px solid color-mix(in oklab, var(--brand) 35%, transparent);
  border-radius: var(--r-pill);
  background: color-mix(in oklab, var(--brand) 8%, transparent);
}
.tx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-faint); }
.tx-dot--live { background: var(--brand); box-shadow: 0 0 0 0 color-mix(in oklab, var(--brand) 70%, transparent); animation: tx-pulse 2s ease-out infinite; }
.tx-term-body { padding: var(--s-4); font-family: var(--font-mono); font-size: var(--type-mono-size); line-height: 1.7; color: var(--fg); flex: 1; }
.tx-line { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.tx-line--prompt { color: var(--fg); }
.tx-line--output { color: var(--fg-muted); }
.tx-line--ok     { color: var(--brand); }
.tx-line--dim    { color: var(--fg-faint); }
.tx-line--wake   { color: var(--state-info); font-weight: 600; }

.tx-relay { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 var(--s-2); min-width: 120px; color: var(--fg-muted); }
.tx-relay-label { font-family: var(--font-mono); font-size: var(--type-eyebrow-size); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: var(--s-3); }
.tx-relay-track { position: relative; width: 100%; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.tx-relay-pulse { position: absolute; top: 0; left: -30%; width: 30%; height: 100%; background: linear-gradient(90deg, transparent, var(--brand), transparent); animation: tx-relay-sweep 2.4s linear infinite; }
.tx-relay-caption { font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-faint); margin-top: var(--s-3); text-align: center; line-height: 1.4; }

@keyframes tx-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--brand) 70%, transparent); }
  70%  { box-shadow: 0 0 0 8px color-mix(in oklab, var(--brand) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--brand) 0%, transparent); }
}
@keyframes tx-relay-sweep {
  0%   { left: -30%; }
  100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .tx-dot--live, .tx-relay-pulse { animation: none; }
}
@media (max-width: 768px) {
  .terminals-demo { grid-template-columns: 1fr; }
  .tx-relay { min-height: 80px; flex-direction: row; gap: var(--s-3); }
  .tx-relay-track { width: 2px; height: 40px; background: var(--border); }
  .tx-relay-pulse { width: 100%; height: 30%; left: 0 !important; top: -30%; background: linear-gradient(180deg, transparent, var(--brand), transparent); animation: tx-relay-sweep-v 2.4s linear infinite; }
}
@keyframes tx-relay-sweep-v {
  0%   { top: -30%; }
  100% { top: 100%; }
}

/* ── Focus states ── */
:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; }
.btn:focus-visible { outline-offset: 3px; }
.nav-link:focus-visible, .rail-link:focus-visible { outline-offset: 4px; border-radius: var(--r-sm); }
.theme-toggle:focus-visible { outline-offset: 2px; }
.data-table tr:focus-visible { outline: 2px solid var(--border-strong); outline-offset: -2px; background: var(--surface-2); }
.drawer-close:focus-visible { outline-offset: 4px; border-radius: var(--r-sm); }

/* ── Agent activity trace view ── */
.act-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); flex-wrap: wrap; gap: var(--s-3); }
.act-status { font-family: var(--font-mono); font-size: var(--type-small-size); color: var(--fg-muted); }
.act-legend { display: flex; gap: var(--s-4); flex-wrap: wrap; }
.act-leg { display: flex; align-items: center; gap: var(--s-1); font-size: var(--type-eyebrow-size); color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.act-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.act-dot--in_progress { background: var(--state-info); }
.act-dot--done        { background: var(--state-ok); }
.act-dot--cancelled   { background: var(--border-strong); }

.act-queue-bar { font-family: var(--font-mono); font-size: var(--type-eyebrow-size); color: var(--state-warn); margin-bottom: var(--s-3); letter-spacing: 0.04em; }

/* Shared layout: agent col (160px) | track (flex) | info (280px) */
.act-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-1); }
.act-empty { padding: var(--s-9) var(--s-5); text-align: center; background: var(--surface-1); }

/* Axis row */
.act-axis-row { display: flex; background: var(--surface-2); border-bottom: 1px solid var(--border); height: 30px; }
.act-axis-spacer { width: 160px; flex-shrink: 0; border-right: 1px solid var(--border); }
.act-axis-track { flex: 1; position: relative; }
.act-axis-lbl { position: absolute; transform: translateX(-50%); font-family: var(--font-mono); font-size: 10px; color: var(--fg-faint); top: 50%; translate: 0 -50%; white-space: nowrap; pointer-events: none; }
.act-axis-lbl:first-child { transform: none; }
.act-axis-lbl--now { transform: translateX(-100%); color: var(--state-warn); font-weight: 600; }

/* Task rows */
.act-rows { display: flex; flex-direction: column; }
.act-row { display: grid; grid-template-columns: 160px 1fr 280px; min-height: 52px; border-bottom: 1px solid var(--border); transition: background var(--dur-fast); }
.act-row:last-child { border-bottom: none; }
.act-row:hover { background: color-mix(in oklab, var(--fg) 2%, transparent); }

/* Agent label column */
.act-row-agent { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-4); border-right: 1px solid var(--border); overflow: hidden; }
.act-agent-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.act-agent-name { font-family: var(--font-mono); font-size: var(--type-eyebrow-size); color: var(--fg); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.act-agent-dur { font-family: var(--font-mono); font-size: 10px; color: var(--fg-faint); flex-shrink: 0; }

/* Timeline track column */
.act-row-track { position: relative; overflow: hidden; }
.act-track-line { position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.act-now-tick { position: absolute; top: 20%; bottom: 20%; right: 0; width: 1px; background: color-mix(in oklab, var(--state-warn) 45%, transparent); }
.act-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 26px; border-radius: var(--r-sm); opacity: 0.85; transition: opacity var(--dur-fast) var(--ease); }
.act-bar:hover { opacity: 1; }
.act-bar--done      { opacity: 0.55; }
.act-bar--cancelled { filter: grayscale(1) brightness(0.5); }
.act-bar--pulse { animation: act-pulse 2.2s ease-in-out infinite; }
.act-bar-label { font-family: var(--font-mono); font-size: 10px; color: var(--bg); font-weight: 600; white-space: nowrap; padding: 0 var(--s-2); overflow: hidden; text-overflow: ellipsis; pointer-events: none; display: block; line-height: 26px; }

/* Info column */
.act-row-info { display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-4); overflow: hidden; border-left: 1px solid var(--border); }
.act-task-title { font-size: var(--type-small-size); color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.act-status-badge { font-family: var(--font-mono); font-size: 10px; padding: 2px 6px; border-radius: var(--r-pill); flex-shrink: 0; white-space: nowrap; }
.act-status-badge--in_progress { background: color-mix(in oklab, var(--state-info) 15%, transparent); color: var(--state-info); }
.act-status-badge--done        { background: color-mix(in oklab, var(--state-ok)   15%, transparent); color: var(--state-ok); }
.act-status-badge--cancelled   { background: color-mix(in oklab, var(--border-strong) 30%, transparent); color: var(--fg-muted); }

@keyframes act-pulse {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 0.5; }
}

@media (max-width: 768px) {
  .act-row { grid-template-columns: 120px 1fr; }
  .act-row-info { display: none; }
  .act-axis-spacer { width: 120px; }
}

.rail-user-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.rail-user-name { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user-role { font-size: 11px; color: var(--fg-faint); }

/* ── Inbox and threads ──
 * The most urgent question gets the page's only large type. Everything else is
 * deliberately quiet, so the eye lands on what needs a person. */
.link-button { background: none; border: 0; padding: 0; color: var(--fg-muted); font: inherit; font-size: var(--type-small-size); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-button:hover { color: var(--fg); }
.link-button--danger { color: var(--state-err); }
.link-button--danger:hover { color: var(--state-err); }

.tstate { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--type-small-size); color: var(--fg-muted); white-space: nowrap; }
.tstate-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-faint); flex: none; }
.tstate--waiting { color: var(--state-warn); }
.tstate--waiting .tstate-dot { background: var(--state-warn); }
.tstate--review { color: var(--state-info); }
.tstate--review .tstate-dot { background: var(--state-info); }
.tstate--blocked { color: var(--state-err); }
.tstate--blocked .tstate-dot { background: var(--state-err); }
.tstate--working .tstate-dot { background: var(--fg-muted); } /* neutral: working needs nobody */
.tstate--quiet { color: var(--state-warn); }
.tstate--quiet .tstate-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--state-warn); }
.tstate--resolved .tstate-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fg-faint); }
/* The four words (src/auth/html/status.ts): only "Waiting on you" asks for attention; working is neutral. */
.tstate--you { color: var(--state-warn); }
.tstate--you .tstate-dot { background: var(--state-warn); }
.tstate--run .tstate-dot { background: var(--fg-muted); }
.tstate--quiet { color: var(--state-warn); }
.tstate--quiet .tstate-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--state-warn); }
.tstate--done .tstate-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fg-faint); }
.tstate--stop { color: var(--state-err); }
.tstate--stop .tstate-dot { background: var(--state-err); }
.tstate-reason { margin-left: 6px; color: var(--fg-faint); font-size: var(--type-small-size); }
.blocker { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin: var(--s-3) 0; padding: 10px 14px; border: 1px solid color-mix(in oklab, var(--state-warn) 40%, var(--border)); border-left-width: 3px; border-radius: 8px; background: color-mix(in oklab, var(--state-warn) 6%, transparent); }
.blocker--stop { border-color: color-mix(in oklab, var(--state-err) 45%, var(--border)); background: color-mix(in oklab, var(--state-err) 6%, transparent); }
.blocker-what { margin: 0; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 12rem; flex-wrap: wrap; }
.blocker-reason { color: var(--fg); font-size: 14px; line-height: 1.45; }
.blocker-act { flex: none; }
.new-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--state-info); vertical-align: middle; flex: none; }
.tevent-new { list-style: none; display: flex; align-items: center; gap: 10px; margin: var(--s-2) 0; color: var(--state-info); font-size: 12px; font-weight: 500; }
.tevent-new::after { content: ''; flex: 1; height: 1px; background: color-mix(in oklab, var(--state-info) 45%, transparent); }

.inbox .section-tabs { margin-bottom: var(--s-6); }
.next-up { padding-bottom: var(--s-7); margin-bottom: var(--s-6); border-bottom: 1px solid var(--border); max-width: 52rem; }
.next-up-who { color: var(--fg-muted); font-size: var(--type-small-size); margin-bottom: var(--s-3); }
.next-up-ask { font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.2; letter-spacing: -0.03em; font-weight: 500; margin-bottom: var(--s-3); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.next-up-title { color: var(--fg-muted); font-size: var(--type-small-size); margin-bottom: var(--s-5); }
.next-up-title a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.next-up--clear .next-up-title { margin-bottom: 0; }

.tgroup { margin-bottom: var(--s-6); }
.tgroup-title { font-size: var(--type-small-size); font-weight: 600; margin-bottom: var(--s-2); }
.tlist { list-style: none; margin: 0; padding: 0; }
.trow { display: grid; grid-template-columns: 11rem minmax(0, 1fr) minmax(0, 14rem) 5rem; gap: var(--s-4); align-items: baseline; padding: var(--s-3) var(--s-2); border-top: 1px solid var(--border); color: var(--fg); text-decoration: none; font-size: var(--type-small-size); }
.trow:hover { background: var(--surface-1); }
.trow-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trow-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-note { color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-who { color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-age { color: var(--fg-faint); text-align: right; white-space: nowrap; }

.thread-head { margin-bottom: var(--s-6); }
.thread-back { display: inline-block; color: var(--fg-muted); font-size: var(--type-small-size); margin-bottom: var(--s-4); }
.thread-title { font-size: clamp(1.375rem, 2.5vw, 1.75rem); line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; margin-bottom: var(--s-2); overflow-wrap: anywhere; }
.thread-meta { display: flex; flex-wrap: wrap; gap: var(--s-4); color: var(--fg-muted); font-size: var(--type-small-size); }
.thread-notice { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border: 1px solid var(--state-warn); border-radius: var(--r-md); font-size: var(--type-small-size); max-width: 44rem; }
.thread-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem); gap: var(--s-7); align-items: start; }
.thread-intent { margin-bottom: var(--s-5); max-width: 44rem; }
.thread-intent h2, .thread-history-title { font-size: var(--type-small-size); font-weight: 600; margin-bottom: var(--s-2); }
.thread-intent p { white-space: pre-wrap; line-height: 1.6; overflow-wrap: anywhere; }
.thread-facts { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); margin: 0 0 var(--s-6); font-size: var(--type-small-size); }
.thread-facts dt { color: var(--fg-muted); }
.thread-facts dd { margin: 0; overflow-wrap: anywhere; }
.thread-facts a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.tevents { list-style: none; margin: 0; padding: 0; max-width: 44rem; }
.tevent { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); padding: var(--s-3) 0; border-top: 1px solid var(--border); }
.tevent-seq { color: var(--fg-faint); font-size: var(--type-small-size); font-variant-numeric: tabular-nums; }
.tevent-head { font-size: var(--type-small-size); color: var(--fg-muted); }
.tevent-head strong { color: var(--fg); font-weight: 600; }
.tevent-head time { color: var(--fg-faint); }
.tevent-body { margin-top: var(--s-1); white-space: pre-wrap; line-height: 1.55; overflow-wrap: anywhere; }
.tevent-code { margin: var(--s-2) 0 0; padding: var(--s-2) var(--s-3); background: var(--surface-2); border-radius: var(--r-sm); font-family: var(--font-mono); font-size: var(--type-mono-size); overflow-x: auto; max-height: 16rem; }
.tevent--user { background: linear-gradient(to right, color-mix(in oklab, var(--brand) 7%, transparent), transparent 70%); }
/* GitHub's own reports: set apart from what people and agents say. */
.tevent--system .tevent-head strong { font-family: var(--font-mono, monospace); font-weight: 500; }
.tevent--system .tevent-body { color: var(--fg-muted); }
.tevent-thinking { margin-top: var(--s-1); }
.tevent-thinking summary { cursor: pointer; color: var(--fg-muted); font-size: var(--type-small-size); }
.tevent-thinking .tevent-body { color: var(--fg-muted); max-height: 24rem; overflow-y: auto; }
.tevent-line { color: var(--fg-muted); }

.thread-panel { position: sticky; top: var(--s-5); padding: var(--s-5); background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--r-lg); max-height: calc(100vh - var(--s-7)); overflow-y: auto; }
.panel-title { font-size: 1.0625rem; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; margin-bottom: var(--s-3); overflow-wrap: anywhere; }
.panel-summary { white-space: pre-wrap; line-height: 1.55; font-size: var(--type-small-size); margin-bottom: var(--s-4); overflow-wrap: anywhere; }
.panel-sub { font-size: var(--type-small-size); font-weight: 600; margin: var(--s-4) 0 var(--s-2); }
.check-list, .path-list { list-style: none; margin: 0; padding: 0; font-size: var(--type-small-size); }
.check-list li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 2px 0; }
.check--ok span:last-child { color: var(--state-ok); }
.check--bad span:last-child { color: var(--state-err); font-weight: 600; }
.check--unknown span:last-child { color: var(--state-warn); }
.panel-warning { margin-top: var(--s-4); padding: var(--s-3); border: 1px solid var(--state-err); border-radius: var(--r-md); font-size: var(--type-small-size); line-height: 1.45; }
.path-list { max-height: 12rem; overflow-y: auto; }
.path-list code { font-family: var(--font-mono); font-size: var(--type-mono-size); color: var(--fg-muted); overflow-wrap: anywhere; }
.panel-form { margin-top: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.panel-form label, .agent-form label { font-size: var(--type-small-size); color: var(--fg-muted); }
.panel-form textarea, .agent-form input { width: 100%; padding: var(--s-2) var(--s-3); background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--r-md); font: inherit; font-size: var(--type-small-size); resize: vertical; }
.panel-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.panel-close { margin-top: var(--s-4); }

.ws-switch { padding: 0 var(--s-1); display: flex; flex-direction: column; gap: var(--s-1); font-size: 0.75rem; color: var(--fg-muted); }
.ws-switch select { width: 100%; }

.team { max-width: 48rem; }
.team .app-section-title { margin-bottom: var(--s-6); }
.team-block { margin-bottom: var(--s-7); }
.team-title { font-size: 1rem; font-weight: 600; margin-bottom: var(--s-3); }
.team-note { color: var(--fg-muted); font-size: var(--type-small-size); margin: var(--s-3) 0; }
.team-table tbody tr:hover { background: none; cursor: default; }
.invite-new { margin: var(--s-4) 0; padding: var(--s-4); border: 1px solid var(--state-warn); border-radius: var(--r-md); font-size: var(--type-small-size); }
.invite-new .cmd-block { margin-top: var(--s-3); }
.invite-list, .agent-list { list-style: none; margin: var(--s-4) 0; padding: 0; font-size: var(--type-small-size); }
.invite-list li, .agent-list li { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0; border-top: 1px solid var(--border); }
.agent-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-2) var(--s-3); margin-top: var(--s-4); }
.agent-form label { width: 100%; }
.agent-form input { width: 16rem; max-width: 100%; }

.join { display: grid; place-items: center; min-height: 60vh; padding: var(--s-5); }
.join-card { max-width: 30rem; }
.join-title { font-size: var(--type-h2-size); line-height: 1.2; letter-spacing: -0.03em; font-weight: 500; margin-bottom: var(--s-3); overflow-wrap: anywhere; }
.join-text { color: var(--fg-muted); line-height: 1.6; margin-bottom: var(--s-5); }

@media (max-width: 960px) {
  .thread-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .thread-panel { position: static; max-height: none; order: -1; }
}
@media (max-width: 720px) {
  .trow { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-1) var(--s-3); }
  .trow-state { grid-column: 1; }
  .trow-age { grid-column: 2; grid-row: 1; }
  .trow-main, .trow-who { grid-column: 1 / -1; }
}

/* ── Team product: one-click answers, file notes, inbox bar ── */
.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; }
.inbox-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.answer-options { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0; }
.answer-options .btn { white-space: normal; text-align: left; }
.next-up .answer-options + .link-button { display: inline-block; margin-top: var(--s-1); }
.panel-or { font-size: var(--type-small-size); color: var(--fg-muted); margin: var(--s-1) 0 var(--s-2); }
.panel-hint { font-size: var(--type-small-size); color: var(--fg-muted); margin-bottom: var(--s-2); line-height: 1.5; }
.path-list--notes details > summary { cursor: pointer; padding: 2px 0; list-style: none; overflow-wrap: anywhere; }
.path-list--notes details > summary::-webkit-details-marker { display: none; }
.path-list--notes details > summary::before { content: "+"; display: inline-block; width: 1.1em; color: var(--fg-faint); }
.path-list--notes details[open] > summary::before { content: "−"; }
.path-list--notes details > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm); }
.path-list--notes textarea { width: 100%; margin: var(--s-1) 0 var(--s-2); font: inherit; font-size: var(--type-small-size); padding: var(--s-2); border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--fg); }
.path-flag { font-size: 0.75rem; color: var(--state-warn); border: 1px solid currentColor; border-radius: 999px; padding: 0 6px; margin-left: 4px; white-space: nowrap; }

/* ── Polish (brand pass): counts, agent marks, the inbox card, the thread timeline ── */
.rail-link { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.rail-count { min-width: 1.35rem; height: 1.35rem; padding: 0 6px; border-radius: var(--r-pill); background: var(--state-warn); color: #000; font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.rail-brand .logo { color: var(--fg); }
.rail-link--active { background: var(--surface-2); color: var(--fg); box-shadow: inset 2px 0 0 var(--fg); }

.agent-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.agent-mark { flex: none; color: var(--fg); opacity: .85; }
.trow-who .agent-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.inbox-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.inbox-head .app-section-title { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.025em; }
.inbox .section-tabs { margin: 0; border-bottom: 0; }
.inbox-bar { border-bottom: 1px solid var(--border); margin-bottom: var(--s-5); }
.inbox-keys { font-size: 0.75rem; color: var(--fg-faint); display: flex; align-items: center; gap: 6px; }
.inbox-keys kbd, .key-hint { font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1; padding: 3px 5px; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--fg-muted); background: var(--surface-2); }
.key-hint { margin-right: 8px; }
.btn--primary .key-hint, .key-hint--dark { background: rgba(0,0,0,.08); border-color: rgba(0,0,0,.2); color: rgba(0,0,0,.6); margin: 0 0 0 8px; }
.btn--primary .key-hint { margin: 0 8px 0 0; }
.inbox-summary { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.inbox-summary span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-muted); border: 1px solid var(--border-strong); border-radius: var(--r-pill); padding: 3px 10px; }
.inbox-summary .inbox-summary-hot { color: var(--state-warn); border-color: color-mix(in oklab, var(--state-warn) 45%, var(--border)); }

.next-up { position: relative; background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: var(--s-6) var(--s-6) var(--s-5); margin-bottom: var(--s-7); max-width: 56rem; overflow: hidden; }
.next-up::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--fg-faint); }
.next-up--waiting::before, .next-up--quiet::before { background: var(--state-warn); }
.next-up--review::before { background: var(--state-info); }
.next-up--blocked::before { background: var(--state-err); }
.next-up--clear { background: transparent; border-style: dashed; }
.next-up--clear::before { display: none; }
.next-up-who { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.next-up-when { color: var(--fg-faint); }

.empty-mark { display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: 14px; margin-bottom: var(--s-4); color: var(--fg); background: var(--surface-1); }
.empty-mark .logo { color: var(--fg); }

.thread-back { transition: color var(--dur-fast) var(--ease); }
.thread-back:hover { color: var(--fg); }
.thread-title { font-weight: 500; letter-spacing: -0.025em; }
.thread-meta { align-items: center; }
.tevents { position: relative; }
.tevents::before { content: ""; position: absolute; left: 11px; top: 14px; bottom: 14px; width: 1px; background: var(--border-strong); }
.tevent { position: relative; grid-template-columns: 2.25rem minmax(0, 1fr); border-top: 0; padding: var(--s-3) 0; }
.tevent--user { background: none; }
.tevent-marker { position: relative; z-index: 1; width: 23px; height: 23px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border-strong); overflow: hidden; }
.tevent-marker img { width: 100%; height: 100%; object-fit: cover; }
.tevent-marker--system::after { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--fg-faint); }
.tevent--review_request .tevent-marker { border-color: var(--state-info); }
.tevent--approved .tevent-marker { border-color: var(--state-ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--state-ok) 18%, transparent); }
.tevent--changes .tevent-marker { border-color: var(--state-err); }
.tevent--user .tevent-main { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); }
.tevent-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.tevent-seq { margin-left: auto; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--fg-faint); }
.thread-panel { border-color: var(--border-strong); }
.panel-title { font-weight: 500; letter-spacing: -0.015em; }
@media (max-width: 720px) { .inbox-keys { display: none; } .next-up { padding: var(--s-5); } }
.app-shell ~ .site-footer { display: none; } /* the logged-in frame has its own chrome */
.check--ok span:last-child::before { content: "✓ "; }
.check--bad span:last-child::before { content: "✕ "; }
.person { display: inline-flex; align-items: center; gap: var(--s-2); }
.person-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); flex: none; }
.agent-list .agent-name { font-weight: 500; }

/* ── Permission requests, command rules, orchestrator ── */
.perm-subject { margin: var(--s-3) 0; padding: var(--s-3) var(--s-4); background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--r-md); font-family: var(--font-mono); font-size: var(--type-mono-size); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12rem; overflow-y: auto; }
.thread-panel .perm-subject { margin-top: 0; }
.perm-flag { display: flex; align-items: center; gap: var(--s-2); font-size: var(--type-small-size); color: var(--state-err); margin-bottom: var(--s-3); }
.perm-flag-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--state-err); flex: none; }
.perm-who { font-size: var(--type-small-size); color: var(--fg-muted); }
.perm-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0 var(--s-4); }
.perm-actions code { font-family: var(--font-mono); font-size: 0.8rem; margin-left: 4px; }
.perm-deny { color: var(--state-err); border-color: color-mix(in oklab, var(--state-err) 35%, var(--border)); }
.perm-deny:hover { color: var(--state-err); border-color: var(--state-err); }
.perm-rule { display: flex; gap: var(--s-2); }
.perm-rule input { flex: 1; min-width: 0; padding: var(--s-2) var(--s-3); background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--r-md); font-family: var(--font-mono); font-size: var(--type-mono-size); }
.next-up--permission .next-up-ask { font-size: clamp(1.25rem, 2.4vw, 1.75rem); }
.perm-rule-kind { display: inline-block; font-size: 0.75rem; border: 1px solid currentColor; border-radius: var(--r-pill); padding: 0 6px; margin-right: 4px; }
.perm-rule-kind--allow { color: var(--state-ok); }
.perm-rule-kind--deny { color: var(--state-err); }
.agent-form select, .agent-form input[type="text"], .agent-form input:not([type]) { padding: var(--s-2) var(--s-3); background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--r-md); font: inherit; font-size: var(--type-small-size); }
.orch-tools { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); width: 100%; font-size: var(--type-small-size); color: var(--fg-muted); }
.orch-tools legend { padding: 0; margin-bottom: var(--s-1); }
.orch-tools label { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); }
.cli-code { width: 100%; padding: var(--s-3); background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--r-md); font-family: var(--font-mono); font-size: 1.5rem; letter-spacing: 0.15em; text-align: center; text-transform: uppercase; }
code, pre, kbd, .t-mono, .perm-subject, .tevent-code, .cli-code, .df-table, .pl-code .pl-text, .ld-map, .ld-table, .id, .ld-map-file, .df-path { font-variant-ligatures: none; font-feature-settings: 'liga' 0, 'calt' 0; } /* show commands exactly as typed */
.trow-code { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 400; font-variant-ligatures: none; }
.agent-form .orch-tools label { width: auto; } .agent-form .orch-tools input { width: auto; margin: 0; accent-color: var(--fg); }

/* Empty inbox: the one command that connects agents. The 1-5 hint means nothing without threads. */
.empty-cmd { width: min(100%, 360px); margin: var(--s-4) auto 0; text-align: left; }
.empty-sub--small { font-size: var(--type-small-size); margin-top: var(--s-4); }
.empty-sub a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.inbox:has(#inbox-body > .empty) .inbox-keys { display: none; }
.rail-signout { margin: 0; }
.rail-signout .link-button { font-size: 11px; color: var(--fg-faint); }
.rail-signout .link-button:hover { color: var(--fg); }
.setup-init { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: var(--s-5); align-items: center; margin-bottom: var(--s-6); }
.setup-init-title { font-size: var(--type-body-size, 15px); font-weight: 600; margin: 0 0 var(--s-1); }
.setup-init p { margin: 0; font-size: var(--type-small-size); }
@media (max-width: 760px) { .setup-init { grid-template-columns: 1fr; } }
.key-agent { display: inline-flex; align-items: center; gap: var(--s-2); }

/* Settings */
.settings { max-width: 760px; }
.settings-notice { margin: 0 0 var(--s-5); padding: var(--s-3) var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r-md); font-size: var(--type-small-size); }
.settings-block { padding: var(--s-6) 0; border-top: 1px solid var(--border); display: grid; gap: var(--s-3); }
.settings-block--danger .settings-title { color: var(--state-err); }
.settings-title { font-size: 15px; font-weight: 600; margin: 0; }
.settings-value { margin: 0; }
.settings-help { margin: 0; font-size: var(--type-small-size); color: var(--fg-muted); max-width: 60ch; }
.settings-form { display: grid; gap: var(--s-2); }
.settings-form label { font-size: var(--type-small-size); color: var(--fg-muted); }
.settings-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.settings-row input, .settings-form input[type="email"], .settings-form input[type="url"], .settings-form input:not([type]) { flex: 1 1 240px; min-width: 0; padding: var(--s-2) var(--s-3); background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--r-md); font: inherit; font-size: var(--type-small-size); }
.btn--danger { color: var(--state-err); border-color: var(--state-err); }
.settings-check { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--fg) !important; }
.settings-help a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.setup-generate { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: stretch; }
.setup-generate input { width: 220px; min-width: 0; padding: var(--s-3) var(--s-3); background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--r-md); font: inherit; font-size: var(--type-small-size); line-height: 1.2; }
.setup-generate input::placeholder { color: var(--fg-muted); }
.setup-generate input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── /welcome: the first minutes after signing up ───────────────────────── */
.wl { max-width: 720px; margin: 0 auto; padding: var(--s-5) max(var(--s-4), env(safe-area-inset-right, 0px)) var(--s-9) max(var(--s-4), env(safe-area-inset-left, 0px)); }
.wl-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-block: var(--s-2) var(--s-8); }
.wl-brand { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--fg); }
.wl-skip { font-family: var(--font-mono); font-size: var(--type-eyebrow-size); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-radius: var(--r-pill); }
.wl-skip:hover { color: var(--fg); border-color: var(--border-strong); }
.wl-hero { margin-bottom: var(--s-8); }
.wl-title { font-size: clamp(2.25rem, 6vw, 3.5rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; margin: var(--s-4) 0; text-wrap: balance; }
.wl-sub { color: var(--fg-muted); font-size: 1.0625rem; line-height: 1.55; max-width: 56ch; }
.wl-steps { list-style: none; margin: 0; padding: 0; }
.wl-step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s-5); }
.wl-rail { position: relative; display: flex; justify-content: center; }
.wl-rail::after { content: ""; position: absolute; top: 40px; bottom: 0; width: 1px; background: var(--border-strong); transition: background var(--dur-slow) var(--ease); }
.wl-step:last-child .wl-rail::after { display: none; }
.wl-step[data-state="done"] .wl-rail::after { background: var(--state-ok); }
.wl-node { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); background: var(--bg); color: var(--fg-muted); font-family: var(--font-mono); font-size: var(--type-small-size); transition: background var(--dur-slow) var(--ease), border-color var(--dur-slow) var(--ease), color var(--dur-slow) var(--ease), box-shadow var(--dur-slow) var(--ease); }
.wl-check { display: none; }
.wl-step[data-state="now"] .wl-node { border-color: var(--fg); color: var(--fg); box-shadow: 0 0 0 6px rgba(237, 237, 237, 0.06); }
.wl-step[data-state="done"] .wl-node { background: var(--state-ok); border-color: var(--state-ok); color: #00210f; }
.wl-step[data-state="done"] .wl-num { display: none; }
.wl-step[data-state="done"] .wl-check { display: grid; }
.wl-body { padding-bottom: var(--s-8); min-width: 0; transition: opacity var(--dur-slow) var(--ease); }
.wl-step[data-state="todo"] .wl-body { opacity: 0.42; }
.wl-h { font-size: 1.375rem; letter-spacing: -0.02em; font-weight: 600; line-height: 40px; margin: 0 0 var(--s-2); }
.wl-p { color: var(--fg-muted); font-size: 0.9375rem; line-height: 1.6; margin: 0 0 var(--s-4); max-width: 60ch; }
.wl-p a, .wl-more a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.wl .cmd-block { margin-bottom: var(--s-4); }
.wl .cmd-body { padding-right: 72px; word-break: normal; overflow-wrap: anywhere; }
.wl-live { display: flex; align-items: center; gap: var(--s-3); margin: 0; color: var(--fg-muted); font-family: var(--font-mono); font-size: var(--type-mono-size); line-height: 1.5; min-width: 0; }
.wl-live [data-text] { min-width: 0; overflow-wrap: anywhere; }
.wl-pulse { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.wl-live[data-on="1"] { color: var(--fg); }
.wl-live[data-on="1"] .wl-pulse { background: var(--state-warn); box-shadow: 0 0 0 0 rgba(245, 165, 36, 0.5); animation: wl-pulse 1.6s var(--ease) infinite; }
.wl-step[data-state="done"] .wl-live { color: var(--fg); }
.wl-step[data-state="done"] .wl-live .wl-pulse { background: var(--state-ok); animation: none; box-shadow: none; }
@keyframes wl-pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 165, 36, 0.5); } 100% { box-shadow: 0 0 0 10px rgba(245, 165, 36, 0); } }
.wl-more { margin-top: var(--s-4); font-size: var(--type-small-size); color: var(--fg-muted); }
.wl-more summary { cursor: pointer; width: fit-content; }
.wl-more summary:hover { color: var(--fg); }
.wl-more .wl-p { margin: var(--s-3) 0 0; }
.wl-card { background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: var(--s-5); display: grid; gap: var(--s-3); animation: wl-in var(--dur-slow) var(--ease); }
@keyframes wl-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wl-card-who { margin: 0; font-family: var(--font-mono); font-size: var(--type-eyebrow-size); letter-spacing: 0.08em; text-transform: uppercase; color: var(--state-warn); }
.wl-card-q { margin: 0; font-size: 1.125rem; line-height: 1.45; color: var(--fg); overflow-wrap: anywhere; }
.wl-card-cmd { margin: 0; padding: var(--s-3) var(--s-4); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); font-family: var(--font-mono); font-size: var(--type-mono-size); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }
.wl-card-note { margin: 0; font-size: var(--type-small-size); color: var(--fg-muted); }
.wl-input { width: 100%; box-sizing: border-box; padding: var(--s-3); background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--r-md); font: inherit; font-size: 0.9375rem; line-height: 1.5; resize: vertical; }
.wl-input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.wl-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.wl-err { margin: 0; color: var(--state-err); font-size: var(--type-small-size); }
.wl-fallback { margin-top: var(--s-3); }
.wl-done { margin-top: var(--s-5); padding: var(--s-7) var(--s-6); border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: radial-gradient(120% 140% at 0% 0%, rgba(61, 214, 140, 0.10), transparent 55%), var(--surface-1); animation: wl-in 480ms var(--ease); }
.wl-done[hidden] { display: none; }
.wl-done-mark { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--state-ok); color: #00210f; }
.wl-done-title { font-size: clamp(1.625rem, 4vw, 2.25rem); letter-spacing: -0.03em; font-weight: 600; line-height: 1.1; margin: var(--s-4) 0 var(--s-3); }
.wl-next { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
@media (max-width: 520px) { .wl-step { grid-template-columns: 32px minmax(0, 1fr); gap: var(--s-4); } .wl-node { width: 32px; height: 32px; } .wl-rail::after { top: 32px; } .wl-h { line-height: 32px; font-size: 1.25rem; } .wl-top { padding-bottom: var(--s-7); } }
@media (prefers-reduced-motion: reduce) { .wl-live[data-on="1"] .wl-pulse, .wl-card, .wl-done { animation: none; } }
/* A finished step folds to its title and its one-line result. */
.wl-step[data-state="done"] .wl-p, .wl-step[data-state="done"] .cmd-block, .wl-step[data-state="done"] .wl-more { display: none; }
.wl-step[data-state="done"] .wl-body { padding-bottom: var(--s-6); }
.wl-step[data-state="done"] .wl-h { margin-bottom: 0; }

/* ── /signin: the one page people sign in or up on ──────────────────────── */
.si { min-height: 100vh; min-height: 100dvh; box-sizing: border-box; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; gap: var(--s-6); padding: var(--s-6) max(var(--s-4), env(safe-area-inset-right, 0px)) var(--s-6) max(var(--s-4), env(safe-area-inset-left, 0px)); background: radial-gradient(60% 50% at 50% 0%, rgba(237, 237, 237, 0.07), transparent 70%); }
.si ~ .site-footer { display: none; }
.si-brand { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--fg); padding: var(--s-2); }
.si-card { width: 100%; max-width: 420px; box-sizing: border-box; background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 16px; padding: var(--s-7) var(--s-6); display: grid; gap: var(--s-4); animation: wl-in var(--dur-slow) var(--ease); }
.si-eyebrow { margin: 0; font-family: var(--font-mono); font-size: var(--type-eyebrow-size); letter-spacing: 0.08em; text-transform: uppercase; color: var(--state-ok); }
.si-title { margin: 0; font-size: 1.875rem; line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; text-wrap: balance; }
.si-sub { margin: 0 0 var(--s-2); color: var(--fg-muted); font-size: 0.9375rem; line-height: 1.55; }
.si-address { color: var(--fg); font-weight: 500; overflow-wrap: anywhere; }
.si-btn { display: flex; align-items: center; justify-content: center; gap: var(--s-3); width: 100%; box-sizing: border-box; min-height: 48px; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.si-btn--github { background: var(--brand); color: var(--brand-fg); border: 1px solid var(--brand); }
.si-btn--github:hover { background: #fff; color: var(--brand-fg); }
.si-btn--email { background: transparent; color: var(--fg); border: 1px solid var(--border-strong); }
.si-btn--email:hover { border-color: var(--fg-muted); background: var(--surface-2); }
.si-btn:focus-visible, .si-input:focus-visible, .si-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.si-or { display: flex; align-items: center; gap: var(--s-3); color: var(--fg-faint); font-family: var(--font-mono); font-size: var(--type-eyebrow-size); letter-spacing: 0.08em; text-transform: uppercase; }
.si-or::before, .si-or::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.si-form { display: grid; gap: var(--s-3); margin: 0; }
.si-label { font-size: var(--type-small-size); color: var(--fg-muted); }
.si-input { width: 100%; box-sizing: border-box; min-height: 48px; padding: var(--s-3) var(--s-4); background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--r-md); font: inherit; font-size: 1rem; }
.si-input::placeholder { color: var(--fg-faint); }
.si-input--code { font-family: var(--font-mono); font-size: 1.75rem; letter-spacing: 0.35em; text-align: center; padding-left: calc(var(--s-4) + 0.35em); font-variant-numeric: tabular-nums; }
.si-fine { margin: 0; color: var(--fg-faint); font-size: var(--type-small-size); line-height: 1.6; }
.si-inline { display: inline; margin: 0; }
.si-link { background: none; border: 0; padding: 0; font: inherit; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.si-problem { margin: 0; padding: var(--s-3) var(--s-4); border: 1px solid var(--state-err); border-radius: var(--r-md); color: var(--fg); font-size: var(--type-small-size); line-height: 1.5; }
.si-notice { margin: 0; color: var(--state-ok); font-size: var(--type-small-size); }
.si-legal { margin: 0; color: var(--fg-faint); font-size: 0.8125rem; text-align: center; }
.si-legal a { color: var(--fg-muted); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 480px) { .si-card { padding: var(--s-6) var(--s-5); } .si-input--code { font-size: 1.5rem; letter-spacing: 0.28em; } }
@media (prefers-reduced-motion: reduce) { .si-card { animation: none; } }
.si-after { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.si-link { font-size: inherit; line-height: inherit; }

/* ══ Detail pages: one frame for plans, fan-outs and diffs ═══════════════════
   A breadcrumb, a title row (title, status, actions), a quiet meta row, then panels:
   a bordered box with a header row and a body. 14 px interface text, tabular numbers. */
.pg { max-width: 76rem; font-size: 14px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-4); font-size: 13px; color: var(--fg-faint); }
.crumbs a { color: var(--fg-muted); text-decoration: none; }
.crumbs a:hover, .crumbs a:focus-visible { color: var(--fg); }
.crumbs [aria-current] { color: var(--fg); }
.pg-head { margin: 0 0 var(--s-5); }
.pg-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.pg-title { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: anywhere; text-wrap: balance; }
.pg-actions { margin-left: auto; }
.pg-meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); margin: var(--s-2) 0 0; color: var(--fg-muted); font-size: 13px; }
.pg-meta strong { color: var(--fg); font-weight: 500; }
.pg-meta a { color: var(--fg-muted); text-decoration: underline; text-underline-offset: 3px; }
.pg-meta a:hover { color: var(--fg); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid var(--border-strong); color: var(--fg-muted); background: var(--surface-1); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--ok, .pill--live { color: var(--state-ok); border-color: color-mix(in oklab, var(--state-ok) 40%, var(--border)); background: color-mix(in oklab, var(--state-ok) 8%, transparent); }
.pill--live::before { animation: pill-pulse 2s var(--ease) infinite; }
.pill--warn, .pill--wait { color: var(--state-warn); border-color: color-mix(in oklab, var(--state-warn) 40%, var(--border)); background: color-mix(in oklab, var(--state-warn) 8%, transparent); }
.pill--err { color: var(--state-err); border-color: color-mix(in oklab, var(--state-err) 40%, var(--border)); background: color-mix(in oklab, var(--state-err) 8%, transparent); }
.pill--quiet { background: transparent; }
@keyframes pill-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.btn--sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; height: 32px; }
.btn--danger { background: transparent; color: var(--state-err); border: 1px solid color-mix(in oklab, var(--state-err) 45%, var(--border)); }
.btn--danger:hover { background: color-mix(in oklab, var(--state-err) 10%, transparent); color: var(--state-err); }

.panel { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); margin: 0 0 var(--s-4); min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); min-height: 44px; padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--border); }
.panel-title { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.panel-aside { margin: 0; color: var(--fg-faint); font-size: 13px; }
.panel-body { padding: var(--s-4); }
.panel-foot { margin: 0; padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); color: var(--fg-faint); font-size: 13px; }
.panel--err { border-color: color-mix(in oklab, var(--state-err) 40%, var(--border)); }
.panel--err .panel-head { border-bottom-color: color-mix(in oklab, var(--state-err) 25%, var(--border)); }
.panel--err .panel-title { color: var(--state-err); }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); line-height: 1.5; }
.row:first-child { border-top: 0; }
.row-main { min-width: 0; overflow-wrap: anywhere; }
.row a, .callout a { color: var(--fg); font-weight: 600; text-decoration: none; }
.row a:hover, .callout a:hover { text-decoration: underline; }
.row code, .callout code { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-muted); }
.callout { line-height: 1.5; }
.empty { padding: var(--s-7) var(--s-5); text-align: center; }
.empty-title { margin: 0 0 var(--s-1); font-weight: 600; }
.empty-text { margin: 0 auto; max-width: 30rem; color: var(--fg-muted); line-height: 1.5; }
.chip { display: inline-flex; align-items: center; gap: var(--s-2); height: 24px; padding: 0 10px; border-radius: 6px; font-size: 12px; color: var(--fg-muted); border: 1px solid var(--border); text-decoration: none; }
.chip--ok { color: var(--state-ok); border-color: color-mix(in oklab, var(--state-ok) 35%, var(--border)); background: color-mix(in oklab, var(--state-ok) 7%, transparent); }
.chip--ok:hover { background: color-mix(in oklab, var(--state-ok) 14%, transparent); }
.chip-bar { width: 3px; height: 12px; border-radius: 2px; background: var(--state-ok); }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--fg-muted); }
.count--warn { background: var(--state-warn); color: #000; }
.diff-add { color: var(--state-ok); }
.diff-del { color: var(--state-err); }
.t-err { color: var(--state-err); }
.t-faint { color: var(--fg-faint); }

/* ── The plan ── */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: var(--s-4); align-items: start; }
.plan-side { position: sticky; top: var(--s-5); }
/* A plan's phases (research, design, plan): done, being reviewed or written, next. */
.steps { display: flex; gap: var(--s-2); list-style: none; margin: 0 0 var(--s-4); padding: 0; overflow-x: auto; }
.step { flex: 1 1 0; min-width: 8rem; display: grid; grid-template-columns: auto 1fr; column-gap: var(--s-2); align-items: center; padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); }
.step-dot { grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--fg-muted); font-size: 12px; }
.step-name { font-weight: 600; }
.step-note { color: var(--fg-faint); font-size: 12px; }
.step--done .step-dot { background: var(--state-ok); border-color: var(--state-ok); color: var(--bg); }
.step--current { border-color: var(--accent); }
.step--current .step-dot { border-color: var(--accent); color: var(--fg); }
.step--next { opacity: 0.7; }
.plan-side .panel:last-child { margin-bottom: 0; }
.plan-panel { margin: 0; }
.plan-doc { padding: var(--s-4) 0 var(--s-5); }
.pl-row { position: relative; display: grid; grid-template-columns: 3rem minmax(0, 1fr) 2.25rem; align-items: baseline; padding: 1px 0; border-left: 2px solid transparent; }
.pl-row:hover, .pl-row:focus-within { background: color-mix(in oklab, var(--fg) 3%, transparent); }
.pl-row:target { background: color-mix(in oklab, var(--state-warn) 9%, transparent); }
.pl-num { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); text-align: right; padding-right: var(--s-3); text-decoration: none; user-select: none; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.pl-row:hover .pl-num, .pl-row:focus-within .pl-num, .pl-row--noted .pl-num, .pl-row--changed .pl-num, .pl-row:target .pl-num { opacity: 1; }
.pl-text { max-width: 46rem; font-size: 15px; line-height: 1.7; color: var(--fg); overflow-wrap: anywhere; }
.pl-text code, .pl-note-body code { font-family: var(--font-mono); font-size: 0.86em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.pl-blank { height: 0.6rem; padding: 0; }
.pl-blank .pl-num, .pl-fence .pl-num { visibility: hidden; }
.pl-fence { height: 0.35rem; padding: 0; }
.pl-row--title { display: none; }
.pl-h .pl-text { font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.pl-h1 { margin-top: var(--s-3); } .pl-h1 .pl-text { font-size: 19px; }
.pl-h2 { margin-top: var(--s-5); } .pl-h2 .pl-text { font-size: 16px; }
.pl-h3 { margin-top: var(--s-3); } .pl-h3 .pl-text { font-size: 15px; color: var(--fg-muted); }
.pl-li .pl-text { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); }
.pl-mark { color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.pl-code .pl-text { font-family: var(--font-mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; background: var(--bg); border-left: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0 var(--s-3); }
.pl-fence + .pl-code .pl-text { border-top: 1px solid var(--border); border-radius: 6px 6px 0 0; padding-top: var(--s-2); }
.pl-code:has(+ .pl-fence) .pl-text { border-bottom: 1px solid var(--border); border-radius: 0 0 6px 6px; padding-bottom: var(--s-2); }
.pl-row--changed { border-left-color: var(--state-ok); background: color-mix(in oklab, var(--state-ok) 6%, transparent); }
.pl-row--changed .pl-num { color: var(--state-ok); }
.pl-row--conflict { border-left-color: var(--state-warn); background: color-mix(in oklab, var(--state-warn) 7%, transparent); }
.pl-row--conflict .pl-num { color: var(--state-warn); opacity: 1; }
.pl-row--noted .pl-num { color: var(--state-warn); }
.pl-add { grid-column: 3; justify-self: center; }
.pl-add > summary { list-style: none; cursor: pointer; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: #000; background: var(--state-warn); font-weight: 700; font-size: 14px; line-height: 1; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.pl-add > summary::-webkit-details-marker { display: none; }
.pl-row:hover .pl-add > summary, .pl-add > summary:focus-visible { opacity: 1; }
.pl-add > summary:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.pl-add[open] { grid-column: 2 / 4; grid-row: 2; justify-self: stretch; padding-right: var(--s-4); }
.pl-add[open] > summary { display: none; }
.pl-form { display: grid; gap: var(--s-2); max-width: 46rem; margin: var(--s-2) 0 var(--s-3); }
.pl-form textarea, .rv-form textarea { width: 100%; padding: 8px 10px; background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: 6px; font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; }
.pl-form textarea:focus, .rv-form textarea:focus { outline: none; border-color: var(--fg-muted); box-shadow: 0 0 0 3px color-mix(in oklab, var(--fg) 12%, transparent); }
.pl-form .btn { justify-self: start; padding: 6px 12px; font-size: 13px; }
.pl-notes { grid-column: 2 / 4; list-style: none; max-width: 46rem; margin: var(--s-1) var(--s-4) var(--s-2) 0; padding: 0; display: grid; gap: var(--s-2); }
.pl-note { display: grid; gap: 2px; padding: 8px 12px; border-radius: 0 6px 6px 0; border-left: 2px solid var(--state-warn); background: color-mix(in oklab, var(--state-warn) 6%, var(--surface-1)); font-size: 13px; line-height: 1.5; }
.pl-note-who { font-weight: 600; }
.pl-note-body { color: var(--fg); overflow-wrap: anywhere; }
.pl-general { margin: var(--s-4) var(--s-4) 0 3rem; }

/* The review panel: state, then decision, in one box. */
.panel--review { border-top-width: 2px; }
.panel--review.panel--ok { border-top-color: var(--state-ok); }
.panel--review.panel--err { border-top-color: var(--state-err); }
.panel--review.panel--warn, .panel--review.panel--wait { border-top-color: var(--state-warn); }
.rv-line { margin: 0; line-height: 1.5; color: var(--fg-muted); }
.rv-line strong { color: var(--fg); font-weight: 600; }
.rv-code { margin-top: var(--s-3); }
.rv-code code { display: block; font-family: var(--font-mono); font-size: 12px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; overflow-wrap: anywhere; }
.rv-form { display: grid; gap: var(--s-2); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--border); }
.rv-label { margin: 0; font-size: 13px; font-weight: 500; color: var(--fg); }
.rv-label span { color: var(--fg-faint); font-weight: 400; margin-left: 4px; }
.rv-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); margin-top: var(--s-1); }
.rv-actions .btn { width: 100%; }
.rv-actions .btn--ghost { color: var(--fg); border-color: var(--border-strong); }
.rv-actions .btn--ghost:hover { background: var(--surface-2); }
.rv-approve { background: var(--fg); color: var(--bg); border: 1px solid var(--fg); }
.rv-approve:hover { background: color-mix(in oklab, var(--fg) 85%, var(--bg)); color: var(--bg); }
.rv-help { margin: var(--s-1) 0 0; color: var(--fg-faint); font-size: 12px; line-height: 1.5; }
.rv-help a { color: var(--fg-muted); text-decoration: underline; }
.toc, .vlist { list-style: none; margin: 0; padding: var(--s-2) 0; }
.toc li, .vlist li { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-4); }
.toc a, .vlist a, .vlist [aria-current] { flex: 1; min-width: 0; padding: 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-muted); text-decoration: none; }
.toc a:hover, .vlist a:hover, .toc a:focus-visible, .vlist a:focus-visible { color: var(--fg); }
.toc-l1 a { color: var(--fg); font-weight: 500; }
.toc-l3 { padding-left: var(--s-6) !important; }
.vlist [aria-current] { color: var(--fg); font-weight: 500; }
.vlist-tag { font-size: 11px; color: var(--fg-faint); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }

/* ── A fan-out ── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: var(--s-4); border-left: 1px solid var(--border); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-label { margin: 0 0 var(--s-2); font-family: var(--font-sans); font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--fg-muted); }
.kpi-value { margin: 0; font-family: var(--font-sans); font-size: 22px; color: var(--fg); font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-of { color: var(--fg-faint); font-weight: 400; font-size: 15px; }
.kpi-note { margin: var(--s-1) 0 0; font-size: 12px; color: var(--fg-faint); }
.ld-segs { display: flex; gap: 2px; height: 6px; margin-top: var(--s-3); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.ld-seg { min-width: 4px; }
.ld-seg--clean { background: var(--state-ok); }
.ld-seg--conflict { background: var(--state-err); }
.ld-seg--waiting { background: var(--border-strong); }
.ld-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); margin: var(--s-2) 0 0; padding: 0; font-size: 12px; color: var(--fg-faint); }
.ld-legend li { display: flex; align-items: center; gap: 6px; }
.ld-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }

.map-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--fg-faint); }
.ld-key { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.ld-key + .ld-key { margin-left: -2px; }
.ld-key--conflict { margin-left: var(--s-3); background: color-mix(in oklab, var(--state-err) 50%, var(--surface-1)); box-shadow: inset 0 0 0 1.5px var(--state-err); }
.ld-map-scroll { position: relative; overflow-x: auto; }
.ld-map { width: auto; border-collapse: separate; border-spacing: 3px; margin: 0; }
.ld-map-agent { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--fg-faint); text-align: center; padding: 0 0 6px; }
.ld-map-agent a { color: inherit; text-decoration: none; }
.ld-map-agent a:hover, .ld-map-agent a:focus-visible { color: var(--fg); }
.ld-map-file { font-family: var(--font-mono); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; padding: 0 var(--s-4) 0 0; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; color: var(--fg); }
.ld-map-dir { color: var(--fg-faint); font-weight: 400; }
.ld-cell { width: 26px; min-width: 26px; max-width: 26px; height: 26px; border-radius: 5px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); padding: 0; }
.ld-cell a { display: block; width: 100%; height: 100%; border-radius: inherit; }
.ld-cell a:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.ld-cell--1 { background: color-mix(in oklab, var(--fg) 16%, var(--bg)); box-shadow: none; }
.ld-cell--2 { background: color-mix(in oklab, var(--fg) 32%, var(--bg)); box-shadow: none; }
.ld-cell--3 { background: color-mix(in oklab, var(--fg) 52%, var(--bg)); box-shadow: none; }
.ld-cell--4 { background: color-mix(in oklab, var(--fg) 74%, var(--bg)); box-shadow: none; }
.ld-cell--conflict { background: color-mix(in oklab, var(--state-err) 50%, var(--bg)); box-shadow: inset 0 0 0 1.5px var(--state-err); }

.ld-scroll { position: relative; overflow-x: auto; }
.ld-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ld-table thead th { text-align: left; font-weight: 500; color: var(--fg-faint); padding: 10px var(--s-4); border-bottom: 1px solid var(--border); white-space: nowrap; }
.ld-table td, .ld-table tbody th { padding: 10px var(--s-4); border-top: 1px solid var(--border); vertical-align: middle; text-align: left; }
.ld-table tbody tr:first-child td, .ld-table tbody tr:first-child th { border-top: 0; }
.ld-table tbody th { font-weight: 500; white-space: nowrap; }
.ld-table tbody th .ld-dot { margin-right: 10px; vertical-align: 1px; }
.ld-table tbody th a { color: var(--fg); text-decoration: none; font-family: var(--font-mono); font-size: 12.5px; }
.ld-table tbody th a:hover, .ld-table tbody th a:focus-visible { text-decoration: underline; }
.ld-row:hover { background: color-mix(in oklab, var(--fg) 3%, transparent); }
.ld-files code { font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); }
.ld-change { white-space: nowrap; }
.ld-nums { display: inline-block; min-width: 4.5rem; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12px; }
.ld-when { color: var(--fg-muted); white-space: nowrap; }
.ld-state { text-align: right; width: 1%; }
.ld-bar { display: inline-flex; gap: 2px; margin-left: var(--s-2); vertical-align: -1px; }
.ld-sq { width: 7px; height: 7px; border-radius: 1.5px; background: var(--surface-2); }
.ld-sq--add { background: var(--state-ok); }
.ld-sq--del { background: var(--state-err); }

/* ── One agent's diff ── */
.df-file { border: 1px solid var(--border); border-radius: 10px; margin: 0 0 var(--s-4); overflow: hidden; background: var(--surface-1); }
.df-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); min-height: 44px; padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--border); font-size: 13px; }
.df-path { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.df-tag { color: var(--fg-muted); border: 1px solid var(--border-strong); border-radius: 999px; padding: 0 8px; font-size: 11px; }
.df-stat { margin-left: auto; font-family: var(--font-mono); font-size: 12px; }
.df-scroll { overflow-x: auto; background: var(--bg); }
.df-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; }
.df-table td { padding: 0 var(--s-3); white-space: pre; }
.df-n { width: 1%; min-width: 3rem; text-align: right; color: var(--fg-faint); user-select: none; font-variant-numeric: tabular-nums; }
.df-c { color: var(--fg-muted); width: 100%; }
.df-add { background: color-mix(in oklab, var(--state-ok) 10%, transparent); }
.df-add .df-n { color: color-mix(in oklab, var(--state-ok) 70%, var(--fg-faint)); }
.df-add .df-c, .df-add .diff-add { color: var(--fg); }
.df-del { background: color-mix(in oklab, var(--state-err) 10%, transparent); }
.df-del .df-n { color: color-mix(in oklab, var(--state-err) 70%, var(--fg-faint)); }
.df-del .df-c, .df-del .diff-del { color: var(--fg); }
.df-add .df-c::before { content: "+"; color: var(--state-ok); margin-right: var(--s-2); }
.df-del .df-c::before { content: "−"; color: var(--state-err); margin-right: var(--s-2); }
.df-hunk td { background: color-mix(in oklab, var(--state-info, #4c8dff) 7%, var(--surface-1)); color: var(--fg-faint); padding: 4px var(--s-3); font-family: var(--font-sans); font-size: 12px; }

/* ── Narrow screens ── */
@media (max-width: 1100px) { .plan-layout { grid-template-columns: minmax(0, 1fr); } .plan-side { position: static; } }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(3) { border-left: 0; } .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); } }
@media (max-width: 640px) {
  .pg-actions { margin-left: 0; flex-basis: 100%; }
  .pg-title { font-size: 21px; }
  .pl-row { grid-template-columns: 2.25rem minmax(0, 1fr) 2rem; }
  .pl-general { margin-left: 2.25rem; }
  .ld-table .ld-files, .ld-table thead th:nth-child(2), .ld-table .ld-when, .ld-table thead th:nth-child(4) { display: none; }
  .ld-table td, .ld-table tbody th, .ld-table thead th { padding-left: var(--s-3); padding-right: var(--s-3); }
  .ld-table .ld-bar { display: none; }
  .ld-map-dir { display: none; }
  .ld-map-file { max-width: 9rem; }
}
@media (prefers-reduced-motion: reduce) { .pl-num, .pl-add > summary { transition: none; } .pill--live::before { animation: none; } }

/* ══ The logged-in frame, second version ═════════════════════════════════════
   Desktop: a full-height column (its colour runs the whole page, the rail inside it stays put), brand and workspace,
   the main sections with icons, the account sections at the bottom, the person's menu last.
   Phone (≤ 768 px): a 52 px top bar (brand, workspace, avatar) and one scrolling strip of tabs, underlined. */
.icon { flex: none; display: inline-block; vertical-align: middle; }
.app-shell { grid-template-columns: 232px minmax(0, 1fr); }
.rail-col { background: var(--surface-1); border-right: 1px solid var(--border); min-width: 0; }
.rail { position: sticky; top: 0; height: 100vh; background: transparent; border-right: 0; padding: var(--s-4) var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); overflow-y: auto; }
.rail-top { display: grid; gap: var(--s-3); padding: 0 var(--s-2) var(--s-3); }
.rail-brand { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) 0; border: 0; color: var(--fg); text-decoration: none; }
.rail-ws { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.ws-avatar { width: 20px; height: 20px; flex: none; border-radius: 5px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #000; background: linear-gradient(135deg, #d4d4d4, #8a8a8a); }
.ws-name { font-family: var(--font-sans); font-size: 13.5px; font-weight: 500; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-ws .ws-switch { flex: 1; min-width: 0; display: block; }
.rail-ws .ws-switch label { display: none; }
.rail-ws .ws-switch select { width: 100%; background: transparent; border: 0; color: var(--fg); font: inherit; font-size: 13.5px; font-weight: 500; padding: 0; cursor: pointer; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; flex: none; }
.rail-nav--account { margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--border); }
.rail-link { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 7px; color: var(--fg-muted); font-size: 13.5px; font-weight: 500; text-decoration: none; box-shadow: none; background: transparent; }
.rail-link .icon { color: var(--fg-faint); transition: color var(--dur-fast) var(--ease); }
.rail-link:hover { background: color-mix(in oklab, var(--fg) 6%, transparent); color: var(--fg); }
.rail-link:hover .icon { color: var(--fg-muted); }
.rail-link--active { background: color-mix(in oklab, var(--fg) 9%, transparent); color: var(--fg); box-shadow: none; font-weight: 500; }
.rail-link--active .icon { color: var(--fg); }
.rail-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-count { margin-left: auto; height: 18px; min-width: 18px; font-size: 11px; }
.rail-count--live { background: color-mix(in oklab, var(--state-ok) 18%, transparent); color: var(--state-ok); }
.rail-user { position: relative; border-top: 1px solid var(--border); padding-top: var(--s-2); margin-top: var(--s-2); }
.rail-nav--account + .rail-user { margin-top: var(--s-2); }
.rail-user-chip { list-style: none; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.rail-user-chip::-webkit-details-marker { display: none; }
.rail-user-chip:hover, .rail-user[open] .rail-user-chip { background: color-mix(in oklab, var(--fg) 6%, transparent); }
.rail-user-chip:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.rail-user-chev { color: var(--fg-faint); transition: transform var(--dur-fast) var(--ease); }
.rail-user[open] .rail-user-chev { transform: rotate(180deg); }
.user-avatar { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.user-avatar--placeholder { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--fg); }
.rail-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 20; padding: 6px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); display: grid; gap: 2px; }
.rail-menu a, .rail-menu .link-button { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 8px; border-radius: 6px; color: var(--fg-muted); font-size: 13px; text-decoration: none; }
.rail-menu a:hover, .rail-menu .link-button:hover { background: color-mix(in oklab, var(--fg) 7%, transparent); color: var(--fg); }
.rail-menu-phone { display: none; }
.rail-signout { margin: 0; }

@media (max-width: 768px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .rail-col { position: sticky; top: 0; z-index: 30; border-right: 0; border-bottom: 1px solid var(--border); background: color-mix(in oklab, var(--surface-1) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .rail { position: static; height: auto; overflow: visible; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "top me" "nav nav"; gap: 0; padding: 0; }
  .rail-top { grid-area: top; display: flex; align-items: center; gap: var(--s-3); height: 52px; padding: 0 0 0 var(--s-4); min-width: 0; }
  .rail-brand .wordmark, .rail-brand svg + svg { display: none; }
  .rail-ws { margin: 0; padding: 4px 8px; border-color: transparent; background: transparent; min-width: 0; }
  .rail-nav { grid-area: nav; flex-direction: row; gap: var(--s-1); height: 44px; align-items: stretch; padding: 0 var(--s-3); overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-nav--account { display: none; }
  .rail-link { height: 44px; border-radius: 0; padding: 0 10px; background: transparent !important; white-space: nowrap; }
  .rail-link .icon { display: none; }
  .rail-link--active { box-shadow: inset 0 -2px 0 var(--fg); }
  .rail-user { grid-area: me; align-self: center; border: 0; padding: 0 var(--s-3) 0 0; margin: 0; }
  .rail-user-chip { padding: 4px; }
  .rail-user-who, .rail-user-chev { display: none; }
  .rail-menu { left: auto; right: 0; bottom: auto; top: calc(100% + 6px); width: 14rem; }
  .rail-menu-phone { display: grid; gap: 2px; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
  .app-main { padding: var(--s-5) var(--s-4); }
}

/* ══ Details shared by the detail pages ═══════════════════════════════════════ */
/* Machine identifiers (agents, paths, commands, ids) are always mono, at one size. */
.id { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }
.pg-title .id, .pg-title.id { font-size: 22px; letter-spacing: -0.02em; }
/* Keyboard focus is always visible; buttons answer a press. */
.pg a:focus-visible, .pg button:focus-visible, .pg summary:focus-visible, .pg input:focus-visible, .pg textarea:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 4px; }
.pg .btn:active { transform: translateY(0.5px); }
/* Tooltips that also work without the slow native title. */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 40; white-space: nowrap; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--fg); font-family: var(--font-sans); font-size: 12px; font-weight: 400; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); pointer-events: none; animation: tip-in 120ms var(--ease) 120ms both; }
@keyframes tip-in { from { opacity: 0; } to { opacity: 1; } }
/* Sections breathe more than the things inside them. */
.pg > .panel, .pg > #live-diffs > .panel { margin-bottom: var(--s-5); }
.pg-title-row .pill { position: relative; top: 1px; }
.pg-meta { font-variant-numeric: tabular-nums; }
/* A copy button: an icon that says "Copied". */
.copy { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--fg-faint); cursor: pointer; padding: 0; }
.copy:hover { color: var(--fg); border-color: var(--border); background: var(--surface-2); }
.copy[data-copied] { color: var(--state-ok); }
kbd.k { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--fg-muted); font-family: var(--font-mono); font-size: 11px; line-height: 1; }
.btn kbd.k { margin-left: 6px; background: color-mix(in oklab, currentColor 10%, transparent); border-color: color-mix(in oklab, currentColor 25%, transparent); color: inherit; }

/* ══ Third pass, after the audit of 26 Nov 2026 ═══════════════════════════════ */
.panel-title { display: inline-flex; align-items: center; gap: 8px; }
.panel-title .icon { color: var(--fg-muted); }
.panel--err .panel-title .icon { color: var(--state-err); }
.btn .icon { margin-right: 2px; }
.btn--icon-only { width: 32px; padding: 0; justify-content: center; }
.btn--icon-only .icon { margin: 0; }
.pg-actions { display: flex; align-items: center; gap: var(--s-2); }
.pg-meta .icon { margin-right: 4px; vertical-align: -2px; }
.toast { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 var(--s-4); padding: 8px 12px; border-radius: 8px; border: 1px solid color-mix(in oklab, var(--state-ok) 35%, var(--border)); background: color-mix(in oklab, var(--state-ok) 8%, transparent); color: var(--state-ok); font-size: 13px; }

/* Segmented controls and the search field. */
.segs { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.seg { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 6px; color: var(--fg-muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.seg:hover { color: var(--fg); }
.seg--on { background: var(--surface-2); color: var(--fg); box-shadow: 0 0 0 1px var(--border-strong); }
.seg-n { font-size: 11px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.seg--on .seg-n { color: var(--fg-muted); }
.segs--fill { display: flex; }
.segs--fill .seg { flex: 1; justify-content: center; }
.search { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--fg-faint); min-width: 15rem; }
.search:focus-within { border-color: var(--fg-muted); box-shadow: 0 0 0 3px color-mix(in oklab, var(--fg) 12%, transparent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: inherit; font-size: 13px; }
.search input::-webkit-search-cancel-button { filter: invert(0.7); }
.ld-toolbar { gap: var(--s-3); }

/* The live indicator in the header, and rows that just changed. */
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-faint); }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--state-ok); animation: pill-pulse 2s var(--ease) infinite; }
.live--warn { color: var(--state-warn); }
.live--warn i { background: var(--state-warn); animation: none; }
@keyframes row-flash { from { background: color-mix(in oklab, var(--fg) 10%, transparent); } to { background: transparent; } }
.flash { animation: row-flash 1.2s var(--ease); }

/* Summary strip: smaller, one concept per cell. */
.kpis { margin-bottom: var(--s-5); }
.kpi { padding: var(--s-3) var(--s-4); }
.kpi-value { font-size: 18px; }
.kpi-of { font-size: 13px; color: var(--fg-faint); font-weight: 400; }
.kpi-bar { display: flex; gap: 2px; height: 4px; margin-top: var(--s-2); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.kpi-bar-add { background: var(--state-ok); }
.kpi-bar-del { background: var(--state-err); }
.ld-segs { height: 4px; margin-top: var(--s-2); }

/* Conflicts: one row per pair and file, with what to do. */
.cf-row { flex-wrap: wrap; justify-content: space-between; }
.cf-row .row-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.cf-and, .cf-in { color: var(--fg-faint); }
.cf-where { color: var(--state-err); font-family: var(--font-mono); font-size: 12px; margin-left: 4px; }
.row-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.pop { position: relative; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.pop-card { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; width: 22rem; max-width: calc(100vw - 2rem); display: grid; gap: var(--s-2); padding: var(--s-3); border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); }
.pop-card--sm { width: auto; white-space: nowrap; padding: 6px; }
.pop-card textarea { width: 100%; padding: 8px 10px; background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: 6px; font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; }
.pop-card .btn { justify-self: start; }

/* The agents table: sticky header, whole-row links, one state marker. */
.ld-scroll { overflow: visible; }
.ld-table { table-layout: fixed; }
.ld-table col.c-agent { width: 16%; } .ld-table col.c-now { width: 30%; } .ld-table col.c-files { width: 16%; } .ld-table col.c-change { width: 14%; } .ld-table col.c-when { width: 11%; } .ld-table col.c-state { width: 13%; }
.ld-now { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ld-act { color: var(--fg-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.blocker-list { order: 3; flex-basis: 100%; margin: 0; padding: 0 0 0 18px; display: grid; gap: 2px; font-size: 13px; color: var(--fg); }
.blocker-list code { font-size: 12px; }
.ld-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-1); }
.th-sort { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-faint); text-decoration: none; }
.th-sort .icon { opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.th-sort:hover { color: var(--fg); } .th-sort:hover .icon, .th-sort--on .icon { opacity: 1; }
.th-sort--on { color: var(--fg); }
.ld-row { position: relative; }
.ld-row:hover { background: color-mix(in oklab, var(--fg) 5%, transparent); cursor: pointer; }
.row-link::after { content: ""; position: absolute; inset: 0; }
.ld-table tbody th .ld-dot { display: none; }
.ld-row--waiting th .id { color: var(--fg-faint); }
.ld-files code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-files { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-nums { text-align: right; min-width: 4rem; margin-right: var(--s-2); }
.ld-state { width: auto; }
.ld-none { margin: 0; padding: var(--s-5); text-align: center; color: var(--fg-faint); }
.nav-on { box-shadow: inset 2px 0 0 var(--fg); background: color-mix(in oklab, var(--fg) 5%, transparent); }

/* The map: empty and filled cells unmistakable, a per-file total, the column under the pointer. */
.ld-cell { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.ld-cell--1 { background: color-mix(in oklab, var(--fg) 28%, var(--bg)); }
.ld-cell--2 { background: color-mix(in oklab, var(--fg) 45%, var(--bg)); }
.ld-cell--3 { background: color-mix(in oklab, var(--fg) 62%, var(--bg)); }
.ld-cell--4 { background: color-mix(in oklab, var(--fg) 82%, var(--bg)); }
.ld-cell--conflict { background: color-mix(in oklab, var(--state-err) 55%, var(--bg)); box-shadow: inset 0 0 0 1.5px var(--state-err); }
.ld-map-agent .ld-dot { display: block; margin: 4px auto 0; width: 5px; height: 5px; }
.ld-map tr:hover .ld-map-file { color: var(--fg); background: color-mix(in oklab, var(--fg) 4%, transparent); }
.ld-map tr:hover .ld-cell:not([class*="ld-cell--"]), .ld-map .col-hot.ld-cell:not([class*="ld-cell--"]) { background: color-mix(in oklab, var(--fg) 5%, transparent); }
.ld-map .col-hot.ld-map-agent { color: var(--fg); }
.ld-map-sum { white-space: nowrap; padding-left: var(--s-4); font-size: 12px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.ld-map-sum .icon { vertical-align: -2px; }
.map-key span:not(.ld-key) { margin: 0 2px; }
.map-key .ld-key + .ld-key { margin-left: -3px; }

/* An agent: the diff and the agent's details beside it. */
.agent-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: var(--s-4); align-items: start; }
.agent-side { position: sticky; top: var(--s-5); }
.facts { margin: 0; padding: var(--s-2) var(--s-4) var(--s-3); display: grid; gap: 0; }
.fact { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: var(--s-2); padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px; }
.fact:first-child { border-top: 0; }
.fact dt { color: var(--fg-faint); }
.fact dd { margin: 0; color: var(--fg); min-width: 0; overflow-wrap: anywhere; }
.fact a { color: var(--fg); }
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); }
.cmp .panel { margin: 0; overflow: hidden; }

/* Diff files fold; their headers stay while you scroll them. */
.df-file > summary { list-style: none; cursor: pointer; position: sticky; top: 0; z-index: 3; background: var(--surface-1); }
.df-file > summary::-webkit-details-marker { display: none; }
.df-chev { color: var(--fg-faint); transition: transform var(--dur-fast) var(--ease); transform: rotate(-90deg); }
.df-file[open] .df-chev { transform: none; }
.df-file:not([open]) .df-head { border-bottom: 0; }
.df-head .copy { margin-left: -4px; opacity: 0; }
.df-head:hover .copy, .df-head .copy:focus-visible { opacity: 1; }
.df-head .pill { height: 20px; }
.df-list .row { padding-block: 8px; }
.df-list a { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; overflow-wrap: anywhere; }
.df-list a .icon { color: var(--fg-faint); }
.df-list .df-stat { margin-left: auto; }
.df-table mark { background: color-mix(in oklab, currentColor 0%, transparent); border-radius: 3px; padding: 0 1px; }
.df-add mark, .df-c--add mark { background: color-mix(in oklab, var(--state-ok) 35%, transparent); color: var(--fg); }
.df-del mark, .df-c--del mark { background: color-mix(in oklab, var(--state-err) 35%, transparent); color: var(--fg); }
.df-row--conflict td:first-child { box-shadow: inset 2px 0 0 var(--state-err); }
.df-row--conflict .df-c { background: color-mix(in oklab, var(--state-err) 14%, transparent); }
.df-table--split td.df-c { width: 50%; white-space: pre-wrap; overflow-wrap: anywhere; }
.df-c--add { background: color-mix(in oklab, var(--state-ok) 10%, transparent); color: var(--fg); }
.df-c--del { background: color-mix(in oklab, var(--state-err) 10%, transparent); color: var(--fg); }
.df-c--none { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in oklab, var(--fg) 3%, transparent) 6px 12px); }
.df-n--add { color: color-mix(in oklab, var(--state-ok) 70%, var(--fg-faint)); }
.df-n--del { color: color-mix(in oklab, var(--state-err) 70%, var(--fg-faint)); }
.df-table--split .df-n { border-left: 1px solid var(--border); }
.df-table--split td:first-child { border-left: 0; }
.df-hunk td { background: color-mix(in oklab, var(--fg) 5%, var(--surface-1)); color: var(--fg-muted); font-family: var(--font-mono); font-size: 12px; }
.df-cut { border: 1px solid var(--border); border-radius: 10px; }

/* A plan, third pass. */
.pl-row { grid-template-columns: 2.75rem minmax(0, 1fr) 2.25rem; }
.plan-panel .panel-head { padding-left: calc(2.75rem + 2px); }
.pl-num { opacity: 0.4; }
.pl-code .pl-text, .pl-form, .pl-notes { max-width: 46rem; }
.pl-row--removed { border-left-color: var(--state-err); background: color-mix(in oklab, var(--state-err) 6%, transparent); }
.pl-row--removed .pl-num { opacity: 1; color: var(--state-err); }
.pl-row--removed del { color: var(--fg-faint); text-decoration-color: color-mix(in oklab, var(--state-err) 70%, transparent); }
.pl-add > summary { background: transparent; color: var(--fg-faint); border: 1px solid var(--border-strong); width: 24px; height: 24px; }
.pl-add > summary:hover { color: var(--fg); background: var(--surface-2); }
@media (hover: none) { .pl-add > summary { opacity: 1; } }
.pl-form-actions { display: flex; align-items: center; gap: var(--s-3); }
.pl-note { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; }
.pl-note-av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #000; background: var(--state-warn); }
.pl-note-av--agent { background: var(--fg-muted); border-radius: 6px; }
.pl-note-main { min-width: 0; }
.pl-note-head { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 12.5px; color: var(--fg-faint); }
.pl-note-head .pl-note-who { color: var(--fg); font-weight: 600; font-size: 13px; }
.pl-note-menu { margin-left: auto; }
.pl-note-body { margin: 0; }
.pl-del { color: var(--state-err); text-decoration: none; padding: 6px 8px; }
.rv-block { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); }
.rv-sub { margin: 0 0 var(--s-2); font-size: 12px; font-weight: 500; color: var(--fg-faint); }
.rv-wide { width: 100%; height: 34px; }
.rv-changes { justify-self: center; font-size: 13px; color: var(--fg-muted); padding: 4px; }
.dp-ask { font-size: 14px; line-height: 1.55; color: var(--fg); }
.dp-changes { height: auto; min-height: 34px; padding: 6px 10px; flex-direction: column; gap: 1px; color: var(--fg); border-color: var(--border-strong); }
.dp-sub { display: block; font-size: 12px; font-weight: 400; color: var(--fg-faint); }
.dp-auto { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; }
.dp-auto legend { margin-bottom: 4px; padding: 0; }
.dp-opt { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 13px; }
.dp-opt:hover { border-color: var(--border-strong); }
.dp-opt:has(input:checked) { border-color: var(--fg-muted); background: color-mix(in oklab, var(--fg) 5%, transparent); }
.dp-opt input { margin: 3px 0 0; accent-color: var(--fg); }
.dp-opt input:focus-visible { outline: 2px solid var(--fg-muted); outline-offset: 2px; }
.dp-note summary { cursor: pointer; font-size: 13px; color: var(--fg-muted); padding: 2px 0; }
.dp-note summary:hover { color: var(--fg); }
.dp-note[open] summary { margin-bottom: 6px; }
.plan-toast { margin: 0 0 var(--s-3); padding: 8px 12px; border: 1px solid color-mix(in oklab, var(--state-ok) 40%, var(--border)); border-radius: 6px; background: color-mix(in oklab, var(--state-ok) 8%, transparent); color: var(--fg); font-size: 13px; transition: opacity .5s ease; }
.plan-toast--out { opacity: 0; }
.dp-conflicts { margin-top: var(--s-3); padding: 10px 12px; border: 1px solid color-mix(in oklab, var(--state-warn) 40%, var(--border)); border-radius: 6px; background: color-mix(in oklab, var(--state-warn) 6%, transparent); }
.dp-conflicts .rv-sub { display: flex; align-items: center; gap: 6px; color: var(--state-warn); }
.dp-conflicts ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; line-height: 1.5; }
.dp-conflicts a { color: var(--fg); font-weight: 500; text-decoration: underline; text-decoration-color: var(--state-warn); }
.dp-reason { margin: var(--s-2) 0; padding: 6px 12px; border-left: 2px solid var(--state-err); color: var(--fg); font-size: 14px; line-height: 1.5; }
.dp-edit { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: var(--s-2); color: var(--fg); border-color: var(--border-strong); text-decoration: none; }
.dp-reject { margin-top: var(--s-3); }
.dp-reject summary { cursor: pointer; font-size: 13px; color: var(--fg-faint); }
.dp-reject summary:hover { color: var(--state-err); }
.dp-reject-form { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.dp-reject-form textarea, .edit-form textarea { width: 100%; padding: 8px 10px; background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: 6px; font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; }
.edit-form { display: grid; gap: 0; overflow: hidden; }
.edit-form .edit-body { border: 0; border-radius: 0; border-bottom: 1px solid var(--border); padding: var(--s-4); min-height: 50vh; font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; line-height: 1.6; font-variant-ligatures: none; tab-size: 2; }
.edit-form textarea:focus { outline: none; box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--fg) 18%, transparent); }
.edit-foot { display: grid; gap: var(--s-3); padding: var(--s-4); max-width: 34rem; }
.edit-actions { display: flex; gap: var(--s-2); }
@media (prefers-reduced-motion: reduce) { .plan-toast { transition: none; } }
.step-note a { color: var(--fg-muted); text-decoration: underline; }
.step-note strong { color: var(--fg); font-weight: 500; }
.rv-code { display: flex; align-items: center; gap: 6px; }
.rv-code code { flex: 1; min-width: 0; }
.panel--review .panel-head .pill { display: none; }
.toc { padding: 0; }
.toc li { padding: 0; }
.plan-bar { display: none; }

/* The list of keys. */
.keys { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); }
.keys[hidden] { display: none; }
.keys-card { width: min(26rem, calc(100vw - 2rem)); border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-1); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.keys-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.keys-list { margin: 0; padding: var(--s-2) var(--s-4) var(--s-4); display: grid; gap: var(--s-2); }
.keys-list div { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); font-size: 13px; }
.keys-list dt { display: flex; gap: 4px; } .keys-list dd { margin: 0; color: var(--fg-muted); }

/* The older pages wear the same badges and titles. */
.badge { font-family: var(--font-sans); font-size: 12px; font-weight: 500; letter-spacing: 0; border-radius: 999px; padding: 2px 10px; }
.app-section-title { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; }

@media (max-width: 1100px) {
  .agent-layout { grid-template-columns: minmax(0, 1fr); }
  .agent-side { position: static; order: -1; }
  .plan-bar { display: flex; gap: var(--s-2); position: sticky; bottom: 0; z-index: 20; margin: var(--s-4) calc(-1 * var(--s-4)) 0; padding: 12px var(--s-4); background: color-mix(in oklab, var(--bg) 85%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--border); }
  .plan-bar .btn { flex: 1; }
}
@media (max-width: 900px) { .cmp { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) {
  .ld-table thead th { top: 96px; }
  .df-file > summary { top: 96px; }
}
@media (max-width: 640px) {
  .search { min-width: 0; flex: 1; }
  .ld-toolbar .segs { overflow-x: auto; max-width: 100%; }
  .ld-table { table-layout: auto; }
  .ld-table col { width: auto !important; }
  .ld-nums { min-width: 0; }
  .df-table td.df-c { white-space: pre-wrap; overflow-wrap: anywhere; }
  .df-table:not(.df-table--split) td.df-n:first-child { display: none; }
  .df-head .copy { opacity: 1; }
  .row-actions { margin-left: 0; width: 100%; }
  .pop-card { left: auto; right: 0; width: min(22rem, calc(100vw - 2rem)); }
  .pg-actions { flex-wrap: wrap; }
}
.df-table--split .df-row--conflict td:nth-child(4).df-c--add { background: color-mix(in oklab, var(--state-ok) 10%, transparent); }
.df-table--split .df-row--conflict td:nth-child(3) { box-shadow: none; }

/* Resolved comments fold to one quiet line; open ones offer Resolve. */
.pl-resolve { margin: 0; display: inline; }
.pl-note-resolve { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; color: var(--fg-faint); text-decoration: none; }
.pl-note-resolve:hover { color: var(--state-ok); }
.pl-menu-item { display: block; width: 100%; text-align: left; padding: 6px 8px; text-decoration: none; color: var(--fg-muted); border-radius: 6px; }
.pl-menu-item:hover { background: color-mix(in oklab, var(--fg) 7%, transparent); color: var(--fg); }
.pl-note--resolved { display: block; padding: 0; border-left-color: var(--border-strong); background: transparent; }
.pl-note--resolved > details > summary { list-style: none; cursor: pointer; }
.pl-note--resolved > details > summary::-webkit-details-marker { display: none; }
.pl-note-fold { display: flex; align-items: center; gap: 8px; padding: 6px 12px; color: var(--fg-faint); font-size: 12.5px; }
.pl-note-fold .icon { color: var(--state-ok); }
.pl-note-fold > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-note-fold strong { color: var(--fg-muted); font-weight: 500; }
.pl-note-by { flex: none; font-size: 11.5px; }
.pl-note-open { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 4px 12px 10px; }
/* Folded context in a diff: one quiet row that opens it. */
.df-expand td { padding: 0 !important; background: color-mix(in oklab, var(--fg) 3%, var(--surface-1)); }
.df-expand-btn { display: flex; align-items: center; gap: 6px; width: 100%; height: 26px; padding: 0 var(--s-3); border: 0; background: transparent; color: var(--fg-faint); font-family: var(--font-sans); font-size: 12px; cursor: pointer; }
.df-expand-btn:hover { color: var(--fg); background: color-mix(in oklab, var(--fg) 5%, transparent); }
.df-ctx-hidden .df-c { color: var(--fg-muted); }

/* ══ The older pages (inbox, thread, team, settings, keys, fan-outs list) on the same system ═══════════════════
   Same title, same panels with header rows, same badges and table headers as the detail pages. */
.app-section-header { align-items: center; margin-bottom: var(--s-5); }
.app-section-sub { color: var(--fg-muted); font-size: 13px; margin-top: var(--s-1); }
.app-section-title, .thread-title { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.settings-block, .team-block, .tgroup { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); margin: 0 0 var(--s-5); padding: 0 0 var(--s-4); border-top: 1px solid var(--border); max-width: 60rem; }
.settings-block + .settings-block { border-top: 1px solid var(--border); padding-top: 0; }
.settings-title, .team-title, .tgroup-title { display: flex; align-items: center; min-height: 44px; margin: 0 0 var(--s-4); padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--fg); }
.settings-block > :not(.settings-title), .team-block > :not(.team-title) { margin-left: var(--s-4); margin-right: var(--s-4); }
.settings-block > :last-child, .team-block > :last-child { margin-bottom: 0; }
.settings-block--danger { border-color: color-mix(in oklab, var(--state-err) 40%, var(--border)); }
.settings-block--danger .settings-title { color: var(--state-err); border-bottom-color: color-mix(in oklab, var(--state-err) 25%, var(--border)); }
.settings-help, .team-note { color: var(--fg-muted); font-size: 13px; line-height: 1.55; }
.tgroup { padding-bottom: 0; overflow: hidden; }
.tgroup-title { margin-bottom: 0; }
.tgroup .tlist { margin: 0; }
.tgroup .trow { padding-left: var(--s-4); padding-right: var(--s-4); }
.tgroup .tlist > li:first-child .trow, .tgroup .tlist > .trow:first-child { border-top: 0; }
.tgroup .trow:hover { background: color-mix(in oklab, var(--fg) 4%, transparent); }
.team-block .data-table th, .team-table th { font-family: var(--font-sans); font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--fg-faint); padding: 10px var(--s-4); }
.team-block .data-table td, .team-table td { padding: 10px var(--s-4); font-size: 13px; }
.team-block .data-table, .team-block .team-table { margin-left: 0; margin-right: 0; width: 100%; }
.team-block > .data-table, .team-block > .team-table { width: calc(100% - 0px); margin: 0; }
.data-table tbody tr:hover { background: color-mix(in oklab, var(--fg) 4%, transparent); cursor: default; }
.inbox-summary span { font-family: var(--font-sans); font-size: 12px; font-weight: 500; height: 24px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--fg-muted); background: var(--surface-1); }
.inbox-summary .inbox-summary-hot { color: var(--state-warn); border-color: color-mix(in oklab, var(--state-warn) 40%, var(--border)); background: color-mix(in oklab, var(--state-warn) 8%, transparent); }
.next-up { max-width: 60rem; padding: var(--s-5); margin-bottom: var(--s-5); border: 1px solid var(--border); border-left: 2px solid var(--state-warn); border-radius: 10px; background: var(--surface-1); }
.next-up--clear { border-left-color: var(--state-ok); }
.next-up-ask { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; margin: 0 0 var(--s-2); }
.next-up-title { margin-bottom: var(--s-4); }
.thread-panel { border-color: var(--border); border-radius: 10px; }
.thread-head .thread-back { margin-bottom: var(--s-3); font-size: 13px; }
.section-tabs { margin-bottom: var(--s-5); }
@media (max-width: 640px) {
  .settings-block, .team-block, .tgroup, .next-up { max-width: none; }
  .next-up { padding: var(--s-4); }
  .team-block .data-table, .team-block .team-table { display: block; overflow-x: auto; }
}

/* A closed pop-up takes no room (it had pushed a phone page 10 px wider). */
.pop:not([open]) > .pop-card { display: none; }
/* On a phone the agents table scrolls in its own box (it had pushed the page 10 px wider). */
@media (max-width: 640px) {
  .ld-scroll { overflow-x: auto; }
  .ld-table td, .ld-table tbody th, .ld-table thead th { padding-left: 10px; padding-right: 10px; }
  .ld-table .pill { padding: 0 8px; }
}

/* The inbox as two panes (Dashboard plan phase 2, 28 Nov 2026): typed groups on the left, the selected item on the right. */
.ix { display: grid; gap: var(--s-5); align-items: start; }
.ix-pane { order: -1; min-width: 0; }
.ix-pane .next-up { margin-bottom: var(--s-3); max-width: none; }
.ix-list { min-width: 0; display: grid; gap: var(--s-4); }
.ix-group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--s-2); font-size: var(--type-small-size); font-weight: 600; color: var(--fg); }
.ix-count { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--fg-muted); font-size: 11px; font-weight: 500; text-align: center; font-variant-numeric: tabular-nums; }
.ix-group[data-group="approve"]:not(.ix-group--empty) .ix-count, .ix-group[data-group="answer"]:not(.ix-group--empty) .ix-count, .ix-group[data-group="allow"]:not(.ix-group--empty) .ix-count { background: var(--state-warn); border-color: var(--state-warn); color: #000; }
.ix-group--empty { display: flex; align-items: baseline; gap: var(--s-3); }
.ix-group--empty .ix-group-title { margin: 0; color: var(--fg-faint); }
.ix-empty { margin: 0; color: var(--fg-faint); font-size: 12px; }
.ix-list .trow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "state age" "main main" "who who"; row-gap: 3px; column-gap: var(--s-3); padding: 10px 12px; border: 1px solid transparent; border-top-color: var(--border); border-radius: 6px; }
.ix-list .trow-state { grid-area: state; }
.ix-list .trow-main { grid-area: main; }
.ix-list .trow-who { grid-area: who; font-size: 12px; color: var(--fg-faint); }
.ix-list .trow-age { grid-area: age; }
.ix-list .trow.ix-on { border-color: var(--border-strong); background: var(--surface-1); box-shadow: inset 2px 0 0 var(--fg); }
.ix-list .trow:focus-visible { outline: 2px solid var(--fg-muted); outline-offset: 1px; }
.trow-same { color: var(--state-warn); font-weight: 500; }
.ix-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-4); }
.ix-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.ix-actions-help { color: var(--fg-faint); font-size: 12px; }
.ix-fold > summary { cursor: pointer; padding: 6px 12px; color: var(--fg-faint); font-size: 12px; }
.ix-fold > summary:hover { color: var(--fg); }
.ix-more > summary, .ix-away > summary { cursor: pointer; padding: 6px 0; color: var(--fg-muted); font-size: var(--type-small-size); font-weight: 500; }
.ix-more > summary:hover, .ix-away > summary:hover { color: var(--fg); }
.ix-wake { margin: -4px 12px 8px; }
.ix-wake .link-button { font-size: 12px; color: var(--fg-faint); }
@media (min-width: 1100px) {
  .ix { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
  .ix-pane { order: 0; position: sticky; top: var(--s-4); }
}

/* First run (Dashboard plan phase 5): the rail's Getting started checklist, the ⌘K menu, the tour. */
.gs { margin: var(--s-3) 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); }
.gs-head { display: flex; align-items: baseline; justify-content: space-between; }
.gs-title { margin: 0; font-size: 12px; font-weight: 600; color: var(--fg); }
.gs-count { font-size: 11px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.gs-bar { height: 3px; margin: 6px 0 8px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.gs-bar span { display: block; height: 100%; background: var(--state-ok); }
.gs-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gs-step { display: flex; align-items: center; gap: 8px; padding: 3px 2px; border-radius: 4px; color: var(--fg-muted); font-size: 12px; text-decoration: none; }
.gs-step:hover { color: var(--fg); background: var(--surface-2); }
.gs-step--done { color: var(--fg-faint); text-decoration: line-through; }
.gs-step svg { color: var(--state-ok); flex: none; }
.gs-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; }
.gs-hide { margin-top: 4px; }
.gs-hide .link-button { font-size: 11px; color: var(--fg-faint); }
.cmdk { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: color-mix(in oklab, var(--bg) 60%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.cmdk[hidden] { display: none; }
.cmdk-card { width: min(36rem, 100%); background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); overflow: hidden; }
.cmdk-input { width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--fg); font: inherit; font-size: 15px; outline: none; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.cmdk-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--fg-muted); font-size: 14px; cursor: pointer; }
.cmdk-list li[aria-selected="true"], .cmdk-list li:hover { background: var(--surface-2); color: var(--fg); }
.cmdk-list li[data-k]::after { content: attr(data-k); margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); }
.cmdk-kind { flex: none; padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 11px; color: var(--fg-faint); }
.cmdk-foot { display: flex; gap: 6px; align-items: center; margin: 0; padding: 8px 12px; border-top: 1px solid var(--border); color: var(--fg-faint); font-size: 11px; }
.cmdk-foot kbd { font-family: var(--font-mono); font-size: 10px; padding: 2px 4px; border: 1px solid var(--border-strong); border-radius: 3px; }
.tour-nav { display: flex; gap: var(--s-4); margin: 0 0 var(--s-4); font-size: 13px; }
.tour-nav a { color: var(--fg-muted); }
.tour-part { margin: var(--s-6) 0; scroll-margin-top: var(--s-4); }
.tour-h { margin: 0 0 var(--s-2); font-size: 18px; font-weight: 600; }
.tour-p { margin: 0 0 var(--s-3); max-width: 46rem; color: var(--fg-muted); font-size: 14px; line-height: 1.55; }
.sample { position: relative; padding: var(--s-4); border: 1px dashed var(--border-strong); border-radius: 10px; }
.sample::before { content: 'Sample'; position: absolute; top: -9px; left: 14px; padding: 0 6px; background: var(--bg); color: var(--fg-faint); font-size: 11px; }
.tour-public { max-width: 1180px; margin: 0 auto; padding: var(--s-6) 16px var(--s-8); }
.rail-search { display: flex; align-items: center; gap: 8px; width: 100%; margin: var(--s-2) 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--fg-faint); font: inherit; font-size: 13px; cursor: pointer; }
.rail-search:hover { color: var(--fg); border-color: var(--border-strong); }
.rail-search kbd { margin-left: auto; font-family: var(--font-mono); font-size: 10px; padding: 1px 4px; border: 1px solid var(--border); border-radius: 3px; }
@media (max-width: 768px) { .rail-search, .gs { display: none; } }

/* Factories on the web (Dashboard plan phase 6). */
.fac-grid, .tpl-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); margin: var(--s-4) 0; }
.fac-card .panel-title a { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; }
.fac-card .panel-title a:hover { text-decoration: underline; }
.fac-goal { margin: 0 0 6px; color: var(--fg); font-size: 14px; line-height: 1.5; }
.fac-desc { margin: 0 0 6px; color: var(--fg-muted); font-size: 13px; }
.fac-wait { margin: 0 0 6px; font-size: 13px; }
.fac-wait a { color: var(--state-warn); font-weight: 500; }
.fac-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; color: var(--fg-faint); font-size: 12px; }
.fac-runs { display: flex; gap: 4px; margin: 8px 0 0; }
.run-dot { width: 10px; height: 10px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--border-strong); }
.run-dot--good { background: var(--state-ok); border-color: var(--state-ok); }
.run-dot--bad, .run-dot--failed { background: var(--state-err); border-color: var(--state-err); }
.run-dot--running { background: var(--state-info); border-color: var(--state-info); }
.run-dot--requested { background: transparent; border-style: dashed; }
.fac-more { margin-top: var(--s-6); }
.fac-measure { margin: 6px 0; font-size: 13px; }
.fac-measure--ok strong { color: var(--state-ok); }
.fac-measure--warn strong { color: var(--state-warn); }
.fac-edit summary { cursor: pointer; font-size: 13px; color: var(--fg-muted); margin-top: 6px; }
.fac-edit input[type="number"] { width: 6rem; padding: 6px 8px; background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: 6px; font: inherit; }
.fac-ask textarea { width: 100%; padding: 8px 10px; margin: 6px 0 10px; background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong); border-radius: 6px; font-family: var(--font-mono); font-size: 13px; }
.fac-verdict { display: flex; gap: 6px; }
.fac-prompt, .tpl-prompt pre { margin: 0; white-space: pre-wrap; font-size: 12.5px; line-height: 1.55; font-variant-ligatures: none; }
.tpl-what { margin: 0 0 8px; color: var(--fg-muted); font-size: 13px; line-height: 1.5; }
.tpl-prompt summary { cursor: pointer; font-size: 13px; color: var(--fg-muted); margin-bottom: 6px; }
.tpl-prompt pre { padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }

/* Welcome: "How did you find Forkit?" (29 Nov 2026) */
.wl-found { margin: var(--s-6) 0 0; padding: var(--s-4); border: 1px solid var(--border); border-radius: 10px; }
.wl-found-h { margin: 0 0 var(--s-1); font-size: 15px; font-weight: 600; }
.wl-found-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--s-3) 0; }
.wl-found-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; cursor: pointer; }
.wl-found-opt:has(input:checked) { border-color: var(--fg); }
.wl-found-other { width: 100%; max-width: 320px; margin: 0 var(--s-2) var(--s-2) 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--fg); font: inherit; font-size: 13px; }
