/* Blackbook Engine — Front Page (index.html) page-specific styles.
 *
 * The page was rebuilt onto the artifact's Front Page composition (L498-516):
 * a .buying-window band over a .fp-grid of two columns. Strict 1:1 (David,
 * 2026-09-13) deleted the surfaces the artifact does not depict, and their CSS
 * with them — the market ticker (and the eight rgba literals that sat on its
 * inverse ground), the hero card, the ICP resume card, the Active Deals table,
 * and the three-column Signal Desk, whose .col / .col-head / .row / .desk-*
 * vocabulary would otherwise have collided with .fp-grid's own .col.
 *
 * Everything the shared layer owns is consumed rather than restated: .screen,
 * .col-head with its .count, .qrank / .qbody / .qhead / .nm / .qco / .qtag /
 * .qwhy, .progress-bar's tokens, .empty-state, .skeleton, .btn, .error-block.
 * What is left here is this page's own composites and the popover chrome.
 */

/* ── Buying window ─────────────────────── */
/* The artifact's inverse band. Its two on-dark values ride tokens added for
   them (--ds-ink-inverse-muted, --ds-border-inverse): the artifact writes
   #C9C9CE and #333333 literally, and page CSS may state no literals. */
.buying-window { background: var(--ds-bg-inverse); color: var(--ds-ink-inverse); border-radius: var(--ds-radius);
  padding: var(--ds-card-padding); display: flex; flex-direction: column; gap: 5px; margin-bottom: 20px; }
.bw-kicker { font-size: 0.75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ds-accent-on-dark); }
.bw-account { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.18; }
.bw-why { font-size: 0.875rem; font-weight: 300; color: var(--ds-ink-inverse-muted); line-height: 1.45; }
/* The committee-gap slot. It renders empty today — the board has no source for
   it — so this rule draws nothing until one exists. Kept because the empty
   slot must not collapse the band's rhythm when it is filled. */
.bw-gap { font-size: 0.875rem; border-top: 1px solid var(--ds-border-inverse); padding-top: 8px; margin-top: 4px; }
.bw-gap:empty { display: none; }

/* ── Signal feed | Today's queue ────────── */
.fp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ds-space-5); align-items: start; }
@media (max-width: 900px) { .fp-grid { grid-template-columns: 1fr; } }

.feed { display: flex; flex-direction: column; gap: var(--ds-space-2); }
.feedrow { border: 1px solid var(--ds-border); border-radius: var(--ds-radius); padding: 14px 16px;
  display: flex; gap: 10px; align-items: flex-start; background: var(--ds-bg);
  box-shadow: var(--sh-card); }
/* The artifact's .feedrow is inert; this one opens the signal popover, so it
   carries the affordance the action needs. Divergence recorded in the PR. */
.feedrow[data-grain] { cursor: pointer; }
.feedrow[data-grain]:hover { background: var(--ds-canvas); }
.fscore { font-family: var(--ds-font-mono); font-weight: 500; font-size: 0.875rem; color: var(--ds-text-accent);
  width: 30px; text-align: right; flex: none; font-variant-numeric: tabular-nums; padding-top: 1px; }
.feedrow-body { flex: 1; min-width: 0; }
.feedrow-nm { font-weight: 600; font-size: 0.9375rem; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.family { font-size: 0.75rem; border: 1px solid var(--ds-border); border-radius: var(--ds-pill);
  padding: 1px 9px; color: var(--ds-ink-secondary); white-space: nowrap; font-weight: 400; }
.feedrow-tl { font-size: 0.75rem; color: var(--ds-ink-muted); letter-spacing: var(--ds-track-caption); }
.feedrow-desc { font-size: 0.875rem; margin-top: 4px; line-height: 1.45; }

.progress { height: 4px; background: var(--ds-pebble); border-radius: var(--ds-pill); overflow: hidden; margin-bottom: 10px; }
/* No transition on width: it is written once per load, and animating it would
   only thrash layout. The artifact's comment at L123-125 rules the same. */
.progress i { display: block; height: 100%; background: var(--ds-action-primary); border-radius: var(--ds-pill); }

.queue { display: flex; flex-direction: column; border: 1px solid var(--ds-border); border-radius: var(--ds-radius);
  overflow: hidden; background: var(--ds-bg); box-shadow: var(--sh-card); }
.taskrow { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--ds-border); }
.taskrow:last-child { border-bottom: none; }
/* The queue is capped server-side, so this is the row that says what is behind
   the slice — otherwise the board reads as if today only holds 25 things. */
.queue-more { padding: 12px 18px; font-size: 0.8rem; color: var(--ds-ink-muted);
  background: var(--ds-canvas); border-top: 1px solid var(--ds-border); }
.taskrow:hover { background: var(--ds-canvas); }
/* The rank's geometry belongs to this row, not to the shared .qrank: Phase 0
   shares the type, this page states the column it occupies. */
.taskrow .qrank { width: 16px; flex: none; padding-top: 2px; font-variant-numeric: tabular-nums; }
/* Due status, restored 2026-09-13 (David) as the shared .st pill. No variant is
   added: overdue takes .st.todo, which already carries the "needs attention"
   weight, and the rest take the base pill. */
.taskrow .st { flex: none; margin-top: 1px; }

/* A task whose upstream step has not landed: the page's locked state. */
.task-btn-locked { background: var(--ds-bg-subtle); border-color: var(--ds-border); color: var(--ds-ink-muted); cursor: not-allowed; }

/* ── Signal row action popover (opens on click, fixed-positioned) ── */
.signal-popover {
  position: fixed; z-index: 200; width: 244px;
  background: var(--ds-bg); border: 1.5px solid var(--ds-ink);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.po-head { padding: 10px 12px; border-bottom: 1px solid var(--ds-border); }
.po-title { font-size: 0.86rem; font-weight: 600; }
.po-meta { font-family: var(--ds-font-mono); font-size: 0.6rem; color: var(--ds-ink-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.po-nav { padding: 6px 0; border-bottom: 1px solid var(--ds-border); }
.po-nav a { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; font-size: 0.8rem; color: var(--ds-ink); text-decoration: none; }
.po-nav a:hover { background: var(--ds-bg-subtle); }
.po-nav .po-x { font-family: var(--ds-font-mono); font-size: 0.7rem; color: var(--ds-ink-muted); }
.po-reach { padding: 10px 12px; }
.po-reach-label { font-family: var(--ds-font-mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ds-ink-muted); margin-bottom: 8px; }
.po-btn { display: block; width: 100%; text-align: left; font: inherit; font-size: 0.8rem; padding: 7px 10px; margin-bottom: 6px; border-radius: var(--ds-radius); cursor: pointer; }
.po-btn:last-child { margin-bottom: 0; }
.po-btn.po-email { background: var(--ds-bg-accent-tint); border: 1px solid var(--ds-accent); color: var(--ds-accent); }
.po-btn.po-linkedin { background: var(--ds-bg-subtle); border: 1px solid var(--ds-border-strong); color: var(--ds-ink); }
.po-reach-note { font-size: 0.76rem; color: var(--ds-ink-muted); margin-top: 6px; }
.po-reach-note a { color: var(--ds-accent); }

/* Resolve & draft button (on-demand MH draft) */
.po-btn.po-draft { background: var(--ds-bg-accent-tint, var(--ds-bg-subtle)); border: 1px solid var(--ds-accent); color: var(--ds-accent); }

/* Signal curation row (Acted / Noise / Snooze) in the popover */
.po-curate { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 8px 0; }
.po-curate .po-btn { margin-bottom: 0; text-align: center; padding: 6px 4px; }

/* On-demand draft modal — chrome is the shared .modal / .modal-foot. */
.mh-draft-body { font-size: 0.85rem; color: var(--ds-ink); max-height: 52vh; overflow: auto; }
.mh-draft-label { margin: 12px 0 4px; font-family: var(--ds-font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ds-ink-muted); }
.mh-draft-copy { background: var(--ds-bg-subtle); border: 1px solid var(--ds-border); border-radius: var(--ds-radius); padding: 10px; white-space: pre-wrap; word-break: break-word; }
.mh-draft-subject { font-weight: 600; margin-bottom: 6px; }
.mh-draft-actions { margin-top: 8px; }
.mh-draft-hint { margin-top: 10px; font-size: 0.72rem; color: var(--ds-ink-muted); }
.mh-draft-hint a { color: var(--ds-accent); }

/* ── Composer (spec 2026-09-15 §2). The overlay and the modal frame come from
   design-system.css; only what sits inside .cm-composer is owned here. No
   .modal-* selector may appear in a page stylesheet — those belong to the
   design system, and tests/test_design_system.py enforces it. ───────────── */

/* .cm-composer lands beside .modal, so it ties on specificity and wins on source
   order: design-system.css is linked first. It replaces the modal's padding and
   its own scrollbar, because the two panes scroll independently.

   Named `cm-composer`, not `composer`. It was the bare word until 2026-09-15,
   and because index.html links this file and icp-builder.css together, that rule
   also matched the ICP wizard's unrelated `.composer` — the chat answer area —
   taking its display, width and overflow with it and collapsing the field to
   236px. The `cm-` prefix is already this block's family (cm-main, cm-head,
   cm-body, …), so scoping it here costs nothing and cannot reach another page's
   markup. Same hazard still exists for any other bare name in this file: if you
   add one, check it against the wizard's classes first. */
.cm-composer { width: min(94vw, 1060px); padding: 0; overflow: hidden; display: flex; align-items: stretch; }
.cm-composer .cm-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.cm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ds-space-3); padding: var(--ds-space-4) var(--ds-space-5); border-bottom: 1px solid var(--ds-border); }
.cm-who { font-size: 1rem; font-weight: 600; color: var(--ds-ink); }
.cm-role { font-family: var(--ds-font-mono); font-size: 0.7rem; color: var(--ds-ink-muted); margin-top: 2px; }
.cm-body { padding: var(--ds-space-5); }
.cm-status { font-family: var(--ds-font-mono); font-size: 0.7rem; color: var(--ds-ink-muted); padding-top: var(--ds-space-2); }
/* The fact the draft was built from. Its own node, never the message: the body
   is the text that sends. It ships hidden and a draft with no citation leaves
   it that way, so this rule only ever styles a line that has something to say. */
.cm-using { font-size: var(--ds-body-xs); color: var(--ds-ink-muted); padding: 0 0 var(--ds-space-2) 2px; }

/* The channel frame. Reference geometry (§0.3): colour, type and spacing are
   this repo's tokens, not the artifact's values. */
.chan { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); overflow: hidden; background: var(--ds-bg); }
.chan-chrome { display: flex; align-items: center; gap: var(--ds-space-2); padding: 10px var(--ds-space-4); border-bottom: 1px solid var(--ds-border); background: var(--ds-bg-subtle); font-size: 0.75rem; color: var(--ds-ink-secondary); }
.chan-ico { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--ds-radius); background: var(--ds-ink-inverse); color: var(--ds-bg); font-size: 0.7rem; font-weight: 700; }
.chan-word { font-weight: 600; color: var(--ds-ink); }
.chan-mut { color: var(--ds-ink-muted); }
.pv-badge { margin-left: auto; font-family: var(--ds-font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ds-ink-muted); }
.chan-screen { padding: var(--ds-space-4); }
.cm-peep { display: flex; align-items: center; gap: var(--ds-space-2); padding-bottom: var(--ds-space-3); }
.cm-av { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--ds-pill); flex: none; background: var(--ds-bg-subtle); border: 1px solid var(--ds-border); font-size: 0.72rem; font-weight: 700; }
.cm-nm { font-weight: 600; font-size: 0.9rem; color: var(--ds-ink); }
.cm-mut { font-size: 0.75rem; color: var(--ds-ink-muted); }
.chan-msg { border: 1px solid var(--ds-border); border-radius: var(--ds-radius); padding: var(--ds-space-3); font-size: 0.85rem; line-height: 1.55; color: var(--ds-ink); white-space: pre-wrap; min-height: 3.5rem; }
.chan-fields { border-bottom: 1px solid var(--ds-border); }
.chan-f { display: flex; gap: var(--ds-space-2); padding: 10px var(--ds-space-4); border-bottom: 1px solid var(--ds-border); font-size: 0.8rem; }
.chan-f:last-child { border-bottom: none; }
.chan-f .k { font-family: var(--ds-font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ds-ink-muted); width: 4rem; flex: none; padding-top: 2px; }
.chan-f .v { color: var(--ds-ink); flex: 1; min-width: 0; }
.chan-actions { display: flex; align-items: center; gap: var(--ds-space-2); padding-top: var(--ds-space-3); }
.chan-actions .sp { flex: 1; }
.chan [contenteditable]:hover { box-shadow: 0 0 0 1px var(--ds-border-heavy); border-radius: var(--ds-radius); }
/* The house ring: --ds-accent at a 2px offset, as .btn:focus-visible states it.
   An earlier draft used --ds-action-primary, which is near-black (#1D1D1F) —
   because the frame body holds focus on open, that read as a heavy black border
   rather than as focus. */
.chan [contenteditable]:focus { outline: 2px solid var(--ds-accent); outline-offset: 2px; }

/* The ledger rides beside the composer. §4.4 bans a page, a tab and a drawer;
   this is a pane of the same window. */
.ledger { width: 300px; flex: none; border-left: 1px solid var(--ds-border); padding: var(--ds-space-4); overflow-y: auto; }
.lg-sec { margin-bottom: var(--ds-space-4); }
.lg-lab { display: block; font-family: var(--ds-font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ds-ink-muted); margin-bottom: var(--ds-space-2); }
.lg-fact { display: flex; gap: var(--ds-space-2); align-items: flex-start; font-size: 0.8rem; color: var(--ds-ink); padding: 6px 0; border-bottom: 1px solid var(--ds-border); }
.lg-tag { flex: none; font-family: var(--ds-font-mono); font-size: 0.6rem; text-transform: uppercase; color: var(--ds-ink-muted); border: 1px solid var(--ds-border); border-radius: var(--ds-pill); padding: 1px 6px; }
.lg-none { font-size: 0.8rem; color: var(--ds-ink-muted); }
/* A proposed fact carries a decision, so it wraps: the tag and the sentence
   stay on the first line and Approve/Discard sit under them, rather than
   becoming a third flex item squeezed beside the text. */
.lg-pending { flex-wrap: wrap; }
.lg-mini { flex-basis: 100%; display: flex; gap: var(--ds-space-2); padding-top: 4px; }
/* Advocacy buttons flow and wrap: six short verbs in a narrow rail. */
.lg-adv { margin: 0 4px 4px 0; }
