/* ==========================================================================
   Bodhi — dark ask-first design system (from Claude Design round 2, 1c)
   Tokens: bg #0E1116 · panel #171B22 · line #2C323B · divider #22262E
   accent #7B7BFF · amber #D9A15C · green #1FA36B · orange #E2703A
   Fonts: Geist (UI) + Newsreader (display serif)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;1,6..72,300&display=swap");

:root {
  --bg: #0e1116;
  --panel: #171b22;
  --panel-deep: #151920;
  --panel-drawer: #131820;
  --line: #2c323b;
  --divider: #22262e;
  --text: #ffffff;
  --text-2: #c7cdd5;
  --text-3: #8b939e;
  --text-4: #5f6773;
  --label: #6b7480;
  --accent: #7b7bff;
  --amber: #d9a15c;
  --amber-bg: #241c12;
  --amber-line: #4a3520;
  --green: #1fa36b;
  --green-bg: #122019;
  --green-line: #2a4a38;
  --orange: #e2703a;
  --orange-bg: #241611;
  --orange-line: #4a2d20;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button { font-family: var(--sans); cursor: pointer; }
input, textarea, select { font-family: var(--sans); }
a { color: var(--accent); text-decoration: none; }

/* ---------- shell ---------- */

.shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  color: var(--text-3);
  font-size: 12.5px;
  gap: 18px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); }
.brand-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--accent); }
.brand span { font-size: 13.5px; font-weight: 500; }
.topbar-status { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar-status .sep { color: var(--text-4); }
.topbar-status .strong { color: var(--text-2); }

.role-switch {
  display: flex;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px;
}
.role-switch button {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 99px;
}
.role-switch button.active { background: var(--line); color: var(--text); }

.status-pills { display: flex; gap: 8px; }
.status-pills span {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--text-3);
  cursor: default;
}
.status-pills span.on { color: var(--green); border-color: var(--green-line); background: var(--green-bg); }
.status-pills span.warn { color: var(--amber); border-color: var(--amber-line); background: var(--amber-bg); }

/* ---------- home (rep) ---------- */

.home-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 24px 60px 40px;
}

.greeting {
  font-family: var(--serif);
  font-size: 19px;
  font-style: italic;
  font-weight: 300;
  color: var(--text-3);
  text-align: center;
}

.ask-hero {
  width: min(760px, 92vw);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px 8px 24px;
  transition: border-color 0.15s ease;
}
.ask-hero:focus-within { border-color: #3d4450; }
.ask-hero .glyph { color: var(--accent); font-size: 17px; }
.ask-hero textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font-family: var(--serif);
  font-weight: 300;
  font-size: 19px;
  line-height: 1.45;
  padding: 12px 0;
  height: 54px;
  max-height: 160px;
}
.ask-hero textarea::placeholder { color: var(--text-4); }
.ask-hero .hero-buttons { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-3);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
}
.icon-btn:hover { color: var(--text); border-color: #3d4450; }
.go-btn {
  border: none;
  background: #fff;
  color: var(--bg);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
}

.chip-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chip-row button {
  font-size: 13px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 15px;
}
.chip-row button:hover { border-color: #3d4450; color: var(--text); }

/* waiting-on-you bottom bar */
.waiting-bar {
  background: var(--panel-deep);
  border-top: 1px solid var(--divider);
  padding: 22px 60px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.waiting-bar .w-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kicker {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
}
.waiting-bar .w-title { font-size: 16px; color: var(--text); }
.waiting-bar .w-meta { font-size: 12.5px; color: var(--text-3); }
.waiting-bar .w-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.btn-primary {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--bg);
  background: #fff;
  border: none;
  padding: 10px 17px;
  border-radius: 7px;
}
.btn-secondary {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--line);
  border: none;
  padding: 10px 17px;
  border-radius: 7px;
}
.btn-ghost {
  font-size: 13.5px;
  color: var(--text-3);
  background: transparent;
  border: 1px solid var(--line);
  padding: 10px 17px;
  border-radius: 7px;
}
.btn-danger {
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  background: #c2410c;
  border: none;
  padding: 10px 17px;
  border-radius: 7px;
}
.btn-link { background: none; border: none; color: var(--accent); font-size: 13px; padding: 4px; }

/* ---------- drawer edge tab ---------- */

.drawer-tab {
  position: fixed;
  right: 0;
  top: 40%;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 14px 12px 14px 14px;
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  cursor: pointer;
}
.drawer-tab:hover { color: var(--text); }
.drawer-tab .arrow { color: var(--accent); writing-mode: horizontal-tb; }

/* ---------- drawer ---------- */

.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 94vw);
  background: var(--panel-drawer);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.7);
  transform: translateX(105%);
  transition: transform 0.22s ease;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-scrim { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer-tab { display: none; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid var(--divider);
}
.drawer-head .dh-title { font-size: 15.5px; font-weight: 500; color: var(--text); }
.drawer-head .dh-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.drawer-close { background: none; border: none; color: var(--text-3); font-size: 18px; }

.drawer-body { padding: 22px 26px 34px; display: flex; flex-direction: column; gap: 24px; }
.hr { height: 1px; background: var(--divider); }

.forecast-line { display: flex; align-items: baseline; gap: 12px; }
.forecast-line .big { font-family: var(--serif); font-size: 30px; font-weight: 300; color: var(--text); }
.forecast-line .note { font-size: 12.5px; color: var(--text-3); }
.meter { height: 5px; border-radius: 99px; background: var(--divider); overflow: hidden; display: flex; }
.meter > div { background: var(--accent); }
.flag-line { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--orange); }

.ladder-cols { display: flex; gap: 28px; }
.ladder-cols .vr { width: 1px; background: var(--divider); }
.ladder { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ladder .rungs { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ladder .rung { display: flex; gap: 9px; align-items: center; color: var(--text-4); }
.ladder .rung .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--line); }
.ladder .rung.current { color: var(--text); }
.ladder .rung.current .dot { background: #fff; }
.ladder .rung.proposed { color: var(--amber); }
.ladder .rung.proposed .dot { background: var(--amber); }

.quiet-list { display: flex; flex-direction: column; }
.quiet-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 0;
  border-top: 1px solid var(--divider);
}
.quiet-item:last-child { border-bottom: 1px solid var(--divider); }
.quiet-item .qi-row { display: flex; gap: 9px; align-items: center; }
.quiet-item .qi-title { font-size: 13.5px; color: var(--text-2); }
.quiet-item .qi-action { font-size: 12.5px; color: var(--accent); padding-left: 2px; cursor: pointer; }
.quiet-item .qi-action.muted { color: var(--text-3); }

.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-nav button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  border-top: 1px solid var(--divider);
  color: var(--text-2);
  font-size: 14px;
  padding: 13px 2px;
  text-align: left;
  width: 100%;
}
.drawer-nav button:last-child { border-bottom: 1px solid var(--divider); }
.drawer-nav button:hover { color: var(--text); }
.drawer-nav button .go { color: var(--text-4); }

.drawer-search { display: flex; flex-direction: column; gap: 8px; position: relative; }
.drawer-search input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
}
.drawer-search input::placeholder { color: var(--text-4); }
.search-results { display: flex; flex-direction: column; gap: 4px; }
.search-results .search-hit {
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-2);
}
.search-results .search-hit span { color: var(--text-4); font-size: 11.5px; display: block; }

/* ---------- pills / chips ---------- */

.pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}
.pill.confirmed { border: 1px solid var(--green-line); color: var(--green); background: var(--green-bg); }
.pill.guessed { border: 1px dashed var(--amber-line); color: var(--amber); background: var(--amber-bg); }
.pill.missing { border: 1px solid var(--orange-line); color: var(--orange); background: var(--orange-bg); }
.pill.quiet { border: 1px solid var(--orange-line); color: var(--orange); background: var(--orange-bg); }

.field-label {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
}

/* ---------- review / answer stage ---------- */

.review-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}
.review-topline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--divider);
}
.review-topline .echo {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 16px;
  font-size: 14.5px;
  color: var(--text);
}
.review-topline .echo .glyph { color: var(--accent); }
.review-topline .clear { background: none; border: none; color: var(--text-3); font-size: 13px; }

.review-wrap { flex: 1; padding: 36px 60px 48px; display: flex; gap: 40px; }
.review-main { flex: 1; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.review-lede {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 300;
  color: var(--text);
  line-height: 1.4;
  max-width: 620px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 30px; }
.fact { display: flex; flex-direction: column; gap: 5px; }
.fact .f-head { display: flex; gap: 8px; align-items: center; }
.fact .f-value { font-size: 15px; color: var(--text); line-height: 1.45; }
.fact .f-value.soft { color: var(--text-2); }
.fact .f-value .src { font-size: 12.5px; color: var(--text-3); }

.ladder-inline { display: flex; gap: 28px; padding-top: 2px; flex-wrap: wrap; }
.ladder-inline .vr { width: 1px; background: var(--divider); }
.rungs-h { display: flex; gap: 7px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.rungs-h .sep { color: #3e454f; }
.rungs-h .r { padding: 4px 9px; border-radius: 99px; color: var(--text-4); border: 1px solid var(--line); }
.rungs-h .r.current { background: var(--amber); color: var(--amber-bg); border-color: var(--amber); }
.rungs-h .r.done { background: #fff; color: var(--bg); border-color: #fff; }

.lines { display: flex; flex-direction: column; font-size: 14px; }
.lines .line-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-top: 1px solid var(--divider);
  color: var(--text-2);
}
.lines .line-row.total { border-top: 1px solid var(--line); color: var(--text); font-size: 17px; padding: 14px 0; }
.lines .line-row.total .money { font-family: var(--serif); font-size: 24px; font-weight: 300; }
.lines .neg { color: var(--amber); }

.question-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.question-row .q { font-size: 15.5px; font-weight: 500; color: var(--text); }
.question-row .q-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }

.headsup { font-size: 12.5px; color: var(--amber); line-height: 1.5; }
.note-quote {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  background: var(--bg);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 14px 16px;
}

.review-side { width: 250px; flex-shrink: 0; display: flex; flex-direction: column; gap: 22px; }
.side-block { display: flex; flex-direction: column; gap: 9px; }
.side-block .sb-body { font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.side-block .sb-link { font-size: 12.5px; color: var(--accent); cursor: pointer; }
.kv-rows { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.kv-rows .kv { display: flex; justify-content: space-between; }
.kv-rows .kv .k { color: var(--text-3); }
.kv-rows .kv .v { color: var(--text); }
.kv-rows .kv .v.green { color: var(--green); }

.edit-note { display: flex; flex-direction: column; gap: 8px; }
.edit-note textarea {
  background: var(--bg);
  border: 1px solid var(--divider);
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  padding: 12px 14px;
  resize: vertical;
  min-height: 44px;
  outline: none;
  width: 100%;
}
.edit-note textarea::placeholder { color: var(--text-4); }

/* ---------- approver home ---------- */

.approve-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 20px 60px 30px;
  overflow-y: auto;
}
.approve-stage .ask-hero { width: min(900px, 94vw); }
.approve-stage .ask-hero textarea { font-size: 16px; height: 44px; padding: 8px 0; }
.approve-col { width: min(900px, 94vw); display: flex; flex-direction: column; gap: 12px; }
.approve-col .a-head { display: flex; justify-content: space-between; align-items: baseline; }
.approve-col .a-meta { font-size: 12.5px; color: var(--text-3); }
.approve-title { font-family: var(--serif); font-size: 25px; font-weight: 300; color: var(--text); }
.approve-sub { font-size: 13px; color: var(--text-3); }
.badge-over {
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--amber-line);
  color: var(--amber);
  background: var(--amber-bg);
  flex-shrink: 0;
  white-space: nowrap;
}
.next-strip {
  background: var(--panel-deep);
  border-top: 1px solid var(--divider);
  padding: 16px 60px;
  display: flex;
  gap: 34px;
  font-size: 13px;
  color: var(--text-3);
}
.next-strip .strong { color: var(--text-2); }

/* ---------- finance home ---------- */

.finance-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 26px 60px 30px;
  overflow-y: auto;
}
.finance-stage .ask-hero { width: min(940px, 94vw); }
.finance-stage .ask-hero textarea { font-size: 16px; height: 44px; padding: 8px 0; }
.stat-row { width: min(940px, 94vw); display: flex; gap: 16px; flex-wrap: wrap; }
.stat {
  flex: 1;
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.stat .s-label { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); }
.stat .s-value { font-family: var(--serif); font-size: 34px; font-weight: 300; color: var(--text); }
.stat .s-note { font-size: 12.5px; color: var(--text-3); }
.stat.flagged .s-label, .stat.flagged .s-value { color: var(--orange); }
.table-cols { width: min(940px, 94vw); display: flex; gap: 24px; flex-wrap: wrap; }
.mini-table { flex: 1; min-width: 300px; display: flex; flex-direction: column; }
.mini-table .mt-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 2px;
  border-top: 1px solid var(--divider);
  font-size: 14px;
  color: var(--text-2);
}
.mini-table .mt-row:last-of-type { border-bottom: 1px solid var(--divider); }
.mini-table .mt-row span:last-child { color: var(--text-3); }
.mini-table .mt-note { font-size: 12.5px; color: var(--text-3); line-height: 1.55; padding-top: 12px; }

/* ---------- substrate overlay (accounts, quotes, calendar, timeline, …) ---------- */

.substrate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 70;
  display: none;
  flex-direction: column;
}
body.substrate-open .substrate { display: flex; }
.substrate-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--divider);
}
.substrate-bar .back { background: none; border: none; color: var(--accent); font-size: 13.5px; }
.substrate-bar h1 { font-size: 15px; font-weight: 500; margin: 0; color: var(--text); }
.substrate-bar .sb-note { font-size: 12.5px; color: var(--text-3); margin-left: auto; }
.substrate-body { flex: 1; overflow-y: auto; padding: 30px 40px 60px; }
.substrate-body .screen { display: none; max-width: 1180px; margin: 0 auto; }
.substrate-body .screen.active { display: block; }

/* generic content styling inside substrate */
.screen h2 { font-family: var(--serif); font-weight: 300; font-size: 24px; margin: 0 0 4px; color: var(--text); }
.screen p { color: var(--text-3); }
.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
  margin: 0 0 6px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 26px 0 12px;
}
.section-title span { font-size: 12px; color: var(--text-4); }
.section-title select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
}

.quick-panel, .settings-panel, .command-panel, .result-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.quick-create-grid, .two-column, .discovery-layout, .quote-layout, .settings-grid {
  display: grid;
  gap: 18px;
}
.quick-create-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.two-column, .discovery-layout, .quote-layout, .settings-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 14px; }
.field-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-3); }
.field-grid input, .field-grid select,
.persona-builder input, textarea#feedbackInput {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  padding: 10px 12px;
  outline: none;
}
textarea#feedbackInput { width: 100%; min-height: 90px; resize: vertical; }

.primary-action {
  font-size: 13.5px; font-weight: 500;
  color: var(--bg); background: #fff;
  border: none; padding: 10px 16px; border-radius: 7px;
}
.secondary-action {
  font-size: 13.5px; color: var(--text-3);
  background: transparent; border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 7px;
}
.command-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.data-table table, .product-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .product-table th {
  text-align: left; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--label); font-weight: 500; padding: 9px 10px; border-bottom: 1px solid var(--line);
}
.data-table td, .product-table td { padding: 11px 10px; border-bottom: 1px solid var(--divider); color: var(--text-2); }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.015); }

.mini-metric-grid, .metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 14px 0; }
.metric-card, .mini-metric {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
}
.metric-card h3, .mini-metric h3 { margin: 0 0 6px; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); font-weight: 500; }
.metric-card strong, .mini-metric strong { font-family: var(--serif); font-size: 26px; font-weight: 300; color: var(--text); }
.metric-card p, .mini-metric p { font-size: 12px; color: var(--text-3); margin: 4px 0 0; }

.account-list .account-card, .notification-list .notification, .event-card, .quote-card,
.timeline-item, .audit-item, .command-item, .choice-card, .contact-card, .feedback-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 10px;
}
.account-card h3, .event-card h3, .quote-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 500; color: var(--text); }
.account-card p, .event-card p, .quote-card p, .notification p { margin: 2px 0; font-size: 13px; color: var(--text-3); }
.notification strong { color: var(--text); font-size: 14px; font-weight: 500; }

.status-pill, .stage-pill {
  display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--text-3); margin-left: 8px;
}
.status-pill.intent { border-color: var(--green-line); color: var(--green); background: var(--green-bg); }
.status-pill.risk { border-color: var(--orange-line); color: var(--orange); background: var(--orange-bg); }
.status-pill.admin { border-color: var(--amber-line); color: var(--amber); background: var(--amber-bg); }

.timeline-item h4, .audit-item h4 { margin: 0 0 4px; font-size: 14px; font-weight: 500; color: var(--text); }
.timeline-item p, .audit-item p, .command-item p { font-size: 13px; color: var(--text-3); margin: 2px 0; }
.timeline-item time, .audit-item time, .command-item time { font-size: 11.5px; color: var(--text-4); }

.persona-list, .template-row, .choice-list, .contact-discovery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.persona-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px;
}
.persona-pill button { background: none; border: none; color: var(--text-4); font-size: 13px; padding: 0; }
.persona-builder { display: flex; gap: 10px; }

.choice-card.selected, .contact-card.selected { border-color: var(--accent); }

.empty-state {
  border: 1px dashed var(--line); border-radius: 10px; padding: 22px;
  color: var(--text-4); font-size: 13.5px;
}
.checklist { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-3); max-height: 400px; overflow-y: auto; }
.checklist label { display: flex; gap: 8px; align-items: center; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #fff; color: var(--bg); font-size: 13.5px; font-weight: 500;
  border-radius: 9px; padding: 12px 18px; opacity: 0; pointer-events: none;
  transition: all 0.25s ease; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* hosted quote page overlay */
.quote-page-overlay {
  position: fixed; inset: 0; background: rgba(5, 7, 10, 0.7);
  display: none; align-items: center; justify-content: center; z-index: 90; padding: 30px;
}
.quote-page-overlay.open { display: flex; }
.quote-page {
  width: min(760px, 96vw); max-height: 90vh; overflow-y: auto;
  background: #fff; color: #0e1116; border-radius: 12px; padding: 26px 30px;
  font-family: var(--sans);
}
.quote-page h1, .quote-page h2, .quote-page h3 { color: #0e1116; }
.quote-page-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.quote-page-url { font-size: 12.5px; color: #6b7480; }
.quote-page .secondary-action { color: #0e1116; border-color: #cfd5dc; }
.quote-page-footnote { font-size: 12px; color: #6b7480; margin-top: 14px; }
.quote-page table { width: 100%; border-collapse: collapse; }
.quote-page td, .quote-page th { padding: 8px 6px; border-bottom: 1px solid #e2e6eb; text-align: left; font-size: 14px; }

/* view visibility */
.view { display: none; flex: 1; flex-direction: column; min-height: 0; }
.view.active { display: flex; }

@media (max-width: 900px) {
  .home-stage, .approve-stage, .finance-stage { padding: 18px 20px 30px; }
  .waiting-bar, .review-wrap { padding-left: 20px; padding-right: 20px; }
  .review-wrap { flex-direction: column; }
  .review-side { width: 100%; }
  .fact-grid { grid-template-columns: 1fr; }
  .topbar-status .hide-sm { display: none; }
  .next-strip { padding: 14px 20px; flex-wrap: wrap; gap: 12px; }
}

/* ==========================================================================
   Wave 8 — the door, who you are, and People and roles
   ========================================================================== */

/* ---------- the sign-in door ---------- */

.auth-gate { display: none; }

body.signed-out .shell { display: none; }
body.signed-out .auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2030 0%, var(--bg) 60%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.2px;
  margin-bottom: 18px;
}
.auth-brand .brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); display: inline-block;
}

.auth-lead { font-size: 15px; color: var(--text-2); margin: 0 0 18px; line-height: 1.5; }
.auth-lead.bad { color: var(--orange); }
.auth-sub { font-size: 12.5px; color: var(--text-4); line-height: 1.55; margin: 14px 0 0; }

.auth-card label {
  display: block;
  font-size: 12px;
  color: var(--label);
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}
.auth-card input,
.auth-card select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 14.5px;
}
.auth-card input:focus,
.auth-card select:focus { outline: none; border-color: var(--accent); }

.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.auth-primary {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14.5px;
  font-weight: 500;
}
.auth-primary:disabled { opacity: 0.5; cursor: default; }

.auth-demo {
  width: 100%;
  padding: 11px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
}
.auth-demo:hover { border-color: var(--accent); color: var(--text); }

.auth-alt { font-size: 13px; color: var(--text-3); margin: 14px 0 0; text-align: center; }
.auth-link {
  background: none; border: none; padding: 0;
  color: var(--accent); font-size: 13px; text-decoration: underline;
}

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 14px; color: var(--text-4); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--divider);
}

.auth-note { font-size: 12.5px; color: var(--text-3); margin: 12px 0 0; min-height: 16px; line-height: 1.5; }
.auth-note.bad { color: var(--orange); }

/* ---------- who you are, top right ---------- */

.who-badge #whoButton {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  background: none;
  border: none;
  padding: 0 4px;
  text-align: right;
}
.who-name { font-size: 12.5px; color: var(--text-2); }
.who-org { font-size: 11px; color: var(--text-4); }

.sign-out {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-3);
  font-size: 11.5px;
  padding: 5px 9px;
}
.sign-out:hover { border-color: var(--accent); color: var(--text-2); }

/* ---------- read-only roles (A-083) ----------
   Finance sees every number and changes nothing. The write controls are not
   merely disabled, they are not offered. */

body.read-only #runCommand,
body.read-only #voiceButton,
body.read-only #confirmProposal,
body.read-only #editProposal,
body.read-only .quick-create-grid,
body.read-only .proposal-actions,
body.read-only .review-actions,
body.read-only [data-approve],
body.read-only [data-w-act] { display: none !important; }

/* ---------- provenance chips (A-088) ---------- */

.prov {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.2px;
  vertical-align: middle;
}
.prov.guessed { background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber); }
.prov.confirmed { background: var(--green-bg); border: 1px solid var(--green-line); color: var(--green); }

/* ---------- People and roles (A-089) ---------- */

.people-invite { margin-bottom: 22px; }
.people-hint { font-size: 12px; color: var(--text-4); margin: 10px 0 0; line-height: 1.5; }

.checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  align-self: flex-start;
}
.field-grid .checkbox-label { align-self: end; padding-bottom: 9px; }
.checkbox-label input {
  width: auto !important;
  min-width: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.invite-link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.invite-link-box code {
  flex: 1;
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }

.person-row {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.person-row.person-off { opacity: 0.55; }

.person-who { display: flex; flex-direction: column; gap: 3px; }
.person-who strong { font-size: 14.5px; }
.person-who span { font-size: 12px; color: var(--text-4); }

.person-role { display: flex; flex-direction: column; gap: 8px; }
.person-role select {
  padding: 8px 10px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
}
.person-blurb { font-size: 11.5px; color: var(--text-4); margin: 0; line-height: 1.45; }

.person-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.person-note { font-size: 11.5px; color: var(--text-4); text-align: right; }

.handover {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: 14px 16px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-radius: 10px;
}
.handover p { margin: 0 0 12px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.handover-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.handover-row select {
  flex: 1;
  min-width: 220px;
  padding: 9px 11px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
}

@media (max-width: 760px) {
  .person-row { grid-template-columns: 1fr; }
  .person-actions { align-items: flex-start; }
}

/* ---------- "which company?" card ----------
   Shown when Bodhi cannot tell which customer an ask is about. It asks
   instead of guessing; nothing is written until the question is answered. */

.company-choice {
  padding: 26px 60px 40px;
  max-width: 1080px;
}
.company-choice .eyebrow { margin: 0; }
.company-choice h2 { margin: 6px 0 10px; font-size: 24px; }

@media (max-width: 760px) {
  .company-choice { padding: 22px 20px 32px; }
}
.choice-lede {
  font-size: 13.5px;
  color: var(--text-3);
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 62ch;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.choice-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  text-align: left;
}
.choice-chip:hover { border-color: var(--accent); }
.choice-chip strong { font-size: 14px; }
.choice-chip span { font-size: 11.5px; color: var(--text-4); }

.choice-new {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 16px;
}
.choice-new label {
  flex: 1;
  min-width: 240px;
  font-size: 12px;
  color: var(--label);
}
.choice-new input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
}
.choice-new input:focus { outline: none; border-color: var(--accent); }

/* ---------- terms tick on the sign-in door (A-096) ---------- */

.auth-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 16px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}
.auth-check input {
  width: auto !important;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}
.auth-check a { text-decoration: underline; }
.auth-sub.forgot { margin: 12px 0 0; }

/* ---------- first run (A-091) ---------- */

.first-run {
  width: min(880px, 92vw);
  margin-top: 8px;
  padding: 26px 28px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.first-run .fr-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  margin: 8px 0 8px;
}
.first-run .fr-head p {
  font-size: 13.5px;
  color: var(--text-3);
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 60ch;
}
.fr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.fr-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  text-align: left;
  padding: 15px 16px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
}
.fr-card:hover { border-color: var(--accent); }
.fr-card strong { font-size: 14px; }
.fr-card span { font-size: 12px; color: var(--text-4); line-height: 1.5; }
.fr-card.fr-soft { opacity: 0.72; }

/* ---------- company screen (A-093 / A-096) ---------- */

.consent-row .status-badge { white-space: nowrap; }

/* ---------- answer card (A-100) ----------
   A question gets an answer, not a proposal. There is deliberately no
   approve button here, because nothing was written. */

.answer-card {
  padding: 26px 60px 40px;
  max-width: 1080px;
}
.answer-card .eyebrow { margin: 0; }
.answer-card h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.35;
  margin: 8px 0 18px;
  max-width: 46ch;
}

.answer-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 18px;
  max-width: 880px;
}
.answer-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 16px;
  background: var(--panel);
}
.answer-row strong { font-size: 14px; }
.answer-row span { font-size: 12.5px; color: var(--text-4); }

.answer-note {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.6;
  margin: 0 0 10px;
  max-width: 66ch;
}
.answer-source {
  font-size: 12px;
  color: var(--text-4);
  line-height: 1.6;
  margin: 0 0 18px;
  max-width: 66ch;
}

@media (max-width: 760px) {
  .answer-card { padding: 22px 20px 32px; }
}

/* the record you just created, so it is findable the moment you land */
.data-row.just-written {
  border-color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* ---------- Set up your company (A-110 / A-111 / A-112) ---------- */

.setup-lede {
  font-size: 13.5px;
  color: var(--text-3);
  line-height: 1.65;
  margin: 0 0 18px;
  max-width: 74ch;
}

.setup-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 34px;
}
.setup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--panel);
}
.setup-row div { display: flex; flex-direction: column; gap: 3px; }
.setup-row strong { font-size: 14px; }
.setup-row span { font-size: 12.5px; color: var(--text-4); }
.setup-row.is-later { opacity: 0.55; }

.setup-tick {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--text-4);
}
.setup-tick.done {
  color: var(--green);
  border-color: var(--green-line);
  background: var(--green-bg);
}

.setup-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.setup-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.si-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.si-main strong { font-size: 14.5px; }
.si-main > span { font-size: 12.5px; color: var(--text-2); }
.si-main p { font-size: 12px; color: var(--text-4); margin: 2px 0 0; line-height: 1.5; }
.si-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.exit-list { margin: 6px 0 0; padding-left: 18px; }
.exit-list li { font-size: 12.5px; color: var(--text-3); line-height: 1.65; }

.setup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 34px;
}
.setup-actions select {
  padding: 9px 11px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
}

.draft-panel {
  padding: 22px 24px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-radius: 14px;
  margin-bottom: 30px;
}
.draft-panel h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  margin: 6px 0 10px;
}
.draft-list { margin: 0 0 18px; padding-left: 20px; }
.draft-list li { font-size: 13px; color: var(--text-2); line-height: 1.7; }

/* top-bar doors — the drawer tab alone is not discoverable */
.topbar-link {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-3);
  font-size: 11.5px;
  padding: 5px 11px;
}
.topbar-link:hover { border-color: var(--accent); color: var(--text); }

/* inline editing on the setup screen */
.setup-item.editing { display: block; border-color: var(--accent); }
.edit-form .field-grid { margin-bottom: 12px; }
.edit-form .full-field {
  display: block;
  font-size: 12px;
  color: var(--label);
  margin-bottom: 12px;
}
.edit-form .full-field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
}
.edit-form .setup-actions { margin-bottom: 0; }

/* a criterion the AI proposed that still needs a person's numbers */
.setup-item.needs-you { border-color: var(--amber-line); background: var(--amber-bg); }
.status-badge.warn { color: var(--amber); border-color: var(--amber-line); }
.candidates { font-size: 12px; color: var(--amber); margin: 4px 0 0; line-height: 1.55; }

/* how an account measures against the ICP — a line, never a warning */
.icp-line {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.45;
  cursor: pointer;
  border-bottom: 1px dotted currentColor;
  width: fit-content;
}
.icp-line.unknown { color: var(--text-4); }
.icp-line.fits { color: var(--green); }
.icp-line.outside { color: var(--amber); }

.icp-panel {
  padding: 16px 18px;
  margin: -4px 0 10px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.icp-panel .unit { color: var(--text-4); }
.icp-panel .setup-actions { margin-bottom: 0; }
