:root {
  --bg: #FEFDFB;
  --surface: #FFFFFF;
  --surface-2: #F7F4EF;
  --surface-3: #EFEAE2;
  --fg: #1A1410;
  --fg-2: #4A4440;
  --fg-3: #8B8580;
  --line: #E8E2D8;
  --line-2: #D4CFC6;
  --accent: #00FF87;
  --accent-ink: #0B3D22;
  --accent-soft: rgba(0, 255, 135, .12);
  --hot: #FB7185;
  --warm: #F59E0B;
  --cold: #3B82F6;

  --display: "Syne", "Inter", system-ui, sans-serif;
  --body: "Instrument Sans", "Inter", system-ui, sans-serif;
  --mono: "DM Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;

  --radius: 8px;
  --radius-sm: 4px;
  --shadow-1: 0 1px 2px rgba(26,20,16,.04), 0 0 0 1px var(--line);
  --shadow-2: 0 2px 8px rgba(26,20,16,.06), 0 0 0 1px var(--line);
  --shadow-lift: 0 16px 40px rgba(26,20,16,.10), 0 0 0 1px var(--line-2);

  --side-w: 272px;
  --top-h: 56px;
}

[data-theme="dark"] {
  --bg: #141210;
  --surface: #1B1815;
  --surface-2: #201D1A;
  --surface-3: #2A2622;
  --fg: #F5EFE5;
  --fg-2: #B8B1A5;
  --fg-3: #7A736B;
  --line: #2F2A24;
  --line-2: #3D372F;
  --accent-ink: #00FF87;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 0 0 1px var(--line);
  --shadow-2: 0 2px 8px rgba(0,0,0,.4), 0 0 0 1px var(--line);
  --shadow-lift: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px var(--line-2);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1,h2,h3,h4 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
kbd {
  font-family: var(--mono); font-size: 10px;
  padding: 2px 5px; border-radius: 3px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--fg-2);
}
.mono-inline { font-family: var(--mono); font-size: 0.92em; color: var(--fg-2); }

/* ---------- Shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  grid-template-rows: 100%;
  height: 100vh;
  min-height: 100vh;
  background: var(--bg);
}
.main {
  display: grid;
  grid-template-rows: var(--top-h) 1fr;
  overflow: hidden;
  border-left: 1px solid var(--line);
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex; flex-direction: column;
  background: var(--surface-2);
  padding: 14px 12px 10px;
  gap: 4px;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--fg); color: var(--bg);
  display: grid; place-items: center;
}
.brand-wordmark {
  font-family: var(--display); font-weight: 800; font-size: 14px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-family: var(--mono); font-size: 10px; color: var(--fg-3);
  letter-spacing: .04em;
}
.side-section { margin: 12px 0 4px; }
.side-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-3);
  padding: 0 8px 8px;
}
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 5px;
  color: var(--fg-2); font-size: 13.5px;
  text-align: left;
}
.nav-item:hover { background: var(--surface-3); color: var(--fg); }
.nav-item.active {
  background: var(--fg); color: var(--bg);
}
.nav-item.active .nav-hint { color: rgba(255,255,255,.5); }
.nav-label { flex: 1; font-weight: 500; }
.nav-hint { font-family: var(--mono); font-size: 10px; color: var(--fg-3); }

.venture {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 5px;
}
.venture:hover { background: var(--surface-3); }
.v-body { min-width: 0; }
.v-name { font-size: 12.5px; font-weight: 600; color: var(--fg); }
.v-phase { font-family: var(--mono); font-size: 10px; color: var(--fg-3); margin-top: 1px; }
.v-bar { height: 2px; background: var(--surface-3); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.v-fill { height: 100%; border-radius: 2px; transition: width .3s; }
.v-mrr { font-family: var(--mono); font-size: 11px; color: var(--fg-2); }

.cmd-list { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.cmd-item code {
  font-family: var(--mono); font-size: 11px; color: var(--fg-2);
  padding: 4px 8px; border-radius: 3px;
  display: block;
}
.cmd-item:hover code { background: var(--surface-3); color: var(--fg); }

.side-footer {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-top: 1px solid var(--line);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--fg); color: var(--bg);
  font-family: var(--display); font-weight: 700; font-size: 11px;
  display: grid; place-items: center;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  margin-left: auto;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px;
  color: var(--fg-3);
}
.crumb { color: var(--fg); }
.cmd-trigger {
  flex: 1; max-width: 480px;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg-3);
  font-size: 12.5px;
  margin: 0 auto;
}
.cmd-trigger span { flex: 1; text-align: left; }
.cmd-trigger:hover { border-color: var(--line-2); background: var(--surface-3); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative;
  width: 32px; height: 32px; border-radius: 6px;
  display: grid; place-items: center;
  color: var(--fg-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 14px; height: 14px; border-radius: 7px;
  background: var(--hot); color: white;
  font-family: var(--mono); font-size: 9px;
  display: grid; place-items: center; padding: 0 3px;
}
.pill-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--fg-2);
}

/* ---------- Content area ---------- */
.content {
  overflow-y: auto;
  background: var(--bg);
}
.view {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 48px 80px;
}
.view-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 32px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-3);
  margin-bottom: 10px;
}
.display {
  font-size: 44px; line-height: 1.05; letter-spacing: -0.03em;
  text-wrap: balance;
  margin-bottom: 10px;
}
.display-dim { color: var(--fg-3); font-weight: 600; }
.lede {
  font-size: 16px; color: var(--fg-2);
  max-width: 60ch; text-wrap: pretty;
}
.lede strong { color: var(--fg); font-weight: 600; }

.head-stats { display: flex; gap: 32px; }
.stat { text-align: right; }
.stat-num {
  font-family: var(--display); font-weight: 700;
  font-size: 28px; letter-spacing: -0.02em;
  color: var(--fg);
}
.stat-unit { font-size: 14px; color: var(--fg-3); }
.stat-lbl {
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-3); letter-spacing: .08em;
  text-transform: uppercase;
}
.head-actions { display: flex; gap: 8px; }

/* ---------- Cards ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card-wide { grid-column: 1 / -1; }
.card-hero { grid-row: span 2; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 18px; font-weight: 700; }
.head-meta {
  font-family: var(--mono); font-size: 11px; color: var(--fg-3);
}
.card-cta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--fg-2); font-size: 12px; font-weight: 500;
  font-family: var(--mono);
}
.card-cta:hover { color: var(--accent-ink); }

/* Focus block */
.focus-block { margin-bottom: 20px; }
.focus-line {
  display: grid; grid-template-columns: 100px 1fr;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.focus-line:last-child { border-bottom: 0; }
.focus-k {
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-3); letter-spacing: .08em; text-transform: uppercase;
  align-self: center;
}

/* Timeline */
.timeline {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.tl-row {
  display: grid;
  grid-template-columns: 52px 14px 1fr auto;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: var(--fg-2);
  position: relative;
}
.tl-t { font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
.tl-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--surface-3);
  border: 1.5px solid var(--line-2);
  justify-self: center;
  position: relative;
  z-index: 1;
}
.tl-row:not(:last-child) .tl-dot::after {
  content: ""; position: absolute; top: 100%;
  left: 50%; transform: translateX(-50%);
  width: 1px; height: 18px; background: var(--line);
}
.tl-row.done .tl-dot { background: var(--fg); border-color: var(--fg); }
.tl-row.done { color: var(--fg-3); text-decoration: line-through; }
.tl-row.now .tl-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-row.now { color: var(--fg); font-weight: 600; }
.tl-row.flag .tl-dot { background: var(--warm); border-color: var(--warm); }
.tl-status {
  font-family: var(--mono); font-size: 10px;
  padding: 2px 6px; border-radius: 3px;
  background: var(--surface-3); color: var(--fg-2);
  letter-spacing: .08em;
}
.tl-now { background: var(--accent); color: var(--accent-ink); }
.tl-flag { background: rgba(245,158,11,.15); color: #7A4A00; }

/* Hot list */
.hot-list { display: flex; flex-direction: column; }
.hot-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  gap: 16px;
}
.hot-row:last-child { border-bottom: 0; }
.hot-name { font-weight: 600; font-size: 14px; }
.hot-sub { font-family: var(--mono); font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.hot-right { text-align: right; }
.hot-val { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.hot-prob {
  font-family: var(--mono); font-size: 10px;
  color: var(--accent-ink); background: var(--accent-soft);
  padding: 1px 6px; border-radius: 3px;
  display: inline-block; margin-top: 4px;
}

/* Moved grid */
.moved-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.moved-k {
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-3); letter-spacing: .1em; text-transform: uppercase;
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.moved-list { margin: 0; padding: 0; list-style: none; }
.moved-list li {
  padding: 6px 0 6px 14px;
  font-size: 13px; color: var(--fg-2);
  position: relative;
}
.moved-list li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 5px; height: 1px; background: var(--line-2);
}
.moved-col:nth-child(1) .moved-k { color: var(--accent-ink); }
.moved-col:nth-child(1) .moved-list li::before { background: var(--accent); }

/* Anti */
.anti-list { display: flex; flex-direction: column; gap: 12px; }
.anti-row { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.anti-icon {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: grid; place-items: center;
  font-size: 14px; color: var(--fg-3);
  flex-shrink: 0;
}
.anti-t { font-weight: 600; font-size: 13.5px; }
.anti-d { font-size: 12.5px; color: var(--fg-3); margin-top: 2px; }

/* Brief card */
.card-brief { background: var(--fg); color: var(--bg); }
.card-brief .card-head { border-bottom-color: rgba(255,255,255,.1); }
.card-brief .card-head h3 { color: var(--bg); }
.card-brief .head-meta { color: rgba(255,255,255,.4); }
.brief-body { display: flex; flex-direction: column; gap: 14px; }
.brief-body p { font-size: 15px; line-height: 1.55; color: rgba(255,255,255,.85); text-wrap: pretty; }
.brief-body strong { color: var(--accent); font-weight: 600; }
.brief-body .mono-inline { color: var(--accent); }
.brief-foot {
  padding-top: 12px; margin-top: 4px;
  border-top: 1px dashed rgba(255,255,255,.15);
  font-size: 13px !important;
  color: rgba(255,255,255,.6) !important;
}

/* ---------- Pipeline / Kanban ---------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  align-items: start;
}
.kan-col {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 400px;
}
.kan-head {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  align-items: center;
  padding: 2px 6px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.kan-title {
  font-family: var(--display); font-weight: 700; font-size: 13px;
  letter-spacing: -0.01em;
}
.kan-count {
  font-family: var(--mono); font-size: 10px;
  background: var(--surface-3); padding: 2px 6px; border-radius: 3px;
  color: var(--fg-2);
}
.kan-sum { font-family: var(--mono); font-size: 10px; color: var(--fg-3); }
.kan-body { display: flex; flex-direction: column; gap: 10px; }
.kan-empty {
  font-family: var(--mono); font-size: 11px;
  color: var(--fg-3); text-align: center;
  padding: 24px 0;
}
.lead-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
  transition: all .15s ease-out;
}
.lead-card:hover {
  border-color: var(--line-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,20,16,.06);
}
.lead-card.is-selected {
  border-color: var(--fg);
  box-shadow: 0 0 0 1px var(--fg);
}
.lead-card.heat-hot { border-left: 3px solid var(--hot); }
.lead-card.heat-warm { border-left: 3px solid var(--warm); }
.lead-card.heat-cold { border-left: 3px solid var(--cold); }

.lc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.lc-name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.lc-kind { font-family: var(--mono); font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .06em; }
.lc-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.lc-row .mono-inline { font-size: 13px; color: var(--fg); font-weight: 500; }
.lc-prob { font-family: var(--mono); font-size: 11px; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 6px; border-radius: 3px; }
.lc-bar { height: 2px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.lc-fill { height: 100%; background: var(--fg); }
.lc-foot { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--fg-3); }
.lc-next {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--fg-2);
}

.ghost-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg-2); font-size: 12.5px;
}
.ghost-btn:hover { border-color: var(--line-2); color: var(--fg); }
.primary-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 5px;
  background: var(--fg); color: var(--bg);
  font-size: 13px; font-weight: 600;
  transition: transform .15s, box-shadow .15s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,255,135,.18); }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Braindump ---------- */
.bd-grid {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px;
  align-items: start;
}
.bd-editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.bd-ed-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.bd-ed-stats { font-family: var(--mono); font-size: 10px; color: var(--fg-3); display: flex; gap: 6px; }
.bd-editor textarea {
  width: 100%; min-height: 220px; resize: vertical;
  padding: 18px;
  background: transparent; border: 0; outline: 0;
  font-family: var(--body); font-size: 15px; line-height: 1.6;
  color: var(--fg);
}
.bd-ed-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.bd-hints { font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
.bd-hints kbd { margin: 0 2px; }

.bd-context {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.bd-ctx-head {
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-3); letter-spacing: .1em; text-transform: uppercase;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.bd-ctx-list { display: flex; flex-direction: column; gap: 6px; }
.bd-ctx-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}
.bd-ctx-row span:nth-child(2) { font-family: var(--mono); font-size: 12px; color: var(--fg); }

.bd-right {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 440px;
  display: flex; flex-direction: column;
}
.bd-empty {
  flex: 1;
  display: flex; flex-direction: column; gap: 12px;
  align-items: flex-start; justify-content: center;
  color: var(--fg-3); font-size: 13.5px;
  max-width: 36ch;
}
.bd-empty-icon {
  font-family: var(--mono); font-size: 20px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
}
.bd-loading { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.bd-step {
  font-family: var(--mono); font-size: 12.5px; color: var(--fg-2);
  display: flex; align-items: center; gap: 10px;
  opacity: 0; animation: fadeUp .4s ease-out forwards;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.bd-step-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.spinner {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.3); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.bd-result { display: flex; flex-direction: column; gap: 14px; }
.bd-sect {}
.bd-sect-k {
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-3); letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 6px;
}
.bd-sect-v { font-size: 14.5px; line-height: 1.5; color: var(--fg); text-wrap: pretty; }
.bd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-chip {
  font-family: var(--mono); font-size: 11px;
  padding: 3px 8px; border-radius: 3px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--fg-2);
}
.bd-chip-link { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.bd-actions { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--fg-2); }
.bd-actions li { padding: 3px 0; }
.bd-goal { font-size: 13px; color: var(--fg-2); font-style: italic; }
.bd-save { align-self: flex-start; margin-top: 6px; }

/* ---------- Decisions ---------- */
.dec-ledger {
  max-width: 880px;
  margin: 0 auto;
  display: flex; flex-direction: column;
}
.dec-row {
  display: grid;
  grid-template-columns: 80px 36px 1fr;
  gap: 16px;
  padding: 4px 0;
}
.dec-date {
  text-align: right;
  padding: 12px 0;
  border-right: 0;
}
.dec-day { font-family: var(--display); font-weight: 800; font-size: 32px; letter-spacing: -0.02em; }
.dec-mo { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--fg-3); }
.dec-yr { font-family: var(--mono); font-size: 10px; color: var(--fg-3); }
.dec-gutter {
  position: relative;
  display: flex; justify-content: center;
}
.dec-node {
  position: absolute; top: 18px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--fg);
  z-index: 1;
}
.dec-line {
  width: 1px; flex: 1;
  background: var(--line-2);
  margin-top: 28px; margin-bottom: -12px;
}
.dec-row:last-child .dec-line { display: none; }
.dec-body {
  padding: 12px 0 28px;
}
.dec-head-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dec-head-row h3 { font-size: 20px; letter-spacing: -0.015em; }
.dec-body p { font-size: 15px; color: var(--fg-2); line-height: 1.55; text-wrap: pretty; max-width: 62ch; }
.dec-meta {
  margin-top: 10px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--fg-3);
  display: flex; gap: 6px; flex-wrap: wrap;
}

/* ---------- Learnings ---------- */
.learn-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.learn-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 180px;
  display: flex; flex-direction: column; gap: 10px;
}
.learn-head { display: flex; justify-content: space-between; align-items: center; }
.learn-card h3 { font-size: 18px; line-height: 1.25; }
.learn-card p { font-size: 13.5px; color: var(--fg-2); line-height: 1.5; }
.learn-empty { border-style: dashed; background: transparent; color: var(--fg-3); }
.learn-empty h3 { color: var(--fg-2); font-weight: 600; }

/* ---------- Command Palette ---------- */
.cmd-overlay {
  position: fixed; inset: 0;
  background: rgba(26,20,16,.28);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: grid;
  place-items: start center;
  padding-top: 14vh;
  animation: fadeIn .15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.cmd-palette {
  width: 640px; max-width: 92vw;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  animation: palettePop .2s cubic-bezier(.3,.9,.4,1.2);
}
@keyframes palettePop {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cmd-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.cmd-input-row input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-family: var(--body); font-size: 16px; color: var(--fg);
}
.cmd-results { max-height: 420px; overflow-y: auto; padding: 6px; }
.cmd-result {
  width: 100%;
  display: grid; grid-template-columns: 24px 1fr auto auto; gap: 10px;
  align-items: center;
  padding: 9px 10px; border-radius: 5px;
  text-align: left;
  font-size: 13.5px;
}
.cmd-result:hover { background: var(--surface-2); }
.cmd-type {
  width: 22px; height: 22px; border-radius: 4px;
  display: grid; place-items: center;
  font-size: 12px;
  background: var(--surface-2); color: var(--fg-2);
}
.cmd-type-cmd { background: var(--fg); color: var(--accent); }
.cmd-type-lead { background: var(--accent-soft); color: var(--accent-ink); }
.cmd-type-view { background: var(--surface-3); color: var(--fg-2); }
.cmd-label { font-weight: 500; font-family: var(--mono); font-size: 13px; }
.cmd-desc { font-size: 12px; color: var(--fg-3); }
.cmd-kind {
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-3);
  padding: 2px 6px; border-radius: 3px;
  background: var(--surface-2);
}
.cmd-empty { padding: 24px; color: var(--fg-3); font-size: 13px; text-align: center; }
.cmd-foot {
  display: flex; gap: 16px; align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11px; color: var(--fg-3);
}
.cmd-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Tweaks Panel ---------- */
.tweaks {
  position: fixed; bottom: 20px; right: 20px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: var(--shadow-lift);
  z-index: 80;
  overflow: hidden;
}
.tw-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: var(--fg); color: var(--bg);
  font-family: var(--display); font-weight: 700; font-size: 13px;
  letter-spacing: .02em;
}
.tw-head button { color: var(--bg); opacity: .6; }
.tw-head button:hover { opacity: 1; }
.tw-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.tw-row { display: flex; flex-direction: column; gap: 6px; }
.tw-label {
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-3); letter-spacing: .1em; text-transform: uppercase;
}
.tw-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.tw-opt {
  flex: 1; min-width: 0;
  padding: 6px 10px; border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg-2);
  font-size: 12px;
  font-family: var(--mono);
  text-align: center;
}
.tw-opt.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tw-swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform .15s;
}
.tw-swatch:hover { transform: scale(1.08); }
.tw-swatch.active { border-color: var(--fg); box-shadow: 0 0 0 1px var(--bg) inset; }

/* ---------- Cockpit ---------- */
.cockpit .display { font-size: 48px; }
.cap-flow { margin-bottom: 24px; }
.flow-viz {
  display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 16px;
  align-items: center;
  min-height: 180px;
}
.fs-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-3);
  margin-bottom: 12px;
}
.fs-ventures { display: flex; flex-direction: column; gap: 10px; }
.fs-chip {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-weight: 600; font-size: 13.5px;
}
.fs-val { font-family: var(--mono); font-size: 13px; color: var(--fg-2); font-weight: 500; }
.fs-neg { color: var(--hot); }
.flow-sink .fs-chip { background: transparent; border-style: dashed; }
.cap-delta {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 24px;
}
.cap-d-row { display: flex; align-items: center; gap: 10px; }
.cap-d-k { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.cap-d-v { font-family: var(--mono); font-size: 13px; color: var(--fg); font-weight: 500; }
.cap-d-warn { color: var(--warm); }

.vent-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 24px;
}
.vent-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--vc);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.vc-head { display: flex; align-items: center; gap: 8px; }
.vc-dot { width: 10px; height: 10px; border-radius: 50%; }
.vc-name { font-family: var(--display); font-weight: 700; font-size: 15px; flex: 1; letter-spacing: -0.01em; }
.vc-phase { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.vc-north { padding: 10px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.vc-k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); display: block; margin-bottom: 4px; }
.vc-v { font-size: 13px; color: var(--fg); font-weight: 500; }
.vc-progress {}
.vc-pbar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.vc-pfill { height: 100%; border-radius: 3px; }
.vc-pmeta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); margin-top: 4px; }
.vc-metrics { display: flex; flex-direction: column; gap: 8px; }
.vc-metric { padding: 8px 10px; background: var(--surface-2); border-radius: 4px; }
.vc-metric.urgent { background: rgba(245,158,11,.1); border-left: 2px solid var(--warm); }
.vc-mk { font-family: var(--mono); font-size: 9.5px; color: var(--fg-3); letter-spacing: .08em; text-transform: uppercase; }
.vc-mv { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.vc-mt { font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); }
.vc-foot { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.vc-agent { display: flex; gap: 6px; align-items: flex-start; font-family: var(--mono); font-size: 10.5px; color: var(--fg-2); line-height: 1.4; }
.vc-agent-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; animation: pulse 1.4s infinite; }

.cockpit-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 24px; }

.git-branch-info { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px dashed var(--line); }
.git-branch-info .mono-inline { font-size: 11px; }
.git-sep { color: var(--fg-3); }
.git-sync { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: 3px; }
.git-rows { display: flex; flex-direction: column; }
.git-row { display: grid; grid-template-columns: 70px auto 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.git-row:last-child { border-bottom: 0; }
.git-hash { font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); }
.git-agent { font-family: var(--mono); font-size: 10px; padding: 2px 7px; border-radius: 3px; background: var(--surface-2); color: var(--fg-2); letter-spacing: .04em; }
.git-agent-synapse { background: var(--accent-soft); color: var(--accent-ink); }
.git-agent-triage { background: rgba(59,130,246,.12); color: #1E3A6B; }
.git-agent-proposal-factory { background: rgba(167,139,250,.14); color: #3B2170; }
.git-agent-natasha { background: var(--fg); color: var(--bg); }
.git-agent-egregore { background: rgba(245,158,11,.14); color: #7A4A00; }
.git-msg { font-family: var(--mono); font-size: 11.5px; color: var(--fg); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.git-when { font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); }
.git-foot { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--fg-3); }

.agent-list { display: flex; flex-direction: column; gap: 12px; }
.agent-row { display: grid; grid-template-columns: 12px 1fr; gap: 10px; align-items: flex-start; padding: 4px 0; }
.agent-pulse { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--fg-3); }
.agent-pulse-accent { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 1.5s infinite; }
.agent-pulse-warm { background: var(--warm); }
.agent-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.agent-status { font-family: var(--mono); font-size: 10px; color: var(--fg-3); background: var(--surface-2); padding: 1px 6px; border-radius: 3px; letter-spacing: .04em; font-weight: 400; }
.agent-detail { font-family: var(--mono); font-size: 11px; color: var(--fg-3); margin-top: 3px; line-height: 1.4; }

.guardrail { margin-bottom: 24px; }
.guard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.guard-item { display: grid; grid-template-rows: auto auto auto 1fr; gap: 6px; padding: 14px; background: var(--surface-2); border-radius: 6px; border: 1px dashed var(--line-2); }
.guard-rule { font-family: var(--mono); font-size: 11.5px; color: var(--fg); padding: 6px 10px; background: var(--surface); border-radius: 3px; border-left: 2px solid var(--fg-3); }
.guard-arrow { font-family: var(--mono); color: var(--fg-3); padding-left: 4px; }
.guard-block { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: #8B1E3F; background: rgba(251,113,133,.12); padding: 4px 8px; border-radius: 3px; display: inline-block; width: fit-content; }
.guard-prompt { font-size: 12.5px; color: var(--fg-2); font-style: italic; line-height: 1.45; padding-top: 4px; text-wrap: pretty; }

.signals { }
.sig-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.sig-cell { display: flex; flex-direction: column; gap: 6px; }
.sig-k { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.sig-v { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; }
.sig-u { font-size: 13px; color: var(--fg-3); font-weight: 500; }
.sig-bar { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.sig-fill { height: 100%; background: var(--accent); }
.sig-dist { display: flex; gap: 1px; height: 4px; border-radius: 2px; overflow: hidden; background: var(--surface-3); }
.sig-note { font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); }

/* Density: compact */
[data-density="compact"] .view { padding: 24px 32px 60px; }
[data-density="compact"] .display { font-size: 34px; }
[data-density="compact"] .card { padding: 16px; }
[data-density="compact"] .view-head { margin-bottom: 20px; padding-bottom: 16px; }

/* ========== PROPOSAL FACTORY ========== */
.pf-view { }
.pf-steps {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.pf-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-3);
  font-weight: 500;
  opacity: 0.6;
}
.pf-step.active {
  opacity: 1;
  color: var(--accent);
}
.pf-step.done {
  opacity: 0.7;
  color: var(--accent);
}
.pf-step-n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--fg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}
.pf-step.active .pf-step-n {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.pf-step.done .pf-step-n {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

/* Step 1: Lead grid */
.pf-lead-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.pf-lead-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms ease-out;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
}
.pf-lead-card:hover {
  border-color: var(--fg-2);
  background: var(--surface-2);
}
.pf-lead-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pf-lc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pf-lc-name {
  font-weight: 600;
  color: var(--fg);
}
.pf-lc-kind {
  font-size: 12px;
  color: var(--fg-2);
}
.pf-lc-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--mono);
}
.pf-lc-last {
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 4px;
}
.pf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.pf-foot-l {
  font-size: 13px;
  color: var(--fg-2);
}
.pf-hint {
  color: var(--fg-3);
}

/* Step 2: Template picker */
.pf-lead-banner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px;
  background: var(--surface-2);
  border-radius: 8px;
  margin-bottom: 24px;
}
.pf-lb-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  margin-top: 4px;
}
.pf-lb-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-3);
  font-family: var(--mono);
}

.pf-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.pf-tpl {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms ease-out;
  font-family: inherit;
  text-align: left;
}
.pf-tpl:hover {
  border-color: var(--fg-2);
  background: var(--surface-2);
}
.pf-tpl.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pf-tpl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pf-tpl-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--fg);
}
.pf-tpl-price {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.pf-tpl-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-2);
}
.pf-tpl-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--mono);
}
.pf-tpl-calc {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--fg-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pf-calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-family: var(--mono);
}
.pf-calc-total {
  border-top: 1px solid var(--fg-3);
  padding-top: 6px;
  margin-top: 6px;
  font-weight: 600;
  color: var(--accent);
}
.pf-calc-dim {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 400;
}

.pf-drafting {
  margin: 20px 0;
  padding: 20px;
  background: var(--surface-2);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.bd-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-2);
  margin-bottom: 8px;
  animation: slideIn 400ms ease-out;
}
.bd-step:last-child { margin-bottom: 0; }
.bd-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Step 3: Review draft */
.pf-review-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  margin-bottom: 24px;
}
.pf-proposal {
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 900px;
  font-size: 14px;
  line-height: 1.6;
}
.pf-pdoc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.pf-pdoc-to {
  font-size: 12px;
  color: var(--fg-2);
  margin-top: 8px;
}
.pf-pdoc-logo {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: right;
  line-height: 1.2;
}
.pf-pdoc-sub {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}
.pf-pdoc-subject {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg-3);
  margin-bottom: 24px;
}
.pf-pdoc-sect {
  margin-bottom: 24px;
}
.pf-pdoc-sect h2 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--fg);
  line-height: 1.3;
}
.pf-pdoc-sect p {
  margin: 0 0 12px 0;
  color: var(--fg-2);
}
.pf-pdoc-k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-3);
  margin-bottom: 8px;
}
.pf-pdoc-pkg {
  padding: 12px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  margin: 12px 0;
  border-radius: 4px;
}
.pf-pdoc-pkg-name {
  font-weight: 600;
  color: var(--fg);
}
.pf-pdoc-pkg-dur {
  font-size: 12px;
  color: var(--fg-2);
  margin-top: 4px;
  font-family: var(--mono);
}
.pf-pdoc-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.pf-pdoc-list li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
  color: var(--fg-2);
}
.pf-pdoc-list li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}
.pf-pdoc-pricing {
  background: var(--surface-2);
  padding: 18px;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}
.pf-price-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}
.pf-price-total {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
  font-weight: 600;
  color: var(--accent);
}
.pf-price-note {
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--mono);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.pf-pdoc-cta {
  background: var(--surface-2);
  padding: 24px;
  border-radius: 6px;
  text-align: center;
  margin-top: 24px;
}
.pf-cta-text {
  font-size: 14px;
  margin: 0 0 16px 0;
  font-weight: 500;
}
.pf-sign-btn {
  padding: 12px 32px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 200ms ease-out;
  font-family: inherit;
}
.pf-sign-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 255, 135, 0.3);
}
.pf-sign-btn.signed {
  background: var(--fg-3);
  color: var(--bg);
  cursor: default;
}
.pf-pdoc-foot {
  font-size: 10px;
  color: var(--fg-3);
  text-align: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.pf-meta {
  padding: 18px;
  background: var(--surface-2);
  border-radius: 8px;
  height: fit-content;
  position: sticky;
  top: 80px;
}
.bd-ctx-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-3);
  margin-bottom: 12px;
}
.pf-meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--fg-2);
}
.pf-meta-row span:first-child {
  opacity: 0.7;
}
.pf-commit {
  padding: 12px;
  background: var(--surface);
  border-radius: 4px;
  border-left: 2px solid var(--accent);
  margin-bottom: 16px;
}
.pf-commit-file {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg);
  word-break: break-all;
  line-height: 1.4;
  margin-bottom: 4px;
}
.pf-commit-msg {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-2);
  margin-bottom: 4px;
}
.pf-commit-agent {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--fg-3);
}
.pf-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Step 4: Success */
.pf-success {
  text-align: center;
  padding: 40px 32px;
}
.pf-success-icon {
  font-size: 60px;
  margin-bottom: 16px;
}
.pf-success-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.pf-success-card {
  padding: 20px;
  background: var(--surface-2);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pf-sc-k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
}

.pf-error {
  padding: 20px;
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: 8px;
  color: #8B1E3F;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Buttons */
.primary-btn {
  padding: 12px 24px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 200ms ease-out;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 255, 135, 0.3);
}
.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ghost-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--fg-2);
  cursor: pointer;
  transition: all 200ms ease-out;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ghost-btn:hover {
  border-color: var(--fg);
  color: var(--fg);
  background: var(--surface-2);
}
