/* AAT Call Desk. One screen, big targets, keyboard on a laptop, one hand on a phone.
   One typeface (Public Sans, tabular figures for every number), navy shell, and exactly one loud thing: the red Call bar. */
:root {
  --navy: #0a2342; --navy-deep: #061a36; --navy-mid: #16386a; --navy-tint: #e8eef8; --navy-tint-2: #cfdaee;
  --red: #c8102e; --red-deep: #a50d25;
  --ink: #111827; --ink-2: #2a3446; --slate: #5a6478; --slate-2: #8a93a5;
  --line: #d9dee8; --line-2: #e9edf3; --canvas: #eef1f5; --hover: #f5f7fa; --white: #fff;
  --live: #1f9d55; --good: #14602f; --good-bg: #eaf6ee; --good-line: #b6ddc3;
  --warn: #7a4f0b; --warn-bg: #fbf3e2; --warn-line: #ead5a3; --amber: #b7791f;
  --bad: #b42318;
  --focus: #2b59c3;
  --r: 8px; --r-sm: 6px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── base ── */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.busy { cursor: progress; }
body.busy .btn { opacity: .7; pointer-events: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--slate); }
.error { color: var(--bad); font-weight: 500; font-size: 14px; margin: 10px 0 0; }
.hint { font-size: 13px; color: var(--slate); }
.mono { font-variant-numeric: tabular-nums; }
b, strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 8px; font: 600 11px/1 var(--font); color: var(--slate); background: var(--white); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; vertical-align: middle; }

summary { cursor: pointer; list-style: none; user-select: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 1px 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); opacity: .7; transition: transform .12s; }
details[open] > summary::before { transform: rotate(45deg); }

/* ── brand ── */
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.brand.small { font-size: 16px; }
.brand-mark { display: inline-grid; place-items: center; height: 28px; padding: 0 8px; background: var(--navy); color: var(--white); font-size: 12px; font-weight: 700; letter-spacing: .1em; border-radius: 5px; }
.brand.small .brand-mark { height: 26px; }

/* ── buttons ── */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--ink); font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; touch-action: manipulation; text-decoration: none; transition: background-color .12s, border-color .12s, transform .05s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn.primary:hover { background: var(--navy-mid); border-color: var(--navy-mid); }
.btn.big { width: 100%; min-height: 52px; font-size: 16px; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(10,35,66,.06); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }

/* ── form controls ── */
#q-search, #q-sort, #rep-filter, .audio-grid select, .text-grid select, .text-grid textarea, .fields input[type="email"], .fields textarea, .est-grid input, .est-grid select {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; min-height: 38px;
}
#q-search:focus, #q-sort:focus, #rep-filter:focus, .audio-grid select:focus, .text-grid select:focus, .text-grid textarea:focus, .fields input[type="email"]:focus, .fields textarea:focus, .est-grid input:focus, .est-grid select:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,35,66,.12);
}
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--navy); margin: 0; }

/* ── sign in ── */
#login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--navy); }
.login-card { width: min(360px, 100%); background: var(--white); border-radius: 10px; padding: 26px 24px 24px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.login-card .brand { margin-bottom: 18px; }
.login-lede { margin: 0 0 12px; font-size: 14px; }
#pin { width: 100%; height: 60px; font: 600 28px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: .28em; text-align: center; padding: 0 12px; color: var(--ink); background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 12px; }
#pin::placeholder { letter-spacing: .08em; font-size: 15px; font-weight: 500; color: var(--slate-2); }
#pin:focus { outline: none; border-color: var(--navy); background: var(--white); box-shadow: 0 0 0 3px rgba(10,35,66,.15); }

/* ── top bar + today's scoreboard ── */
#desk { display: grid; grid-template-columns: minmax(0, 1fr); }
#desk > .inbound, #desk > .work { min-width: 0; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 0 16px; background: var(--navy); color: var(--white); }
.top .brand { color: var(--white); }
.top .brand-mark { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,.7); }
.top .who { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: rgba(255,255,255,.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 6px; }
.top .btn { min-height: 36px; padding: 6px 12px; font-size: 13px; color: var(--white); border-color: rgba(255,255,255,.28); background: transparent; }
.top .btn:hover { background: rgba(255,255,255,.1); }

.tally { position: sticky; top: 0; z-index: 5; display: flex; align-items: stretch; background: var(--navy-deep); color: var(--white); padding: 0 8px; }
.tally-title { display: none; }
.tally > div:not(.tally-title) { flex: 1 1 0; min-width: 0; padding: 8px 6px 7px; text-align: center; border-left: 1px solid rgba(255,255,255,.1); }
.tally > .tally-title + div { border-left: 0; }
.tally b { display: block; font-size: 20px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
.tally span { display: block; font-size: 11px; line-height: 1.2; color: rgba(255,255,255,.66); margin-top: 2px; }

/* ── callbacks & voicemails ── */
.inbound { width: 100%; max-width: 1400px; margin: 12px auto 0; padding: 0 16px; font-size: 14px; }
.inbound summary { display: flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink-2); padding: 9px 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.inbound[open] summary { border-radius: var(--r) var(--r) 0 0; }
.inbound-list { list-style: none; margin: 0; padding: 0; background: var(--white); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); max-height: 320px; overflow: auto; }
.inbound-list li { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.inbound-list li:last-child { border-bottom: 0; }
.inbound-list li.unheard { background: var(--warn-bg); box-shadow: inset 3px 0 0 var(--amber); }
.inbound-list .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.inbound-list .vm { margin-top: 6px; }
.inbound-list audio { width: 100%; max-width: 420px; height: 36px; }
.inbound-list .transcript { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

.pill { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 7px; border-radius: 999px; background: var(--navy-tint); color: var(--navy); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.pill.hot { background: var(--warn-bg); color: var(--warn); }
.pill:empty { display: none; }

/* ── list + card layout ── */
.work { width: 100%; max-width: 1400px; margin: 0 auto; padding: 12px 16px 40px; }
.sec-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.queue { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.queue-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.queue-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#q-search { min-width: 220px; }
.queue-wrap { max-height: calc(100vh - 220px); overflow: auto; }
#q-empty { margin: 10px 2px 0; }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--white); }
th, td { padding: 8px 8px; text-align: right; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; vertical-align: top; }
th:first-child, td:first-child { text-align: left; }
th { position: sticky; top: 0; z-index: 1; font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--slate); background: var(--hover); border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); }

#q-table { min-width: 600px; }
#q-table th:nth-child(-n+3), #q-table td:nth-child(-n+3), #q-table th:nth-child(8), #q-table td:nth-child(8) { text-align: left; }
#q-table td { font-size: 13px; line-height: 1.35; }
#q-table th:first-child { width: 17%; }
#q-table td:first-child b { color: var(--ink); }
#q-table th:nth-child(3) { width: 27%; }
#q-table td small { display: block; color: var(--slate); font-size: 11.5px; margin-top: 1px; }
#q-table td.mono { white-space: nowrap; }
#q-table td small.closed-note { color: var(--amber); }
#q-table tbody tr { cursor: pointer; }
#q-table tbody tr:hover td { background: var(--hover); }
#q-table tbody tr.sel td { background: var(--navy-tint); }
#q-table tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--navy); }
#q-table tbody tr.done td, #q-table tbody tr.done td b { color: var(--slate); }
#q-table tbody tr.held td { opacity: .5; }
#q-table tbody tr.closed td:nth-child(4) { color: var(--amber); }
.tag-booked, .tag-interested { color: var(--good); font-weight: 600; }
.tag-not_interested { color: var(--warn); font-weight: 600; }
.tag-dial { color: var(--navy-mid); font-weight: 600; }

/* ── lead card ── */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 18px; margin-top: 12px; }
.card-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.card-id { min-width: 0; }
h1 { font-size: 22px; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 6px 0 2px; text-transform: capitalize; overflow-wrap: anywhere; }
#c-company { font-size: 14px; }
.phones { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.phone { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--navy); text-decoration: none; white-space: nowrap; }
.phone.alt { font-size: 14px; font-weight: 500; color: var(--slate); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 14px 0 6px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.fact.wide { grid-column: 1 / -1; }
.fact span { display: block; font-size: 12px; color: var(--slate); margin-bottom: 2px; }
.fact b { display: block; font-size: 15px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.grid > .fact.wide:first-child b { font-size: 16px; font-weight: 600; }
.fact b:empty::after { content: "n/a"; color: var(--slate-2); font-weight: 400; }
.muted-fact b { color: var(--ink-2); font-weight: 400; }
.more { margin: 6px 0 12px; font-size: 13px; color: var(--slate); }
.more summary { font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.more pre { white-space: pre-wrap; font: 12px/1.45 ui-monospace, Consolas, monospace; background: var(--canvas); padding: 10px; border-radius: var(--r-sm); max-height: 180px; overflow: auto; color: var(--ink-2); margin: 6px 0 0; }

/* the one loud thing */
.actions { display: flex; gap: 10px; margin-top: 8px; }
.btn.call { flex: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; background: var(--red); border-color: var(--red); color: var(--white); border-radius: var(--r); text-align: left; }
.btn.call:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn.call:disabled { background: #7d8798; border-color: #7d8798; }
.btn.call .call-label { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.btn.call kbd { color: rgba(255,255,255,.9); background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); }
.btn.call .sub-label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.85); text-align: right; line-height: 1.3; max-width: 240px; justify-self: end; }
.lamp { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.7); flex: none; }

.actions.small { flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btn.call.alt { display: inline-flex; flex: 1 1 auto; min-height: 44px; padding: 8px 12px; font-size: 13px; font-weight: 600; background: var(--white); color: var(--navy); border: 1px solid var(--navy-tint-2); border-radius: var(--r-sm); text-align: center; }
.btn.call.alt:hover { background: var(--navy-tint); border-color: var(--navy); }

.callbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px 10px 14px; background: var(--navy-deep); color: var(--white); border-radius: var(--r); }
.callbar-state { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; min-width: 0; }
#cb-state { overflow-wrap: anywhere; }
.callbar .lamp { background: var(--live); }
.card:has(#soft-call:disabled) .callbar .lamp { animation: pulse 1.6s ease-out infinite; }
.card:has(#soft-call:disabled):has(#callbar:not([hidden])) .actions:not(.small) { display: none; }
.callbar .mono { font-weight: 500; color: rgba(255,255,255,.8); white-space: nowrap; }
.callbar .btn { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.callbar-actions { display: flex; gap: 8px; flex: none; }
.callbar .btn.ghost { color: var(--white); border-color: rgba(255,255,255,.3); }
.callbar .btn.ghost:hover { background: rgba(255,255,255,.1); }
.callbar kbd { color: rgba(255,255,255,.85); background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }
.btn.hangup { background: var(--red); border-color: var(--red); color: var(--white); }
.btn.hangup:hover { background: var(--red-deep); border-color: var(--red-deep); }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(31,157,85,.6); } to { box-shadow: 0 0 0 12px rgba(31,157,85,0); } }
@media (prefers-reduced-motion: reduce) { .lamp { animation: none !important; } summary::before { transition: none; } }

.audio, .other-ways, .textpanel { margin-top: 10px; font-size: 13px; color: var(--slate); }
.audio summary, .other-ways summary, .textpanel summary { font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.audio-grid, .text-grid { display: grid; gap: 10px 16px; margin-top: 8px; padding: 12px; background: var(--canvas); border-radius: var(--r-sm); }
.audio-grid { grid-template-columns: 1fr 1fr; }
.audio-grid label, .text-grid label, .fields label, .est-grid label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--slate); }
.audio-grid select, .text-grid select, .text-grid textarea { width: 100%; max-width: 100%; font-weight: 400; }
.audio-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.audio-actions .btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.mic-level { display: inline-block; width: 120px; height: 8px; background: rgba(10,35,66,.12); border-radius: 4px; overflow: hidden; }
.mic-level i { display: block; height: 100%; width: 0; background: var(--live); }
.audio-grid .hint { grid-column: 1 / -1; margin: 0; }
.text-grid textarea { line-height: 1.4; }
.status { margin: 10px 0 0; padding: 10px 12px; background: var(--navy-tint); border-radius: var(--r-sm); font-size: 14px; color: var(--navy-deep); }

/* after the call: the outcome keypad */
.outcome { margin: 18px -16px -18px; padding: 14px 16px 18px; background: var(--canvas); border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }
.disp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.btn.disp { position: relative; justify-content: flex-start; min-width: 0; min-height: 56px; padding: 8px 38px 8px 12px; font-size: 14px; line-height: 1.25; text-align: left; white-space: normal; }
.btn.disp kbd { position: absolute; right: 8px; top: 50%; margin: 0; transform: translateY(-50%); }
.btn.disp.good { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.btn.disp.good:hover { background: #def0e4; }
.btn.disp.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.btn.disp.warn:hover { background: #f6e9cc; }
.btn.disp.suggest { outline: 2px solid var(--navy); outline-offset: 1px; }
.callbar .btn.retry { background: var(--white); color: var(--navy); border-color: var(--white); font-weight: 600; }
.callbar .btn.retry:hover { background: #e9eef6; }
#stats-table td small { display: block; font-size: 11px; font-weight: 500; color: var(--slate); white-space: nowrap; }
.fields { display: grid; gap: 10px; margin-top: 14px; }
.fields input[type="email"], .fields textarea { width: 100%; font-weight: 400; }
.fields textarea { line-height: 1.4; resize: vertical; }
.fields .check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink); min-height: 40px; }
.fields .check input { width: 20px; height: 20px; }
.book-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.book-row .hint { flex: 1 1 200px; }
.btn.book { flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 14px; background: var(--white); border-color: var(--navy-tint-2); color: var(--navy); text-align: left; }
.btn.book .muted { font-size: 11.5px; font-weight: 500; }
.btn.book:hover { border-color: var(--navy); background: var(--navy-tint); }

/* ── estimate (KBKG quick estimator, written nightly by estimate-bot) ── */
.est { margin: 12px 0 4px; padding: 12px 14px; background: var(--navy-tint); border-radius: var(--r); }
.est-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.est .pill { background: var(--warn-bg); color: var(--warn); }
.est-num b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.est-rep { margin: 6px 0 2px; font-size: 14px; color: var(--ink); }
.est .hint { margin: 2px 0 0; }

/* The estimate panel is a question sheet: the four things KBKG needs, asked on the call. Nothing is pre-filled
   and nothing is stored - KBKG does the math. Two columns on a laptop, one on a phone. */
.est-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 10px 0; }
.est-grid label.wide { grid-column: 1 / -1; }
.est-grid input, .est-grid select { width: 100%; font-weight: 400; font-variant-numeric: tabular-nums; }
.est-grid .hint { font-weight: 400; }
.est-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.est-actions .btn { background: var(--navy); border-color: var(--navy); color: var(--white); }
.est-actions .btn:hover { background: var(--navy-mid); border-color: var(--navy-mid); }
.est-actions .hint { flex: 1; min-width: 200px; }
/* What KBKG said, once the server run comes back. Deliberately looks like an answer, not a form field. */
.est-out { margin: 10px 0 4px; padding: 12px 14px; background: var(--good-bg); border: 1px solid var(--good-line); border-radius: var(--r-sm); }
.est-out .est-num b { color: var(--good); }
.est-out .hint { margin: 4px 0 0; }
.est-manual { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
/* A leftover from the retired nightly bot. Amber, never a headline number: a rep must not read it out. */
.est-stale { padding: 10px 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r-sm); color: var(--warn); }
.est-stale p { margin: 0 0 6px; font-size: 14px; }
.est-stale .hint { color: var(--warn); opacity: .85; }
@media (max-width: 560px) { .est-grid { grid-template-columns: 1fr; } }
#q-table td.est-cell { white-space: nowrap; color: var(--navy); }

.card-placeholder { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 24px; margin-top: 12px; }
.empty h2 { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.empty p { margin: 0; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy-deep); color: var(--white); padding: 12px 18px; border-radius: var(--r); font-weight: 600; font-size: 14px; box-shadow: 0 12px 32px rgba(6,26,54,.3); z-index: 20; max-width: min(92vw, 560px); }
.toast.good { background: var(--live); }
.toast.bad { background: var(--bad); }

/* ── team performance (admin) ── */
.wrap { max-width: 1100px; margin: 16px auto 60px; padding: 0 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--white); }
.seg button { appearance: none; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 500; padding: 9px 12px; min-height: 38px; cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--hover); }
.seg button.on { background: var(--navy); color: var(--white); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 0 0 14px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 11px; }
.kpi .l { font-size: 12px; font-weight: 600; color: var(--slate); }
.kpi .v { font-size: 26px; font-weight: 600; line-height: 1.1; margin-top: 4px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--slate); margin-top: 3px; }
#stats-table tbody tr[data-rep] { cursor: pointer; }
#stats-table tbody tr[data-rep]:hover td { background: var(--hover); }
#stats-table tbody tr.sel td { background: var(--navy-tint); }
#stats-table td, #stats-table th, #days-table td, #days-table th { white-space: nowrap; font-size: 13px; }
.wrap > .hint { margin: 8px 2px 0; }
.chart { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px 2px; margin-bottom: 8px; }
.chart svg { display: block; width: 100%; height: auto; }
h3 { font-size: 15px; font-weight: 600; margin: 22px 0 8px; }
.recent { list-style: none; max-height: 420px; overflow: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 12px; margin: 0; }
.recent li { padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.recent li:last-child { border-bottom: 0; }

/* ── responsive ── */
@media (min-width: 1000px) {
  .work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 480px); gap: 16px; align-items: start; }
  .disp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .work .card, .work .card-placeholder { position: sticky; top: 68px; max-height: calc(100vh - 84px); overflow: auto; margin-top: 0; }
}
@media (min-width: 1120px) {
  /* the scoreboard joins the top bar */
  #desk { grid-template-columns: minmax(0, 1fr) auto; }
  #desk > .inbound, #desk > .work { grid-column: 1 / -1; }
  .tally { background: var(--navy); padding: 0 12px 0 0; }
  .tally-title { display: grid; place-items: center; padding: 0 14px 0 6px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.6); border-left: 1px solid rgba(255,255,255,.14); }
  .tally > div:not(.tally-title) { flex: 0 0 auto; text-align: left; padding: 9px 14px 8px; border-left: 1px solid rgba(255,255,255,.14); }
}
@media (min-width: 641px) and (max-width: 1299px) {
  #q-table th:nth-child(5), #q-table td:nth-child(5) { display: none; }
}
@media (max-width: 720px) {
  .kpis.five { grid-template-columns: repeat(2, 1fr); }
  .who-clock { display: none; }
}
@media (max-width: 640px) {
  .top { min-height: 52px; padding: 0 12px; }
  .tally > div:not(.tally-title) { padding: 7px 3px 6px; }
  .tally b { font-size: 17px; }
  .tally span { font-size: 10px; }
  .inbound { padding: 0 10px; margin-top: 10px; }
  .work { padding: 10px 10px 40px; }
  .queue { padding: 10px; }
  .queue-wrap { max-height: 45vh; }
  .queue-tools { width: 100%; }
  #q-search { min-width: 0; flex: 1 1 100%; }
  /* phone: each row becomes two lines. owner + their time, then property + last outcome. phone number lives on the card. */
  #q-table { min-width: 0; display: block; }
  #q-table thead { display: none; }
  #q-table tbody { display: block; }
  #q-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(72px, auto); column-gap: 10px; padding: 10px; border-bottom: 1px solid var(--line-2); }
  #q-table tbody tr:last-child { border-bottom: 0; }
  #q-table td { display: block; padding: 0; border: 0; text-align: left; }
  #q-table td:nth-child(2), #q-table td:nth-child(5), #q-table td:nth-child(6), #q-table td:nth-child(7) { display: none; }
  #q-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  #q-table td:nth-child(3) { grid-column: 1; grid-row: 2; margin-top: 2px; }
  #q-table td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  #q-table td:nth-child(8) { grid-column: 2; grid-row: 2; text-align: right; font-size: 12px; max-width: 130px; }
  #q-table td:nth-child(9) { grid-column: 1 / -1; grid-row: 3; text-align: left; font-size: 12px; margin-top: 2px; }
  #q-table td:nth-child(9):empty { display: none; }
  #q-table tbody tr:hover td { background: transparent; }
  #q-table tbody tr.sel { background: var(--navy-tint); box-shadow: inset 3px 0 0 var(--navy); }
  #q-table tbody tr.sel td, #q-table tbody tr.sel td:first-child { background: transparent; box-shadow: none; }
  .card { margin-top: 10px; padding: 14px; }
  .outcome { margin: 16px -14px -14px; padding: 12px 14px 16px; }
  .card-head { flex-direction: column; gap: 8px; }
  .phones { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 12px; }
  .grid { gap: 10px 14px; }
  .disp-grid { grid-template-columns: 1fr 1fr; }
  .disp-grid .btn { min-height: 60px; }
  kbd { display: none; }
  .btn.call .sub-label { max-width: 58%; }
  .audio-grid { grid-template-columns: 1fr; }
  .btn.call.alt { flex: 1 1 100%; }
}

/* ── cost-seg intake (admin): mint form + delivery tracker ── */
.intake-wrap { max-width: 1240px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.in-new > .hint { margin: 0 0 12px; }
#in-form { display: grid; gap: 10px; }
#in-form label { display: block; font-size: 12px; font-weight: 600; color: var(--slate); }
#in-form label > input:not([type="checkbox"]) { display: block; margin-top: 4px; }
#in-form label .muted { font-weight: 500; }
#in-form input:not([type="checkbox"]) { font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; min-height: 38px; width: 100%; }
#in-form input:not([type="checkbox"]):focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,35,66,.12); }
#in-form label.check { display: grid; grid-template-columns: 20px 1fr; column-gap: 10px; align-items: start; font-size: 14px; font-weight: 500; color: var(--ink); padding: 6px 0; }
#in-form label.check input { width: 20px; height: 20px; grid-row: 1 / span 2; margin-top: 1px; }
#in-form label.check .muted { grid-column: 2; font-weight: 400; font-size: 13px; }
.in-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.in-results { display: grid; gap: 6px; }
.in-results:empty { display: none; }
.in-hit { appearance: none; display: grid; gap: 2px; text-align: left; font: inherit; font-size: 14px; padding: 8px 10px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; color: var(--ink); }
.in-hit:hover { background: var(--navy-tint); border-color: var(--navy-tint-2); }
.in-hit span { font-size: 12px; color: var(--slate); }
.hint.linked { color: var(--good); font-weight: 600; margin: 0; }
.in-done { display: grid; gap: 10px; }
.in-done > .hint { margin: 0; }
#in-url { font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--canvas); color: var(--ink); width: 100%; }
.in-done-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.in-done-actions .btn.book { flex-direction: row; align-items: center; gap: 6px; }
.seg.small button { padding: 6px 10px; font-size: 13px; min-height: 32px; }
.in-list { display: grid; gap: 10px; }
.in-row { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--white); }
.in-row.done { opacity: .6; }
.in-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.in-row-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.in-meta { font-size: 13px; color: var(--slate); margin-top: 3px; }
.in-meta a { color: var(--navy); font-weight: 500; }
.in-meta.warn { color: var(--warn); font-weight: 600; }
.in-meta.stale { color: var(--red); font-weight: 600; }
.in-props { margin-top: 10px; border-top: 1px solid var(--line-2); }
.in-prop { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.in-prop:last-child { border-bottom: 0; }
.in-prop small { display: block; font-size: 12px; color: var(--slate); margin-top: 2px; }
.in-prop-actions { display: grid; gap: 6px; justify-items: end; align-content: start; }
.in-prop-actions select, .in-prop-actions input { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--ink); min-height: 34px; }
.pips { display: inline-flex; gap: 3px; margin-top: 6px; }
.pips i { display: block; width: 16px; height: 4px; border-radius: 2px; background: var(--line); }
.pips i.on { background: var(--navy); }
.pips i.done { background: var(--live); }
.in-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--slate); }
.in-link .mono { overflow-wrap: anywhere; }
@media (min-width: 1000px) {
  .intake-wrap { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
  .in-new { position: sticky; top: 68px; max-height: calc(100vh - 84px); overflow: auto; }
}
@media (max-width: 640px) {
  .in-two { grid-template-columns: 1fr; }
  .in-prop { grid-template-columns: 1fr; }
  .in-prop-actions { grid-auto-flow: column; justify-items: start; }
}
