/* ASA OS call desk (088): the call card (a side window that pops on ring) and #/calls.
 * Built for an iPad in landscape at a trade-show booth: big type, generous spacing, one accent, calm motion.
 * Phones get the same card as a full-height sheet. Uses the shop design tokens (shop.css). */

.cd-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.cd-layer > * { pointer-events: auto; }

.cd-card { position: absolute; top: 16px; right: 16px; bottom: 16px; width: min(560px, 46vw); display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink); border-radius: 22px; box-shadow: var(--shadow-pop); overflow: hidden; }
.cd-card.is-new { animation: cd-in .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes cd-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.cd-head { padding: 18px 22px 16px; border-bottom: 1px solid var(--hair); background: var(--surface-2); }
.cd-head-top { display: flex; align-items: center; gap: 10px; }
.cd-badge { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1.2 var(--font); color: var(--ink-2); }
.cd-badge.s-ringing { color: var(--accent); }
.cd-badge.s-answered { color: var(--green); }
.cd-badge.s-failed { color: var(--red); }
.cd-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.cd-badge.s-ringing .cd-dot, .cd-pill.s-ringing .cd-dot { animation: cd-ring 1.1s ease-in-out infinite; }
@keyframes cd-ring { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.cd-src { font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--fill); border-radius: 999px; padding: 3px 10px; }
.cd-icon { margin-left: auto; width: 36px; min-height: 36px; padding: 0; font-size: 20px; line-height: 1; }
.cd-number { font: 700 34px/1.1 var(--font-display); letter-spacing: -0.02em; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.cd-callback { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.cd-callback-k { font-weight: 500; }
.cd-callback-n { white-space: nowrap; }
.cd-who-title { font: 600 22px/1.25 var(--font-display); letter-spacing: -0.015em; }
.cd-who.is-known .cd-who-title { color: var(--green); }
.cd-who-line { font-size: 16px; color: var(--ink-2); margin-top: 2px; }
.cd-others { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.cd-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cd-transcript { flex: 1 1 55%; min-height: 120px; overflow-y: auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 12px; }
.cd-turn { max-width: 88%; }
.cd-turn.sp-staff, .cd-turn.sp-ai { align-self: flex-end; text-align: right; }
.cd-speaker { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 3px; letter-spacing: 0.01em; }
.cd-text { display: inline-block; font-size: 19px; line-height: 1.4; padding: 10px 14px; border-radius: 16px; background: var(--fill); text-align: left; }
.cd-turn.sp-staff .cd-text { background: var(--accent-soft); }
.cd-turn.sp-ai .cd-text { background: var(--amber-soft); }
.cd-turn.sp-technician .cd-text { background: var(--green-soft); }
.cd-turn.is-partial .cd-text { color: var(--ink-2); }
.cd-en { font-size: 14px; color: var(--ink-2); margin-top: 4px; padding: 0 4px; font-style: italic; }   /* the English line under a turn in another language */
.cd-turn.is-partial .cd-text::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -2px; background: currentColor; animation: cd-caret 1s steps(2) infinite; }
@keyframes cd-caret { 50% { opacity: 0; } }
.cd-empty { color: var(--ink-3); font-size: 15px; margin: 4px 0; }

.cd-side { flex: 0 1 auto; max-height: 45%; overflow-y: auto; border-top: 1px solid var(--hair); padding: 14px 22px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cd-sec h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: none; margin: 0 0 8px; }
.cd-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; }
.cd-facts dt { font-size: 14px; color: var(--ink-2); }
.cd-facts dd { margin: 0; font-size: 16px; font-weight: 500; }
.cd-confirm { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 2px 8px; }
.cd-fine { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.cd-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cd-act { display: grid; grid-template-columns: 22px 1fr; gap: 2px 8px; align-items: start; }
.cd-check { font-weight: 700; color: var(--ink-3); text-align: center; line-height: 1.5; }
.cd-act.st-applied .cd-check { color: var(--green); }
.cd-act.st-held .cd-check { color: var(--amber); }
.cd-act.st-failed .cd-check { color: var(--red); }
.cd-act-label { font-size: 16px; font-weight: 500; }
.cd-act-sum { font-size: 14px; color: var(--ink-2); }
.cd-act-text { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }   /* 146: the text's exact words + checked link */
.cd-act-text:empty { display: none; }
.cd-act-words { font-size: 13px; line-height: 1.4; color: var(--ink); background: var(--fill); border-radius: 10px; padding: 6px 9px; overflow-wrap: anywhere; }
.cd-act-text .is-bad { color: var(--red); }
.cd-act-btns { grid-column: 2; display: flex; gap: 8px; margin-top: 4px; }
.cd-act-btns button { min-height: 40px; padding: 0 18px; font-size: 15px; }
.cd-act .cd-fine { grid-column: 2; }

.cd-booking { grid-column: 1 / -1; }
.cd-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 22px 16px; border-top: 1px solid var(--hair); }
.cd-end { background: var(--red-soft); color: var(--red); min-height: 44px; padding: 0 20px; font-size: 15px; }
.cd-mic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cd-seg { display: inline-flex; background: var(--fill); border-radius: 999px; padding: 3px; }
.cd-seg button { min-height: 36px; background: transparent; }
.cd-seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.cd-listen { font-size: 13px; font-weight: 600; color: var(--red); }
.cd-listen::before { content: '● '; }

.cd-pill { position: absolute; right: 20px; bottom: 20px; min-height: 48px; padding: 0 20px; font-size: 15px; gap: 10px; background: var(--surface); box-shadow: var(--shadow-pop); }
.cd-pill.s-ringing { color: var(--accent); }
.cd-pill.s-answered { color: var(--green); }

/* #/calls */
.cd-page .panel + .panel { margin-top: 16px; }
.cd-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cd-store { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.cd-scripts { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cd-script { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.cd-script-title { font-weight: 600; font-size: 16px; }
.cd-mic-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cd-table-wrap { overflow-x: auto; }
.cd-table td { vertical-align: middle; }
.cd-nowrap { white-space: nowrap; }
.cd-row-btns { white-space: nowrap; text-align: right; }

@media (max-width: 860px) {
  .cd-card { inset: 0; width: auto; border-radius: 0; }
  .cd-number { font-size: 28px; }
  .cd-side { grid-template-columns: 1fr; max-height: 40%; }
  .cd-text { font-size: 17px; }
  .cd-pill { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; }
  .cd-table th:nth-child(n+4):nth-child(-n+6), .cd-table td:nth-child(n+4):nth-child(-n+6), .cd-table th:nth-child(2), .cd-table td:nth-child(2) { display: none; }
  .cd-table td, .cd-table th { padding: 10px 6px; }
  .cd-script { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .cd-card.is-new, .cd-badge.s-ringing .cd-dot, .cd-pill.s-ringing .cd-dot, .cd-turn.is-partial .cd-text::after { animation: none; }
}

/* who answers (095) */
.cd-route-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 16px; }
.cd-route-seg button { flex: 1 1 140px; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 8px 14px; border-radius: 12px; }
.cd-route-k { font-size: 16px; font-weight: 600; }
.cd-route-sub { font-size: 12px; color: var(--ink-2); font-weight: 400; }
.cd-route-now { margin: 10px 0 4px; font-size: 15px; }
.cd-route-why { margin: 4px 0; font-size: 13px; color: var(--amber); }
.cd-route-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.cd-route-row label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.cd-route-row select { min-height: 40px; }
.cd-play { min-height: 40px; }
.cd-route-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--ink); }

/* The phone script's next line (script.ts): what the person on the call says next, as the transcript fills in. */
.cd-say { margin: 0 16px 12px; padding: 16px 18px; border-radius: 16px; background: var(--say-bg); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); }
.cd-say-k { font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; opacity: .85; }
.cd-say-line { margin-top: 6px; font-size: 24px; line-height: 1.3; font-weight: 650; }   /* Oct 19: the headline of the card */
.cd-say-alt { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cd-say-alt li { font-size: 14px; line-height: 1.35; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.16); }
.cd-say.is-casey { background: var(--surface-2, #f2f2f7); color: inherit; padding: 10px 14px; }
.cd-say.is-casey .cd-say-line { font-size: 17px; font-weight: 500; }

.cd-say-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cd-say-step { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); }
.cd-say.is-casey .cd-say-step { background: rgba(127, 127, 127, 0.14); color: var(--ink-3); }

/* The Say next banner: white text on near-black (light) or a deep blue (dark), readable either way. */
:root { --say-bg: #14171c; }
@media (prefers-color-scheme: dark) { :root { --say-bg: #0b5bd3; } }
.cd-say:not(.is-casey) .cd-say-step { background: #fff; color: #14171c; }
.cd-say.is-long .cd-say-line { font-size: 17px; line-height: 1.35; }   /* a long recommendation stays readable without filling the card */
.cd-say-booking { margin-top: 8px; display: inline-block; font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #ffb340; color: #1c1300; }
.cd-say-booking.is-booked { background: #32c25b; color: #04210d; }
/* C4 (160): after the call, its summary and the script score */
.cd-after-sum { margin: 0 0 4px; line-height: 1.45; }
.cd-warn { margin: 4px 0; padding: 6px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; color: var(--warn-ink, #8a4b00); background: var(--warn-bg, #fff4e0); }
.cd-score { margin-top: 10px; }
.cd-score-head { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.cd-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cd-steps li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; border-top: 1px solid var(--hair, rgba(0,0,0,.08)); min-width: 0; }
.cd-steps li:first-child { border-top: 0; }
.cd-step-st { color: var(--ink-3); flex: none; }
.cd-steps li.st-missed .cd-step-st, .cd-steps li.st-partial .cd-step-st { color: var(--amber); font-weight: 600; }

/* Batch 30 (UI_COVERAGE.md, stream B): the Calls page's panels (the call board, texts, search, who answers, rehearse, recent calls; styling only) under the shared band look (stream A's .band: the accent, white heavy
   italic, square). Markup unchanged: a panel whose first child is its heading (or a head row holding it) gets the band. */
body.shop-on :is(.cd-page > .panel):has(> h2:first-child, > :is(div, header):first-child > h2) { padding-top: 0; padding-left: 18px; padding-right: 18px; }   /* no overflow clip: rows, menus and popovers stay reachable */
body.shop-on :is(.cd-page > .panel) > h2:first-child,
body.shop-on :is(.cd-page > .panel) > :is(div, header):first-child:has(> h2) { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap;
  margin: 0 -18px 14px; padding: 9px 18px; min-height: 44px; box-sizing: border-box; background: var(--accent); color: var(--accent-ink, #fff); border-radius: 3px 3px 0 0; }
body.shop-on :is(.cd-page > .panel) > :is(div, header):first-child > h2 { margin: 0; }
body.shop-on :is(.cd-page > .panel) > h2:first-child, body.shop-on :is(.cd-page > .panel) > :is(div, header):first-child > h2 { color: var(--accent-ink, #fff);
  font: italic 900 23px/1.08 var(--font-title); text-transform: uppercase; letter-spacing: -0.004em; }
body.shop-on :is(.cd-page > .panel) > :is(div, header):first-child:has(> h2) :is(span, small, label, .cp-fine, a:not(.btn)) { color: inherit; }
body.shop-on :is(.cd-page > .panel) > :is(div, header):first-child:has(> h2) :is(button.quiet, .btn.quiet) { color: inherit; background: rgba(255, 255, 255, 0.14); }
@media (max-width: 860px) { body.shop-on :is(.cd-page > .panel) > h2:first-child, body.shop-on :is(.cd-page > .panel) > :is(div, header):first-child > h2 { font-size: 19px; } body.shop-on :is(.cd-page > .panel):has(> h2:first-child, > :is(div, header):first-child > h2) { padding-left: 14px; padding-right: 14px; } body.shop-on :is(.cd-page > .panel) > h2:first-child, body.shop-on :is(.cd-page > .panel) > :is(div, header):first-child:has(> h2) { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; } }

/* Batch 31 (one-accent look, shop line): "Say this next" on the live call card follows the company accent; white text stays at
   AA because shop-branding.js already picks the nearest shade of the accent that passes with white. The booth's own
   .bo-say (booth.css) is untouched; the live booth changes only through its SEMA release. */
body.shop-on .cd-say:not(.is-casey) { background: var(--accent); color: var(--accent-ink, #fff); border-radius: 6px; }

/* The booking action stays reachable while the transcript and step lists scroll. */
.cd-book-actions { flex: 0 0 auto; background: var(--surface, #fff); border-top: 1px solid var(--hair); }
.cd-book-actions:empty { display: none; }
.cd-book-actions .cb-foot { padding: 10px 18px; }
.cd-book-actions .cb-sub { max-height: 3em; overflow-y: auto; }
