/* SourceWeaver landing — Terminal Console theme. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

:root {
  --maxw: 1240px;
  --gut: 32px;

  --bg: #0c0d0a;
  --bg-2: #131410;
  --bg-3: #1d1e18;
  --ink: #e8e4d3;
  --ink-2: #a8a394;
  --ink-3: #6f6b5d;
  --rule: rgba(232,228,211,0.12);
  --rule-2: rgba(232,228,211,0.06);
  --accent: #9ef36a;
  --accent-soft: rgba(158,243,106,0.10);
  --accent-deep: #6dc041;
  --on-accent: #0c0d0a;
  --pill-running: #9ef36a;
  --pill-done: #6ee7a8;
  --pill-assess: #f5d77a;
  --pill-review: #8fb8ff;
  --danger-ink: #ff7a75;
  --danger-edge: #cc6666;
  --warn-ink: #e89c30;
  --warn-edge: #c47a1f;
  --font-display: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-body: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --shadow-card: 0 0 0 1px rgba(232,228,211,0.06), 0 12px 40px -16px rgba(0,0,0,0.6);
  --radius: 2px;
}

/* ── Mid theme (charcoal slate, less contrast) ─────────────── */
[data-theme="mid"] {
  --bg: #1f2a24;
  --bg-2: #26342d;
  --bg-3: #2f3f37;
  --ink: #e3ece6;
  --ink-2: #a8b8b0;
  --ink-3: #748079;
  --rule: rgba(227,236,230,0.14);
  --rule-2: rgba(227,236,230,0.07);
  --accent: #7ad05a;
  --accent-soft: rgba(122,208,90,0.12);
  --accent-deep: #5aa840;
  --on-accent: #0e1612;
  --danger-ink: #d65a55;
  --danger-edge: #a83a36;
  --warn-ink: #c87a1a;
  --warn-edge: #8e530f;
  --shadow-card: 0 0 0 1px rgba(227,236,230,0.05), 0 14px 40px -16px rgba(0,0,0,0.5);
}
[data-theme="mid"] body {
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(122,208,90,0.06), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 3px);
}

/* ── Light theme (warm paper, ink on cream) ────────────────── */
[data-theme="light"] {
  --bg: #f4f1e8;
  --bg-2: #ebe6d6;
  --bg-3: #e0d9c4;
  --ink: #1a1d18;
  --ink-2: #4a5044;
  --ink-3: #8a8775;
  --rule: rgba(26,29,24,0.16);
  --rule-2: rgba(26,29,24,0.08);
  --accent: #2d8a3e;
  --accent-soft: rgba(45,138,62,0.10);
  --accent-deep: #1e6b2d;
  --on-accent: #f4f1e8;
  --pill-running: #2d8a3e;
  --pill-done: #4ba85f;
  --pill-assess: #c79a2c;
  --pill-review: #4467b8;
  --danger-ink: #b3322d;
  --danger-edge: #8a2521;
  --warn-ink: #a06012;
  --warn-edge: #6e3f08;
  --shadow-card: 0 0 0 1px rgba(26,29,24,0.06), 0 12px 36px -18px rgba(26,29,24,0.25);
}
[data-theme="light"] body {
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(45,138,62,0.06), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.014) 0 1px, transparent 1px 3px);
}

/* Subtle scanline texture only on body to keep it from doubling on iframes */
body {
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(158,243,106,0.05), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  background-attachment: fixed;
}

.shell { width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.rule { border-top: 1px solid var(--rule); }

/* ── Top nav ───────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex; align-items: center; gap: 28px;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.brand-mark {
  width: 22px; height: 22px;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  border-radius: var(--radius);
}
.brand-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 22px; margin-left: 18px; }
.nav-links a { color: var(--ink-2); font-size: 13px; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-spacer { flex: 1; }
.nav-cta { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  font-family: var(--font-body);
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--bg-2); border-color: var(--ink-3); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); filter: brightness(1.1); }

/* ── Hero ──────────────────────────────────────────────── */
.hero { padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero-stamp {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero-stamp-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(158,243,106,0.22);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 5.2vw, 68px);
  line-height: 1.0;
  letter-spacing: -0.04em;
  font-weight: 700;
  margin-bottom: 24px;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--accent); }

.hero-sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 540px;
  margin-bottom: 32px;
  text-wrap: pretty;
}

.hero-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-meta {
  margin-top: 28px;
  display: flex; gap: 28px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.hero-meta b { color: var(--ink); font-weight: 700; }

/* Hero right: pipeline visual frame */
.hero-visual {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

/* ── Pipeline ──────────────────────────────────────────── */
.pipeline { display: flex; flex-direction: column; gap: 16px; }
.pipeline-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pipeline-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pipeline-id {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.08em;
}
.pipeline-title {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pipeline-status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-2);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 1.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(158,243,106,0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(158,243,106,0); }
}
.status-label { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.status-elapsed { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.pipeline-track {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.stage { display: flex; flex-direction: column; gap: 6px; }
.stage-bar {
  height: 4px; background: var(--rule-2); border-radius: 2px; overflow: hidden;
  position: relative;
}
.stage-fill {
  position: absolute; inset: 0;
  background: var(--ink-3);
  width: 0%;
  transition: width .8s ease;
}
.stage-name {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.04em; color: var(--ink-3);
  text-transform: uppercase;
}
.stage-desc {
  font-size: 10.5px; color: var(--ink-3); line-height: 1.3;
  display: none;
}
.stage-done .stage-fill { width: 100%; background: var(--accent-deep); }
.stage-done .stage-name { color: var(--ink); }
.stage-live .stage-fill {
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: liveSlide 1.4s linear infinite;
}
@keyframes liveSlide { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.stage-live .stage-name { color: var(--accent); font-weight: 700; }
.stage-pending .stage-name { color: var(--ink-3); opacity: 0.6; }

.pipeline-foot {
  background: var(--bg-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.logstream { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55; height: 88px; overflow: hidden; }
.logstream-row { display: flex; gap: 10px; }
.logstream-key { color: var(--accent); flex-shrink: 0; width: 80px; }
.logstream-val { color: var(--ink-2); }

/* ── Marquee strip ─────────────────────────────────────── */
.strip {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
  background: var(--bg-2);
}
.strip-inner {
  display: flex; gap: 48px; align-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.1em; text-transform: uppercase;
  overflow: hidden; white-space: nowrap;
}
.strip-inner span:first-child { color: var(--accent); font-weight: 700; }

/* ── Section header ────────────────────────────────────── */
.section { padding: 96px 0; border-top: 1px solid var(--rule); }
.section-head { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; margin-bottom: 56px; align-items: end; }
.section-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
  color: var(--ink);
}
.section-blurb { font-size: 15px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; max-width: 520px; }

/* ── 3-step flow ──────────────────────────────────────── */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flow-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  background: var(--bg-2);
  position: relative;
  min-height: 240px;
  display: flex; flex-direction: column;
}
.flow-step {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px;
}
.flow-card h3 {
  font-family: var(--font-display); font-size: 22px;
  line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; margin-bottom: 12px;
  color: var(--ink);
}
.flow-card p { color: var(--ink-2); font-size: 14px; line-height: 1.6; flex: 1; }
.flow-card-foot {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--rule-2);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
}

/* ── Two-up: workspace + PR ───────────────────────────── */
.twoup { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Workspace tree */
.wstree {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: var(--shadow-card);
}
.wstree-head {
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  padding: 12px 16px; color: var(--accent);
  letter-spacing: 0.14em; text-transform: uppercase;
  border-bottom: 1px solid var(--rule-2);
  margin-bottom: 4px;
}
.wstree-row {
  display: grid;
  grid-template-columns: 28px 78px 1fr;
  align-items: center; gap: 12px;
  padding: 9px 16px;
  color: var(--ink-2);
}
.wstree-row:hover { background: var(--bg-3); }
.wstree-child {
  padding-left: 44px; grid-template-columns: 28px 78px 1fr;
  position: relative;
}
.wstree-child::before {
  content: '';
  position: absolute;
  left: 26px; top: 0; bottom: 50%;
  border-left: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  width: 12px;
  border-bottom-left-radius: 4px;
}
.wstree-icon {
  position: relative;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.wstree-id {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.04em;
}
.tree-overlay {
  position: absolute;
  bottom: -2px; right: -3px;
  width: 11px; height: 11px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-2);
}
.tree-overlay-pulse { animation: arbiter-pulse 2s ease-in-out infinite; }
@keyframes arbiter-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
.tree-q {
  position: absolute;
  top: -5px; right: -7px;
  background: #f59e0b; color: var(--on-accent);
  font-family: var(--font-mono); font-size: 9px; font-weight: 800;
  padding: 1px 4px; border-radius: 999px;
  border: 2px solid var(--bg-2);
  line-height: 1;
}
.wstree-title {
  color: var(--ink); font-weight: 500; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* PR card */
.prcard {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-card);
}
.prcard-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.prcard-icon { color: var(--pill-done); font-size: 18px; }
.prcard-title { flex: 1; font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--ink); }
.prcard-num { font-family: var(--font-mono); color: var(--ink-3); font-size: 13px; }
.prcard-meta {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3);
  margin-bottom: 16px;
}
.prcard-pill {
  background: var(--accent); color: var(--on-accent); padding: 2px 8px;
  border-radius: 999px; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; font-weight: 700;
}
.prcard-author { color: var(--accent); font-weight: 700; }
.prcard-body {
  background: var(--bg-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.prcard-line { color: var(--ink-2); }
.prcard-line.muted { color: var(--ink-3); margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--rule-2); }
.prcard-foot { display: flex; gap: 8px; }
.prcard-btn {
  padding: 7px 14px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: transparent; color: var(--ink); font-size: 12px; font-weight: 600;
  font-family: var(--font-body);
}
.prcard-btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.prcard-btn.ghost { color: var(--ink-3); }

/* ── YAML block ────────────────────────────────────────── */
.yaml-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.yaml-frame {
  background: var(--bg-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.yaml-frame-head {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-2);
  background: var(--bg-3);
}
.yaml-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3);
  opacity: 0.5;
}
.yaml-frame-name {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-3); margin-left: 8px;
}
.yaml-pre {
  font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.7;
  padding: 18px 20px;
  margin: 0;
  color: var(--ink);
  overflow: auto;
}
.yaml-line { display: block; padding: 0 8px; margin: 0 -8px; border-radius: 3px; transition: background .12s; cursor: default; }
.yaml-line-hot { background: rgba(158,243,106,0.10); }
.yaml-k { color: var(--accent); }
.yaml-s { color: var(--ink); }
.yaml-p { color: var(--ink-3); }
.yaml-c { color: var(--ink-3); font-style: italic; }

.yaml-note {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky; top: 88px;
}
.yaml-note-eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.yaml-note-title {
  font-family: var(--font-display); font-size: 22px;
  font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px;
  color: var(--ink);
}
.yaml-note-body { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin-bottom: 16px; text-wrap: pretty; }
.yaml-note-hint {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); padding-top: 14px; border-top: 1px solid var(--rule-2);
}

.optional-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  vertical-align: middle;
}

/* ── Merge queue ──────────────────────────────────────── */
.mqueue {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.mqueue-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-3);
}
.mqueue-eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 4px;
}
.mqueue-title {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  color: var(--ink);
}
.mqueue-status { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.mqueue-list { padding: 6px 0; }
.mqueue-row {
  display: grid;
  grid-template-columns: 28px 22px 64px 1fr 140px 160px;
  align-items: center; gap: 14px;
  padding: 10px 22px;
  border-top: 1px solid var(--rule-2);
  font-family: var(--font-mono); font-size: 12.5px;
}
.mqueue-row:first-child { border-top: 0; }
.mqueue-row.is-head { background: rgba(158,243,106,0.05); }
.mqueue-row.is-head .mqueue-pos { color: var(--accent); font-weight: 700; }
.mqueue-pos { color: var(--ink-3); text-align: center; }
.mqueue-pr { color: var(--ink-3); }
.mqueue-pr-title {
  color: var(--ink); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-body);
}
.mqueue-pr-author { color: var(--accent); }
.mqueue-state {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em;
  justify-self: end;
}
.mqueue-spin { display: inline-flex; animation: mqueue-spin 1.4s linear infinite; }
@keyframes mqueue-spin { to { transform: rotate(360deg); } }

.mqueue-recovery {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 22px 10px 76px;
  background: rgba(232,156,48,0.06);
  border-top: 1px solid var(--rule-2);
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-2);
}
.mqueue-recovery-arrow { color: #e89c30; font-weight: 700; }
.mqueue-recovery-tag {
  color: #e89c30; font-weight: 700;
  background: rgba(232,156,48,0.12);
  padding: 2px 8px; border-radius: 3px;
  letter-spacing: 0.04em;
}
.mqueue-recovery-text { color: var(--ink-3); }

.mqueue-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
}
.mqueue-recovery-card {
  background: var(--bg-3);
  padding: 18px 22px;
}
.mqueue-recovery-name {
  font-family: var(--font-mono); font-size: 12px; color: #e89c30;
  font-weight: 700; margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.mqueue-recovery-desc {
  font-size: 13px; line-height: 1.5; color: var(--ink-2);
}

.mqueue-pr-icon { display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 1100px) {
  .mqueue-row { grid-template-columns: 24px 22px 56px 1fr 120px; }
  .mqueue-pr-author { display: none; }
  .mqueue-foot { grid-template-columns: 1fr; }
}

/* ── Self-built section ────────────────────────────────── */
.self {
  background: var(--accent);
  color: var(--on-accent);
  padding: 96px 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.self::before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.self > * { position: relative; }
.self .section-eyebrow { color: rgba(0,0,0,0.65); }
.self h2 { color: var(--on-accent); }
.self .section-blurb { color: rgba(0,0,0,0.82); }
.self p { color: var(--on-accent) !important; opacity: 0.85; }

.self-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.self-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; padding-top: 32px; border-top: 1px solid currentColor; border-top-color: color-mix(in srgb, var(--on-accent) 25%, transparent); }
.self-stat-num { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.self-stat-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; margin-top: 8px; }
.self-pr { background: var(--on-accent); color: var(--ink); border: 1px solid color-mix(in srgb, var(--on-accent) 60%, transparent); padding: 22px; border-radius: var(--radius); }
.self-pr-head { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.self-pr-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 16px; color: var(--ink); }
.self-pr-quote { font-size: 14px; line-height: 1.6; color: var(--ink-2); padding-left: 14px; border-left: 2px solid var(--accent); }

/* ── Audience split ───────────────────────────────────── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.split-col { padding: 40px 36px; background: var(--bg-2); }
.split-col + .split-col { border-left: 1px solid var(--rule); }
.split h3 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; color: var(--ink); }
.split p { color: var(--ink-2); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.split ul { list-style: none; padding: 0; }
.split li {
  display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule-2);
  font-size: 13.5px; color: var(--ink-2);
}
.split li::before {
  content: '+'; color: var(--accent); font-family: var(--font-mono);
  font-weight: 700; flex-shrink: 0;
}

/* ── Differentiator grid ──────────────────────────────── */
.diffgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.diff-cell { background: var(--bg-2); padding: 28px 24px 32px; min-height: 200px; display: flex; flex-direction: column; }
.diff-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--on-accent); background: var(--accent);
  margin-bottom: 16px;
  border-radius: var(--radius);
}
.diff-cell h4 { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; line-height: 1.3; color: var(--ink); }
.diff-cell p { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }

/* ── CTA block ────────────────────────────────────────── */
.cta {
  border-top: 1px solid var(--rule);
  padding: 96px 0;
  text-align: center;
}
.cta h2 { margin-bottom: 16px; }
.cta-sub { font-size: 16px; color: var(--ink-2); margin-bottom: 28px; }
.cta-code {
  display: inline-block;
  font-family: var(--font-mono); font-size: 13px;
  background: var(--bg-3); border: 1px solid var(--rule);
  padding: 12px 18px; border-radius: var(--radius);
  margin-top: 22px; color: var(--ink);
}
.cta-code .accent { color: var(--accent); }

.interest-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 460px;
  margin: 0 auto;
  text-align: left;
}
.interest-form input,
.interest-form textarea {
  font: inherit;
  font-size: 14px;
  background: var(--bg-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
.interest-form input:focus,
.interest-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.interest-form button {
  align-self: flex-start;
}
.interest-ok {
  display: inline-block;
  background: var(--bg-3);
  border: 1px solid var(--rule);
  padding: 14px 22px;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 15px;
}
.interest-err {
  font-size: 13px;
  color: #ef5350;
}

/* ── Footer ───────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--rule);
  padding: 48px 0 36px;
  background: var(--bg-2);
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot-brand { display: flex; flex-direction: column; gap: 10px; }
.foot-tag { color: var(--ink-3); font-size: 12.5px; line-height: 1.6; max-width: 280px; }
.foot-col h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.foot-col a { display: block; padding: 4px 0; color: var(--ink-2); font-size: 13px; }
.foot-col a:hover { color: var(--ink); }
.foot-bottom {
  margin-top: 36px; padding-top: 22px;
  border-top: 1px solid var(--rule-2);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
}

/* ── Pricing page ─────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.price-col { padding: 36px 28px 32px; background: var(--bg-2); display: flex; flex-direction: column; }
.price-col + .price-col { border-left: 1px solid var(--rule); }
.price-col.featured { background: var(--bg-3); position: relative; }
.price-col.featured::before {
  content: 'recommended'; position: absolute; top: 12px; right: 16px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent); padding: 3px 8px; border-radius: 999px; font-weight: 700;
}
.price-col h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--ink); }
.price-tag { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-bottom: 24px; letter-spacing: 0.06em; }
.price-num { display: flex; align-items: baseline; gap: 6px; margin-bottom: 28px; }
.price-num b { font-family: var(--font-display); font-size: 48px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--ink); }
.price-num span { color: var(--ink-3); font-size: 13px; }
.price-list { list-style: none; padding: 0; margin: 0 0 28px; flex: 1; }
.price-list li { padding: 8px 0; border-top: 1px solid var(--rule-2); color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.price-list li:first-child { border-top: 0; }
.price-list li::before { content: '✓ '; color: var(--accent); font-weight: 700; }

/* ── Docs page ────────────────────────────────────────── */
.docs-shell { display: grid; grid-template-columns: 240px 1fr; gap: 56px; padding: 56px 0; }
.docs-side { position: sticky; top: 88px; align-self: start; }
.docs-side h6 { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin: 24px 0 8px; }
.docs-side h6:first-child { margin-top: 0; }
.docs-side a { display: block; padding: 5px 0; font-size: 13px; color: var(--ink-2); }
.docs-side a:hover { color: var(--ink); }
.docs-side a.active { color: var(--accent); font-weight: 700; }
.docs-body { max-width: 720px; }
.docs-body h1 { font-family: var(--font-display); font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 16px; color: var(--ink); }
.docs-lede { font-size: 16px; line-height: 1.6; color: var(--ink-2); margin-bottom: 32px; max-width: 600px; }
.docs-body h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 40px 0 12px; color: var(--ink); }
.docs-body p { font-size: 14.5px; line-height: 1.7; color: var(--ink-2); margin-bottom: 14px; }
.docs-body code { font-family: var(--font-mono); font-size: 12.5px; background: var(--bg-2); padding: 1px 6px; border-radius: 3px; color: var(--accent); }
.docs-pre {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65;
  background: var(--bg-3); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 18px 20px; margin: 16px 0 24px;
  white-space: pre; overflow-x: auto; color: var(--ink);
}
.docs-callout {
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  background: var(--accent-soft);
  margin: 16px 0 24px;
  font-size: 13.5px; line-height: 1.6;
  color: var(--ink);
}
.docs-callout code { background: rgba(0,0,0,0.4); }

@media (max-width: 1100px) {
  .hero-grid, .yaml-wrap, .self-grid, .twoup, .docs-shell { grid-template-columns: 1fr; }
  .docs-side { position: static; top: auto; }
  .yaml-note { position: static; top: auto; }
  .pipeline-track { grid-template-columns: repeat(4, 1fr); }
  .flow, .diffgrid, .pricing-grid, .foot-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split-col + .split-col { border-left: 0; border-top: 1px solid var(--rule); }
}


/* ── AppShell mock — recreated Arbiter UI in green/black/white ── */
.appshell {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(232,228,211,0.05), 0 30px 90px -30px rgba(0,0,0,0.8);
  display: flex; flex-direction: column;
  height: 660px;
}

/* Preview ribbon — diagonal corner badge marking the app shell as a design preview */
.appshell .preview-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 110px;
  height: 110px;
  overflow: hidden;
  pointer-events: none;
  z-index: 50;
}
.appshell .preview-ribbon span {
  position: absolute;
  display: block;
  width: 170px;
  padding: 5px 0;
  background: #dc2626;
  color: #fff;
  text-align: center;
  font: 600 10px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: rotate(45deg);
  top: 24px;
  right: -46px;
}

/* Top bar */
.apptop {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px;
  padding: 0 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.apptop-left {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-2);
  min-width: 0;
  flex: 1;
}
.apptop-brand {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--accent); font-weight: 700;
}
.apptop-brand-mark {
  width: 16px; height: 16px;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; border-radius: 2px;
}
.apptop-sep { color: var(--ink-3); }
.apptop-crumb { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apptop-crumb-current { color: var(--ink); font-weight: 500; }
.apptop-counter { color: var(--ink-3); margin-left: 4px; }

.apptop-right {
  display: flex; align-items: center; gap: 16px;
  flex-shrink: 0;
}
.apptop-progress {
  width: 90px; height: 3px;
  background: var(--bg-3);
  border-radius: 2px; overflow: hidden;
  position: relative;
}
.apptop-progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 60%;
  background: linear-gradient(90deg, var(--accent), transparent);
  animation: apptop-progress 2.4s linear infinite;
}
@keyframes apptop-progress {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(166%); }
}
.apptop-tabs { display: flex; gap: 6px; }
.apptop-tab {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-3);
  background: transparent;
}
.apptop-tab.is-active {
  background: var(--accent); color: var(--on-accent);
  border-color: var(--accent);
}

/* Body layout */
.appshell-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: 0;
}

/* Sidebar */
.appside {
  background: var(--bg);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column;
  min-height: 0;
}
.appside-search {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 12px 8px;
  padding: 7px 10px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-3);
}
.appside-search svg { color: var(--ink-3); flex-shrink: 0; }

.appside-chips {
  display: flex; align-items: center; gap: 4px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--rule-2);
}
.appside-chip {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 2px;
  cursor: default;
}
.appside-chip:hover { background: var(--bg-2); }
.appside-chip.is-muted { opacity: 0.4; }
.appside-chip-spacer { flex: 1; }
.appside-newbtn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border: 0; border-radius: 2px;
}

.appside-tree {
  padding: 6px 0 12px;
  overflow-y: auto;
  font-family: var(--font-mono); font-size: 12px;
  flex: 1;
  min-height: 0;
}
.appside-folder {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 4px;
  color: var(--ink-2);
  font-weight: 600;
}
.appside-folder-caret { color: var(--ink-3); font-size: 10px; width: 10px; }
.appside-folder svg { color: var(--ink-2); }
.appside-folder-name { letter-spacing: 0.02em; }

.appside-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center; gap: 8px;
  padding: 5px 12px;
  color: var(--ink-2);
  cursor: default;
}
.appside-row:hover { background: var(--bg-2); }
.appside-row.is-active {
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}
.appside-row.is-active .appside-row-title { color: var(--ink); font-weight: 600; }
.appside-child-1 { padding-left: 24px; }
.appside-child-2 { padding-left: 38px; position: relative; }
.appside-child-2::before {
  content: '';
  position: absolute;
  left: 28px; top: 0; bottom: 50%;
  border-left: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  width: 8px;
  border-bottom-left-radius: 3px;
}
.appside-row.is-active.appside-child-1 { padding-left: 22px; }

.appside-icon {
  position: relative;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
}
.appside-q {
  position: absolute;
  top: -5px; right: -7px;
  background: var(--accent); color: var(--on-accent);
  font-size: 8.5px; font-weight: 800;
  padding: 1px 4px; border-radius: 999px;
  border: 1.5px solid var(--bg);
  line-height: 1;
}
.appside-row-title {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 11.5px;
}

/* Main pane */
.appmain {
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--bg-2);
}
.appmain-tabs {
  display: flex;
  border-bottom: 1px solid var(--rule);
  padding: 0 24px;
  flex-shrink: 0;
}
.appmain-tab {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 14px 20px;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: default;
}
.appmain-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.appmain-scroll {
  flex: 1; overflow-y: auto;
  padding: 22px 24px 28px;
  display: flex; flex-direction: column; gap: 22px;
}

/* Sections inside the main pane */
.appsec-h {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

/* Pull Request panel */
.appsec-pr {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--font-mono); font-size: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.appsec-pr-row {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.appsec-pr-label {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
  width: 50px; flex-shrink: 0;
}
.appsec-pr-link {
  color: var(--accent);
  border-bottom: 1px dashed var(--accent);
  padding-bottom: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.appsec-pr-link-target { color: var(--ink); border-bottom-color: var(--ink-3); }
.appsec-pr-foot {
  display: flex; gap: 12px; align-items: center;
  margin-top: 4px; padding-top: 8px;
  border-top: 1px dashed var(--rule-2);
  font-size: 11px; color: var(--ink-3);
}
.appsec-pr-time { margin-left: auto; }

/* Pills */
.appsec-pill {
  display: inline-block;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: capitalize;
}
.appsec-pill-open      { background: rgba(158,243,106,0.18); color: var(--accent); border: 1px solid rgba(158,243,106,0.35); }
.appsec-pill-broken    { background: rgba(239,83,80,0.18);  color: #ff7a75; border: 1px solid rgba(239,83,80,0.4); }
.appsec-pill-progress  { background: rgba(158,243,106,0.18); color: var(--accent); border: 1px solid rgba(158,243,106,0.4); }
.appsec-pill-warn      { background: rgba(232,156,48,0.18); color: #f3b66a; border: 1px solid rgba(232,156,48,0.4); }
.appsec-pill-queued    { background: rgba(168,163,148,0.14); color: var(--ink-2); border: 1px solid var(--rule); }
.appsec-pill-done      { background: rgba(158,243,106,0.18); color: var(--accent); border: 1px solid rgba(158,243,106,0.4); }
.appsec-pill-idle      { background: rgba(168,163,148,0.10); color: var(--ink-3); border: 1px solid var(--rule); }

/* Merge Queue panel */
.appsec-mq {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--font-mono);
}
.appsec-mq-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.appsec-mq-label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
.appsec-mq-val { color: var(--ink); font-weight: 700; }
.appsec-mq-spacer { flex: 1; }
.appsec-eject {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  border-radius: 2px;
}
.appsec-mq-meta {
  font-size: 11px; color: var(--ink-3);
  line-height: 1.55;
}
.appsec-mq-tags { display: flex; gap: 8px; }
.appsec-mq-retry {
  display: inline-block;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(232,156,48,0.16);
  color: #f3b66a;
  border: 1px solid rgba(232,156,48,0.4);
}
.appsec-mq-fail {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px;
  color: #ff7a75;
  padding-top: 6px;
  border-top: 1px dashed var(--rule-2);
}
.appsec-mq-fail-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ff7a75;
}
.appsec-mq-fail code {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent);
  background: rgba(158,243,106,0.10);
  padding: 1px 6px; border-radius: 2px;
}

/* Event Timeline */
.apptl {
  position: relative;
  padding-left: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.apptl::before {
  content: '';
  position: absolute;
  left: 5px; top: 4px; bottom: 4px;
  width: 1px; background: var(--rule);
}
.apptl-row {
  position: relative;
  padding-left: 24px;
  margin-left: -18px;
}
.apptl-dot {
  position: absolute;
  left: 0; top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--ink-3);
}
.apptl-broken    .apptl-dot { background: #ef5350; }
.apptl-progress  .apptl-dot { background: #e89c30; }
.apptl-idle      .apptl-dot { background: var(--ink-3); }
.apptl-row.is-live .apptl-dot {
  box-shadow: 0 0 0 4px rgba(239,83,80,0.25);
  animation: apptl-pulse 1.4s ease-in-out infinite;
}
@keyframes apptl-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239,83,80,0.4); }
  50%      { box-shadow: 0 0 0 7px rgba(239,83,80,0); }
}

.apptl-body { display: flex; flex-direction: column; gap: 2px; }
.apptl-title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink);
}
.apptl-ago { color: var(--ink-3); font-size: 11px; }
.apptl-state-from { color: var(--ink-2); }
.apptl-arrow { color: var(--ink-3); }
.apptl-state-to { color: var(--ink); font-weight: 700; }
.apptl-broken .apptl-state-to { color: #ff7a75; }
.apptl-progress .apptl-state-to { color: #f3b66a; }

.apptl-meta {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3);
}
.apptl-link {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--accent);
  border-bottom: 1px dashed var(--accent);
  align-self: flex-start;
  padding-bottom: 1px;
  margin-top: 2px;
}

/* Workflow Runs table */
.appwf {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
}
.appwf-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--rule-2);
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink);
}
.appwf-row.appwf-head {
  background: var(--bg-2);
  border-top: 0;
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
.appwf-name { color: var(--ink); font-weight: 500; }
.appwf-time { color: var(--ink-3); font-size: 11.5px; }

@media (max-width: 880px) {
  .appshell { height: auto; }
  .appshell-body { grid-template-columns: 1fr; }
  .appside { border-right: 0; border-bottom: 1px solid var(--rule); }
  .appwf-row { grid-template-columns: 1.4fr 1fr 1fr; }
  .appwf-row > :nth-child(4) { display: none; }
}


/* ── Hero stacked layout for AppShell mock ─────────────── */
.hero-stacked { padding: 64px 0 32px; }
.hero-stacked .hero-text {
  max-width: 880px; margin: 0 auto 48px; text-align: center;
}
.hero-stacked .hero-text .hero-sub { margin-left: auto; margin-right: auto; max-width: 640px; }
.hero-stacked .hero-actions { justify-content: center; }
.hero-stacked .hero-meta { justify-content: center; }
.hero-shell {
  position: relative;
  margin: 0 auto;
  max-width: 1320px;
}
.hero-shell::after {
  content: '';
  position: absolute; inset: -60px -40px 40px -40px;
  background: radial-gradient(ellipse at 50% 30%, rgba(158,243,106,0.10), transparent 60%);
  pointer-events: none; z-index: -1;
}
@media (max-width: 1100px) {
  .hero-stacked { padding: 40px 0 24px; }
  .hero-stacked .hero-text { margin-bottom: 32px; }
}


/* AppShell — wrap fixes & tightening */
.apptop-tab { white-space: nowrap; }
.appsec-mq-retry { white-space: nowrap; }
.appside-folder-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.appside-folder { min-width: 0; }
.appside-search > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appsec-pr-link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-width: 0; }
.appsec-pr-time { white-space: nowrap; }
.appsec-mq-fail { flex-wrap: wrap; }
.apptl-title { white-space: nowrap; }


/* Expanded workflow row containing the live pipeline */
.appwf-row.is-expanded {
  background: rgba(158,243,106,0.06);
  border-top: 1px solid var(--rule);
}
.appwf-caret {
  display: inline-block;
  width: 12px;
  color: var(--accent);
  margin-right: 4px;
  font-size: 10px;
}
.appwf-expanded {
  border-top: 1px dashed var(--rule-2);
  padding: 16px 18px 18px;
  background: var(--bg);
}
/* Tighten the embedded pipeline so it fits inside the row */
.appwf-expanded .pipeline { gap: 12px; }
.appwf-expanded .pipeline-track { grid-template-columns: repeat(8, 1fr); gap: 6px; }
.appwf-expanded .pipeline-head { font-size: 11px; }
.appwf-expanded .pipeline-id { font-size: 10px; }
.appwf-expanded .pipeline-title { font-size: 12px; }
.appwf-expanded .pipeline-status { font-size: 10px; gap: 6px; }
.appwf-expanded .stage-name { font-size: 9.5px; }
.appwf-expanded .stage-bar { height: 3px; }
.appwf-expanded .pipeline-foot { padding: 10px 12px; }
.appwf-expanded .logstream { height: 72px; font-size: 10.5px; line-height: 1.5; }
.appwf-expanded .logstream-key { width: 70px; }

@media (max-width: 880px) {
  .appwf-expanded .pipeline-track { grid-template-columns: repeat(4, 1fr); }
}


/* ── Branching Pipeline (DAG with fan-out/fan-in) ────── */
.bp {
  display: flex; flex-direction: column; gap: 10px;
  font-family: var(--font-mono);
}
.bp-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.bp-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bp-id { font-size: 9.5px; letter-spacing: 0.1em; color: var(--ink-3); }
.bp-title { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; color: var(--ink-2);
}
.bp-active {
  color: var(--accent); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 9.5px;
}
.bp-elapsed { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.bp-canvas-wrap {
  background: var(--bg);
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  padding: 8px 10px;
  overflow: hidden;
}
.bp-canvas {
  width: 100%;
  height: auto;
  display: block;
  font-family: var(--font-mono);
}

/* Edges */
.bp-edge {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1.5;
  transition: stroke 0.4s, stroke-width 0.4s;
}
.bp-edge.is-done {
  stroke: var(--accent-deep);
  stroke-width: 1.5;
  opacity: 0.7;
}
.bp-edge.is-live {
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0.4;
}
.bp-edge-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 8 200;
  animation: bp-edge-pulse 1.4s linear infinite;
  filter: drop-shadow(0 0 4px rgba(158,243,106,0.7));
}
@keyframes bp-edge-pulse {
  from { stroke-dashoffset: 200; }
  to   { stroke-dashoffset: 0; }
}

/* Nodes */
.bp-node rect {
  fill: var(--bg-2);
  stroke: var(--rule);
  stroke-width: 1;
  transition: fill 0.3s, stroke 0.3s;
}
.bp-node-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: var(--ink-3);
  transition: fill 0.3s;
}
.bp-node-done rect {
  fill: rgba(158,243,106,0.08);
  stroke: var(--accent-deep);
}
.bp-node-done .bp-node-label { fill: var(--ink); }
.bp-node-live rect {
  fill: var(--accent);
  stroke: var(--accent);
  filter: drop-shadow(0 0 8px rgba(158,243,106,0.55));
  animation: bp-node-pulse 1.4s ease-in-out infinite;
}
.bp-node-live .bp-node-label { fill: var(--on-accent); }
@keyframes bp-node-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(158,243,106,0.4)); }
  50%      { filter: drop-shadow(0 0 14px rgba(158,243,106,0.85)); }
}
.bp-node-pending rect { fill: var(--bg); stroke: var(--rule); }

/* Gate node — diamond-ish hint via a thicker border */
.bp-node-kind-gate rect {
  stroke-dasharray: 3 2;
}

/* Fan-out halo */
.bp-fanout-halo rect {
  fill: rgba(158,243,106,0.04);
  stroke: rgba(158,243,106,0.25);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  animation: bp-halo 2.4s linear infinite;
}
@keyframes bp-halo {
  to { stroke-dashoffset: -12; }
}
.bp-fanout-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-anchor: middle;
  fill: var(--accent);
  text-transform: uppercase;
}

/* Foot */
.bp-foot {
  display: flex;
  border-top: 1px dashed var(--rule-2);
  padding-top: 8px;
}
.bp-legend {
  display: flex; align-items: center; gap: 14px;
  font-size: 10px; color: var(--ink-3);
  letter-spacing: 0.04em;
  width: 100%;
}
.bp-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.bp-legend-done { color: var(--accent-deep); }
.bp-legend-live { color: var(--accent); }
.bp-legend-pending { color: var(--ink-3); }
.bp-legend-spacer { flex: 1; }
.bp-legend-tag {
  color: var(--ink-3); font-size: 9.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}


/* Branching pipeline — open node ring + artifact card */
.bp-node-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-dasharray: 2 2;
  opacity: 0.7;
  animation: bp-halo 2.4s linear infinite;
}
.bp-node.is-open rect:not(.bp-node-ring) {
  filter: drop-shadow(0 0 6px rgba(158,243,106,0.4));
}
.bp-node:hover rect:not(.bp-node-ring) {
  stroke: var(--accent);
}

.bp-detail {
  margin-top: 4px;
  background: var(--bg-3);
  border: 1px solid var(--accent-deep);
  border-radius: 4px;
  font-family: var(--font-mono);
  overflow: hidden;
  animation: bp-detail-in 0.18s ease-out;
}
@keyframes bp-detail-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bp-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px dashed var(--rule-2);
  background: rgba(158,243,106,0.04);
}
.bp-detail-title-row {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.bp-detail-status {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
}
.bp-detail-status-live {
  color: var(--accent);
  background: rgba(158,243,106,0.12);
  border: 1px solid var(--accent-deep);
}
.bp-detail-status-done {
  color: var(--accent-deep);
  background: rgba(122,180,82,0.1);
  border: 1px solid var(--rule-2);
}
.bp-detail-status-pending {
  color: var(--ink-3);
  background: var(--bg-2);
  border: 1px solid var(--rule);
}
.bp-detail-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.bp-detail-pin {
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.bp-detail-close {
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
}
.bp-detail-close:hover { color: var(--ink); }

.bp-detail-summary {
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.bp-detail-files {
  padding: 0 12px 10px;
}
.bp-detail-files-head {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.bp-detail-file-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.bp-detail-file {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 2px;
  color: var(--ink);
  background: rgba(255,255,255,0.015);
}
.bp-detail-file:hover { background: rgba(158,243,106,0.06); }
.bp-detail-file-kind {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 2px 4px;
  border-radius: 2px;
  color: var(--ink-2);
  background: var(--bg-2);
  border: 1px solid var(--rule-2);
}
.bp-detail-file-kind-code, .bp-detail-file-kind-test {
  color: var(--accent);
  border-color: var(--accent-deep);
}
.bp-detail-file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.bp-detail-file-size {
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.bp-detail-foot {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px dashed var(--rule-2);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.bp-detail-btn-secondary,
.bp-detail-btn-primary {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bp-detail-btn-secondary {
  background: transparent;
  border: 1px solid var(--rule-2);
  color: var(--ink-2);
}
.bp-detail-btn-secondary:hover { color: var(--ink); border-color: var(--ink-3); }
.bp-detail-btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--on-accent);
}
.bp-detail-btn-primary:hover {
  filter: brightness(1.08);
}


/* ── Task Edit View ────────────────────────────────────── */
.tev {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  height: 720px;
  max-height: 80vh;
}

.tev-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-2);
  font-size: 11.5px;
}
.tev-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; overflow: hidden; }
.tev-crumb { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tev-crumb.is-current { color: var(--ink-2); }
.tev-crumb-sep { color: var(--rule); }
.tev-bar-right { display: flex; align-items: center; gap: 14px; }
.tev-progress {
  width: 90px; height: 3px; background: var(--rule-2); border-radius: 2px; overflow: hidden;
}
.tev-progress > span {
  display: block; width: 60%; height: 100%; background: var(--accent);
  box-shadow: 0 0 6px rgba(158,243,106,0.6);
}
.tev-bar-tabs { display: flex; gap: 2px; }
.tev-bar-tabs button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 5px 9px;
  cursor: pointer;
}
.tev-bar-tabs button.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 2px;
}
.tev-bar-tabs button:not(.is-active):hover { color: var(--ink); }

.tev-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1;
  min-height: 0;
}

/* Sidebar */
.tev-side {
  border-right: 1px solid var(--rule);
  background: var(--bg-2);
  display: flex; flex-direction: column;
  min-height: 0;
}
.tev-search {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 8px;
}
.tev-search-icon { color: var(--ink-3); font-size: 13px; }
.tev-search input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--rule-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 6px 8px;
  border-radius: 2px;
  outline: none;
}
.tev-search input::placeholder { color: var(--ink-3); }
.tev-search input:focus { border-color: var(--accent-deep); }

.tev-side-controls {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px 10px;
}
.tev-filter-row { display: flex; gap: 2px; flex: 1; }
.tev-filter {
  width: 22px; height: 22px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  border-radius: 2px;
  display: grid; place-items: center;
}
.tev-filter:hover { background: var(--bg-3); color: var(--ink); }
.tev-filter.is-active { color: var(--accent); border-color: var(--accent-deep); }
.tev-new {
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 9px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
}

.tev-tree {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 12px;
  font-size: 11.5px;
}

.tev-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.tev-row:hover { background: var(--bg-3); color: var(--ink); }
.tev-row.is-selected {
  background: rgba(158,243,106,0.10);
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}
.tev-row.is-branch { color: var(--ink); font-weight: 600; }
.tev-caret {
  font-size: 9px;
  color: var(--ink-3);
  transition: transform 0.15s;
  display: inline-block;
  width: 8px;
}
.tev-caret.is-open { transform: rotate(90deg); }
.tev-caret-spacer { display: inline-block; width: 8px; }
.tev-icon {
  width: 14px;
  text-align: center;
  font-size: 11px;
  flex-shrink: 0;
}
.tev-icon-extension { color: var(--accent); }
.tev-icon-bug { color: #f47d6b; }
.tev-icon-tag { color: #c4a85f; }
.tev-icon-folder { color: var(--ink-3); }
.tev-icon-doc { color: var(--ink-3); }
.tev-row-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.tev-side-foot {
  border-top: 1px solid var(--rule-2);
  padding: 8px 14px;
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Main */
.tev-main {
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.tev-tabs-row {
  border-bottom: 1px solid var(--rule);
  display: flex;
}
.tev-tabs { display: flex; }
.tev-tabs button {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
}
.tev-tabs button.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tev-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--rule-2);
  background: var(--bg-2);
}
.tev-titlebar-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.tev-task-icon { color: var(--accent); font-size: 12px; }
.tev-task-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tev-titlebar-right { display: flex; align-items: center; gap: 10px; }
.tev-save {
  background: transparent;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
}
.tev-save-disabled { opacity: 0.5; cursor: not-allowed; }

.tev-mode-tabs { display: flex; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.tev-mode-tabs button {
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 5px 10px;
  cursor: pointer;
  border-right: 1px solid var(--rule);
}
.tev-mode-tabs button:last-child { border-right: none; }
.tev-mode-tabs button.is-active {
  background: var(--accent);
  color: var(--on-accent);
}
.tev-mode-tabs button:not(.is-active):hover { color: var(--ink); }

.tev-exec {
  background: transparent;
  border: 1px dashed var(--rule);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 2px;
}
.tev-exec:hover { border-color: var(--accent-deep); color: var(--accent); }

.tev-doc {
  flex: 1;
  overflow-y: auto;
  padding: 22px 36px 16px;
  background: var(--bg);
}
.tev-doc-edit {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  max-width: 720px;
}
.tev-doc-line { display: block; }
.tev-doc-blank { height: 12px; }
.tev-md-h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: 4px;
}
.tev-md-h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin: 6px 0 2px;
  letter-spacing: 0.01em;
}
.tev-doc-edit code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-3);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid var(--rule-2);
}
.tev-doc-list { padding-left: 22px; margin: 4px 0; }
.tev-doc-list li { color: var(--ink-2); margin: 3px 0; font-size: 13px; }
.tev-doc-edit b { color: var(--ink); }

/* Properties drawer */
.tev-props {
  border-top: 1px solid var(--rule);
  background: var(--bg-2);
  flex-shrink: 0;
}
.tev-props-tabs {
  display: flex; align-items: center;
  padding: 6px 18px;
  border-bottom: 1px solid var(--rule-2);
}
.tev-props-tabs button {
  background: none;
  border: none;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  letter-spacing: 0.04em;
}
.tev-props-tabs button.is-active { color: var(--accent); }
.tev-props-spacer { flex: 1; }

.tev-props-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  padding: 12px 18px 14px;
}
.tev-field { display: flex; flex-direction: column; gap: 5px; }
.tev-field-label {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}
.tev-select {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--rule-2);
  color: var(--ink);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 2px;
  cursor: pointer;
}
.tev-select:hover { border-color: var(--ink-3); }
.tev-select-empty { color: var(--ink-3); }
.tev-select-empty span:first-child { color: var(--ink-3); }
.tev-select-caret { color: var(--ink-3); font-size: 9px; }

@media (max-width: 900px) {
  .tev-body { grid-template-columns: 1fr; }
  .tev-side { display: none; }
  .tev { height: auto; max-height: none; }
  .tev-doc { padding: 18px 18px 12px; }
}


/* BranchingPipeline — side-by-side layout when the detail card is open */
.bp-stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.bp-stage.has-detail {
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.9fr);
  align-items: start;
}
.bp-stage.has-detail .bp-detail { margin-top: 0; max-height: 100%; }

/* When stacked again on narrow widths, restore the original column layout */
@media (max-width: 720px) {
  .bp-stage.has-detail { grid-template-columns: 1fr; }
}


/* ── Approval gate node + amber-blocked state ────────── */
.status-dot.is-blocked { background: #e89c30; box-shadow: 0 0 0 3px rgba(232,156,48,0.22); animation: none; }
.bp-active.is-blocked { color: #e89c30; }

.bp-gate-shape {
  fill: var(--bg-2);
  stroke: var(--rule);
  stroke-width: 1;
  transform-origin: center;
  transition: fill 0.3s, stroke 0.3s;
}
.bp-gate-glyph {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  fill: var(--ink-3);
  text-anchor: middle;
  dominant-baseline: middle;
}
.bp-gate-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  fill: var(--ink-3);
  text-anchor: middle;
}

.bp-gate-blocked .bp-gate-shape {
  fill: rgba(232,156,48,0.16);
  stroke: #e89c30;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 8px rgba(232,156,48,0.55));
  animation: bp-gate-pulse 1.6s ease-in-out infinite;
}
.bp-gate-blocked .bp-gate-glyph { fill: #e89c30; }
.bp-gate-blocked .bp-gate-label { fill: #e89c30; }
@keyframes bp-gate-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(232,156,48,0.4)); }
  50%      { filter: drop-shadow(0 0 14px rgba(232,156,48,0.85)); }
}
.bp-gate-done .bp-gate-shape {
  fill: rgba(158,243,106,0.08);
  stroke: var(--accent-deep);
}
.bp-gate-done .bp-gate-glyph,
.bp-gate-done .bp-gate-label { fill: var(--ink); }
.bp-gate-pending .bp-gate-shape { fill: var(--bg); stroke: var(--rule); }

/* Gate detail card variant */
.bp-detail-gate { border-color: #c47a1f; }
.bp-detail-gate .bp-detail-head { background: rgba(232,156,48,0.08); }
.bp-detail-status-blocked {
  color: #e89c30;
  background: rgba(232,156,48,0.14);
  border: 1px solid #c47a1f;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
}
.bp-gate-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px 8px;
  font-size: 11px;
  border-bottom: 1px dashed var(--rule-2);
  margin-bottom: 8px;
}
.bp-gate-meta > div { display: flex; flex-direction: column; gap: 2px; }
.bp-gate-meta-k {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}
.bp-gate-meta-v { color: var(--ink-2); font-size: 11px; }

.bp-gate-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.bp-gate-btn {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bp-gate-btn-reject {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--danger-ink);
}
.bp-gate-btn-reject:hover { border-color: var(--danger-edge); color: var(--danger-edge); }
.bp-gate-btn-changes {
  background: transparent;
  border: 1px solid var(--warn-edge);
  color: var(--warn-ink);
}
.bp-gate-btn-changes:hover { background: rgba(232,156,48,0.1); }
.bp-gate-btn-approve {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--on-accent);
}
.bp-gate-btn-approve:hover { filter: brightness(1.1); }

.bp-legend-blocked { color: #e89c30; }

/* Tev — overlay tightening for the smaller 14px icons */
.tev-icon {
  position: relative;
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tev-icon .tree-overlay {
  position: absolute;
  right: -3px; bottom: -3px;
  width: 9px; height: 9px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--bg-2);
}
.tev-row.is-selected .tev-icon .tree-overlay { border-color: var(--bg-3); }

.tev-task-icon {
  position: relative;
  display: inline-flex;
}
.tev-task-icon .tree-overlay {
  position: absolute;
  right: -3px; bottom: -3px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-2);
}

.tev-exec {
  display: inline-flex; align-items: center; gap: 6px;
}


/* ── Comment-driven additions ───────────────────────── */

/* Branching pipeline: per-node duration label */
.bp-node-duration {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  fill: var(--ink-3);
  text-anchor: middle;
}
.bp-node-live .bp-node-duration { fill: var(--accent); font-weight: 700; }
.bp-node-done .bp-node-duration { fill: var(--ink-2); }
.bp-gate-blocked .bp-node-duration { fill: #e89c30; font-weight: 700; }

/* Simplified legend: filename + SHA */
.bp-legend-file {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.bp-legend-sep { color: var(--ink-3); margin: 0 4px; }
.bp-legend-sha {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
  border-bottom: 1px dashed var(--accent-deep);
  padding-bottom: 1px;
  cursor: pointer;
}
.bp-legend-sha:hover { color: var(--ink); border-color: var(--ink); }

/* Run / dropdown split-button */
.tev-exec-wrap { position: relative; display: inline-flex; }
.tev-exec-play {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  border-right: 1px solid rgba(12,13,10,0.25);
  border-radius: 2px 0 0 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 5px 11px;
  cursor: pointer;
}
.tev-exec-play:hover { filter: brightness(1.08); }
.tev-exec-play-icon { font-size: 9px; line-height: 1; transform: translateY(-0.5px); }

.tev-exec-menu {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--accent);
  border-left: none;
  border-radius: 0 2px 2px 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  cursor: pointer;
}
.tev-exec-menu:hover { background: var(--bg-2); }
.tev-exec-caret { color: var(--ink-3); font-size: 9px; margin-left: 2px; }

.tev-exec-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 280px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  z-index: 30;
  padding: 4px 0;
  font-family: var(--font-mono);
}
.tev-exec-pop-head {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 8px 12px 4px;
}
.tev-exec-pop-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 7px 12px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.tev-exec-pop-item:hover { background: var(--bg-2); }
.tev-exec-pop-item.is-selected { background: rgba(158,243,106,0.08); }
.tev-exec-pop-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
}
.tev-exec-pop-item.is-selected .tev-exec-pop-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(158,243,106,0.18); }
.tev-exec-pop-name { flex: 1; }
.tev-exec-pop-meta { font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; }
.tev-exec-pop-foot {
  border-top: 1px dashed var(--rule-2);
  margin-top: 4px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--ink-3);
  cursor: pointer;
}
.tev-exec-pop-foot:hover { color: var(--accent); }

/* Folder children: visible indent guide line */
.tev-tree-children {
  position: relative;
}
.tev-tree-children::before {
  content: '';
  position: absolute;
  top: 0; bottom: 4px;
  /* Aligns the guide rail under the folder caret of the parent row */
  left: calc(10px + var(--tev-depth, 0) * 22px + 4px);
  width: 1px;
  background: var(--rule);
  pointer-events: none;
}


/* ── TaskEditView embedded inside AppShell — no double chrome ─ */
.appshell-body .tev.tev-embedded {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: auto;
  max-height: none;
  flex: 1 1 auto;
  width: 100%;
  background: transparent;
}
/* Sidebar is owned by .tev-side; appshell-body is grid-stretchy. */
.appshell-body > .tev.tev-embedded {
  min-width: 0;
}

/* When TaskEditView is embedded as the sole body child, span the grid. */
.appshell-body:has(> .tev.tev-embedded) {
  grid-template-columns: 1fr;
}


/* TaskEditView activity panel — stacks PR + Event Timeline cards. */
.tev-activity {
  display: flex; flex-direction: column;
  gap: 16px;
  padding: 16px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.tev-activity .appsec {
  margin: 0;
}
