/* bleed (7 Nov): the Bleed tab, "Bleed needs you" and Bleed's settings (docs/SALES-BLEED-PLAN.md §4).
   Everything from app.css's §0 tokens, so light and dark are a token swap. Status is words and an
   icon with colour: red = failed or overdue, amber = soon, neutral = normal waiting. */

/* the bar is dark chrome in both themes */
:root { --bd-alert: #e0574b; --bd-chrome-soft: color-mix(in srgb, var(--ivory) 82%, transparent); }

/* --- the bar: the tab first, its count, a red dot when a client is overdue ------------------ */
nav button.bd-tab { color: var(--bd-chrome-soft); font-weight: 600; }
nav button.bd-tab .count { margin-left: 6px; }
.bd-dot { flex: none; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--bd-alert); vertical-align: middle; box-shadow: 0 0 0 2px color-mix(in srgb, var(--bd-alert) 30%, transparent); }

/* the Sales Agent's counter in the bar: it opens "Questions for the team" in the tab */
.bd-needs-wrap { position: relative; display: inline-flex; }
.bd-needs { height: 30px; gap: 6px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(var(--accent-rgb), .3); background: transparent; color: var(--bd-chrome-soft); font-size: 12.5px; font-weight: 600; }
.bd-needs:hover { background: rgba(var(--accent-rgb), .16); color: var(--ivory); border-color: rgba(var(--accent-rgb), .5); }
.bd-needs .icon { width: 15px; height: 15px; }
.bd-needs.has { color: var(--ivory); border-color: var(--chrome-gold); }
.bd-needs .count { background: rgba(var(--accent-rgb), .3); color: var(--ivory); border-radius: 999px; padding: 1px 6px; font-size: 10.5px; }
.bd-needs-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.bd-need { padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--paper); }
.bd-need.soon { box-shadow: inset 3px 0 0 var(--warn); }
.bd-need.late { box-shadow: inset 3px 0 0 var(--stop); }
.bd-need-q { margin: 0 0 4px; font-weight: 600; }
.bd-need-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 8px; font-size: 12px; color: var(--soft); }
.bd-need-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bd-need-actions button { height: 30px; padding: 0 10px; font-size: 12.5px; }
.bd-need-answer { flex: 1 1 140px; display: flex; }
.bd-need-answer input { width: 100%; height: 30px; padding: 0 10px; border: 1px solid var(--rule2); border-radius: var(--r-sm); background: var(--paper); }
.bd-need-open { margin-top: 6px; padding-left: 0; font-size: 12px; }

/* --- the tab: list · conversation · project ------------------------------------------------------ */
body.wide #tab-bleed { flex: 1; min-height: 0; display: flex; }
/* the tab keeps the screen's height at every width (app.css lets other wide tabs grow under 1100 px), so
   the draft's buttons stay in one place and the thread scrolls */
body.wide.bleed-tab-open #app { height: 100vh; height: 100dvh; }
body.wide.bleed-tab-open main { display: flex; }
.bd { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(270px, 320px) minmax(0, 1fr) minmax(300px, 380px); grid-template-rows: minmax(0, 1fr); flex: 1; width: 100%; min-height: 0; background: var(--bg); }
.bd-pad { padding: 16px 20px; margin: 0; }
.bd .icon { width: 15px; height: 15px; flex: none; }

/* left */
.bd-list { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; background: var(--paper); border-right: 1px solid var(--rule); }
.bd-list-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; background: linear-gradient(180deg, var(--night2), var(--night)); }
.bd-list-head .eyebrow { color: var(--chrome-gold); letter-spacing: .24em; }
.bd-total { flex: 1; font: 300 28px/1 var(--text); letter-spacing: -.03em; color: var(--ivory); font-variant-numeric: tabular-nums lining-nums; }
.bd-gear { color: var(--bd-chrome-soft); padding: 6px; }
.bd-gear:hover { color: var(--ivory); background: rgba(255,255,255,.08); }
.bd-gear .icon { width: 17px; height: 17px; }
.bubble.pending { opacity: .72; border-style: dashed; }
/* the list's top line: what Bleed is doing, and when the list was last read */
.bd-pulse { margin: 0; padding: 7px 16px; border-bottom: 1px solid var(--rule); background: var(--bg2); color: var(--soft); font-size: 12px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.bd-pulse.busy::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--gold); vertical-align: 1px; animation: bd-beat 1.4s ease-in-out infinite; }
.bd-pulse.bad { color: var(--stop); }
@keyframes bd-beat { 50% { opacity: .3; } }
.bd-list-head .bd-help-open { color: var(--bd-chrome-soft); padding: 6px; }
.bd-list-head .bd-help-open:hover { color: var(--ivory); background: rgba(255,255,255,.08); }
.bd-help-open .icon { width: 17px; height: 17px; }
/* "How this works": five lines, closed once read */
.bd-help { margin: 12px 12px 0; padding: 10px 12px 10px 14px; border: 1px solid var(--gold-line); border-radius: var(--r); background: var(--gold-soft); color: var(--ink); font-size: 12.5px; line-height: 1.45; }
.bd-help[hidden] { display: none; }
.bd-help-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.bd-help ol { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.bd-help-close { font-size: 12px; font-weight: 600; }
/* the server's own words behind a small toggle */
.bd-detail { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.bd-detail summary { cursor: pointer; width: max-content; font-weight: 600; color: var(--soft); }
.bd-detail p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bd-tag.new { color: var(--paper); background: var(--accent3); border-color: transparent; }
.bd-row.fresh:not(.on) { background: color-mix(in srgb, var(--gold-soft) 60%, transparent); }
.bd-attempt-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--warn); }
.bd-attempt-note .icon { width: 15px; height: 15px; }
.bd-pending { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.bd-preview {margin: 12px 12px 0; padding: 8px 10px; border: 1px solid var(--gold-line); border-radius: var(--r-sm); background: var(--gold-soft); color: var(--ink); font-size: 13px; line-height: 1.4; }
.bd-preview[hidden] { display: none; }
.bd-preview strong { margin-right: 4px; }
.bd-search { display: flex; align-items: center; gap: 8px; margin: 12px 12px 0; padding: 0 10px; height: 36px; border: 1px solid var(--rule2); border-radius: var(--r-sm); background: var(--paper); color: var(--muted); }
.bd-search:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-soft); }
.bd-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.bd-filters { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; gap: 6px; margin: 8px 12px 0; }
/* the Conversations list's own compact select (app.css .side-list-head select) */
.bd-filters select { min-width: 0; height: 30px; min-height: 30px; padding: 0 28px 0 10px; border: 1px solid var(--rule2); border-radius: var(--r-sm); background-color: var(--paper); background-position: right 9px center; font-size: 12.5px; text-overflow: ellipsis; }
/* the latest message's day, from and to, on one line under the selects */
.bd-dates { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); }
.bd-dates-label { flex: none; font-weight: 600; }
.bd-dates input { flex: 1 1 0; min-width: 0; height: 30px; min-height: 30px; padding: 0 6px; border: 1px solid var(--rule2); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font-size: 12px; }
.bd-clear { justify-self: start; align-self: center; padding: 0 2px; font-size: 12px; }
.bd-clear[hidden] { display: none; }
.bd-views, .bd-mine { display: flex; gap: 4px; margin: 10px 12px 0; padding: 3px; border-radius: var(--r); background: var(--bg2); }
.bd-mine { margin-top: 6px; }
.bd-seg { flex: 1; height: 30px; gap: 6px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--soft); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.bd-seg:hover { background: var(--paper2); border-color: transparent; }
.bd-seg.on, .bd-seg.on:hover { background: var(--paper); color: var(--ink); border-color: var(--rule); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.bd-seg.small { height: 26px; font-size: 12px; }
.bd-questions-bar .bd-mine, .bd-inline .bd-seg { flex: none; margin: 0; }
/* 9 Nov, the owner's screenshot: "Needs action 122Waiting 18": a long count ran into the next
   label. Each segment sizes to its words, never past its own edge, and the row wraps before
   two of them touch; the count is its own small pill. */
.bd-views, .bd-mine { flex-wrap: wrap; gap: 3px; }
.bd-views .bd-seg, .bd-mine .bd-seg { flex: 1 1 auto; min-width: 0; padding: 0 5px; gap: 4px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.bd-n { display: inline-block; min-width: 1.6em; padding: 1px 4px; border-radius: 999px; background: color-mix(in srgb, currentColor 11%, transparent); font-variant-numeric: tabular-nums; font-size: 11px; line-height: 1.3; text-align: center; }
.bd-seg:disabled { opacity: .55; cursor: default; background: transparent; }
.bd-time.muted { color: var(--muted); font-weight: 500; }
.bd-rows { list-style: none; margin: 8px 0 0; padding: 0 8px 8px; flex: 1; }
.bd-empty { margin: 12px 8px; padding: 14px; border: 1px dashed var(--rule2); border-radius: var(--r); color: var(--soft); font-size: 13px; list-style: none; }
.bd-row { display: grid; gap: 3px; width: 100%; margin: 2px 0; padding: 10px 10px 10px 12px; border: 1px solid transparent; border-radius: var(--r); background: transparent; color: var(--ink); text-align: left; font-weight: 400; justify-content: stretch; }
.bd-row:hover { background: var(--paper2); border-color: var(--rule); }
.bd-row.on, .bd-row.on:hover { background: var(--accent2); border-color: var(--gold-line); }
.bd-row.late { box-shadow: inset 3px 0 0 var(--stop); }
.bd-row.soon { box-shadow: inset 3px 0 0 var(--warn); }
.bd-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bd-row-top strong { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-chan { display: inline-flex; color: var(--muted); }
.bd-time { flex: none; font-variant-numeric: tabular-nums; font-size: 11.5px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.bd-time.soon { color: var(--warn); }
.bd-time.late { color: var(--stop); }
.bd-row-project { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 12.5px; color: var(--ink2); }
.bd-projects { padding: 0 6px; border-radius: 999px; background: var(--bg2); color: var(--soft); font-size: 11px; font-weight: 600; }
.bd-studio { font-size: 11.5px; color: var(--muted); }
.bd-next { font-size: 12.5px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-owner { font-size: 11.5px; color: var(--info); font-weight: 600; }
/* the newest message and its time, as the Conversations list shows one */
.bd-when { flex: none; font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bd-last { font-size: 12.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-row-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 0; }
.bd-row-tags:empty { display: none; }
.bd-tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg2); color: var(--soft); font-size: 11px; font-weight: 600; white-space: nowrap; }
.bd .bd-tag .icon { width: 12px; height: 12px; }
.bd-tag.draft { color: var(--accent3); background: var(--gold-soft); border-color: var(--gold-line); }
.bd-tag.held { color: var(--info); }
.bd-keys { margin: 0; padding: 8px 16px 14px; font-size: 11.5px; }

/* middle: head, the thread, the draft pinned under it */
.bd-chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.bd-pick { margin: auto; padding: 40px; text-align: center; grid-row: 1 / -1; }
.bd-head { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 20px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.bd-head-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.bd-head-main strong { font: 600 19px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--soft); }
.bd-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid var(--rule); background: var(--bg); color: var(--soft); font: 600 11px/1 var(--text); white-space: nowrap; }
.bd-chip .icon { width: 13px; height: 13px; }
.bd-chip.move { color: var(--accent3); background: var(--gold-soft); border-color: var(--gold-line); }
.bd-back, .bd-drawer-open, .bd-drawer-close { display: none; }
.bd-drawer-open { height: 32px; padding: 0 10px; font-size: 12.5px; }
.bd-thread { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 18px clamp(16px, 2.4vw, 32px); background: var(--canvas); outline: none; }
.bd-thread:focus-visible { box-shadow: inset 0 0 0 2px var(--gold-line); }
.bd-photos { display: block; margin-top: 4px; font-size: 11.5px; opacity: .75; }

/* the draft card: its body scrolls, its buttons stay put */
.bd-card { display: flex; flex-direction: column; max-height: min(60vh, 560px); border-top: 1px solid var(--rule); background: var(--paper); box-shadow: 0 -12px 30px -24px rgba(0,0,0,.35); }
.bd-card.is-draft { border-top: 2px solid var(--gold-line); }
.bd-card-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 20px 8px; display: grid; gap: 10px; align-content: start; }
.bd-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bd-card-head .eyebrow { color: var(--accent3); }
.bd-timing { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bd-timing + .bd-timing::before { content: "·"; margin-right: 8px; }
.bd-to { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--soft); }
.bd-texts { display: grid; gap: 6px; }
.bd-text { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 14px 14px 4px 14px; background: var(--paper2); }
.bd-text p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.bd-text-n { display: block; margin-bottom: 2px; font: 600 10px var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bd-edit { display: grid; gap: 4px; }
.bd-edit textarea { width: 100%; resize: vertical; min-height: 84px; padding: 10px 12px; border: 1px solid var(--gold-line); border-radius: var(--r); background: var(--paper); line-height: 1.55; }
.bd-why { margin: 0; font-size: 13px; color: var(--ink2); }
/* Bleed's read of the client (bleed-read.js): one line, the whole read behind a click */
.bd-read { margin: 0; padding: 2px 0 2px 10px; border-left: 2px solid var(--gold-line); font-size: 13px; color: var(--ink2); }
.bd-read summary { cursor: pointer; list-style: none; overflow-wrap: anywhere; line-height: 1.5; }
.bd-read summary::-webkit-details-marker { display: none; }
.bd-read summary b { flex: none; font-weight: 600; color: var(--ink); }   /* the app's flex summary squeezed "Read:" to a letter a line */
.bd-read-line { flex: 1 1 auto; min-width: 0; }
.bd-read summary:focus-visible { outline: 2px solid var(--gold-line); outline-offset: 2px; border-radius: var(--r-sm); }
.bd-read-list { margin: 6px 0 2px; display: grid; gap: 3px; }
.bd-read-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
.bd-read-row dt { font: 600 10.5px/1.9 var(--text); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bd-read-row dd { margin: 0; overflow-wrap: anywhere; }
.bd-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.bd-sources-label { font: 600 10px var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bd-source { display: inline-flex; align-items: center; gap: 5px; padding: 2px 6px; font-size: 12px; font-weight: 600; text-align: left; }
.bd-source.missing { color: var(--warn); }
.bd-held { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.bd-checks { display: flex; flex-wrap: wrap; gap: 4px; }
.bd-check { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--rule); font-size: 11.5px; color: var(--soft); }
.bd-check.ok .icon { color: var(--ok); }
.bd-check.bad { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--rule)); background: color-mix(in srgb, var(--warn) 8%, var(--paper)); }
.bd-check .icon { width: 12px; height: 12px; }
.bd-check-notes { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink2); }
.bd-approval { margin: 0; font-size: 12px; color: var(--soft); }
.bd-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-radius: var(--r); background: var(--bg2); }
.bd-inline input { flex: 1 1 180px; height: 32px; padding: 0 10px; border: 1px solid var(--rule2); border-radius: var(--r-sm); background: var(--paper); }
.bd-inline input[type="datetime-local"] { flex: 0 1 210px; }
.bd-inline button { height: 32px; padding: 0 12px; font-size: 12.5px; }
.bd-quiet { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px dashed var(--rule2); border-radius: var(--r); background: var(--bg); color: var(--ink2); }
.bd-quiet > .icon { width: 20px; height: 20px; margin-top: 2px; color: var(--muted); }
.bd-quiet p { margin: 2px 0 0; }
.bd-quiet.taken { border-style: solid; border-color: color-mix(in srgb, var(--info) 35%, var(--rule)); }
.bd-quiet.taken > .icon { color: var(--info); }
.bd-actions { flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 20px 12px; border-top: 1px solid var(--rule); }
.bd-actions-main, .bd-actions-more { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-actions button { height: 34px; padding: 0 12px; font-size: 13px; }
.bd-approve { min-width: 172px; }
.bd-actions-more button { background: transparent; border-color: transparent; color: var(--soft); }
.bd-actions-more button:hover { background: var(--paper2); border-color: var(--rule); color: var(--ink); }
.bd-actions button:disabled { opacity: .4; cursor: not-allowed; }
.bd-status { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; padding: 8px 20px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--soft); }
.bd-status:empty { display: none; }
.bd-status.bad { color: var(--stop); }
.bd-cancel { color: var(--stop); padding: 2px 8px; text-decoration: underline; }

/* right: the project */
.bd-panel { min-width: 0; overflow-y: auto; padding: 18px; border-left: 1px solid var(--rule); background: var(--bg); display: flex; flex-direction: column; gap: 14px; }
.bd-panel > * { flex: none; }
.bd-project h3 { margin: 4px 0 0; font-size: 22px; line-height: 1.15; }
.bd-project select { width: 100%; height: 34px; margin-top: 6px; padding: 0 8px; border: 1px solid var(--rule2); border-radius: var(--r-sm); background: var(--paper); font-weight: 600; }
.bd-facts { margin: 0; display: grid; gap: 1px; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--rule); }
.bd-fact { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 9px 12px; background: var(--paper); transition: background .6s; }
.bd-fact dt { font: 600 10.5px/1.9 var(--text); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bd-fact dd { margin: 0; display: grid; gap: 2px; font-size: 13px; }
.bd-fact.flash { background: var(--gold-soft); }
.bd-basis { font-size: 11.5px; color: var(--soft); }
.bd-ladder { display: grid; gap: 8px; }
.bd-ladder ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.bd-booking { padding-top: 6px !important; border-top: 1px dashed var(--rule2); }
.bd-step { position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 12.5px; color: var(--muted); }
.bd-step-mark { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--rule2); background: var(--paper); }
.bd-step.done { color: var(--ink2); }
.bd-step.done .bd-step-mark { background: var(--ok); border-color: var(--ok); }
.bd-step.now { color: var(--ink); font-weight: 600; }
.bd-step.now .bd-step-mark { border-color: var(--accent3); box-shadow: 0 0 0 3px var(--gold-soft); background: var(--accent3); }
.bd-flag { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; font-weight: 600; }
.bd-flag.late { color: var(--stop); }
.bd-tasks ul, .bd-known ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.bd-tasks > .side-note { margin: 4px 0 0; }
.bd-task { padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); }
.bd-task p { margin: 0 0 4px; font-size: 12.5px; }
.bd-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.bd-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg); color: var(--soft); font: 600 10.5px/1 var(--text); white-space: nowrap; }
.bd-badge.soon { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--rule)); background: color-mix(in srgb, var(--warn) 10%, var(--paper)); }
.bd-badge.late { color: var(--stop); border-color: color-mix(in srgb, var(--stop) 35%, var(--rule)); background: color-mix(in srgb, var(--stop) 10%, var(--paper)); }
.bd-known { display: grid; gap: 10px; }
.bd-group .eyebrow { display: flex; align-items: center; gap: 6px; }
.bd-group li { font-size: 12.5px; padding-left: 21px; }
.bd-group.known .eyebrow { color: var(--ok); }
.bd-group.missing .eyebrow { color: var(--warn); }
.bd-group.not_needed .eyebrow, .bd-group.not_needed li { color: var(--muted); }
.bd-group.unknown .eyebrow { color: var(--info); }
.bd-fold summary { cursor: pointer; font: 600 10.5px var(--text); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.bd-history { margin: 8px 0 0; padding-left: 16px; display: grid; gap: 4px; font-size: 12.5px; color: var(--ink2); }

/* settings, and the questions for the team: each the whole tab */
.bd-settings, .bd-questions { grid-column: 1 / -1; overflow-y: auto; padding: 20px clamp(16px, 4vw, 56px) 48px; }
.bd[data-pane="settings"] > :not(.bd-settings), .bd[data-pane="questions"] > :not(.bd-questions) { display: none !important; }
.bd-settings > *, .bd-questions > * { max-width: 860px; }
.bd-settings-intro h2, .bd-questions-intro h2 { margin: 4px 0 4px; font-size: 32px; }
.bd-questions-bar { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.bd-list-head .bd-questions-open { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 6px; color: var(--bd-chrome-soft); font-size: 12.5px; }
.bd-list-head .bd-questions-open:hover, .bd-list-head .bd-questions-open[aria-pressed="true"] { color: var(--ivory); }
.bd-questions-open .icon { width: 15px; height: 15px; }
.bd-questions-open .count { background: rgba(var(--accent-rgb), .3); color: var(--ivory); border-radius: 999px; padding: 1px 6px; font-size: 10.5px; }
.bd-questions-open .count:empty { display: none; }
.bd-set { margin-top: 24px; padding: 18px 20px; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--paper); }
.bd-set h3 { margin: 0 0 4px; font-size: 22px; }
.bd-approvals { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 0; }
.bd-model-today { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 0; }
.bd-model-today li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.bd-model-today strong { overflow-wrap: anywhere; }
.bd-approval-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name switch" "evidence switch" "why switch"; gap: 2px 16px; padding: 12px 0; border-top: 1px solid var(--rule); }
.bd-approval-name { grid-area: name; display: flex; align-items: center; gap: 8px; }
.bd-evidence { grid-area: evidence; margin: 0; font-size: 12.5px; color: var(--soft); font-variant-numeric: tabular-nums; }
.bd-why-switch { grid-area: why; display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); }
.bd-why-switch.locked { color: var(--warn); }
.bd-switch-wrap { grid-area: switch; align-self: center; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--soft); }
.bd-switch { position: relative; width: 42px; height: 24px; padding: 0; border-radius: 999px; border: 1px solid var(--rule2); background: var(--bg2); }
.bd-switch-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.bd-switch.on { background: var(--ok); border-color: var(--ok); }
.bd-switch.on .bd-switch-knob { transform: translateX(18px); }
.bd-switch:disabled { opacity: .5; cursor: not-allowed; }
.bd-meter { margin-top: 12px; }
.bd-meter > p { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; }
.bd-meter-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg2); }
.bd-meter-bar .sales, .bd-meter-key .sales::before { background: var(--accent3); }
.bd-meter-bar .ink, .bd-meter-key .ink::before { background: var(--info); }
.bd-meter-key { display: flex; gap: 16px; margin: 4px 0 0; font-size: 12px; color: var(--soft); }
.bd-meter-key span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; }
.bd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-back-settings { padding-left: 0; }
/* Lessons (8 Nov): the weekly reports the owner approves or drops */
.bd-lessons { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 0; }
.bd-lesson { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--rule); }
.bd-lesson-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bd-lesson-meta { margin: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bd-lesson-items { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.bd-lesson-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 4px 12px; }
.bd-lesson-item > div { flex: 1 1 280px; min-width: 0; display: grid; gap: 2px; }
.bd-lesson-said, .bd-lesson-line { margin: 0; font-size: 13px; color: var(--ink2); overflow-wrap: anywhere; }
.bd-lesson-said b { font-weight: 600; color: var(--ink); }
.bd-lesson-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- narrower: the project becomes a drawer; a phone shows one pane at a time ------------------ */
@media (max-width: 1180px) {
  .bd { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); }
  .bd-drawer-open { display: inline-flex; }
  .bd-drawer-close { display: inline-flex; align-self: flex-start; padding-left: 0; }
  .bd-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 30; width: min(380px, 100%); border-left: 1px solid var(--rule2); box-shadow: var(--shadow-3); transform: translateX(105%); visibility: hidden; transition: transform .28s var(--ease), visibility 0s .28s; }
  .bd[data-drawer="open"] .bd-panel { transform: none; visibility: visible; transition: transform .28s var(--ease); }
}
@media (max-width: 760px) {
  .bd { grid-template-columns: minmax(0, 1fr); }
  .bd[data-pane="list"] .bd-chat, .bd[data-pane="chat"] .bd-list { display: none; }
  .bd-back { display: inline-flex; padding-left: 0; }
  .bd-keys { display: none; }
  .bd-head { padding: 8px 16px; gap: 8px; }
  .bd-thread { padding: 14px 16px; }
  .bd-card { max-height: 52vh; }
  .bd-card-body, .bd-actions, .bd-status { padding-left: 16px; padding-right: 16px; }
  .bd-actions { justify-content: flex-start; }
  .bd-actions-main { width: 100%; }
  .bd-approve { flex: 1 1 100%; }
  .bd-actions-more button { padding: 0 8px; font-size: 12.5px; }
  .bd-panel { width: 100%; }
  .bd-needs-words { display: none; }
  .bd-approval-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "evidence" "why" "switch"; }
  .bd-switch-wrap { justify-self: start; margin-top: 6px; }
}

/* Settings, Model: why drafts are or are not on the ChatGPT plan, said plainly (11 Nov) */
.bd-route-why { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r); background: var(--bg2); color: var(--ink); font-size: 13px; line-height: 1.45; }
.bd-route-why.off { background: color-mix(in srgb, var(--warn) 12%, var(--paper)); box-shadow: inset 3px 0 0 var(--warn); }
/* the Sales Agent's card above a client chat in Conversations: its status beside the title */
.bd-conv-status { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .bd-panel, .bd[data-drawer="open"] .bd-panel, .bd-switch-knob, .bd-fact { transition: none; }
  .bd-pulse.busy::before { animation: none; }
}
