/* Layout layer — loaded last. One clear frame for the chat screen; earlier sheets keep look & feel.

   Desktop: header · status · chat (always scrolls) · composer, centered; a work tab opens a side
   panel with its own scroll — the chat never locks or dims behind it.
   Phone:   the chat scrolls; a work tab opens a full-screen sheet with its title + Close visible;
   all work tabs fit on screen. */

#stage-chat #stream {
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-width: thin !important;
  min-height: 0 !important;
}
#stage-chat #stream::-webkit-scrollbar { display: block !important; width: 8px; }
#stage-chat #stream::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 8px;
}
#stage-chat .chat-shell.activity-open #stream::after,
#stage-chat .chat-shell.work-open #stream::after { content: none !important; }

#stage-chat #activityBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#stage-chat #chatSchedule:not([hidden]) {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  overflow: hidden !important;
}
#stage-chat #chatSchedule .activity-bar { flex: 0 0 auto; }

/* Today card sits in the flow above the chat; it never floats over messages. */
#stage-chat #todayDock {
  position: static !important;
  transform: none !important;
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 10px !important;
}

@media (min-width: 1024px) {
  #stage-chat .chat-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    column-gap: 20px;
    max-width: none !important;
    height: 100%;
  }
  #stage-chat .chat-shell > .chat-head { grid-column: 1 / -1; grid-row: 1; }
  #stage-chat #todayDock,
  #stage-chat #stream,
  #stage-chat #chatDock,
  #stage-chat .chat-head-row {
    width: min(58rem, 100%) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  #stage-chat #todayDock { grid-column: 1; grid-row: 2; }
  #stage-chat #stream { grid-column: 1; grid-row: 3; }
  #stage-chat #workStatus { grid-column: 1; grid-row: 4; }
  #stage-chat #chatDock { grid-column: 1; grid-row: 4; }

  #stage-chat .chat-shell.work-open,
  #stage-chat .chat-shell.activity-open {
    grid-template-columns: minmax(0, 1fr) minmax(22rem, 30rem);
  }
  #stage-chat .chat-shell.work-open #todayDock,
  #stage-chat .chat-shell.activity-open #todayDock,
  #stage-chat .chat-shell.work-open #stream,
  #stage-chat .chat-shell.activity-open #stream,
  #stage-chat .chat-shell.work-open #chatDock,
  #stage-chat .chat-shell.activity-open #chatDock { width: 100% !important; }
  #stage-chat .chat-shell #chatSchedule:not([hidden]) {
    grid-column: 2;
    grid-row: 2 / 5;
    min-height: 0 !important;
    contain: size layout; /* the panel scrolls inside its track instead of growing the grid */
    align-self: stretch;
    position: relative !important;
    inset: auto !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    width: auto !important;
    transform: none !important;
  }
}

@media (max-width: 1023px) {
  #stage-chat #chatSchedule:not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 80 !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #stage-chat #chatSchedule .activity-bar {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--panel);
    padding: 12px 16px;
  }
  #stage-chat #workTabs {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 4px !important;
    overflow: visible !important;
    white-space: normal;
  }
  #stage-chat #workTabs .work-tab {
    min-width: 0;
    min-height: 34px;
    padding: 4px 6px !important;
    font-size: 12.5px;
    justify-content: center;
  }
  /* The old Today card repeated the tab badges. The desk view is the page, so it stays on phones too. */
  #stage-chat #todayDock:not(:has(.desk-view)) { display: none !important; }
  #stage-chat #todayDock:has(.desk-view) { padding: 8px 10px 6px; }
  #stage-chat #workTabs .work-tab[hidden] { display: none !important; }
  /* Credit stays in Settings → About on phones; the chat needs the room. */
  footer.footer-minimal { display: none !important; }
}

/* ── Type: one sans for everything you read and click, the serif only for names and titles.
   The old --ui stack fell back to a serif on every Mac and phone (only Windows has Segoe UI). */
:root {
  --ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body { font-family: var(--ui); }
button, input, textarea, select { font: inherit; }

/* ── Chat header: name + one status line. The "Ask here…" line said what the composer already says. */
#stage-chat #chatCapability { display: none !important; }
#stage-chat .chat-head { padding-bottom: 6px; }
#stage-chat #chatWhere { font-family: var(--display); }

/* ── Today: one compact line instead of a 170px card that repeated the tab badges. */
#stage-chat #todayDock .today-brief {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 8px 14px !important;
  min-height: 0;
}
#stage-chat #todayDock .today-brief-head,
#stage-chat #todayDock .today-quiet { display: none !important; }
#stage-chat #todayDock .today-lead,
#stage-chat #todayDock .today-next-due,
#stage-chat #todayDock .today-stats { margin: 0 !important; padding: 0 !important; font-size: 14px; }
#stage-chat #todayDock .today-stats { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
#stage-chat #todayDock .today-link { padding: 2px 10px !important; min-height: 0 !important; font-size: 13px; }
#stage-chat #todayDock { max-height: 42vh; overflow-y: auto; }
#stage-chat #todayDock:has(.desk-view) { max-height: none; }
#stage-chat #todayDock:has(.desk-view.is-folded) { max-height: none; padding-top: 6px; padding-bottom: 6px; }
#stage-chat #todayDock .today-brief > .today-next-due { margin-left: auto !important; }
#stage-chat #todayDock details.today-more { flex: 1 1 100%; margin: 2px 0 0; }
#stage-chat #todayDock details.today-more > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  font-size: 12.5px;
  color: var(--muted);
  padding: 2px 0;
}
#stage-chat #todayDock details.today-more > summary::-webkit-details-marker { display: none; }
#stage-chat #todayDock details.today-more > summary::before { content: "▸ "; }
#stage-chat #todayDock details.today-more[open] > summary::before { content: "▾ "; }
#stage-chat #todayDock details.today-more > summary:hover { color: var(--ink); }
#stage-chat #todayDock .today-more-body { display: grid; gap: 10px; padding-top: 8px; }
#stage-chat #todayDock .today-more-body .today-desk { margin: 0; }

/* ── Work panel: the glossary and the refresh are helpers, not the headline. */
#stage-chat .work-sheet-glossary { font-size: 12.5px; opacity: 0.8; }
#stage-chat .overlay-refresh { width: auto !important; padding: 6px 14px !important; }

/* ── Work panel header on one row: title left, actions right. */
#stage-chat #chatSchedule .activity-bar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}
#stage-chat #chatSchedule .activity-bar-actions { display: flex; gap: 6px; flex: 0 0 auto; margin: 0 !important; }
#stage-chat #chatSchedule .activity-bar-actions button { padding: 6px 12px !important; min-height: 0 !important; font-size: 13px; }

/* ── Row actions in lists: small and calm. The gold button is for Send, not for every row. */
#stage-chat #activityBody .cron-roster-cta .send,
#stage-chat #activityBody .need-actions .send {
  background: transparent !important;
  color: var(--bronze, #d9b77c) !important;
  border: 1px solid color-mix(in srgb, var(--bronze, #d9b77c) 55%, transparent) !important;
  box-shadow: none !important;
  padding: 4px 12px !important;
  min-height: 0 !important;
  font-size: 13px !important;
  font-weight: 500;
}
#stage-chat #activityBody .cron-roster-cta .send:hover,
#stage-chat #activityBody .need-actions .send:hover { background: color-mix(in srgb, var(--bronze, #d9b77c) 14%, transparent) !important; }

/* ── Section heads: readable, not shouting. */
#stage-chat #activityBody .work-section-head {
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  font-size: 16px !important;
}

#stage-chat #todayDock .today-lead { font-family: var(--ui); }

@media (max-width: 1023px) {
  /* A full-screen sheet can't get bigger. */
  #stage-chat #toggleStreamExpand { display: none !important; }
}
#stage-chat #activityBody .cron-roster-cta .send,
#stage-chat #activityBody .need-actions .send,
#stage-chat .overlay-refresh { height: auto !important; line-height: 1.4 !important; font-size: 13px !important; }

/* ── Spend chart: fills its card instead of a fixed 600px row. */
#settings .trend-svg { width: 100%; height: 120px; display: block; }
#settings .trend-chart h5 { margin: 0 0 4px; font-weight: 500; }
#settings .usage-card table { width: 100%; border-collapse: collapse; }
#settings .usage-card { overflow-x: auto; }

/* ── Settings drawer on phones: above the chat bar, no sideways overflow, nav scrolls sideways. */
@media (max-width: 1023px) {
  #settings.drawer { z-index: 95 !important; position: fixed !important; inset: 0 !important; }
  #settings .drawer-card { max-width: 100vw; overflow: hidden; }
  #settings .drawer-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    align-items: center;
  }
  #settings .drawer-nav::-webkit-scrollbar { display: none; }
  #settings .drawer-nav .settings-nav-label { flex: 0 0 auto; margin: 0 6px 0 0; }
  #settings .drawer-tab { flex: 0 0 auto; }
  #settings .drawer-body { overflow-x: hidden; overflow-wrap: anywhere; word-break: break-word; }
  #settings .drawer-body table { display: block; max-width: 100%; overflow-x: auto; }
  #settings .drawer-body .kv,
  #settings .drawer-body .connector-row,
  #settings .drawer-body .field-row { grid-template-columns: minmax(0, 1fr) !important; min-width: 0; }
  #settings .drawer-body pre, #settings .drawer-body code { white-space: pre-wrap; overflow-wrap: anywhere; }
}

/* ── Today strip: the schedule line is a footnote, not a second headline. */
#stage-chat #todayDock .today-schedule-truth { font-size: 13px; color: var(--muted); margin: 0 !important; }

/* ── Lane policy rows in CEO setup: label left, one clear select right. */
#settings .lane-policy .policy-lane {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
}
#settings .lane-policy .policy-lane:first-of-type { border-top: 0; }
#settings .lane-policy .policy-lane select { max-width: 60%; }
/* ── Boss decisions read as a review, not a job. */
#stage-chat .job-stream-meta .job-preset-boss,
#stage-chat .lane-badge.boss { color: var(--bronze); }

/* ── Re-imagined CEO screen: what needs you → what's happening → the conversation → records.
   The header carries the brand, the stage and spend. State lives on the desk, not in pills. */
#stage-chat #pulse, #stage-chat #hermesHint, .bar-right #hermesHint { display: none !important; }
.bar-right .meter .meter-line { display: none !important; }

/* Records drawer: four tabs. Errors, Live and Due fold into the status strip (its chips open them). */
#stage-chat #workTabs .work-tab[data-work="failed"],
#stage-chat #workTabs .work-tab[data-work="doing"],
#stage-chat #workTabs .work-tab[data-work="next"] { display: none !important; }
#stage-chat #workTabs .work-tab[data-work="schedule"] .n,
#stage-chat #workTabs .work-tab[data-work="goals"] .n,
#stage-chat #workTabs .work-tab[data-work="bus"] .n { display: none !important; }
@media (max-width: 1023px) {
  #stage-chat #workTabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* The panel's subtitle already says what it is; no glossary box. */
#stage-chat .work-sheet-glossary { display: none !important; }

/* CEO rail: name + one state word. The desk shows the rest. */
.org-desk-card .org-now, .org-desk-card .ceo-work-badges, .org-row .org-role { display: none !important; }
.org-desk-card .org-lamp { font-weight: 400; letter-spacing: 0; text-transform: none; }

/* Decision cards: one primary action, the rest quiet. */
#stage-chat .today-decision .need-actions .send { padding: 6px 14px !important; min-height: 0 !important; font-size: 13.5px; }
#stage-chat .today-decision .need-actions .ghost-btn { padding: 6px 12px !important; min-height: 0 !important; font-size: 13px; }
#stage-chat .today-decision .today-autopilot-kicker { letter-spacing: 0.06em; }
/* Header: no "Done / chat" pulse pill; the desk says what is running. */
.bar-right #pulse { display: none !important; }
/* Records panels: the repo/site wiring and the desk's Blocker line belong to Goals, not to every tab. */
#stage-chat #activityBody .work-desk-context { display: none !important; }
#stage-chat #activityBody:has(.work-sheet-lead[data-work-lead="goals"]) .work-desk-context { display: block !important; }

/* ── ottoBOSS glance: one row per CEO on the strip itself. */
#stage-chat #todayDock .today-fleet { flex: 1 1 100%; margin: 4px 0 0; }
#stage-chat #todayDock .today-fleet-kicker { font-size: 11px; letter-spacing: 0.12em; margin: 0 0 4px; }
#stage-chat #todayDock .today-org-glance { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
#stage-chat #todayDock .today-org-row {
  display: grid; grid-template-columns: 10px 9.5rem minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 5px 0; border-top: 1px solid color-mix(in srgb, var(--muted) 16%, transparent);
}
#stage-chat #todayDock .today-org-row:first-child { border-top: 0; }
#stage-chat #todayDock .today-org-row b { font-size: 14px; }
#stage-chat #todayDock .today-org-row > span:last-child { font-size: 13px; }
#stage-chat #todayDock .today-org-row .today-ceo-link { padding: 0; }

/* ── CEO setup: the engineering lives under Advanced. */
#settings .ceo-setup-advanced { margin-top: 12px; }
#settings .ceo-setup-advanced > summary {
  cursor: pointer; list-style: none; font-size: 13px; color: var(--muted); padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
}
#settings .ceo-setup-advanced > summary::-webkit-details-marker { display: none; }
#settings .ceo-setup-advanced > summary::before { content: "▸ "; }
#settings .ceo-setup-advanced[open] > summary::before { content: "▾ "; }
#settings .ceo-setup-advanced-body { display: grid; gap: 14px; padding-top: 8px; }
#stage-chat #todayDock .today-fleet, #stage-chat #todayDock .today-org-glance { width: 100%; max-width: none; }
#stage-chat #todayDock .today-org-row > b,
#stage-chat #todayDock .today-org-row > span:last-child { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#stage-chat #todayDock .today-org-lamp { margin-top: 0; }
#stage-chat #todayDock .today-brief { max-width: none !important; width: 100%; }
#stage-chat #todayDock .today-org-row > .today-org-lamp { grid-column: 1 !important; grid-row: 1 !important; }
#stage-chat #todayDock .today-org-row > b { grid-column: 2 !important; grid-row: 1 !important; }
#stage-chat #todayDock .today-org-row > span:last-child { grid-column: 3 !important; grid-row: 1 !important; }

/* ── Watch an engine run: a quiet monospace tail inside the Live card. */
#stage-chat .live-watch > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; padding: 4px 0; }
#stage-chat .live-watch > summary::-webkit-details-marker { display: none; }
#stage-chat .live-watch > summary::before { content: "▸ "; }
#stage-chat .live-watch[open] > summary::before { content: "▾ "; }
#stage-chat .live-tail {
  max-height: 260px; overflow: auto; margin: 4px 0 8px; padding: 10px 12px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink); background: color-mix(in srgb, var(--panel) 70%, black);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent); border-radius: 10px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---- Plan: the loop on the Goals tab ---------------------------------------------------- */
.plan-sheet { display: grid; gap: 12px; margin-top: 10px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--muted) 22%, transparent); }
.plan-sheet:empty { display: none; }
.plan-head { display: grid; gap: 4px; }
.plan-title { margin: 0; font-family: var(--display); font-size: 15px; font-weight: 500; }
.plan-lede, .plan-empty { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); max-width: 62ch; }
.plan-numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.activity-body.is-wide .plan-numbers, .work-sheet-wide .plan-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-number {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label edit" "value edit"; align-items: center; gap: 2px 8px;
  padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--panel) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
}
.plan-number-label { grid-area: label; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.plan-value { grid-area: value; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.plan-value.is-stale { color: var(--muted); }
.plan-unknown { grid-area: value; font-size: 13px; color: color-mix(in srgb, var(--muted) 70%, transparent); font-style: italic; }
.plan-trend { font-style: normal; font-size: 13px; margin-left: 4px; }
.plan-trend-up { color: #3aa76d; } .plan-trend-down { color: #d0655a; } .plan-trend-flat { color: var(--muted); }
.plan-number-edit { grid-area: edit; font-size: 11px; color: var(--muted); background: transparent; border: 0; padding: 4px 8px; min-height: 32px; cursor: pointer; opacity: 0.55; }
.plan-number:hover .plan-number-edit, .plan-number-edit:focus { opacity: 1; }
.plan-bets-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 4px; }
.plan-bets-head h5 { margin: 0; font-size: 13px; font-weight: 600; }
.plan-bets-head span { font-size: 12px; color: var(--muted); }
.plan-bets { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan-bet {
  display: grid; grid-template-columns: 10px 1fr; grid-template-areas: "dot body" "dot foot"; align-items: start; gap: 4px 10px;
  padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--muted) 16%, transparent);
}
.plan-bet-dot { grid-area: dot; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--bronze); }
.plan-bet.is-won .plan-bet-dot { background: #3aa76d; } .plan-bet.is-lost .plan-bet-dot { background: #d0655a; } .plan-bet.is-dropped .plan-bet-dot { background: var(--muted); }
.plan-bet-body { grid-area: body; min-width: 0; }
.plan-bet-text { margin: 0; font-size: 13.5px; line-height: 1.45; }
.plan-bet-meta { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.plan-bet-foot { grid-area: foot; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-bet-state { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.plan-bet-actions { display: flex; gap: 4px; }
.plan-bet-actions .ghost-btn { padding: 2px 8px; font-size: 11.5px; min-height: 0; }
.plan-add { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 6px; }
.plan-add input { min-width: 0; font-size: 13px; padding: 7px 9px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--ink); }
.plan-settled summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.plan-settled ul { margin-top: 6px; }
.plan-add { grid-template-columns: 1fr 1fr; }
.plan-add input[name="bet"] { grid-column: 1 / -1; }
.plan-sheet { margin-top: 0; padding-top: 0; border-top: 0; padding-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--muted) 22%, transparent); }


/* ---- Seat: intake form + seat card ------------------------------------------------------ */
.node-menu.ceo-add .menu-field textarea { width: 100%; min-height: 54px; resize: vertical; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--ink); }
.node-menu .menu-advanced { margin: 4px 0 8px; }
.node-menu .menu-advanced > summary { font-size: 12.5px; color: var(--muted); cursor: pointer; padding: 6px 0; }
.node-menu .menu-advanced .menu-field { margin-top: 8px; }
.seat-card .seat-state { margin: 0 0 6px; font-size: 13px; }
.seat-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.seat-stage { display: grid; grid-template-columns: 18px auto 1fr; gap: 8px; align-items: baseline; font-size: 12.5px; line-height: 1.45; }
.seat-stage b { font-weight: 600; white-space: nowrap; }
.seat-note { color: var(--muted); overflow-wrap: anywhere; }
.seat-mark { text-align: center; color: var(--muted); }
.seat-stage.is-ok .seat-mark { color: #3aa76d; }
.seat-stage.is-held .seat-mark, .seat-stage.is-failed .seat-mark { color: #d0655a; }
.seat-stage.is-running .seat-mark { color: var(--bronze); }
.seat-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.seat-actions .ghost-btn { font-size: 12px; padding: 5px 10px; text-decoration: none; }
.seat-brief { margin: 10px 0 0; padding: 10px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); background: color-mix(in srgb, var(--panel) 70%, black); border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent); border-radius: 10px; }

/* ---- Functions + Connections ------------------------------------------------------------ */
.fn-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.fn-row { padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--muted) 16%, transparent); }
.fn-row.is-on { border-color: color-mix(in srgb, var(--bronze) 40%, transparent); }
.fn-row .check-line { font-size: 13.5px; }
.fn-meta { margin: 4px 0 0 24px; font-size: 12px; line-height: 1.45; }
.node-menu.ceo-add .menu-field select { width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--ink); }
.connection .connection-how summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.connection .connection-how p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; }
.connection.is-set { border-color: color-mix(in srgb, #3aa76d 40%, transparent); }
.engine-pins, .engine-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.engine-card textarea { width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--ink); resize: vertical; }

/* ---- Desk kinds at seat ------------------------------------------------------------------ */
.desk-kind-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.desk-kind { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent); cursor: pointer; font-size: 12.5px; }
.desk-kind input { position: absolute; opacity: 0; pointer-events: none; }
.desk-kind b { font-size: 13px; }
.desk-kind span { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.desk-kind.is-on { border-color: var(--bronze); background: color-mix(in srgb, var(--bronze) 10%, transparent); }
.task-block .menu-field select, .task-block .menu-field textarea, .task-block .menu-field input { width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--ink); }
@media (max-width: 560px) { .desk-kind-row { grid-template-columns: 1fr; } }
.desk-kind b, .desk-kind span { text-transform: none; letter-spacing: 0; }

/* ---- Channels ----------------------------------------------------------------------------- */
.channel-list, .outbox-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.channel-row { display: grid; grid-template-columns: 170px 170px 1fr; gap: 8px; align-items: center; font-size: 13px; padding: 6px 8px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--muted) 16%, transparent); }
.channel-row.is-trusted { border-color: color-mix(in srgb, #3aa76d 45%, transparent); }
.host-faces { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.host-face { display: grid; gap: 4px; justify-items: center; font-size: 12px; }
.host-face img { width: 84px; height: 150px; object-fit: cover; border-radius: 10px; border: 2px solid transparent; }
.host-face.is-chosen img { border-color: #3aa76d; }
.host-token { width: 100%; font: 12px/1.4 ui-monospace, monospace; }
.channel-row.is-paused { border-color: color-mix(in srgb, #d0655a 45%, transparent); }
.channel-row select, .channel-row input { font: inherit; font-size: 12.5px; padding: 5px 8px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--ink); }
.channel-row input { grid-column: 1 / -1; }
.outbox-row { font-size: 12.5px; line-height: 1.5; padding: 6px 8px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--muted) 14%, transparent); }
.outbox-row .need-actions { display: inline-flex; gap: 4px; margin-left: 6px; }
.outbox-row .ghost-btn { padding: 2px 8px; font-size: 11.5px; min-height: 0; }
@media (max-width: 720px) { .channel-row { grid-template-columns: 1fr 1fr; } }

.connection-group { margin: 14px 0 2px; font-size: 13px; }
.hook-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.hook-list li { display: grid; grid-template-columns: 200px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; }
.hook-list code { font: 11.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; color: var(--muted); }
@media (max-width: 720px) { .hook-list li { grid-template-columns: 1fr; } }

/* App lane */
.app-card h5 { margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); }
.app-spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 10px; }
.app-spec-grid .field { margin: 0; }
.check-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.stage-rail { list-style: none; display: flex; gap: 0; padding: 0; margin: 14px 0 6px; counter-reset: stage; }
.stage-rail li { flex: 1; position: relative; text-align: center; font-size: 12px; color: var(--muted, #6b7280); padding-top: 18px; }
.stage-rail li::before { content: ""; position: absolute; top: 5px; left: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translateX(-50%); background: var(--line, #d6d9de); z-index: 1; }
.stage-rail li:not(:first-child)::after { content: ""; position: absolute; top: 9px; right: 50%; width: 100%; height: 2px; background: var(--line, #d6d9de); }
.stage-rail li.is-done::before, .stage-rail li.is-done::after { background: var(--ok, #16a34a); }
.stage-rail li.is-done { color: var(--ink, #111); }
.stage-rail li.is-now::before { background: var(--accent, #2563eb); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.stage-rail li.is-now { color: var(--ink, #111); font-weight: 600; }
.stage-rail li.is-now::after { background: var(--ok, #16a34a); }
.app-list { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.app-list li { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.app-list li.is-errored { color: var(--bad, #b91c1c); }
.app-list .need-actions { margin-left: auto; display: flex; gap: 6px; }
.app-adam { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: rgba(245, 158, 11, .10); border: 1px solid rgba(245, 158, 11, .35); font-size: 13px; }
.app-adam ul { margin: 6px 0 0; padding-left: 18px; }
.app-missing summary, .app-rejection summary { cursor: pointer; font-size: 13px; margin: 8px 0 4px; }
.app-missing ul { margin: 4px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.app-blocker { color: var(--bad, #b91c1c); font-size: 13px; }
.app-rejection textarea { width: 100%; }
@media (max-width: 640px) { .app-spec-grid { grid-template-columns: 1fr; } .stage-rail li { font-size: 10px; } }
.node-menu .menu-field label.seat-app-line { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink, inherit); font-weight: 600; }
.node-menu .menu-note.seat-app-note { margin: 2px 0 6px; }

/* Workbench */
.wb-modes { display: inline-flex; border: 1px solid var(--line, #2a2622); border-radius: 999px; padding: 3px; gap: 2px; }
.wb-mode { border: 0; background: transparent; color: var(--muted, #9a938a); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.wb-mode.on { background: rgba(201, 166, 107, 0.18); color: var(--ink, #f2ece2); font-weight: 600; }
.wb-model { max-width: 300px; font-size: 12px; }
.wb-turn { margin: 6px 16px; padding: 12px 14px; border: 1px solid var(--line, #2a2622); border-radius: 12px; background: rgba(201, 166, 107, 0.06); }
.wb-turn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.wb-turn-grid label { display: grid; gap: 4px; font-size: 12px; color: var(--muted, #9a938a); }
.wb-turn-grid input, .wb-turn-grid select { width: 100%; }
.wb-stream .bubble.bot .bubble-text { line-height: 1.55; }
.wb-stream .bubble.bot.wb-wait:not(.has-text) .bubble-text { display: none; }
.wb-stream .bubble.bot .bubble-text table { width: 100%; border-collapse: collapse; margin: 0.4em 0 0.8em; font-size: 14px; }
.wb-stream .bubble.bot .bubble-text th, .wb-stream .bubble.bot .bubble-text td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line, #2a2622); vertical-align: top; }
.wb-meta { font-size: 11px; color: var(--muted, #9a938a); }
.wb-wait .thinking { margin-bottom: 0; }
.wb-wait.has-text .thinking { margin-bottom: 8px; }
.org-add.org-work { border-style: solid; font-weight: 600; }
.wb-depth .wb-mode { padding: 5px 11px; font-size: 12px; }

/* Key help on failed cards */
.need-help { margin: 6px 0 4px; display: grid; gap: 4px; }
.need-help-title { font-weight: 600; margin: 0; }
.need-help-options { margin: 4px 0 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }
.need-raw pre { white-space: pre-wrap; font-size: 11px; opacity: .8; margin: 4px 0 0; }

/* Ask about this card */
.need-ask { margin-top: 8px; border-top: 1px dashed var(--line, #2a2622); padding-top: 8px; display: grid; gap: 6px; }
.need-ask-row { display: flex; gap: 6px; }
.need-ask-row[hidden], .need-ask-open[hidden] { display: none !important; }
.need-ask .need-ask-open { justify-self: start; font-size: 13px; padding: 6px 0; color: var(--muted, #9a938a); }
.need-ask .need-ask-open:hover { color: var(--bronze, #c9a66b); }
.need-ask-input { flex: 1; font-size: 13px; padding: 7px 10px; }
.need-qa { display: grid; gap: 2px; font-size: 13px; }
.need-q { margin: 0; color: var(--muted, #9a938a); }
.need-a { margin: 0; white-space: pre-wrap; }

.routine-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.routine-row { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line, #2a2622); border-radius: 10px; font-size: 13px; }
.routine-row.is-off { opacity: .6; }
.wb-turn.hidden { display: none; }

/* Scorecard */
.score-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 6px 0 10px; }
.score-tile { border: 1px solid var(--line, #2a2622); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.score-tile span { font-size: 11px; color: var(--muted, #9a938a); text-transform: uppercase; letter-spacing: .04em; }
.score-tile b { font-size: 22px; font-variant-numeric: tabular-nums; }
.score-tile small { font-size: 11px; color: var(--muted, #9a938a); }
.score-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.score-tables table { width: 100%; font-size: 12px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.score-tables caption { text-align: left; font-size: 11px; color: var(--muted, #9a938a); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 4px; }
.score-tables td { padding: 3px 4px; border-top: 1px solid var(--line, #2a2622); }
.score-tables td:nth-child(n+2) { text-align: right; }
@media (max-width: 640px) { .score-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Home */
.home-stage { overflow: auto; }
.home-wrap { max-width: 1240px; margin: 0 auto; padding: 28px 28px 60px; width: 100%; box-sizing: border-box; }
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.home-kicker { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--bronze, #c9a66b); }
.home-title { margin: 2px 0 0; font-family: var(--serif, Georgia, serif); font-weight: 400; font-size: 34px; }
.home-head-actions { display: flex; gap: 8px; }
.home-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.home-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line, #2a2622); background: transparent; color: inherit; border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.home-chip:hover { border-color: var(--bronze, #c9a66b); }
.home-chip span:last-child { color: var(--muted, #9a938a); }
.home-chip .dot, .sys-pool .dot { width: 8px; height: 8px; border-radius: 50%; background: #3fa66b; flex: none; display: inline-block; }
.home-chip.is-warn .dot { background: #d99a2b; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; background: #3fa66b; box-shadow: 0 0 0 3px rgba(63, 166, 107, .15); flex: none; }
.is-amber .health-dot { background: #d99a2b; box-shadow: 0 0 0 3px rgba(217, 154, 43, .15); }
.is-red .health-dot { background: #d0584a; box-shadow: 0 0 0 3px rgba(208, 88, 74, .18); }
@media (max-width: 640px) { .home-wrap { padding: 18px 14px 40px; } .home-grid { grid-template-columns: 1fr; } .home-title { font-size: 28px; } }

/* System */
.sys-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 14px; }
.sys-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sys-table th { text-align: left; font-size: 11px; color: var(--muted, #9a938a); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; padding: 4px 6px; }
.sys-table td { padding: 7px 6px; border-top: 1px solid var(--line, #2a2622); }
.sys-table tr.is-failed td:nth-child(2) { color: var(--danger, #e5484d); }
.sys-steps { padding-left: 20px; }
.sys-steps li { margin: 10px 0; }
.sys-steps pre { white-space: pre-wrap; word-break: break-all; margin: 6px 0; font-size: 12px; }
.sys-pools { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.sys-pool { border: 1px solid var(--line, #2a2622); border-radius: 12px; padding: 10px 12px; }
.sys-pool h5 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #9a938a); }
.sys-pool ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.sys-pool li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sys-pool li.is-benched .dot { background: #d99a2b; }
.sys-timers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sys-timers li { border: 1px solid var(--line, #2a2622); border-radius: 12px; padding: 10px 12px; font-size: 13px; display: grid; gap: 4px; }
.sys-timers p { margin: 0; font-size: 12px; }
.sys-think { display: flex; flex-wrap: wrap; gap: 6px; }
.sys-log { max-height: 340px; overflow: auto; border: 1px solid var(--line, #2a2622); border-radius: 12px; padding: 8px 10px; font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(0, 0, 0, .25); }
.log-line span { color: var(--muted, #9a938a); }
.log-line.is-error { color: #e07b6e; }
.log-line.is-warn { color: #e0b15a; }
#sysLogQ { flex: 1; min-width: 200px; }
/* Phone header: three views fit beside the menu and Settings */
@media (max-width: 640px) {
  .stages .stage-btn { min-width: 0; padding: 7px 11px; font-size: 13px; }
  .stages { gap: 0; }
  .bar-left .mark-gem { display: none; }
}
@media (max-width: 640px) { .sys-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Chats: Work with me lives in the chat column, listed in the rail like CEOs and to-dos. */
.chat-col.wb-on > .chat-shell { display: none !important; }
.wb-inline { flex: 1; min-height: 0; display: flex; }
.wb-inline[hidden] { display: none; }
.wb-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: 1; width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 16px 12px; }
.wb-title-row { display: flex; align-items: center; gap: 10px; padding: 14px 4px 8px; border-bottom: 1px solid var(--line, #2a2622); }
.wb-title { margin: 0; flex: 1; min-width: 0; font-family: var(--serif, inherit); font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: text; border-radius: 6px; padding: 2px 6px; margin-left: -6px; }
.wb-title:hover { background: color-mix(in srgb, var(--bronze, #c9a66b) 8%, transparent); }
.wb-title[contenteditable="true"] { outline: 1px solid var(--bronze, #c9a66b); white-space: normal; }
.wb-head-actions { display: flex; gap: 6px; flex-shrink: 0; }
.wb-stream { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 4px; }
.wb-composer { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line, #2a2622); border-radius: 16px; background: var(--panel, #151311); }
.wb-composer:focus-within { border-color: color-mix(in srgb, var(--bronze, #c9a66b) 60%, var(--line, #2a2622)); }
.wb-composer textarea { width: 100%; resize: none; min-height: 48px; max-height: 40vh; border: 0; background: transparent; padding: 4px 2px; font: inherit; color: inherit; outline: none; box-shadow: none; }
.wb-composer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-composer-bar .send { margin-left: auto; }
.wb-mode-note { font-size: 12px; }
.wb-model { max-width: 220px; font-size: 12px; }
.wb-empty { max-width: 40rem; margin: 8vh auto 0; text-align: center; display: grid; gap: 10px; }
.wb-empty h3 { margin: 0; font-family: var(--serif, inherit); font-size: 26px; font-weight: 600; }
.wb-empty p { margin: 0; line-height: 1.55; }
.wb-starters { display: grid; gap: 8px; margin-top: 10px; }
.wb-starter { text-align: left; border: 1px solid var(--line, #2a2622); background: transparent; color: inherit; border-radius: 12px; padding: 10px 14px; cursor: pointer; font-size: 14px; }
.wb-starter:hover { border-color: var(--bronze, #c9a66b); color: var(--bronze, #c9a66b); }

.org-chats-slot { flex-shrink: 0; min-width: 0; background: var(--bg-rail); border-top: 1px solid var(--line); }
.org-chats { padding: 6px 8px 4px; max-height: min(28vh, 13rem); overflow: auto; }
.org-chats.collapsed { max-height: none; }
.org-chats.collapsed .org-chats-body { display: none; }
.org-chats-head { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; background: var(--bg-rail); z-index: 1; padding-bottom: 4px; }
.org-chats-toggle { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); background: transparent; border: 0; padding: 8px 4px; cursor: pointer; text-align: left; }
.org-chats-toggle:hover { color: var(--bronze); }
.org-chats-new { flex-shrink: 0; font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.org-chats-new:hover, .org-chats-new.on { border-color: var(--bronze); color: var(--bronze); }
.org-chats-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.org-chat { display: flex; align-items: center; border-radius: 8px; }
.org-chat:hover, .org-chat.on { background: color-mix(in srgb, var(--bronze-soft, #c9a66b) 22%, transparent); }
.org-chat-open { flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; background: transparent; border: 0; color: inherit; padding: 6px 8px; cursor: pointer; }
.org-chat-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-chat.on .org-chat-title { font-weight: 600; }
.org-chat-sub { font-size: 11px; color: var(--muted); }
.org-chat-del { flex-shrink: 0; opacity: 0; border: 0; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; padding: 4px 8px; cursor: pointer; border-radius: 6px; }
.org-chat:hover .org-chat-del, .org-chat-del:focus-visible { opacity: 1; }
.org-chat-del:hover { color: #e07b6e; }
.org-chats-more { background: transparent; border: 0; color: var(--muted); font-size: 12px; padding: 6px 8px; cursor: pointer; }
.org-chats-more:hover { color: var(--bronze); }
.org-btn.on.wb-dim { background: transparent; }
@media (max-width: 900px) {
  .wb-turn-grid { grid-template-columns: 1fr; }
  .wb-main { padding: 0 10px 10px; }
  .org-chat-del { opacity: 1; }
  .wb-model { max-width: 150px; }
}

/* Home: one table, a row per company; a stuck move is a sub-row under its company. */
.home-summary { margin: 0 0 10px; font-size: 13px; color: var(--muted, #9a938a); }
.home-summary .is-red { color: #e07b6e; } .home-summary .is-amber { color: #e0b15a; } .home-summary .is-green { color: #6cc28f; }
.home-table-wrap { border: 1px solid var(--line, #2a2622); border-radius: 14px; overflow: hidden; background: var(--panel, #151311); }
.home-table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: 14px; }
.home-table thead th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #9a938a); padding: 0; border-bottom: 1px solid var(--line, #2a2622); background: color-mix(in srgb, var(--line, #2a2622) 25%, transparent); white-space: nowrap; }
.home-table thead th { padding: 11px 14px; }
.home-table thead th:has(> button) { padding: 0; }
.home-table thead th > button { display: block; width: 100%; text-align: inherit; background: none; border: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; padding: 11px 14px; cursor: pointer; }
.home-table thead th > button:hover, .home-table thead th.is-sorted { color: var(--ink, #f2ece2); }
.home-table td { padding: 12px 14px; border-bottom: 1px solid var(--line, #2a2622); vertical-align: middle; }
.home-table tbody tr:last-child td { border-bottom: 0; }
.home-row { cursor: pointer; transition: background .12s ease; }
.home-row:hover, .home-row:focus-visible { background: color-mix(in srgb, var(--bronze, #c9a66b) 6%, transparent); outline: none; }
.home-row.has-sub td { border-bottom-color: transparent; }
/* A product (Nadia under Kept in Touch) sits under its company in Home and in the rail. */
.home-row.is-product .home-co { padding-left: 18px; }
.org-project.org-product { margin-left: 16px; border-left: 1px solid color-mix(in srgb, var(--bronze, #c9a66b) 30%, transparent); padding-left: 4px; }
.home-row.is-red td:first-child { box-shadow: inset 3px 0 0 #d0584a; }
.home-row.is-amber td:first-child { box-shadow: inset 3px 0 0 #d99a2b; }
.home-co { display: flex; align-items: center; gap: 10px; min-width: 0; }
.home-co b { display: block; font-family: var(--serif, Georgia, serif); font-weight: 400; font-size: 17px; white-space: nowrap; }
.home-co small { display: block; font-size: 11px; color: var(--muted, #9a938a); letter-spacing: .04em; }
.col-status { min-width: 180px; max-width: 280px; }
.home-status { display: inline-block; font-size: 12px; font-weight: 600; margin-right: 6px; }
.home-status.is-red { color: #e07b6e; } .home-status.is-amber { color: #e0b15a; } .home-status.is-green { color: #6cc28f; }
.home-status-why { display: block; font-size: 12px; color: var(--muted, #9a938a); line-height: 1.4; margin-top: 2px; }
.home-needs { margin-top: 6px; border: 0; border-radius: 999px; padding: 5px 10px; min-height: 26px; font-size: 11px; font-weight: 600; background: rgba(217, 154, 43, 0.16); color: #e0b15a; cursor: pointer; }
.home-needs:hover { background: rgba(217, 154, 43, 0.28); }
.col-now { color: var(--ink, inherit); max-width: 340px; }
.home-now { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.45; }
.col-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.home-table thead th.col-num > button { text-align: right; }
/* The business numbers lead Home: value, then how it compares with a week ago. */
.home-table thead th small { font-size: 11px; letter-spacing: .04em; text-transform: none; opacity: .8; }
.col-biz { min-width: 84px; }
.home-biz-label { display: none; }
.home-biz { display: block; font-family: var(--serif, Georgia, serif); font-weight: 400; font-size: 19px; color: var(--ink, #f2ece2); line-height: 1.2; }
.home-biz.is-stale { opacity: .6; }
.home-trend { display: block; font-size: 11px; color: var(--muted, #9a938a); }
.home-trend.is-up { color: #6cc28f; } .home-trend.is-down { color: #e07b6e; }
.home-biz-none { font-size: 12px; color: var(--muted, #9a938a); font-style: italic; }
.col-loop { font-size: 12px; line-height: 1.45; }
.col-loop > span { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-loop-record { font-weight: 600; color: var(--ink, inherit); }
.home-loop-last.is-won { color: #6cc28f; } .home-loop-last.is-lost { color: #e07b6e; }
.home-loop-next { color: var(--muted, #9a938a); }
.col-act { width: 1%; white-space: nowrap; }
.home-acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.home-acts .ghost-btn, .home-acts .send { padding: 6px 12px; font-size: 13px; min-height: 0; }
.home-icon { width: 32px; padding: 6px 0 !important; text-align: center; }
.home-sub td { padding: 0 14px 14px 40px; }
.home-sub.is-red td:first-child { box-shadow: inset 3px 0 0 #d0584a; }
.home-sub.is-amber td:first-child { box-shadow: inset 3px 0 0 #d99a2b; }
.home-stuck { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid color-mix(in srgb, #d99a2b 35%, var(--line, #2a2622)); background: color-mix(in srgb, #d99a2b 7%, transparent); border-radius: 10px; padding: 10px 12px; }
.home-sub.is-red .home-stuck { border-color: color-mix(in srgb, #d0584a 40%, var(--line, #2a2622)); background: color-mix(in srgb, #d0584a 7%, transparent); }
.home-stuck-text { flex: 1 1 360px; min-width: 0; display: grid; gap: 2px; }
.home-stuck p { margin: 0; font-size: 13px; line-height: 1.45; }
.home-stuck-head { font-size: 11px !important; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #9a938a); }
.home-stuck-head b { color: var(--ink, inherit); }
.home-stuck-next { font-weight: 600; overflow-wrap: anywhere; }
.home-stuck-why span { color: var(--muted, #9a938a); }
.home-stuck .need-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.home-stuck .need-actions button { padding: 6px 12px; font-size: 13px; min-height: 0; }
.home-add { margin-top: 12px; width: 100%; text-align: left; border: 1px dashed var(--line, #2a2622); border-radius: 12px; background: transparent; color: var(--ink, inherit); padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: 600; }
.home-add span { font-weight: 400; margin-left: 6px; }
.home-add:hover { border-color: var(--bronze, #c9a66b); }
@media (max-width: 1280px) { .home-table .col-loop { display: none; } }
@media (max-width: 760px) {
  .home-wrap { padding: 18px 12px 48px; }
  .home-table td, .home-table thead th, .home-table thead th > button { padding-left: 10px; padding-right: 10px; }
  .home-table thead th:has(> button) { padding: 0; }
  .home-acts [data-home-think], .home-acts .home-icon { display: none; }
  .col-status { min-width: 0; }
  .home-co b { font-size: 15px; white-space: normal; }
  .home-sub td { padding: 0 10px 12px; }
  .home-add span { display: block; margin: 2px 0 0; }
}

/* Desk view: the top of a CEO page. Needs you first, then what it is doing, then what it did. */
.desk-view { margin: 4px 0 12px; display: grid; gap: 10px; }
.desk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.desk-head h3 { margin: 0; font-family: var(--serif, Georgia, serif); font-weight: 500; font-size: 20px; }
.desk-head-acts { display: flex; gap: 6px; }
.desk-head-acts .ghost-btn { padding: 6px 12px; font-size: 13px; min-height: 0; }
.desk-needs { display: grid; gap: 8px; }
.desk-clear { margin: 0; padding: 12px 14px; border: 1px dashed var(--line, #2a2622); border-radius: 12px; color: var(--muted, #9a938a); font-size: 14px; }
.desk-need { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--bronze, #c9a66b) 45%, var(--line, #2a2622)); border-left: 3px solid var(--bronze, #c9a66b); border-radius: 12px; background: color-mix(in srgb, var(--bronze, #c9a66b) 6%, transparent); }
.desk-need.is-stuck { border-color: color-mix(in srgb, #d99a2b 45%, var(--line, #2a2622)); border-left-color: #d99a2b; background: color-mix(in srgb, #d99a2b 6%, transparent); }
.desk-need-text { flex: 1 1 360px; min-width: 0; display: grid; gap: 4px; }
.desk-need p { margin: 0; line-height: 1.45; }
.desk-need-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #9a938a); }
.desk-need-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.desk-need-why { font-size: 13px; } .desk-need-why span { color: var(--muted, #9a938a); }
.desk-why { font-size: 13px; } .desk-why summary { cursor: pointer; color: var(--muted, #9a938a); } .desk-why p { margin: 4px 0 0; color: var(--ink, inherit); }
.desk-need .need-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.desk-need .need-actions button { padding: 6px 12px; font-size: 13px; min-height: 0; }
.desk-doing { display: grid; gap: 4px; padding: 10px 14px; border: 1px solid var(--line, #2a2622); border-radius: 12px; }
.desk-line { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.desk-line span { display: inline-block; min-width: 84px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #9a938a); }
.desk-line.is-bad span { color: #e07b6e; }
.desk-results { border: 1px solid var(--line, #2a2622); border-radius: 12px; padding: 0 14px; }
.desk-results summary { cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 600; color: var(--muted, #9a938a); list-style: none; }
.desk-results summary::before { content: "▸ "; } .desk-results[open] summary::before { content: "▾ "; }
.desk-days { list-style: none; margin: 0; padding: 0 0 8px; display: grid; gap: 8px; }
.desk-day > b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #9a938a); margin-bottom: 4px; }
.desk-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.desk-item { display: grid; grid-template-columns: 44px 68px minmax(0, 1fr); gap: 8px; font-size: 13px; line-height: 1.45; align-items: baseline; }
.desk-time { color: var(--muted, #9a938a); font-variant-numeric: tabular-nums; }
.desk-lane { color: var(--bronze, #c9a66b); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.desk-what { overflow-wrap: anywhere; }
.desk-item.is-bad .desk-what { color: #e07b6e; }
.desk-foot { margin: 0; padding: 6px 0 10px; font-size: 12px; color: var(--muted, #9a938a); }
.link-btn { background: none; border: 0; padding: 0; color: var(--bronze, #c9a66b); cursor: pointer; font: inherit; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .desk-item { grid-template-columns: 40px minmax(0, 1fr); }
  .desk-lane { display: none; }
  .desk-line span { display: block; min-width: 0; }
}

/* What a CEO can see: five capabilities, a score, and what is missing. */
.desk-sees { margin: 0; font-size: 13px; color: var(--muted, #9a938a); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.desk-sees b { color: var(--ink, inherit); }
.desk-sees.is-on b { color: #6cc28f; } .desk-sees.is-mid b { color: #e0b15a; } .desk-sees.is-low b { color: #e07b6e; }
.sees-score { margin: 0 0 8px; font-size: 14px; } .sees-score b { font-size: 20px; margin-right: 6px; }
.sees-score.is-on b { color: #6cc28f; } .sees-score.is-mid b { color: #e0b15a; } .sees-score.is-low b { color: #e07b6e; }
.sees-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sees-cap { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13px; }
.sees-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: #e07b6e; }
.sees-cap.is-partial .sees-dot { background: #e0b15a; } .sees-cap.is-on .sees-dot { background: #6cc28f; }
.sees-cap b { font-size: 14px; }
.sees-have { margin: 2px 0 0; color: var(--muted, #9a938a); }
.sees-missing { margin: 4px 0 0; padding-left: 16px; display: grid; gap: 3px; }
.home-sees { font-weight: 600; } .home-sees.is-on { color: #6cc28f; } .home-sees.is-mid { color: #e0b15a; } .home-sees.is-low { color: #e07b6e; }

.desk-fold { background: none; border: 0; padding: 0 4px 0 0; color: inherit; font: inherit; cursor: pointer; }
.desk-view.is-folded .desk-fold { font-family: var(--serif, Georgia, serif); font-size: 17px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.desk-view.is-folded .desk-head { gap: 8px; }
.conn-result { margin: 6px 0 0; font-size: 13px; min-height: 1em; overflow-wrap: anywhere; }
.conn-result.is-ok { color: #6cc28f; } .conn-result.is-bad { color: #e07b6e; }
.fail-plain { margin: 6px 0 0; font-size: 13px; color: var(--muted, #9a938a); }

/* Functions: specialists the CEO calls on, no calendar in the headline */
.functions-card .fn-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.functions-card .fn-row { border: 1px solid var(--line, #2a2622); border-radius: 10px; padding: 10px 12px; }
.functions-card .fn-row.is-on { border-color: color-mix(in srgb, var(--bronze, #c9a66b) 35%, var(--line, #2a2622)); }
.functions-card .fn-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.functions-card .fn-head b { font-size: 15px; }
.functions-card .fn-last { margin-left: auto; font-size: 12px; }
.functions-card .fn-blurb { margin: 4px 0 0 26px; font-size: 13px; }
.functions-card .fn-detail { margin: 6px 0 0 26px; font-size: 13px; }
.functions-card .fn-detail summary { cursor: pointer; color: var(--muted, #9a938a); }
.functions-card .fn-detail ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.functions-card .fn-detail li { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.functions-card .fn-advanced { margin: 6px 0; font-size: 13px; }
.functions-card .fn-advanced summary { cursor: pointer; color: var(--muted, #9a938a); }

/* Connect and AI & spend: one box, what is connected, what is next; the catalog behind Advanced */
.connect-box { border: 1px solid color-mix(in srgb, var(--bronze, #c9a66b) 45%, var(--line, #2a2622)); border-radius: 14px; padding: 12px; background: var(--panel, #151311); display: grid; gap: 10px; }
.connect-box textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 52px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: transparent; border: 0; color: inherit; outline: none; }
.connect-guess:empty { display: none; }
.connect-guess p { margin: 0 0 6px; font-size: 14px; }
.connect-refuse { color: #e07b6e; }
.connect-picks, .connect-email { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.connect-email input { flex: 1 1 200px; min-width: 0; }
.connect-hosts { margin-top: 8px; font-size: 13px; } .connect-hosts summary { cursor: pointer; color: var(--muted, #9a938a); }
.connect-h { margin: 20px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.connect-h .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.connect-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; border: 1px solid var(--line, #2a2622); border-radius: 12px; overflow: hidden; }
.connect-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel, #151311); flex-wrap: wrap; }
.connect-list li > div { flex: 1 1 240px; min-width: 0; display: grid; gap: 2px; }
.connect-list li > div .muted { font-size: 12.5px; }
.connect-list .conn-result { flex: 1 1 100%; order: 3; margin: 0; }
.connect-list .conn-result:empty { display: none; }
.connect-list.is-suggested li { background: transparent; }
.connect-more { margin-top: 18px; border-top: 1px solid var(--line, #2a2622); padding-top: 10px; }
.connect-more > summary { cursor: pointer; color: var(--muted, #9a938a); font-size: 13px; padding: 4px 0; }
.connect-g { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 8px; }
.connect-g th, .connect-g td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line, #2a2622); }
.connect-g th { font-weight: 500; color: var(--muted, #9a938a); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.connect-code { font-size: 12px; padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--line, #2a2622) 50%, transparent); overflow-wrap: anywhere; }
.conn-ok { color: #6cc28f; } .conn-bad { color: #e07b6e; }
.ai-keys { margin: 0; padding: 0; list-style: none; counter-reset: k; display: grid; gap: 1px; border: 1px solid var(--line, #2a2622); border-radius: 12px; overflow: hidden; }
.ai-keys li { counter-increment: k; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel, #151311); flex-wrap: wrap; }
.ai-keys li::before { content: counter(k); width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; background: color-mix(in srgb, var(--bronze, #c9a66b) 20%, transparent); color: var(--bronze, #c9a66b); }
.ai-keys li > div { flex: 1 1 200px; display: grid; gap: 2px; } .ai-keys li > div .muted { font-size: 12.5px; }
.ai-acts { display: flex; gap: 4px; } .ai-acts .ghost-btn { padding: 4px 10px; min-height: 0; font-size: 13px; }
.connect-email ~ #aiKeyStatus, #aiKeyStatus { margin: 6px 0 0; font-size: 13px; }
.ai-spend { display: grid; gap: 8px; }
.ai-spend p { margin: 0; }
.ai-bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--line, #2a2622) 70%, transparent); overflow: hidden; }
.ai-bar span { display: block; height: 100%; background: var(--bronze, #c9a66b); }
.ai-cap { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.ai-cap input { width: 80px; } .ai-cap select { width: auto; }

/* CEO setup: short sections you open when you need them */
.ceo-sec { border: 1px solid var(--line, #2a2622); border-radius: 12px; margin: 10px 0; background: var(--panel, #151311); }
.ceo-sec > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; }
.ceo-sec > summary::-webkit-details-marker { display: none; }
.ceo-sec > summary::before { content: "▸"; color: var(--muted, #9a938a); font-size: 11px; }
.ceo-sec[open] > summary::before { content: "▾"; }
.ceo-sec > summary b { font-size: 15px; }
.ceo-sec > summary .muted { font-size: 12.5px; margin-left: auto; text-align: right; }
.ceo-sec-body { padding: 0 14px 12px; }
.ceo-sec-body > .usage-card, .ceo-sec-body > fieldset.usage-card { margin: 8px 0 0; border: 0; padding: 0; background: none; box-shadow: none; }
.ceo-sec-body > .field, .ceo-sec-body > .field-row { margin-top: 8px; }

#panel-ceo .ceo-sees-card { border: 1px solid var(--line, #2a2622); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; background: var(--panel, #151311); }
#panel-ceo .ceo-sees-card > h4 { margin: 0 0 4px; font-size: 15px; color: var(--ink, inherit); }
#panel-ai .connect-email { margin-top: 10px; }
#panel-ai .ai-keys + .connect-email, #panel-ai p.muted + .connect-email { margin-top: 10px; }

.functions-card .fn-head input[type="checkbox"] { width: auto; height: auto; margin: 0; flex: 0 0 auto; }
.functions-card .fn-head { display: flex !important; }
.functions-card .fn-blurb, .functions-card .fn-detail { margin-left: 24px; }

.connect-warn { color: #e0b15a; font-size: 13px; }
.connect-google-guide { margin-top: 18px; border: 1px solid color-mix(in srgb, var(--bronze, #c9a66b) 35%, var(--line, #2a2622)); border-radius: 12px; padding: 0 14px; background: var(--panel, #151311); }
.connect-google-guide > summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; padding: 12px 0; flex-wrap: wrap; }
.connect-google-guide > summary::-webkit-details-marker { display: none; }
.connect-google-guide > summary .muted { font-size: 12.5px; }
.gg-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.gg-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
.gg-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: color-mix(in srgb, var(--bronze, #c9a66b) 20%, transparent); color: var(--bronze, #c9a66b); }
.gg-steps p { margin: 2px 0 6px; font-size: 13px; }
.gg-link { display: inline-block; padding: 5px 12px; font-size: 13px; min-height: 0; text-decoration: none; }
.gg-where { font-size: 12.5px; } .gg-where a { color: var(--bronze, #c9a66b); }

/* Home top: one line — what needs you and what is wrong, else all clear; optional setup stays quiet */
.home-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.home-prob, .home-ok { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line, #2a2622); background: transparent; color: inherit; border-radius: 999px; padding: 7px 14px; font-size: 13px; font: inherit; }
.home-prob { cursor: pointer; text-align: left; }
.home-prob:hover { border-color: var(--bronze, #c9a66b); }
.home-prob .dot, .home-ok .dot { width: 8px; height: 8px; border-radius: 50%; background: #3fa66b; flex: none; display: inline-block; }
.home-prob.is-warn .dot { background: #d9534f; }
.home-prob.is-you .dot { background: #d99a2b; }
.home-prob::after { content: "→"; color: var(--muted, #9a938a); margin-left: 2px; }
.home-more { display: none; color: var(--muted, #9a938a); }
.home-more::after { content: none; }
.home-line.is-open .home-more { display: none !important; }
.home-optional { margin: 0 0 18px; font-size: 12px; }
.home-optional .link-btn { font-size: 12px; }
.home-sub-h { margin: 22px 0 8px; font-size: 14px; font-weight: 600; }
.home-sub-h .muted { font-weight: 400; margin-left: 8px; }
.home-helpers { display: grid; gap: 6px; }
.home-helper { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line, #2a2622); border-radius: 10px; }
.home-helper > div { display: grid; gap: 2px; min-width: 0; }
.home-helper small { color: var(--muted, #9a938a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-helper .home-acts { display: flex; gap: 6px; align-items: center; flex: none; }

/* You · Settings and Help sit in the top bar on every stage */
.bar-right .profile-dock { border: 0; padding: 0; background: transparent; display: flex; align-items: center; gap: 8px; }
.bar-right .profile-card { width: auto; padding: 4px 10px 4px 6px; border-radius: 999px; gap: 8px; }
.bar-right .profile-copy small { display: none; }
.bar-right .help-link { width: auto; padding: 0 4px; white-space: nowrap; }
@media (max-width: 1023px) { .bar-right .profile-dock { display: none; } }
.desk-need-side { display: grid; gap: 6px; justify-items: end; }
.desk-choice-hint { margin: 0; font-size: 11px; color: var(--muted, #9a938a); text-align: right; max-width: 380px; }
.desk-choice-hint b { color: inherit; font-weight: 600; }
.desk-view.is-flash .desk-need { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bronze, #c9a66b) 45%, transparent); transition: box-shadow .4s; }
.card.msg-cron .bubble-text { max-height: none; -webkit-mask-image: none; mask-image: none; }

/* The work sheet (Needs you / What it did / Schedule / Goals) fills the chat column. Nothing is tucked on the right. */
#stage-chat .chat-shell { position: relative; }
@media (min-width: 1024px) {
  #stage-chat .chat-shell #chatSchedule:not([hidden]) {
    position: absolute !important; inset: 0 !important; grid-column: 1 / -1 !important; grid-row: 1 / -1 !important;
    width: auto !important; height: auto !important; max-height: none !important; margin: 0 !important; border-radius: 14px !important;
    z-index: 40 !important; contain: none !important; padding: 0 !important;
  }
  #stage-chat .chat-shell.work-open #stream, #stage-chat .chat-shell.activity-open #stream { visibility: hidden; }
}
#stage-chat #chatSchedule .activity-body { padding: 16px 22px 28px; max-width: 980px; width: 100%; margin: 0 auto; }
#stage-chat #chatSchedule .activity-bar { padding: 12px 22px; }
#stage-chat #chatSchedule .activity-bar #activityTitle { font-size: 17px; font-weight: 600; }

/* One line above the chat: health, what is next, and the pills that open the sheet. */
.desk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin: 4px 0 10px; border: 1px solid var(--line, #2a2622); border-radius: 12px; }
.desk-bar-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 320px; }
.desk-bar-dot { width: 9px; height: 9px; border-radius: 50%; background: #3fa66b; flex: none; }
.desk-bar.is-warn .desk-bar-dot { background: #d99a2b; } .desk-bar.is-bad .desk-bar-dot { background: #d9534f; }
.desk-bar-sees { appearance: none; background: transparent; border: 1px solid var(--line, #2a2622); border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 12px; color: inherit; cursor: pointer; flex: none; }
.desk-bar-text { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-bar-text b { font-weight: 600; color: var(--muted, #9a938a); }
.desk-bar-acts { display: flex; gap: 6px; align-items: center; flex: none; }
.desk-pill { appearance: none; font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line, #2a2622); background: transparent; color: inherit; cursor: pointer; }
.desk-pill.is-hot { border-color: var(--bronze, #c9a66b); color: var(--bronze, #c9a66b); font-weight: 600; }
.desk-pill:hover, .desk-bar-sees:hover { border-color: var(--bronze, #c9a66b); }
@media (max-width: 700px) { .desk-bar-text { white-space: normal; } .desk-bar-acts { width: 100%; justify-content: flex-start; flex-wrap: wrap; } }
.activity-body .desk-need { width: 100%; margin: 0 0 10px; }
.activity-body .desk-need .need-ask { flex-basis: 100%; }
.activity-body .desk-need .need-help { margin-top: 6px; }
#stage-chat #todayDock:has(.desk-bar) { border: 0 !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; }

/* The PIN and share gates sit above everything (the phone chat dock covered the PIN field). */
#unlockGate:not(.hidden), #shareGate:not(.hidden) { z-index: 10000 !important; position: fixed !important; inset: 0 !important; display: grid !important; place-items: start center !important; padding: max(24px, env(safe-area-inset-top)) 16px 24px !important; overflow-y: auto; background: rgba(10, 9, 8, 0.94) !important; }
#unlockGate:not(.hidden) .panel, #shareGate:not(.hidden) .panel { position: relative !important; inset: auto !important; width: min(420px, 100%) !important; margin: 12vh 0 0 !important; transform: none !important; }
#unlockGate input { font-size: 18px; letter-spacing: 0.2em; }
body:has(#unlockGate:not(.hidden)) #chatDock, body:has(#shareGate:not(.hidden)) #chatDock { visibility: hidden; }

/* ── Phone (≤700px): one clear column per page ───────────────────────────────── */
.home-stuck-line { display: none; }
.need-howto summary { cursor: pointer; color: var(--muted, #9a938a); font-size: 13px; margin: 4px 0; }
.need-howto[open] summary { margin-bottom: 8px; }
@media (max-width: 1023px) {
  /* The CEO menu (☰) belongs to Chat; Home and Tools have their own pages. */
  body:not([data-stage="chat"]) #mobileOrgToggle { visibility: hidden; }
  /* The desk line shows on phones too (a leftover rule only kept the old desk block). */
  #stage-chat #todayDock:has(.desk-bar) { display: block !important; max-height: none !important; padding: 6px 12px 0 !important; }
  .desk-bar { margin: 0 0 6px; padding: 10px 12px; gap: 8px; }
  .desk-bar-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13px; }
  .desk-bar-acts { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .desk-bar-acts::-webkit-scrollbar { display: none; }
  .desk-bar-acts > * { flex: none; }
  /* Tools are desktop engine consoles; the phone keeps Home and Chat. */
  .stage-btn[data-stage="tools"] { display: none !important; }
  /* Settings tabs: no "BOARD" label eating the row. */
  #settings .settings-nav-label, #settings .drawer-nav-label { display: none !important; }
}
@media (max-width: 700px) {
  .home-wrap { padding: 16px 14px 40px !important; }
  .home-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .home-head-actions { width: 100%; display: flex; gap: 8px; }
  .home-head-actions > * { flex: 1; padding: 9px 10px; font-size: 14px; }
  #homeSystem { display: none; }
  .home-title { font-size: 30px; }
  .home-prob, .home-ok { font-size: 14px; padding: 8px 12px; }
  /* On a phone the strip shows the first problem; the rest wait behind "+N more" so the companies stay on screen. */
  .home-line:not(.is-open) .home-prob.is-extra { display: none; }
  .home-line .home-more { display: inline-flex; }
  .home-summary { font-size: 13px; }
  /* The company table becomes a stack of cards; the whole card opens that CEO's chat. */
  .home-table-wrap { border: 0; background: transparent; overflow: visible; }
  .home-table, .home-table tbody { display: block; }
  .home-table thead { display: none; }
  .home-table tr.home-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; align-items: center; padding: 14px 14px 14px 16px; margin: 0 0 10px; border: 1px solid var(--line, #2a2622); border-left-width: 3px; border-radius: 14px; background: var(--panel, #151311); cursor: pointer; }
  .home-table tr.home-row.is-red { border-left-color: #d9534f; }
  .home-table tr.home-row.is-amber { border-left-color: #d99a2b; }
  .home-table tr.home-row.is-green { border-left-color: #3fa66b; }
  .home-table tr.home-row > td { display: block; padding: 0; border: 0; }
  .home-table .col-co { grid-column: 1 / -1; grid-row: 1; }
  .home-table .col-status { grid-column: 1 / -1; grid-row: 2; }
  .home-table .col-biz { grid-row: 3; min-width: 0; text-align: left; padding-top: 6px !important; border-top: 1px solid var(--line, #2a2622) !important; }
  .home-table .home-biz-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #9a938a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .home-table .home-biz { font-size: 17px; }
  .home-table .col-loop, .home-table .col-act { display: none !important; }
  .home-table .home-status-why { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .home-table tr.home-sub { display: none; }
  .home-stuck-line { display: block; font-size: 12px; color: #d99a2b; margin-top: 2px; }
  .home-helper { flex-wrap: wrap; }
  /* Sheets and cards breathe on a phone. */
  #stage-chat #chatSchedule .activity-body { padding: 12px 14px 28px; }
  .desk-need { padding: 12px; }
  .desk-need-side { justify-items: stretch; width: 100%; }
  .desk-need .need-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .desk-need .need-actions button { width: 100%; }
  .desk-choice-hint { text-align: left; }
  .need-ask-row { gap: 6px; }
}
/* Tools: the note never overlaps the box above it. */
#stage-opencode .embed-head *, #stage-hermes .embed-head *, #stage-openship .embed-head * { max-height: none; }
#stage-opencode [class*="missing"], #stage-hermes [class*="missing"], #stage-openship [class*="missing"] { height: auto !important; overflow: visible !important; }
@media (max-width: 700px) {
  /* The card's own left edge carries the health colour; the desktop row accent is not repeated inside it. */
  .home-table tr.home-row > td, .home-table tr.home-row > td:first-child { box-shadow: none !important; border-left: 0 !important; }
  .home-table tr.home-row > td::before, .home-table tr.home-row::before { display: none !important; }
  /* Needs cards fit the screen: one column, full width, nothing spills right. */
  .activity-body .desk-need, .today-need-card.desk-need { display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; box-sizing: border-box; height: auto !important; max-height: none !important; overflow: visible !important; }
  .desk-need-text { flex: none !important; min-width: 0 !important; width: 100%; }
  .desk-need-title, .desk-need-why, .need-help-title { overflow-wrap: anywhere; }
  .desk-need .need-actions { grid-template-columns: 1fr; margin-top: 10px; }
  .desk-need .need-actions button { white-space: normal; text-align: center; }
  .need-ask-row { display: flex; min-width: 0; }
  .need-ask-input { min-width: 0; flex: 1; font-size: 15px; }
  #stage-chat #chatSchedule .activity-body { overflow-x: hidden; }
}

/* Toasts: what a button did, bottom of the screen, above the chat dock */
#toasts { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 64px); bottom: auto; transform: translateX(-50%); z-index: 9000; display: grid; gap: 8px; width: min(520px, calc(100vw - 24px)); pointer-events: none; }
.toast { padding: 11px 14px; border-radius: 12px; font-size: 14px; line-height: 1.4; background: #1f1c18; color: var(--ink, #f2ece2); border: 1px solid var(--line, #2a2622); box-shadow: 0 10px 30px rgba(0,0,0,.45); border-left: 3px solid #3fa66b; animation: otto-rise-in .2s ease-out; transition: opacity .4s, transform .4s; }
.toast.is-bad { border-left-color: #d9534f; }
.toast.is-out { opacity: 0; transform: translateY(-6px); }
button.is-busy { opacity: .75; cursor: progress; }
/* What it did */
.wid-hint { margin: -4px 0 10px; font-size: 12px; color: var(--muted, #9a938a); }
.wid-day { margin: 16px 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #9a938a); }
.wid-item { border: 1px solid var(--line, #2a2622); border-left: 3px solid #3fa66b; border-radius: 10px; margin: 0 0 6px; background: var(--panel, #151311); }
.wid-item.is-bad { border-left-color: #d9534f; } .wid-item.is-ask { border-left-color: #d99a2b; }
.wid-item > summary { list-style: none; display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: baseline; padding: 10px 12px; cursor: pointer; }
.wid-item > summary::-webkit-details-marker { display: none; }
.wid-time { font-size: 12px; color: var(--muted, #9a938a); font-variant-numeric: tabular-nums; }
.wid-lane { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--bronze, #c9a66b); }
.wid-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.wid-state { font-size: 12px; color: var(--muted, #9a938a); }
.wid-item.is-bad .wid-state { color: #d9534f; } .wid-item.is-ask .wid-state { color: #d99a2b; }
.wid-item[open] .wid-line { white-space: normal; }
.wid-body { padding: 4px 14px 12px; border-top: 1px solid var(--line, #2a2622); font-size: 14px; }
.wid-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wid-cut { margin: 8px 0 0; }
@media (max-width: 700px) {
  .wid-item > summary { grid-template-columns: auto 1fr auto; }
  .wid-lane { display: none; }
  #toasts { top: calc(env(safe-area-inset-top, 0px) + 60px); }
}

/* Home painted from this browser's last copy while fresh numbers load */
#homeGrid.is-stale .home-table-wrap, #homeGrid.is-stale .home-summary { opacity: .72; transition: opacity 250ms cubic-bezier(0.22, 1, 0.36, 1); }

/* The card's recommended answer is the filled button and says so. */
.need-actions button.is-rec { position: relative; }
.need-actions button.is-rec::after { content: "Recommended"; display: block; margin-top: 2px; font: 600 10px/1.2 var(--ui, system-ui); letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.need-actions button.is-rec.is-busy::after { content: none; }
@media (max-width: 700px) {
  /* A long card keeps its answers in reach: the buttons ride the bottom of the screen until the card ends. */
  .desk-need.is-pinned > .desk-need-side { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); }
  /* In the company sheet the bar sits on the sheet's bottom edge: its 28px padding no longer shows text under the bar. */
  #chatSchedule .activity-body .desk-need.is-pinned > .desk-need-side { bottom: calc(env(safe-area-inset-bottom, 0px) - 28px); }
  .desk-need > .desk-need-side { z-index: 2; margin: 10px -6px 0; padding: 8px 6px 6px; border-radius: 12px; background: color-mix(in srgb, var(--bronze, #c9a66b) 7%, var(--bg, #0f0d0b)); box-shadow: 0 -10px 18px -8px rgba(0,0,0,.55); }
  .desk-need > .desk-need-side .need-actions { margin-top: 0; }
  .desk-need-text > .need-more { min-height: 32px; padding: 8px 0; margin: 2px 0 0; }
  /* Connect: the paste box shows its whole hint, and column heads break between words, never inside one. */
  #settings .connect-box textarea { min-height: 84px; }
  .connect-g th { overflow-wrap: normal; word-break: normal; hyphens: none; }
  /* Key pool: four small buttons sit two by two instead of a tall stack. */
  #keyList .provider .actions { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px !important; }
  #keyList .provider .actions button { width: 100%; min-width: 0; }
}

/* Lock screen: the passkey button sits under Open, full width. */
#unlockGate .unlock-passkey { display: block; width: 100%; margin: 10px 0 4px; }
#unlockGate .unlock-passkey[hidden] { display: none; }
.passkeys { margin-top: 14px; }
.passkeys .devices-list li .link-btn { margin-left: 8px; }

/* A company sheet on a wide screen stops above the composer, so you can still type to that CEO (sending closes it). */
@media (min-width: 1024px) {
  #stage-chat .chat-shell #chatSchedule:not([hidden]) { bottom: calc(var(--chat-dock, 120px) + 8px) !important; }
  #stage-chat .chat-shell.work-open #chatDock, #stage-chat .chat-shell.activity-open #chatDock { position: relative; z-index: 41; }
}

/* Tools: "← Chat · Support" is a back link, not a grey system button (it showed the browser's default button box). */
button.embed-back { appearance: none; -webkit-appearance: none; background: none; border: 0; margin: 0; padding: 6px 0; min-height: 32px; font-family: var(--ui, inherit); text-align: left; cursor: pointer; }
button.embed-back:hover { text-decoration: underline; text-underline-offset: 3px; }
button.embed-back:focus-visible { outline: 2px solid var(--bronze, #c9a66b); outline-offset: 2px; border-radius: 6px; }

/* A code card whose coder run stopped on a wall (out of credit, an error) says so in the warning colour. */
.dec-bg.coder-stopped { padding: 10px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, #e0a85e 55%, transparent); background: color-mix(in srgb, #e0a85e 10%, transparent); }
.dec-bg.coder-stopped > span { display: block; margin-bottom: 2px; color: #e9c48d; font-weight: 600; }

/* Phone Home: "N things need you" already leads the page as a chip; the summary line does not repeat it. */
@media (max-width: 700px) { .home-summary .home-sum-needs { display: none; } }

/* Usage: what happens while OpenCode Go is used up (10/16). */
.spend-break > .wallet-note { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.spend-break > .wallet-note a { color: inherit; text-decoration: underline; }

/* Openship's dashboard, framed from the companion's own host name (openbot/openship_companion.py). */
#osFrame[hidden] { display: none; }
#osEmbedHint a { color: var(--ink); text-underline-offset: 3px; }

/* ── Running now: every engine's live work on one page, and inline under the chat it came from. */
.running-stage { overflow: auto; align-content: start; }
.running-wrap { max-width: 980px; }
.running-summary { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.running-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.running-filter {
  min-height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hair-strong, var(--hair)); background: transparent; color: var(--strong);
  font: 500 12.5px/1 var(--ui);
}
.running-filter.on { background: var(--bronze-soft); border-color: color-mix(in srgb, var(--bronze) 45%, transparent); color: var(--ink); }
.running-list { display: grid; gap: 12px; }
.run-card {
  display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  min-width: 0;
}
.run-card-head { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.run-card-copy { display: grid; gap: 2px; min-width: 0; }
.run-card-copy b { font: 600 14.5px/1.3 var(--ui); color: var(--ink); overflow-wrap: anywhere; }
.run-card-copy > span { font-size: 12.5px; color: var(--muted); }
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bronze); animation: run-pulse 1.8s ease-out infinite; }
.run-card[data-engine-kind="opencode"] .run-dot, .stream-live-row[data-engine-kind="opencode"] .run-dot { background: #6aa7ff; }
.run-card[data-engine-kind="openship"] .run-dot, .stream-live-row[data-engine-kind="openship"] .run-dot { background: #7bc49a; }
@keyframes run-pulse { 0% { box-shadow: 0 0 0 0 rgba(201, 166, 107, 0.5); } 100% { box-shadow: 0 0 0 8px rgba(201, 166, 107, 0); } }
@media (prefers-reduced-motion: reduce) { .run-dot { animation: none; } }
.run-step { margin: 0; font-size: 13px; line-height: 1.45; color: var(--strong); overflow-wrap: anywhere; }
.run-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.run-note a { color: var(--ink); text-underline-offset: 3px; }
.run-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.run-actions .ghost-btn { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.run-actions .run-open { color: var(--bronze); }
.running-empty { padding: 28px 20px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--muted) 30%, transparent); }
.running-empty b { font: 500 16px/1.3 var(--display); color: var(--ink); }
.running-empty p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 62ch; }
.running-ship-note { padding: 4px 2px; }
.running-done { margin-top: 22px; }
.running-sub { margin: 0 0 8px; font: 600 11px/1 var(--ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.run-done-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.run-done-row { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 8px 4px; border-bottom: 1px solid color-mix(in srgb, var(--muted) 14%, transparent); }
.run-done-copy { display: grid; gap: 2px; min-width: 0; }
.run-done-copy b { font: 500 13.5px/1.3 var(--ui); color: var(--strong); overflow-wrap: anywhere; }
.run-done-copy small { font-size: 12px; color: var(--muted); }
.running-stage .live-watch > summary,
.stream-live .live-watch > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; padding: 4px 0; }
.running-stage .live-watch > summary::-webkit-details-marker,
.stream-live .live-watch > summary::-webkit-details-marker { display: none; }
.running-stage .live-watch > summary::before,
.stream-live .live-watch > summary::before { content: "▸ "; }
.running-stage .live-watch[open] > summary::before,
.stream-live .live-watch[open] > summary::before { content: "▾ "; }
.running-stage .live-tail,
.stream-live .live-tail {
  max-height: 260px; overflow: auto; margin: 4px 0 2px; padding: 10px 12px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink); background: color-mix(in srgb, var(--panel) 70%, black);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent); border-radius: 10px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.stream-live .live-tail { max-height: 180px; }
#chatDock > .stream-live { max-height: 42vh; overflow: auto; margin: 0 0 8px; }
.rail-running-btn.is-live small { color: var(--bronze); }
.rail-running-btn.is-live svg { color: var(--bronze); }

/* Inline under a chat: what this CEO or chat has working right now, with its own live tail. */
.stream-live { display: grid; gap: 8px; margin: 6px 0 10px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--bronze) 28%, transparent); background: color-mix(in srgb, var(--bronze-soft) 60%, transparent); }
.stream-live[hidden] { display: none; }
.stream-live-kicker { margin: 0; font: 600 10.5px/1 var(--ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--bronze); }
.stream-live-row { display: grid; gap: 4px; min-width: 0; }
.stream-live-head { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.stream-live-head b { font: 500 13.5px/1.3 var(--ui); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream-live-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stream-live .run-step { font-size: 12.5px; color: var(--muted); }
.stream-live-more { justify-self: start; border: 0; background: transparent; padding: 2px 0; color: var(--bronze); font: 500 12.5px/1.3 var(--ui); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .run-card { padding: 12px; }
  .run-card-head { grid-template-columns: 10px minmax(0, 1fr); }
  .run-card-head .engine-pill { grid-column: 2; justify-self: start; }
  .stream-live-head { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .stream-live-head .run-actions { grid-column: 2 / -1; }
  .running-filters { width: 100%; }
  .running-stage .live-tail { max-height: 200px; font-size: 11.5px; }
  #chatDock > .stream-live { max-height: 34vh; }
}
