/* Pipeline: deal desk for Lee Woodlands Group.
   Ink navy shell, cool paper workspace, one signal colour (amber) reserved
   for "this needs you". Staleness is the memorable element: every lead shows
   how long since anyone touched it. */
:root {
  --ink: #162033;
  --ink-2: #1f2b42;
  --ink-3: #2c3a55;
  --paper: #f5f6f8;
  --card: #ffffff;
  --line: #e2e5eb;
  --text: #1b2433;
  --muted: #697285;
  --signal: #d9822b;
  --signal-soft: #fbefe2;
  --good: #2f7d5b;
  --good-soft: #e5f2ec;
  --bad: #b5443a;
  --radius: 8px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--paper);
  font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* shell */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #cdd3df; padding: 20px 12px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.brand { color: #fff; font-weight: 600; font-size: 15px; padding: 4px 10px 22px; letter-spacing: -0.01em; }
.brand span { display: block; font-weight: 400; font-size: 12px; color: #8d97ab; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: #cdd3df; }
.nav a:hover { background: var(--ink-2); text-decoration: none; color: #fff; }
.nav a.on { background: var(--ink-3); color: #fff; }
.nav svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; flex: none; }
.side-foot { margin-top: auto; font-size: 12px; color: #8d97ab; padding: 10px; line-height: 1.45; }
.side-foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 6px; }
.side-foot .dot.off { background: var(--bad); }
.main { min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--card); }
.page { padding: 24px 28px 48px; }

/* buttons + inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
  padding: 7px 12px; border-radius: 6px; font: inherit; font-weight: 500; cursor: pointer; color: var(--text); }
.btn:hover { border-color: #c7ccd6; text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-3); }
input, select, textarea { font: inherit; color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 10px; background: #fff; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }

/* panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }

/* dashboard figures: a single ledger strip, not five cards */
.ledger { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 16px; }
.ledger div { padding: 16px 18px; border-left: 1px solid var(--line); }
.ledger div:first-child { border-left: 0; }
.ledger b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.ledger span { font-size: 12px; color: var(--muted); }
.ledger .flag b { color: var(--signal); }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .grow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.empty { color: var(--muted); padding: 8px 0; }

.av { width: 32px; height: 32px; border-radius: 50%; background: #e8ebf1; color: var(--ink); display: grid;
  place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.av.lg { width: 56px; height: 56px; font-size: 18px; }

.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #eef0f4; color: var(--ink); white-space: nowrap; }
.pill.signal { background: var(--signal-soft); color: #9a5512; }
.pill.good { background: var(--good-soft); color: var(--good); }

/* staleness rail: the one bold device. Width and colour = days since last touch */
.stale { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 8px; }
.stale i { display: block; height: 100%; background: var(--good); }
.stale.warm i { background: #c9a227; }
.stale.cold i { background: var(--signal); }

/* pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 272px; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.col { background: #eceef2; border-radius: var(--radius); padding: 10px; min-height: 60vh; }
.col.over { background: #e2e6ee; outline: 2px dashed #b8c0cf; }
.col-h { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 10px; font-weight: 600; }
.col-h .muted { font-weight: 400; font-size: 12px; }
.deal { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; }
.deal:active { cursor: grabbing; }
.deal.dragging { opacity: 0.5; }
.deal-t { font-weight: 600; display: block; }
.deal-m { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 500; color: var(--muted); border-top: 0; background: #fafbfc; }
tbody tr:hover { background: #fafbfc; }
.who { display: flex; align-items: center; gap: 10px; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; }
.filters input { max-width: 320px; }
.filters select { max-width: 200px; }

/* contact page */
.contact { display: grid; grid-template-columns: 300px 1fr 300px; gap: 16px; align-items: start; }
.id-card { text-align: left; }
.id-card h1 { margin-top: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .mk { position: absolute; left: 0; top: 4px; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
.timeline .mk.out { border-color: var(--muted); }
.timeline .mk.meet { background: var(--ink); }
.t-h { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.t-body { margin-top: 6px; white-space: pre-wrap; color: #34405a; font-size: 13px; max-height: 9.5em; overflow: hidden; }
.t-body.open { max-height: none; }
.more { font-size: 12px; color: var(--muted); background: none; border: 0; padding: 4px 0; cursor: pointer; font: inherit; }

/* conversations */
.inbox { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 71px); }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--card); }
.inbox-list a { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.inbox-list a:hover { background: #fafbfc; text-decoration: none; }
.inbox-list a.on { background: #eef1f6; box-shadow: inset 3px 0 0 var(--ink); }
.inbox-list .l1 { display: flex; justify-content: space-between; gap: 8px; }
.inbox-list .l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-list .l2, .inbox-list .l3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.inbox-list .l3 { color: var(--muted); }
.inbox-read { overflow-y: auto; padding: 24px 32px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; max-width: 760px; }
.msg.me { margin-left: 48px; border-color: #d3d9e4; background: #f8f9fc; }
.msg-h { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.msg-b { white-space: pre-wrap; font-size: 14px; }
.tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; }
.tabs a { padding: 5px 10px; border-radius: 6px; font-size: 13px; color: var(--muted); }
.tabs a.on { background: var(--ink); color: #fff; text-decoration: none; }

/* calendar */
.day { margin-bottom: 22px; }
.day h2 { font-size: 13px; color: var(--muted); font-weight: 500; }
.slot { display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.slot time { font-weight: 600; }
.slot.cancelled { opacity: 0.55; }
.slot.cancelled .slot-t { text-decoration: line-through; }

.notes-doc { white-space: pre-wrap; max-width: 780px; font-size: 14px; line-height: 1.65; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--ink); }
.login form { background: #fff; padding: 32px; border-radius: var(--radius); width: 340px; }
.login h1 { margin-bottom: 4px; }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; }

@media (max-width: 1100px) {
  .contact { grid-template-columns: 1fr; }
  .ledger { grid-template-columns: repeat(2, 1fr); }
  .g-2, .g-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .brand { padding: 4px 10px; }
  .nav { display: flex; flex-wrap: wrap; }
  .side-foot { display: none; }
  .page, .top { padding-left: 16px; padding-right: 16px; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .slot { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.banner { padding: 9px 28px; font-size: 13px; background: var(--signal-soft); color: #7a4310; border-bottom: 1px solid #f0d9bf; }
.banner.stop { background: #f8e3e0; color: #8a2f27; border-color: #efc9c4; }
.banner a { text-decoration: underline; }
.login form, .login-card { background: #fff; padding: 32px; border-radius: var(--radius); width: 360px; max-width: calc(100vw - 32px); }
.qr { display: grid; place-items: center; margin: 12px 0; }

code { font-size: 12px; background: #eef0f4; padding: 2px 5px; border-radius: 4px; word-break: break-all; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 15px; letter-spacing: .04em; }
.codes li { background: #eef0f4; border-radius: 6px; padding: 6px 10px; text-align: center; }

/* ---------- v3: context-first layout ---------- */
h3 { font-size: 12px; font-weight: 600; color: var(--muted); margin: 16px 0 6px; }
.sub { margin: -8px 0 10px; }
.callout { margin-bottom: 16px; border-color: #e8d8c4; background: #fffaf3; }
.seg { display: inline-flex; background: #eceef2; border-radius: 7px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 11px; border-radius: 5px; font-size: 13px; color: var(--muted); }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(22,32,51,.12); }
.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #eef1f6; margin: 0 6px 6px 0; }
.chip.warn { background: var(--signal-soft); color: #7a4310; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--ink); text-decoration: underline; cursor: pointer; }

/* stage pills carry the journey: open stages ink, late stages signal, outcomes green/grey */
.pill.stage-proposal_requested, .pill.stage-proposal_sent, .pill.stage-negotiating { background: #e7ebf3; color: var(--ink); font-weight: 500; }
.pill.stage-won { background: var(--good-soft); color: var(--good); }
.pill.stage-stalled { background: #f3f0ea; color: #7c6a4c; }
.pill.stage-lost { background: #f1f2f4; color: #8a909c; }
.pill.intent-hot { background: #fbe7dc; color: #9a3d12; }
.pill.intent-warm { background: var(--signal-soft); color: #7a4310; }
.pill.intent-cold { background: #eef0f4; color: var(--muted); }

/* today */
.today { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.moves { list-style: none; margin: 0; padding: 0; }
.moves li { border-top: 1px solid var(--line); }
.moves li:first-child { border-top: 0; }
.move { display: flex; gap: 12px; padding: 12px 6px; border-radius: 6px; }
.move:hover { background: #f7f8fa; text-decoration: none; }
.move-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.move-who { font-size: 13px; }
.move-next { font-size: 15px; font-weight: 500; line-height: 1.4; }
.move-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; margin-top: 2px; }
.rows li.col-row { flex-direction: column; align-items: stretch; gap: 2px; }
.row-h { display: flex; justify-content: space-between; gap: 10px; }
.prep { margin: 4px 0 0; font-size: 13px; color: #3a4660; }
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stage-cell { background: #f5f6f8; border-radius: 6px; padding: 10px 12px; }
.stage-cell:hover { background: #eceef2; text-decoration: none; }
.stage-cell b { display: block; font-size: 20px; }
.stage-cell span { font-size: 12px; color: var(--muted); }

/* pipeline cards */
.deal-p { font-size: 12px; color: var(--muted); margin-top: 1px; }
.deal-next { font-size: 13px; margin: 8px 0 6px; line-height: 1.4; color: #2a3550;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.deal-m { align-items: center; }
.col-empty { color: #9aa1ae; font-size: 12px; padding: 4px; margin: 0; }

/* contacts table */
.leads .next-cell { max-width: 380px; font-size: 13px; }
.leads .next-cell .pill { margin-top: 4px; }

/* lead page */
.lead-head { flex-wrap: wrap; }
.lead-head .who { gap: 14px; }
.lead-head h1 { margin: 0; }
.head-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lead { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.lead-main, .lead-side { display: grid; gap: 16px; min-width: 0; }
.stand .summary { font-size: 15px; line-height: 1.55; margin: 0 0 14px; max-width: 70ch; }
.next { border: 1px solid var(--line); border-left: 3px solid var(--ink-3); border-radius: 6px; padding: 10px 14px; }
.next.mine { border-left-color: var(--signal); background: #fffbf6; }
.next-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.next p { margin: 6px 0 0; }
.next-step { font-weight: 500; font-size: 15px; }
.commit { list-style: none; padding: 0; margin: 0; }
.commit li { padding: 5px 0; font-size: 14px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.facts p { margin: 0; }
.reason { margin: 14px 0 4px; }
.gist { margin: 6px 0 4px; font-size: 14px; }
.actions { margin: 4px 0; padding-left: 18px; font-size: 13px; }
details summary { cursor: pointer; font-size: 13px; color: var(--ink); }
details .notes-doc { margin-top: 8px; font-size: 13px; color: #34405a; max-height: 420px; overflow-y: auto; }
.t-mail details summary { list-style: none; color: var(--text); }
.t-mail details summary::-webkit-details-marker { display: none; }
.t-mail details[open] + .t-snip { display: none; }
.t-snip { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* conversations */
.thread-ctx { background: #f5f6f8; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; max-width: 760px; }
.thread-ctx p { margin: 6px 0 0; }
.ask { color: #7a4310; }

/* calendar */
.slot-main { min-width: 0; }
.slot .prep { max-width: 80ch; }

.notes-wrap h2 { margin-top: 18px; }
.notes-wrap h2:first-child { margin-top: 0; }

@media (max-width: 1100px) {
  .today, .lead { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
}

.qr svg { width: 240px; height: 240px; display: block; }
.manual { margin: 4px 0 8px; }
.key { font: 600 17px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; word-spacing: .3em; background: #eef0f4; padding: 8px 10px; border-radius: 6px; margin: 6px 0 8px; }

/* ---------- v5: clients, invoices, lead finder ---------- */
.ledger-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: end; }
.form-grid.form-4 { grid-template-columns: 2fr 1.4fr 1.2fr auto; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .go { padding-bottom: 0; }
.form-grid .btn { margin-top: 12px; }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); margin-top: 12px; }
.check-row input { width: auto; }
tr.inactive td { opacity: .5; }
form.inline { margin: 0; }
form.inline select { width: auto; padding: 4px 8px; font-size: 13px; }
select.status-held { border-color: var(--good); color: var(--good); }
select.status-no_show { border-color: var(--signal); color: #9a5512; }
select.status-cancelled { color: var(--muted); }
.appts td, .appts th { padding: 8px 10px; }
.row-h h2 { margin: 0; }
.row-h { align-items: center; margin-bottom: 10px; }
.plan-steps { padding-left: 20px; margin: 8px 0; }
.plan-steps li { margin-bottom: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.finder { margin-bottom: 16px; }
.finder-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.searches a.b { font-weight: 600; }
.prospects td { vertical-align: top; }
.err { color: var(--bad); }
@media (max-width: 1100px) {
  .finder-body { grid-template-columns: 1fr; }
  .form-grid.form-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .form-grid, .form-grid.form-4 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .ledger-3 { grid-template-columns: 1fr; }
}

/* ---------- v6: threads, compose, signals, agent keys ---------- */
.count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #e7ebf3; color: var(--ink);
  font-size: 11px; font-weight: 600; text-align: center; line-height: 17px; vertical-align: 1px; }
.nav-count { margin-left: auto; background: var(--signal); color: #fff; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; }
.flash.good { background: var(--good-soft); color: var(--good); border: 1px solid #cfe5d9; }

/* thread reading */
.thread-h { margin: 16px 0 14px; }
.thread-h h1 { margin-bottom: 2px; }
.msg { display: block; }
.msg > summary { list-style: none; cursor: pointer; gap: 12px; margin-bottom: 0; }
.msg > summary::-webkit-details-marker { display: none; }
.msg[open] > summary { margin-bottom: 8px; }
.msg-who { display: flex; gap: 10px; min-width: 0; }
.msg-who b { white-space: nowrap; }
.msg-peek { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg[open] .msg-peek { display: none; }
.msg-when { white-space: nowrap; flex-shrink: 0; }
.msg:not([open]) { padding-top: 10px; padding-bottom: 10px; }
.msg-to { margin: -4px 0 8px; }
.msg-b { line-height: 1.6; overflow-wrap: anywhere; }
.earlier { margin-bottom: 12px; max-width: 760px; }
.earlier > summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 8px 0; list-style: none; }
.earlier > summary::before { content: "▸ "; }
.earlier[open] > summary::before { content: "▾ "; }
.earlier > summary::-webkit-details-marker { display: none; }

/* contact timeline: email threads + agent notes */
.t-thread > summary { cursor: pointer; }
.t-thread[open] + .t-snip { display: none; }
.t-msgs { margin-top: 10px; }
.t-msgs .msg { max-width: none; margin-left: 0; margin-bottom: 8px; padding: 10px 14px; }
.t-msgs .msg.me { margin-left: 24px; }
.t-msgs .msg-b { font-size: 13px; }
.timeline .mk.sig { border-color: var(--signal); background: var(--signal-soft); }

/* compose */
.compose { max-width: 760px; margin-top: 16px; scroll-margin-top: 16px; }
.inbox-read .compose { margin-bottom: 40px; }
.compose .row-h { flex-wrap: wrap; }
.ai-row { display: flex; gap: 8px; align-items: center; flex: 1; justify-content: flex-end; min-width: 280px; }
.ai-ask { max-width: 340px; font-size: 13px; padding: 6px 10px; }
.compose .addr { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; margin-bottom: 6px; }
.compose .addr label { margin: 0; }
.compose-body { min-height: 220px; margin-top: 6px; line-height: 1.55; }
.compose-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.compose .btn.busy { opacity: .6; pointer-events: none; }

/* signals */
.signals { display: grid; gap: 12px; max-width: 900px; }
.signal-card { border-left: 3px solid var(--line); }
.signal-card.u-high { border-left-color: var(--signal); }
.signal-card.u-medium { border-left-color: #c7ccd6; }
.sig-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.sig-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.score { font-weight: 600; font-size: 14px; }
.score small { font-weight: 400; color: var(--muted); font-size: 11px; }
.sig-title { font-size: 16px; font-weight: 600; margin: 10px 0 4px; }
.sig-who { margin: 0 0 6px; }
.sig-next { margin-top: 10px; padding: 8px 12px; background: #f6f7fa; border-radius: 6px; font-size: 13px; }
.sig-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sig-actions form { margin: 0; }
.filters .seg { margin-right: 6px; }

/* agent keys */
.key-once { border: 1px solid #e8d8c4; background: #fffaf3; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.key-row { display: flex; gap: 8px; align-items: center; }
.key-row code { flex: 1; overflow-wrap: anywhere; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-size: 12px; }
.key-new { display: flex; gap: 8px; }
.key-new input { max-width: 160px; }
.key-new select { max-width: 200px; }
@media (max-width: 760px) {
  .ai-row { justify-content: flex-start; }
  .compose .addr { grid-template-columns: 1fr; gap: 2px; }
  .compose-foot { flex-direction: column; align-items: stretch; }
  .key-new { flex-direction: column; }
  .key-new input, .key-new select { max-width: none; }
}
form.inline { display: inline; margin: 0; }
.sig-title { color: var(--text); }
.lead-main .compose { max-width: none; }

/* profiles */
.profiles { display: grid; gap: 12px; max-width: 1000px; }
.profiles > .panel > details > summary { list-style: none; cursor: pointer; margin: 0; }
.profiles > .panel > details > summary::-webkit-details-marker { display: none; }
.profiles > .panel > details[open] > summary { margin-bottom: 12px; }
.profiles details[open] ~ .p-peek, .profiles details[open] ~ .pb-peek { display: none; }
.p-name { font-size: 15px; }
.p-meta { display: flex; gap: 10px; align-items: center; }
.p-peek, .pb-peek { margin: 8px 0 0; color: #34405a; }
.profile.inactive { opacity: .65; }
.p-top { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; }
.p-top label { margin-top: 0; }
.p-top .check-row { margin: 0 0 10px; display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text); }
.p-top .check-row input { width: auto; }
.p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.p-grid textarea { min-height: 96px; font-size: 13px; line-height: 1.5; }
.playbook { min-height: 420px; font-size: 13px; line-height: 1.55; }
@media (max-width: 760px) { .p-top, .p-grid { grid-template-columns: 1fr; } }
tr.sub td:first-child { padding-left: 26px; }
.sub-mark { color: var(--muted); margin-right: 6px; }
.sub-add { display: flex; gap: 8px; margin-top: 10px; }

/* Grok tasks */
.flash.warn { background: var(--signal-soft); color: #7a4310; border: 1px solid #f0d9bf; }
.flash.warn a { text-decoration: underline; }
.nav-count.quiet { background: var(--ink-3); color: #cdd3df; }
.ask-any { max-width: 900px; margin-bottom: 14px; }
.ask-any > summary, .list-grok > summary { cursor: pointer; list-style: none; }
.ask-any > summary::-webkit-details-marker, .list-grok > summary::-webkit-details-marker { display: none; }
.ask-any[open] > summary, .list-grok[open] > summary { margin-bottom: 10px; }
.list-grok { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ask-grok textarea { min-height: 56px; font-size: 13px; }
.ask-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.sig-grok { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.task { border: 1px solid var(--line); border-left: 3px solid #c7ccd6; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; background: #fbfbfd; }
.task.t-needs_input { border-left-color: var(--signal); background: #fffaf3; }
.task.t-in_progress { border-left-color: var(--ink); }
.task.t-done { border-left-color: var(--good); }
.task.t-failed { border-left-color: var(--bad); }
.task.t-cancelled { opacity: .6; }
.task-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.task-pill.t-needs_input { background: var(--signal-soft); color: #9a5512; }
.task-pill.t-done { background: var(--good-soft); color: var(--good); }
.task-pill.t-in_progress { background: var(--ink); color: #fff; }
.task-pill.t-failed { background: #f8e3e0; color: #8a2f27; }
.task-ins { white-space: pre-wrap; font-size: 13px; margin-top: 6px; }
.task-msg { font-size: 13px; margin-top: 6px; white-space: pre-wrap; }
.task-msg.agent { color: #34405a; }
.task-result { margin-top: 8px; font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.task-result div { white-space: pre-wrap; margin: 2px 0 4px; }
.task-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.task-reply { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.tasks-page { display: grid; gap: 12px; max-width: 900px; }
.task-wrap { padding: 12px; }
.task-wrap .task { margin: 0; }
.lead-side .ask-row .small { display: none; }

/* prospects */
.prospect-card { border-left: 3px solid var(--line); }
.prospect-card.ps-replied, .prospect-card.ps-booked { border-left-color: var(--signal); }
.prospect-card.ps-promoted { border-left-color: var(--good); opacity: .8; }
.prospect-card.ps-parked { opacity: .65; }
.ps-select { width: auto; font-size: 13px; padding: 4px 8px; }
.thesis { margin-top: 8px; padding: 9px 12px; background: #f6f7fa; border-radius: 6px; font-size: 13px; line-height: 1.55; }
.thesis div { white-space: pre-wrap; }
td .thesis { margin-top: 6px; padding: 6px 9px; }
.p-notes { margin-top: 8px; white-space: pre-wrap; color: #34405a; }
.promote { display: flex; gap: 8px; margin: 0; }
.promote input { max-width: 220px; }
.p-edit > summary { list-style: none; }
.p-edit > summary::-webkit-details-marker { display: none; }
.p-edit[open] { flex-basis: 100%; }
.p-edit-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; margin-top: 10px; }
.p-edit-form .span-2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .p-edit-form { grid-template-columns: 1fr; } .promote { flex-direction: column; } }
.dots span + span::before { content: " · "; color: var(--muted); }

/* outreach */
.outreach { display: grid; gap: 12px; max-width: 920px; }
.tabs-seg { justify-self: start; }
.approve-bar, .enrol-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; position: sticky; top: 8px; z-index: 5; box-shadow: 0 2px 10px rgba(22,32,51,.06); }
.approve-bar .btn, .enrol-bar .btn { margin-left: auto; }
.enrol-bar { margin-bottom: 12px; max-width: 900px; }
.enrol-bar select { width: auto; max-width: 260px; }
.enrol-bar .small { flex-basis: 100%; }
.check-row { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text); margin: 0; }
.check-row input { width: auto; }
.ox-card { padding: 14px 16px; }
.ox-card.s-approved { border-left: 3px solid var(--ink); }
.ox-card.s-sent { border-left: 3px solid var(--good); }
.ox-card.s-failed { border-left: 3px solid var(--bad); }
.ox-head { display: flex; gap: 10px; align-items: baseline; }
.ox-head .grow { flex: 1; min-width: 0; }
.ox-head input[type=checkbox] { width: auto; transform: translateY(2px); }
.ox-thesis { margin: 6px 0 0; }
.ox-edit { margin-top: 10px; display: grid; gap: 6px; }
.ox-edit input { font-weight: 600; }
.ox-edit textarea { min-height: 190px; font-size: 13.5px; line-height: 1.55; }
.ox-actions { display: flex; gap: 8px; align-items: center; }
.ox-view { margin-top: 8px; }
.ox-view summary { cursor: pointer; }
.ox-body { white-space: pre-wrap; font-size: 13.5px; margin-top: 8px; line-height: 1.55; }
.reply-snip { margin: 8px 0 0; padding: 8px 12px; background: var(--signal-soft); border-radius: 6px; white-space: pre-wrap; }
.reply-card.bounced .reply-snip { background: #f3f4f6; }
.seq summary { cursor: pointer; list-style: none; }
.seq summary::-webkit-details-marker { display: none; }
.seq details[open] summary { margin-bottom: 12px; }
.seq-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.seq-form .span-2 { grid-column: 1 / -1; }
.seq-form .hours input { width: 70px; display: inline-block; }
.seq-form .check-row { margin-top: 10px; }
.sig-tags .p-pick { width: auto; }
@media (max-width: 760px) { .seq-form { grid-template-columns: 1fr; } .approve-bar .btn, .enrol-bar .btn { margin-left: 0; } }
.backup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 4px; }
.backup-grid > div > span:first-child { display: block; margin-bottom: 2px; }
@media (max-width: 760px) { .backup-grid { grid-template-columns: 1fr; } }
.pill.tiny { font-size: 10px; padding: 0 6px; vertical-align: 1px; }

/* Today queue */
.queue { margin-bottom: 16px; }
.q-list { list-style: none; margin: 0; padding: 0; }
.q-list li { border-top: 1px solid var(--line); }
.q-list li:first-child { border-top: 0; }
.q-item { display: flex; gap: 12px; align-items: center; padding: 10px 2px; }
.q-item:hover { background: #fafbfc; text-decoration: none; }
.q-item .pill { min-width: 74px; text-align: center; }
.q-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.q-body .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-at { white-space: nowrap; }
.pill.bad { background: #f8e3e0; color: #8a2f27; }

/* results */
.results { display: grid; gap: 14px; }
.results .ledger { margin-bottom: 0; }
.funnel-bars { display: grid; gap: 6px; }
.fb { display: grid; grid-template-columns: 150px 1fr 48px; gap: 10px; align-items: center; font-size: 13px; }
.fb-bar { background: #eef0f4; border-radius: 4px; height: 14px; overflow: hidden; }
.fb-bar i { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.fb b { text-align: right; }
.res-table td, .res-table th { white-space: nowrap; }
@media (max-width: 760px) { .fb { grid-template-columns: 100px 1fr 36px; } .res-table { display: block; overflow-x: auto; } }

/* ---------- v9: clustered sidebar ---------- */
/* Outreach, Pipeline and Clients each open a fly-out of their tools on hover or keyboard focus. */
.side { z-index: 30; }
.nav-group { position: relative; }
.nav .nav-head .chev { width: 13px; height: 13px; margin-left: auto; opacity: .45; transition: transform .12s, opacity .12s; }
.nav .nav-head .nav-count { margin-left: auto; }
.nav .nav-head .nav-count + .chev { margin-left: 6px; }
.nav-group.on > .nav-head { background: var(--ink-3); color: #fff; }
.nav-group:hover > .nav-head, .nav-group:focus-within > .nav-head, .nav-group.open > .nav-head { background: var(--ink-2); color: #fff; }
.nav-group.on:hover > .nav-head, .nav-group.on:focus-within > .nav-head { background: var(--ink-3); }
.nav-group:hover .chev, .nav-group:focus-within .chev, .nav-group.open .chev { opacity: 1; transform: translateX(2px); }
.nav-fly { position: absolute; left: calc(100% + 8px); top: -8px; min-width: 216px; padding: 8px; background: var(--ink-2);
  border: 1px solid var(--ink-3); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(10, 16, 28, .32);
  visibility: hidden; opacity: 0; transform: translateX(-4px);
  transition: opacity .12s ease, transform .12s ease, visibility 0s linear .18s; }
/* an invisible bridge so the pointer can cross the gap without the menu closing */
.nav-fly::before { content: ""; position: absolute; left: -22px; top: 0; bottom: 0; width: 22px; }
.nav-group:hover .nav-fly, .nav-group:focus-within .nav-fly, .nav-group.open .nav-fly {
  visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.nav-fly-h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8d97ab; padding: 4px 10px 6px; }
.nav .nav-fly a { padding: 7px 10px; white-space: nowrap; }
.nav .nav-fly a:hover { background: var(--ink-3); }
.nav .nav-fly a.on { background: var(--ink); color: #fff; box-shadow: inset 2px 0 0 var(--signal); }
.nav-settings { margin-top: 2px; }
@media (max-width: 760px) {
  .nav-fly { left: 0; top: calc(100% + 4px); transform: translateY(-4px); }
  .nav-fly::before { left: 0; right: 0; top: -6px; bottom: auto; width: auto; height: 6px; }
}
@media (prefers-reduced-motion: reduce) { .nav-fly, .nav .nav-head .chev { transition: none; } }

/* ---------- v9: proposals ---------- */
.prop-new { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px 24px; align-items: start; }
.prop-new textarea { min-height: 168px; line-height: 1.5; }
.prop-new .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.prop-src { margin-top: 10px; padding: 10px 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.prop-src b { font-weight: 600; }
.prop-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn.busy { opacity: .6; pointer-events: none; }
.prop-edit { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.prop-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.prop-fields .wide { grid-column: 1 / -1; }
.prop-body { min-height: 520px; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.prop-key { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.prop-key code { background: #eef0f4; border-radius: 4px; padding: 0 4px; font-size: 11.5px; }
.prop-ai { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.prop-ai input { flex: 1; }
.prop-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.prop-side { position: sticky; top: 16px; min-width: 0; }
.prop-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; min-height: 24px; }
.prop-gaps { margin: 0 0 12px; padding: 10px 14px 10px 30px; font-size: 13px; background: var(--signal-soft); color: #7a4310;
  border: 1px solid #f0d9bf; border-radius: var(--radius); }
.prop-gaps li { margin: 2px 0; }
.sheet-wrap { background: #e4e7ed; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow: hidden; }
.sheet-fit { transform-origin: 0 0; }
.pdoc { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(22, 32, 51, .18); box-sizing: border-box;
  width: 8.5in; min-height: 11in; padding: 0.55in 0.75in 0.65in; text-align: left; font-feature-settings: normal; }
.pdoc.a4 { width: 210mm; min-height: 297mm; }
.pdoc .pfoot { position: absolute; left: 0.75in; right: 0.75in; bottom: 0.3in; }
.pdoc tbody tr:hover { background: none; }
.pdoc table { overflow: visible; }
.pdoc td, .pdoc th { vertical-align: baseline; }
.pdoc.over::after { content: "Page one ends here"; position: absolute; left: 0; right: 0; top: 11in; border-top: 1.5px dashed var(--bad);
  color: var(--bad); font: 500 11px/1.8 var(--font); text-align: right; padding-right: 10px; }
.pdoc.a4.over::after { top: 297mm; }
@media (max-width: 1100px) { .prop-edit, .prop-new { grid-template-columns: 1fr; } .prop-side { position: static; } }

/* v17: a done/queued state shown where a button was */
.btn.ghost { background: transparent; border-style: dashed; color: var(--muted); cursor: default; font-weight: 400; }
.btn.ghost:hover { border-color: var(--line); }

/* v21: what Grok proposes, with a one-click yes */
.task-suggest { margin-top: 8px; font-size: 13px; background: var(--signal-soft); border: 1px solid #f0d9bf; border-radius: 6px; padding: 8px 10px; color: #5f3a12; }
.task-suggest div { white-space: pre-wrap; margin-top: 2px; }

/* v23: contact form outreach */
.ledger-4 { grid-template-columns: repeat(4, 1fr); }
.cforms .filters { align-items: center; flex-wrap: wrap; }
.cf-table td { vertical-align: top; }
.cf-table tr.cf-more td { border-top: 0; padding-top: 0; padding-bottom: 12px; }
.cf-table tr.cf-more:hover, .cf-table tr:hover + tr.cf-more { background: none; }
.cf-table tr.cf-fresh { background: #fffaf3; }
.cf-table tr.cf-fresh > td:first-child { box-shadow: inset 3px 0 0 var(--signal); }
.cf-table details > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.cf-msg, .cf-reply div { white-space: pre-wrap; font-size: 13px; line-height: 1.55; }
.cf-msg { margin: 8px 0; padding: 10px 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; max-width: 760px; }
.cf-reply { margin: 0 0 8px; padding: 10px 12px; background: var(--good-soft); border: 1px solid #cfe5d9; border-radius: 6px; max-width: 760px; }
.cf-reply div { margin-top: 3px; }
.cf-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.cf-mark { display: flex; gap: 8px; min-width: 320px; flex: 0 1 460px; margin: 0; }
.cf-act { text-align: right; white-space: nowrap; }
tr[id^="f"]:target { outline: 2px solid var(--signal); outline-offset: -2px; }
@media (max-width: 760px) { .ledger-4 { grid-template-columns: repeat(2, 1fr); } .cf-table { display: block; overflow-x: auto; } }

/* v24: lead finder as lists */
.finder-form { display: grid; grid-template-columns: 2fr 1.4fr 130px 1.3fr; gap: 0 14px; align-items: end; }
.finder-form label { margin-top: 0; }
.finder-form .ff-must { grid-column: 1 / 4; border: 0; padding: 0; margin: 14px 0 0; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.finder-form .ff-must legend { float: left; padding: 0; margin-right: 4px; font-size: 12px; color: var(--muted); }
.finder-form .go { margin-top: 14px; display: flex; justify-content: flex-end; }
label.check { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; color: var(--text); cursor: pointer; }
label.check input { width: 16px; height: 16px; padding: 0; accent-color: var(--ink); }
.lists { margin-top: 16px; }
.lists td { vertical-align: top; }
@media (max-width: 900px) { .finder-form { grid-template-columns: 1fr 1fr; gap: 10px 14px; } .finder-form .ff-must { grid-column: 1 / -1; margin-top: 4px; } .finder-form .go { grid-column: 1 / -1; margin-top: 4px; } .lists { display: block; overflow-x: auto; } }

/* v25: Google bill on the lead finder */
.gbill { display: grid; grid-template-columns: 190px 1fr; gap: 24px; align-items: center; margin-top: 16px; }
.gbill-main b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--good); border-radius: 3px; }
.meter.warm i { background: #c9a227; }
.meter.full i { background: var(--signal); }
@media (max-width: 760px) { .gbill { grid-template-columns: 1fr; gap: 10px; } }

/* v26: run labels */
.finder-form { grid-template-columns: 2fr 1.4fr 120px 1.2fr 1fr; }
.finder-form .ff-must { grid-column: 1 / 5; }
.pill.tagp { background: var(--ink); color: #fff; text-decoration: none; }
.label-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.label-form label { margin: 0; }
.label-form input { width: 200px; }
@media (max-width: 900px) { .finder-form { grid-template-columns: 1fr 1fr; } .finder-form .ff-must { grid-column: 1 / -1; } }

/* v27: the client is the run's label */
.finder-form { grid-template-columns: 2fr 1.4fr 130px 1.3fr; }
.finder-form .ff-must { grid-column: 1 / 4; }
.label-form select { width: 240px; }
@media (max-width: 900px) { .finder-form { grid-template-columns: 1fr 1fr; } .finder-form .ff-must { grid-column: 1 / -1; } }
