/* salesbd screens: rules added by the UI pass of 25 Oct 2026; loaded after features.css so same-specificity rules here win. */

/* ---------- Sub-tabs: three grouped segmented controls in one strip that scrolls sideways on a phone and wraps between
   whole groups on a wide screen; the active tab is scrolled into view by bd.js. ---------- */
.bd-views { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.bd-views::-webkit-scrollbar { display: none; }
.bd-views > .seg { flex: none; overflow: visible; }
.bd-views .seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg-n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.seg-n[hidden] { display: none; }
.seg button.on .seg-n { background: var(--warn); color: #fff; border-color: var(--warn); }
@media (min-width: 900px) { .bd-views { flex-wrap: wrap; } } /* wraps between whole groups; a group wider than the column still scrolls, never clips */
.bd-banner .callout > .btn { display: inline-flex; vertical-align: middle; margin-top: 0; margin-left: 8px; }

/* ---------- View switching: the old view fades and stops taking clicks until the new one is in (120 ms delay: a fast
   load never flashes) ---------- */
.bd-view.is-loading { opacity: 0.5; pointer-events: none; transition: opacity 0.15s ease 0.12s; }
@media (prefers-reduced-motion: reduce) { .bd-view.is-loading { transition: none; } }

/* ---------- Approve: the bulk bar parks under the top bar (not behind it) on the bar material ---------- */
.bd-bulk { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 5; padding: 8px 0; margin-top: 10px; background: var(--bar-bg, var(--surface)); box-shadow: 0 1px 0 var(--line); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .bd-bulk { -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); } }

/* ---------- Approve: draft card header — company first, badges on their own line ---------- */
.bd-draft > .between { flex-wrap: wrap; } /* the "written by" note may drop under the company name */
.bd-draft-head { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.bd-draft-head > .bd-fold, .bd-draft-head > .bd-hit { flex: none; }
.bd-draft-who { min-width: 0; overflow-wrap: anywhere; }
.bd-draft-badges { margin-top: 6px; }
.bd-draft.collapsed .bd-draft-badges { margin-top: 4px; }
.badge.ai { background: var(--ai-bg); color: var(--primary-text); border-color: var(--ai-line); }

/* ---------- Today: the flow has seven tiles; the one that needs you is outlined in the theme's green; tiles with a view
   are buttons ---------- */
.bd-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* 4 + 3 in a narrow column, one row of seven on a wide screen */
@media (min-width: 1280px) { .bd-flow { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@media (max-width: 420px) { .bd-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bd-flow-step span { overflow-wrap: anywhere; }
.bd-steps li .link { text-align: left; }
.bd-flow-step.attn { outline: 2px solid var(--primary); background: var(--primary-soft); }
.bd-flow-step:is(button) { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: box-shadow 0.15s, transform 0.06s; }
.bd-flow-step:is(button):hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.bd-flow-step:is(button):active { transform: translateY(1px); }
.bd-flow-step:is(button):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bd-flow-step.attn em { color: var(--primary-text); font-weight: 600; }
.bd-view .stat:is(button) { font: inherit; }
.bd-view details.card > summary.subhead { cursor: pointer; margin: 0; padding: 0; border: 0; list-style: none; }
.bd-view details.card > summary.subhead::-webkit-details-marker { display: none; }
.bd-view details.card > summary.subhead::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); font-size: 0.85em; }
.bd-view details.card[open] > summary.subhead::before { content: "▾"; }
.bd-end { justify-content: flex-end; }
.bd-hint { display: block; font-weight: 400; margin-top: 2px; }

/* ---------- Outbox, Prospects and Verification on a phone: each row is a block, every value keeps its column name
   ("Stage: …"), empty values are left out, and the actions get a row of their own ---------- */
@media (max-width: 640px) {
  .bd-bulk > .small { display: none; } /* the sticky bar keeps only its buttons on a phone */
  .bd-draft .bd-draft-head { flex: 1 0 100%; } /* the company gets the whole first line; the "written by" note goes under it */
  .bd-table.bd-stack thead { display: none; }
  .bd-table.bd-stack, .bd-table.bd-stack tbody, .bd-table.bd-stack tr, .bd-table.bd-stack td { display: block; width: 100%; box-sizing: border-box; }
  .bd-table.bd-stack tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .bd-table.bd-stack tr:last-child { border-bottom: 0; } /* the table's own border closes the last one */
  .table-wrap .bd-table.bd-stack td { padding: 2px 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .table-wrap .bd-table.bd-stack td.bd-wrap { min-width: 0; max-width: none; }
  .bd-table.bd-stack td.bd-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
  .bd-table.bd-stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.75rem; }
  .bd-table.bd-stack td[data-label]:empty, .bd-table.bd-stack td.bd-actions:empty, .bd-table.bd-stack td.bd-phone-hide { display: none; }
  /* A prospect: its checkbox at the left of the company name, then stage, score and country side by side, then the
     next step. The checkbox's cell never opens the prospect (bd.js), so a tap beside the box can't open it by mistake. */
  .bd-table.bd-stack tr.bd-prow { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 14px; position: relative; padding-left: 56px; }
  .bd-table.bd-stack tr.bd-prow > td { width: auto; flex: 0 1 auto; }
  .bd-table.bd-stack tr.bd-prow > td.bd-org, .bd-table.bd-stack tr.bd-prow > td.bd-wrap { flex: 1 1 100%; }
  /* (bd-selcell, not bd-pick: features.css gives .bd-pick a scrolling list's height, overflow and margin) */
  .table-wrap .bd-table.bd-stack tr.bd-prow > td.bd-selcell { position: absolute; left: 6px; top: 4px; width: auto; padding: 0; }
  .bd-table.bd-stack tr.bd-prow .bd-selcell .bd-hit { margin: 0; }
}

/* ---------- Email → Sent emails: subject and "How" wrap instead of widening the table; on a phone each email is a
   block like the Outbox's ---------- */
.table-wrap .sent-table td.sent-wrap { white-space: normal; overflow-wrap: anywhere; min-width: 160px; max-width: 320px; }
@media (max-width: 640px) {
  .sent-table thead { display: none; }
  .sent-table, .sent-table tbody, .sent-table tr, .sent-table td { display: block; width: 100%; box-sizing: border-box; }
  .sent-table tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .sent-table tr:last-child { border-bottom: 0; }
  .table-wrap .sent-table td, .table-wrap .sent-table td.sent-wrap { padding: 2px 0; border: 0; white-space: normal; overflow-wrap: anywhere; min-width: 0; max-width: none; }
  .sent-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.75rem; }
  .sent-table td[data-label]:empty { display: none; }
}

/* ---------- Phone touch targets: 44 px around the small checkboxes and the fold button; 16 px fields so iOS doesn't zoom ---------- */
.bd-hit { display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; margin: -6px -4px; cursor: pointer; vertical-align: middle; }
.bd-hit input { margin: 0; }
@media (pointer: coarse) {
  .bd-hit { min-width: 44px; min-height: 44px; margin: -10px -8px; }
  .bd-draft .bd-fold { min-width: 44px; min-height: 44px; }
  .bd-draft input[data-pick], .bd-table input[data-sel] { width: 24px; height: 24px; }
  .bd-view input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), .bd-view select, .bd-view textarea, .bd-banner input, .bd-banner select, .sw-trace select { font-size: 16px; }
}
