/* Client pipeline. Use the shared tokens. Keep every text at 12 px or more. */
.cp {
  --cp-p1: color-mix(in srgb, var(--bo-accent) 55%, var(--bo-surface));
  --cp-p2: color-mix(in srgb, var(--bo-accent) 72%, var(--bo-surface));
  --cp-p3: color-mix(in srgb, var(--bo-accent) 86%, var(--bo-surface));
  --cp-p4: var(--bo-accent);
  --cp-p5: var(--bo-success);
  color: var(--bo-ink); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 1600px; margin: 0 auto; min-width: 0;
  font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums;
}
:where(.cp) *, :where(.cp) *::before, :where(.cp) *::after { box-sizing: border-box; }
:where(.cp) :where(button, input, select) { font: inherit; color: inherit; }
:where(.cp) button { cursor: pointer; }
:where(.cp) button:disabled { opacity: .55; cursor: default; }
.cp :focus-visible { outline: 2px solid var(--bo-accent); outline-offset: 2px; }
:where(.cp) :where(h2, h3, h4, p, ul, ol, dl, dd) { margin: 0; padding: 0; }
:where(.cp) :where(ul, ol) { list-style: none; }
.cp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cp [data-phase="new"] { --cp-phase: var(--cp-p1); }
.cp [data-phase="in_progress"] { --cp-phase: var(--cp-p2); }
.cp [data-phase="qualified"] { --cp-phase: var(--cp-p3); }
.cp [data-phase="negotiation"] { --cp-phase: var(--cp-p4); }
.cp [data-phase="won"] { --cp-phase: var(--cp-p5); }
.cp [data-phase="risk"] { --cp-phase: var(--bo-warning); }
.cp [data-phase="lost"] { --cp-phase: var(--bo-muted); }
.cp [data-phase="unclassified"] { --cp-phase: var(--bo-line); }

/* Page head. Keep the top right free for the global tools of the app. */
.cp-head { display: grid; gap: 4px; min-width: 0; }
.cp-crumb { color: var(--bo-muted); background: none; border: 0; padding: 2px 8px 2px 0; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; border-right: 1px solid var(--bo-line); }
.cp-crumb:hover { color: var(--bo-accent); }
.cp-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; padding-right: min(340px, 26vw); }
.cp-title h2 { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; }
.cp-client-pick { font-size: 26px !important; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; border: 0; background: transparent; padding: 0 24px 0 0; margin: 0; max-width: 100%; field-sizing: content; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(-45deg, transparent 50%, currentColor 50%); background-size: 6px 6px; background-position: right 10px center, right 4px center; background-repeat: no-repeat; }
.cp-client-pick option { font-size: 14px; font-weight: 400; color: var(--bo-ink); background: var(--bo-surface); }
.cp-client { position: relative; min-width: 0; flex: 0 1 auto; }
.cp-client .search-select-icon { display: none; }
.cp-client .search-select-input { width: min(560px, 100%); field-sizing: content; min-width: 180px; max-width: 100%; padding: 0 4px; border: 1px solid transparent; border-radius: var(--bo-radius-sm); background: transparent; color: var(--bo-ink); font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; text-overflow: ellipsis; }
.cp-client .search-select-input:hover { background: var(--bo-surface-soft); }
.cp-client .search-select-input:focus { border-color: var(--bo-accent); box-shadow: none; background: var(--bo-surface); }
.cp-client .combo-menu { min-width: 300px; font-size: 14px; font-weight: 400; letter-spacing: 0; }
.cp-help-open { background: none; border: 0; padding: 4px 0; color: var(--bo-accent); font-size: 13px; }
.cp-help-open:hover { text-decoration: underline; }
.cp-lede { color: var(--bo-muted); }
.cp-lede-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; }
.cp-lede b { color: var(--bo-ink); font-weight: 600; }
.cp-lede .is-warn { color: var(--bo-warning); }

/* Data state. */
.cp-fresh { position: relative; display: inline-block; }
.cp-fresh > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--bo-muted); font-size: 13px; padding: 2px 0; }
.cp-fresh > summary::-webkit-details-marker { display: none; }
.cp-fresh > summary:hover { color: var(--bo-ink); }
.cp-fresh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bo-success); flex: none; }
.cp-fresh-dot.is-warn { background: var(--bo-warning); }
.cp-fresh-dot.is-bad { background: var(--bo-danger); }
.cp-fresh-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(380px, 80vw); background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: var(--bo-radius-md); box-shadow: var(--bo-shadow); padding: 14px; display: grid; gap: 10px; color: var(--bo-ink); }
.cp-fresh-pop li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 2px 8px; align-items: baseline; }
.cp-fresh-pop .cp-sub { grid-column: 2; }

/* Tabs and search. */
.cp-bar { display: flex; align-items: flex-end; gap: 8px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--bo-line); padding-bottom: 8px; }
.cp-bar.has-tabs { padding-bottom: 0; }
.cp-tabs { display: flex; gap: 2px; order: 1; }
.cp-tabs[hidden] { display: none; }
.cp-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; color: var(--bo-muted); margin-bottom: -1px; white-space: nowrap; }
.cp-tabs button:hover { color: var(--bo-ink); }
.cp-tabs button[aria-selected="true"] { color: var(--bo-accent); border-color: var(--bo-accent); font-weight: 600; }
.cp-search { position: relative; flex: 1 1 320px; order: 2; min-width: 0; margin: 0 0 6px auto; max-width: 460px; }
.cp-bar:not(.has-tabs) .cp-search { max-width: none; margin: 0; }
.cp-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--bo-muted); pointer-events: none; }
.cp-search input { width: 100%; height: 40px; padding: 0 34px 0 36px; background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: var(--bo-radius-sm); }
.cp-search input::placeholder { color: var(--bo-muted); opacity: 1; }
.cp-search input::-webkit-search-cancel-button { appearance: none; }
.cp-search-clear { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; background: none; color: var(--bo-muted); border-radius: var(--bo-radius-sm); }
.cp-search-clear:hover { color: var(--bo-ink); background: var(--bo-surface-soft); }
.cp-search-clear[hidden] { display: none; }

.cp-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }

/* First visit guide. */
.cp-intro { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px 20px; align-items: start; padding: 12px 14px; background: var(--bo-accent-soft); border-radius: var(--bo-radius-md); }
.cp-intro li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.cp-intro b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bo-surface); color: var(--bo-accent); font-size: 12px; }
.cp-intro ol { display: contents; }
.cp-intro-close { background: none; border: 0; color: var(--bo-accent); font-size: 13px; padding: 2px 4px; white-space: nowrap; }

/* Panels and states. */
.cp-box { background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: var(--bo-radius-md); min-width: 0; }
.cp-status { color: var(--bo-muted); font-size: 13px; min-height: 0; }
.cp-status:empty { display: none; }
.cp-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--bo-danger); background: var(--bo-danger-soft); padding: 10px 14px; border-radius: var(--bo-radius-md); }
.cp-empty { padding: 36px 20px; text-align: center; color: var(--bo-muted); display: grid; gap: 6px; justify-items: center; }
.cp-empty b { color: var(--bo-ink); font-size: 16px; font-weight: 600; }
.cp-empty p { max-width: 56ch; }
.cp-btn { min-height: 34px; padding: 6px 12px; background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: var(--bo-radius-sm); }
.cp-btn:hover:not(:disabled) { background: var(--bo-surface-soft); border-color: var(--bo-muted); }
.cp-btn.is-primary { background: var(--bo-accent-fill); border-color: var(--bo-accent-fill); color: #fff; font-weight: 600; }
.cp-link { background: none; border: 0; padding: 0; text-align: left; color: inherit; }
.cp-link:hover { color: var(--bo-accent); }
.cp-sub { display: block; color: var(--bo-muted); font-size: 13px; overflow-wrap: anywhere; }
.cp-warn { color: var(--bo-warning); }
.cp-bad { color: var(--bo-danger); }

/* Pipeline selector and filters. */
.cp-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.cp-seg { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.cp-seg button { display: inline-flex; gap: 6px; align-items: baseline; min-height: 34px; padding: 6px 12px; border-radius: var(--bo-radius-sm); border: 1px solid transparent; background: none; color: var(--bo-muted); }
.cp-seg button:hover { background: var(--bo-surface-soft); color: var(--bo-ink); }
.cp-seg button[aria-pressed="true"] { background: var(--bo-accent-soft); color: var(--bo-accent); font-weight: 600; }
.cp-seg small { font-size: 12px; opacity: .85; font-weight: 400; }
.cp-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.cp-field { display: inline-flex; align-items: center; gap: 6px; color: var(--bo-muted); font-size: 13px; min-width: 0; }
.cp-field select, .cp-field input { min-height: 34px; max-width: 200px; padding: 5px 8px; background: var(--bo-surface); color: var(--bo-ink); border: 1px solid var(--bo-line); border-radius: var(--bo-radius-sm); }
.cp-field select:disabled { opacity: .7; }
.cp-more { position: relative; }
.cp-more > summary { list-style: none; min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--bo-line); border-radius: var(--bo-radius-sm); background: var(--bo-surface); cursor: pointer; }
.cp-more > summary::-webkit-details-marker { display: none; }
.cp-more > summary b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--bo-accent-fill); color: #fff; font-size: 12px; font-weight: 600; }
.cp-more-pop { position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); width: 280px; max-width: 86vw; display: grid; gap: 10px; padding: 14px; background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: var(--bo-radius-md); box-shadow: var(--bo-shadow); }
.cp-more-pop .cp-field { display: grid; gap: 4px; }
.cp-more-pop .cp-field select { max-width: none; width: 100%; }

/* Funnel map: the phases read left to right, and each one lists its CRM stages. */
.cp-map { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 220px); }
.cp-funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-width: 0; }
.cp-phase { position: relative; min-width: 0; padding: 12px 14px; display: grid; gap: 6px; align-content: start; border-right: 1px solid var(--bo-line); }
.cp-phase::after { content: ""; position: absolute; top: 28px; right: -6px; width: 10px; height: 10px; background: var(--bo-surface); border-top: 1px solid var(--bo-line); border-right: 1px solid var(--bo-line); transform: rotate(45deg); z-index: 1; }
.cp-funnel > .cp-phase:last-child::after { display: none; }
.cp-phase-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: baseline; text-align: left; background: none; border: 0; padding: 4px; margin: -4px; border-radius: var(--bo-radius-sm); }
.cp-phase-head:hover { background: var(--bo-surface-soft); }
.cp-phase-head[aria-pressed="true"] { background: var(--bo-accent-soft); }
.cp-phase-head:disabled:hover { background: none; }
.cp-phase-name { grid-column: 1 / -1; color: var(--bo-muted); font-size: 13px; font-weight: 500; }
.cp-phase-num { font-size: 24px; line-height: 1.15; font-weight: 650; }
.cp-phase-pct { color: var(--bo-muted); font-size: 12px; }
.cp-phase-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--bo-surface-soft); overflow: hidden; margin-top: 2px; }
.cp-phase-bar i { display: block; height: 100%; min-width: 2px; border-radius: 2px; background: var(--cp-phase); }
.cp-stage-list { display: grid; gap: 1px; min-width: 0; }
.cp-stage-btn { display: flex; justify-content: space-between; gap: 8px; width: 100%; background: none; border: 0; padding: 2px 4px; margin: 0 -4px; width: calc(100% + 8px); border-radius: 4px; color: var(--bo-muted); font-size: 13px; text-align: left; }
.cp-stage-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-stage-btn b { font-weight: 500; color: var(--bo-ink); }
.cp-stage-btn:hover { background: var(--bo-surface-soft); color: var(--bo-ink); }
.cp-stage-btn[aria-pressed="true"] { background: var(--bo-accent-soft); color: var(--bo-accent); }
.cp-stage-more { background: none; border: 0; color: var(--bo-accent); font-size: 12px; text-align: left; padding: 2px 0; }
.cp-off { padding: 12px 14px; display: grid; gap: 2px; align-content: start; background: var(--bo-surface-soft); border-radius: 0 var(--bo-radius-md) var(--bo-radius-md) 0; }
.cp-off h4 { font-size: 12px; font-weight: 600; color: var(--bo-muted); margin-bottom: 4px; }
.cp-off-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; margin: 0 -6px; width: calc(100% + 12px); background: none; border: 0; border-radius: 4px; text-align: left; }
.cp-off-btn b { margin-left: auto; font-weight: 600; }
.cp-off-btn:hover { background: var(--bo-surface); }
.cp-off-btn[aria-pressed="true"] { background: var(--bo-accent-soft); }
.cp-mark { width: 10px; height: 10px; border-radius: 3px; background: var(--cp-phase); flex: none; display: inline-block; }
.cp-mark[data-phase="unclassified"] { background: none; border: 1px dashed var(--bo-muted); }

/* Lists. */
.cp-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 14px; }
.cp-list-head h3 { font-size: 15px; font-weight: 600; }
.cp-list-head h3 small { color: var(--bo-muted); font-size: 13px; font-weight: 400; margin-left: 4px; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cp-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px; border-radius: 14px; border: 1px solid var(--bo-line); background: var(--bo-surface); font-size: 13px; }
.cp-chip:hover { border-color: var(--bo-muted); }
.cp-chip[aria-pressed="true"], .cp-chip.is-on { background: var(--bo-accent-soft); border-color: transparent; color: var(--bo-accent); }
.cp-chip.is-warn b { color: var(--bo-warning); }
.cp-chip.is-bad b { color: var(--bo-danger); }
.cp-chip b { font-weight: 600; }
.cp-table-wrap { overflow-x: auto; border-top: 1px solid var(--bo-line); }
.cp-table { width: 100%; border-collapse: collapse; text-align: left; }
.cp-table th { font-size: 12px; font-weight: 600; color: var(--bo-muted); background: var(--bo-surface-soft); padding: 7px 14px; white-space: nowrap; }
.cp-table th button { background: none; border: 0; padding: 0; font-weight: 600; color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.cp-table th button:hover { color: var(--bo-ink); }
.cp-table th[aria-sort] button { color: var(--bo-accent); }
.cp-table td { padding: 8px 14px; border-top: 1px solid var(--bo-line); vertical-align: top; }
.cp-table tbody tr:first-child td { border-top: 0; }
.cp-table tbody tr[data-record], .cp-table tbody tr[data-open-client] { cursor: pointer; }
.cp-table tbody tr[data-record]:hover, .cp-table tbody tr[data-open-client]:hover { background: var(--bo-surface-soft); }
.cp-table tbody tr.is-on { background: var(--bo-accent-soft); }
.cp-lead-name { font-weight: 600; }
.cp-cell-num { text-align: right; }
.cp-table th.cp-cell-num button { justify-content: flex-end; width: 100%; }
.cp-where { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13px; color: var(--bo-muted); }
.cp-stage-name { font-weight: 500; overflow-wrap: anywhere; }
.cp-steps { display: inline-flex; gap: 2px; flex: none; }
.cp-steps i { width: 13px; height: 5px; border-radius: 1.5px; background: var(--bo-line); }
.cp-steps i.is-on { background: var(--cp-phase); }
.cp-list-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; color: var(--bo-muted); font-size: 13px; border-top: 1px solid var(--bo-line); }
.cp-busy { opacity: .55; transition: opacity .12s; }
.cp-skel td span { display: block; height: 12px; border-radius: 4px; background: var(--bo-surface-soft); margin: 4px 0; }

/* Portfolio. */
.cp-glance { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.cp-mini { display: flex; gap: 2px; height: 10px; width: 100%; min-width: 120px; }
.cp-mini i { display: block; height: 100%; min-width: 3px; background: var(--cp-phase); border-radius: 2px; }
.cp-mini i[data-phase="unclassified"] { background: repeating-linear-gradient(135deg, var(--bo-line) 0 3px, transparent 3px 6px); }
.cp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--bo-muted); font-size: 12px; padding: 8px 14px; border-top: 1px solid var(--bo-line); }
.cp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cp-nodata > summary { cursor: pointer; padding: 10px 14px; font-weight: 500; }
.cp-nodata[open] > summary { border-bottom: 1px solid var(--bo-line); }
.cp-nodata-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 24px; padding: 12px 14px; }
.cp-nodata-groups h4 { font-size: 13px; font-weight: 600; }
.cp-nodata-groups li { padding-top: 4px; }

/* Lead detail. It stays open beside the list, so the next lead is one click away. */
.cp-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--bo-line); width: min(520px, 100vw); max-width: 100vw; height: 100dvh; max-height: none; overflow: hidden; display: flex; flex-direction: column; background: var(--bo-surface); box-shadow: var(--bo-shadow); color: var(--bo-ink); font-family: inherit; font-size: 14px; line-height: 1.45; }
.cp-drawer[hidden] { display: none; }
.cp-drawer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--bo-line); }
.cp-drawer-top h3 { font-size: 20px; line-height: 1.25; font-weight: 650; outline: none; overflow-wrap: anywhere; }
.cp-drawer-tools { display: flex; gap: 4px; flex: none; }
.cp-icon { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; background: none; border: 1px solid var(--bo-line); border-radius: var(--bo-radius-sm); color: var(--bo-muted); }
.cp-icon:hover:not(:disabled) { color: var(--bo-ink); border-color: var(--bo-muted); }
.cp-icon svg { width: 16px; height: 16px; }
.cp-drawer-body { overflow-y: auto; padding: 16px 20px 28px; display: grid; gap: 18px; align-content: start; }
.cp-now { display: grid; gap: 10px; padding: 14px; background: var(--bo-surface-soft); border-radius: var(--bo-radius-md); }
.cp-now-stage { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 16px; font-weight: 600; }
.cp-now-stage small { font-size: 13px; font-weight: 400; color: var(--bo-muted); }
.cp-now ul { display: grid; gap: 4px; }
.cp-now li { color: var(--bo-muted); }
.cp-now li b { color: var(--bo-ink); font-weight: 600; }
.cp-now li .cp-warn, .cp-now li b.cp-warn { color: var(--bo-warning); }
.cp-now li b.cp-bad { color: var(--bo-danger); }
.cp-track { display: flex; flex-wrap: wrap; gap: 6px 0; align-items: center; font-size: 13px; color: var(--bo-muted); }
.cp-track li { display: inline-flex; align-items: center; gap: 6px; }
.cp-track li + li::before { content: ""; width: 14px; height: 1px; background: var(--bo-line); margin: 0 6px; }
.cp-track i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--bo-line); flex: none; }
.cp-track .is-past i { background: var(--cp-phase); border-color: var(--cp-phase); }
.cp-track .is-now { color: var(--bo-ink); font-weight: 600; }
.cp-track .is-now i { background: var(--cp-phase); border-color: var(--bo-ink); box-shadow: 0 0 0 2px var(--bo-surface-soft), 0 0 0 3px var(--bo-ink); }
.cp-sec h4 { font-size: 13px; font-weight: 600; color: var(--bo-muted); margin-bottom: 8px; }
.cp-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cp-story { display: grid; }
.cp-story li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 2px 10px; padding-bottom: 12px; position: relative; }
.cp-story li::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 1px; background: var(--bo-line); }
.cp-story li:last-child::before { display: none; }
.cp-story-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bo-surface-soft); color: var(--bo-muted); grid-row: span 2; }
.cp-story-icon svg { width: 13px; height: 13px; }
.cp-story li.is-stage .cp-story-icon { color: var(--bo-accent); background: var(--bo-accent-soft); }
.cp-story-text { font-weight: 500; overflow-wrap: anywhere; }
.cp-story-body { margin-top: 4px; padding: 8px 10px; background: var(--bo-surface-soft); border-radius: var(--bo-radius-sm); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.cp-facts dt { color: var(--bo-muted); font-size: 12px; }
.cp-facts dd { overflow-wrap: anywhere; }
.cp-copy { background: none; border: 0; padding: 0 0 0 4px; color: var(--bo-accent); font-size: 12px; }

/* Help. */
.cp-help-body { display: grid; gap: 16px; }
.cp-help-body h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--bo-ink); }
.cp-help-body p { color: var(--bo-muted); }
.cp-help-phases { display: grid; gap: 6px; }
.cp-help-phases li { display: grid; grid-template-columns: 10px 112px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.cp-help-phases span:last-child { color: var(--bo-muted); font-size: 13px; }

/* Analysis and stage setup. */
.cp-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cp-pad { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; align-content: start; }
.cp-pad h3 { font-size: 15px; font-weight: 600; }
.cp-note { color: var(--bo-muted); font-size: 13px; }
.cp-goal { display: flex; height: 14px; gap: 2px; }
.cp-goal i { display: block; height: 100%; border-radius: 3px; min-width: 3px; }
.cp-goal .is-ok { background: var(--bo-success); }
.cp-goal .is-late { background: var(--bo-warning); }
.cp-goal-keys { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--bo-muted); }
.cp-goal-keys b { color: var(--bo-ink); }
.cp-hbar { display: block; height: 6px; border-radius: 3px; background: var(--bo-accent); margin-top: 4px; min-width: 2px; }
.cp-rule-row select, .cp-rule-row input { min-height: 34px; padding: 5px 8px; background: var(--bo-surface); color: var(--bo-ink); border: 1px solid var(--bo-line); border-radius: var(--bo-radius-sm); width: 100%; }
.cp-rule-row input { max-width: 110px; }
.cp-rule-row select:disabled, .cp-rule-row input:disabled { opacity: .7; }
.cp-rule-row td { vertical-align: middle; }

@media (max-width: 1180px) {
  .cp-map { grid-template-columns: minmax(0, 1fr); }
  .cp-off { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; border-radius: 0 0 var(--bo-radius-md) var(--bo-radius-md); }
  .cp-off h4 { margin: 0; width: 100%; }
  .cp-off-btn { width: auto; margin: 0; flex: 1 1 140px; }
  .cp-phase { border-bottom: 1px solid var(--bo-line); }
}
@media (max-width: 760px) {
  .cp-title { padding-right: 0; }
  .cp-title h2, .cp-client-pick { font-size: 22px !important; }
  .cp-client .search-select-input { font-size: 22px; min-width: 0; width: 100%; }
  .cp-client { flex: 1 1 100%; }
  .cp-intro { grid-template-columns: minmax(0, 1fr); }
  .cp-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-phase::after { display: none; }
  .cp-grid2 { grid-template-columns: minmax(0, 1fr); }
  .cp-search { max-width: none; flex-basis: 100%; margin-left: 0; }
  .cp-controls { align-items: stretch; flex-direction: column; flex-wrap: nowrap; }
  .cp-filters .cp-field { flex: 1 1 140px; }
  .cp-filters .cp-field select { max-width: none; flex: 1; min-width: 0; }
  .cp-seg { flex-wrap: nowrap; overflow-x: auto; }
  .cp-seg button { white-space: nowrap; }
  .cp-more-pop { right: auto; left: 0; }
  .cp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cp-leads tbody tr, .cp-clients tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; padding: 10px 14px; border-top: 1px solid var(--bo-line); }
  .cp-leads tbody tr:first-child, .cp-clients tbody tr:first-child { border-top: 0; }
  .cp-leads td, .cp-clients td { display: block; padding: 0; border: 0; text-align: left; }
  .cp-leads td:nth-child(1), .cp-leads td:nth-child(2), .cp-clients td:nth-child(1), .cp-clients td:nth-child(2) { grid-column: 1 / -1; }
  .cp-cell-label { display: block; color: var(--bo-muted); font-size: 12px; }
  .cp-table-wrap:has(> .cp-leads, > .cp-clients) { overflow-x: visible; }
}
@media (min-width: 761px) { .cp-cell-label { display: none; } }
@media (prefers-reduced-motion: reduce) { .cp-busy { transition: none; } }
