/* ============================================================================
 * Quick Call V3 — chrome additions
 *
 * QC inherits Owner Modal V2 1:1 (drawer chrome, header chips, hero, body
 * grid, property cards, activity feed, dock chips). The 3 additions below
 * are the ONLY new visual elements V3 introduces:
 *   1. Queue progress strip — 2px hairline fill at the very top of the drawer
 *   2. Queue chrome row — cooler-tint band with mode pill + Prev/Skip/Next
 *      nav buttons + inline session stats (Queue N of M · X ans · Y% · Z left)
 *   3. Inline dock — replaces OMv2 floating dock; pinned to drawer footer,
 *      cooler tint, head + body unified
 *
 * Tokens sourced exclusively from variables-v2.css canonical set. No new
 * colors, no copy-pasted OMv2 rules. Verbatim transcription from the
 * ratified mockup at docs/specs/quickcall-v3-mockup.html.
 *
 * Plan: SCOUT-QUICK-CALL-V3-REDESIGN-PLAN-2026-05-17.md §3
 * Build: SCOUT-QUICK-CALL-V3-BUILD-PLAN-2026-05-17.md §2
 * ============================================================================ */

/* ── Drawer host ─────────────────────────────────────────────────────────── */
/* QC mounts the OMv2 drawer into this container. Hidden by default; gains
   .open class when renderQCOwner mounts a drawer. The drawer's own
   position:fixed + z-index handles viewport placement — this host is
   logically a mount point, not a positioned wrapper. */
#qc-host { display: contents; }
#qc-host:empty { display: none; }

/* ============================================================================
 * §1 Queue progress strip — 2px hairline at drawer top
 * ──────────────────────────────────────────────────────────────────────────
 * Functional progress indicator, NOT decorative chrome (BAN 3 exception:
 * data-driven element with semantic meaning, not card-identity chrome).
 * Track at hairline opacity so the filled portion reads clearly.
 * ============================================================================ */
.qc-queue-progress {
  height: 2px;
  background: oklch(0.20 0.010 200 / 0.06);
  overflow: hidden;
  flex-shrink: 0;
}
.qc-queue-progress-fill {
  height: 100%;
  background: var(--color-secondary);
  transition: width var(--duration-fast, 150ms) var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1));
}

/* ============================================================================
 * §2 Queue chrome row — cooler-tint band between progress strip and the
 *    OMv2 header. Mode pill + Prev/Skip/Next nav + inline session stats.
 * ──────────────────────────────────────────────────────────────────────────
 * Surface-1 tint (one step cooler than the drawer's near-white) + soft
 * elevation shadow below to read as a distinct queue band, not a
 * continuation of the white drawer body above the OMv2 header.
 * Verbatim per user feedback 2026-05-17: "the call login section blends in
 * with the modal" + "same with the quick call section at the very top."
 * ============================================================================ */
.qc-queue-chrome {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  background: var(--color-surface-1);
  border-bottom: 1px solid var(--color-glass-border-strong);
  box-shadow: 0 8px 24px -8px oklch(0.20 0.010 200 / 0.08);
  flex-shrink: 0;
}

.qc-queue-mode {
  font: 700 9px/1 'JetBrains Mono', monospace;
  color: var(--color-secondary);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-secondary-muted);
  flex-shrink: 0;
}

.qc-queue-chrome-nav {
  display: flex; gap: 4px;
  flex-shrink: 0;
}
.qc-queue-nav-btn {
  width: 26px; height: 26px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-glass-border);
  background: var(--omv2-surface-near-white, #FFFFFF);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: background var(--duration-fast, 150ms) ease,
              color var(--duration-fast, 150ms) ease,
              border-color var(--duration-fast, 150ms) ease;
}
.qc-queue-nav-btn:hover {
  background: var(--color-surface-1);
  color: var(--color-text-primary);
}
.qc-queue-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.qc-queue-nav-btn svg { width: 13px; height: 13px; }

/* "Skip" is a wider button with mono label (vs icon-only Prev/Next). */
.qc-queue-nav-skip {
  width: auto;
  padding: 0 10px;
  font: 600 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

.qc-queue-stats {
  flex: 1;
  display: flex; gap: 12px; align-items: baseline;
  font: 11px/1 'JetBrains Mono', monospace;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.qc-queue-stats .val   { color: var(--color-text-primary); font-weight: 600; }
.qc-queue-stats .sep   { color: var(--color-text-tertiary); }
.qc-queue-stats .label { color: var(--color-text-tertiary); }

/* ============================================================================
 * §3 Inline dock — pinned to drawer footer, replaces OMv2 floating dock
 * ──────────────────────────────────────────────────────────────────────────
 * Cooler-tint surface (--color-surface-1) so the dock reads as a distinct
 * action zone vs the white drawer body. Head + body share the same surface
 * (user feedback 2026-05-17: "what about the section with 'logging call'?
 * thats part of the dock right" — head and body are visually unified).
 * Phone selector input + Note textarea keep near-white surface as input
 * "wells" that pop within the cooler dock.
 *
 * Soft top elevation shadow + 1px-strong border at the top edge so the
 * dock band reads as pinned-on-top of the body, not flush-continuous.
 * ============================================================================ */
.qc-dock-inline {
  flex-shrink: 0;
  background: var(--color-surface-1);
  border-top: 1px solid var(--color-glass-border-strong);
  box-shadow: 0 -8px 24px -8px oklch(0.20 0.010 200 / 0.08);
}

/* OMv2 dock head row — verbatim styling from owner-modal-v2.css, but
   without the position:fixed since we're inline-pinned to the drawer.
   The .omv2-dock-head class itself comes from OMv2; this just overrides
   the cooler background OMv2's floating dock didn't set. */
.qc-dock-inline .omv2-dock-head {
  background: transparent;       /* inherit dock cooler surface */
}

/* OMv2 dock body — same: transparent so the cooler dock surface bleeds
   through. The body's vertical padding + row gap come from OMv2 canon. */
.qc-dock-inline .omv2-dock-body {
  background: transparent;
}

/* Phone selector + note textarea — keep near-white surface so they read
   as clickable "wells" within the cooler dock. These overrides are
   needed because OMv2's own rules don't differentiate (the OMv2 floating
   dock sits on near-white surface by default; QC's dock sits on
   --color-surface-1 so the inputs need their own background lift). */
.qc-dock-inline .omv2-dock-phone-select,
.qc-dock-inline .omv2-dock-phone-custom,
.qc-dock-inline .omv2-dock-note,
.qc-dock-inline .omv2-dock-cb-input {
  background: var(--omv2-surface-near-white, #FFFFFF);
}

/* ============================================================================
 * §4 Session-complete card — D-QC-23
 * ──────────────────────────────────────────────────────────────────────────
 * Swaps the drawer body (.omv2-hero + .omv2-body-grid + .omv2-header + dock
 * hidden) with a centered summary card when the queue exhausts. Drawer +
 * queue chrome stay visible. 10s auto-close timer with hover-to-cancel.
 * Industry-standard completion moment (HubSpot, SalesLoft, Outreach).
 * ============================================================================ */
.qc-session-complete {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 48px 28px 32px;
  gap: 16px;
  flex: 1; min-height: 0;
  background: var(--omv2-surface-near-white, #FFFFFF);
}
.qc-session-icon {
  color: var(--color-success);
  flex-shrink: 0;
}
/* Prefix with :root[data-v2="1"] so this rule wins over variables-v2.css's
   `:root[data-v2="1"] h2` which would otherwise force Geist Sans on the
   <h2 class="qc-session-title"> markup. */
:root[data-v2="1"] .qc-session-title,
.qc-session-title {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}
.qc-session-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  width: 100%;
  max-width: 560px;
  margin-top: 8px;
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
}
.qc-session-stat {
  display: flex; flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  border-right: 1px solid var(--color-glass-border);
  gap: 4px;
}
.qc-session-stat:last-child { border-right: 0; }
.qc-session-stat-val {
  font: 600 24px/1 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}
.qc-session-stat-lbl {
  font: 500 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.qc-session-breakdown {
  display: flex; gap: 8px; align-items: center;
  margin-top: 4px;
  font: 11px/1 'JetBrains Mono', monospace;
  color: var(--color-text-secondary);
}
.qc-session-sep { color: var(--color-text-tertiary); }
.qc-session-actions {
  display: flex; gap: 8px;
  margin-top: 8px;
}
.qc-session-btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-glass-border-strong);
  background: var(--omv2-surface-near-white, #FFFFFF);
  color: var(--color-text-secondary);
  font: 600 12px 'Geist', system-ui, sans-serif;
  cursor: pointer;
  transition: background var(--duration-fast, 150ms) ease,
              color var(--duration-fast, 150ms) ease,
              border-color var(--duration-fast, 150ms) ease;
}
.qc-session-btn:hover {
  background: var(--color-surface-1);
  color: var(--color-text-primary);
}
.qc-session-btn-primary {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--omv2-near-white, #FFFFFF);
}
.qc-session-btn-primary:hover {
  background: var(--color-secondary-hover, #1f6669);
  border-color: var(--color-secondary-hover, #1f6669);
  color: var(--omv2-near-white, #FFFFFF);
}
.qc-session-autoclose {
  font: 500 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
  margin-top: 8px;
}

/* ============================================================================
 * §5 Cheat sheet overlay — D-QC-24
 * ──────────────────────────────────────────────────────────────────────────
 * Toggled by '?' keypress. Centered modal-frame primitive (per CLAUDE.md
 * R6.13). Tabular dl/dt/dd layout, Linear/Figma <kbd> styling.
 * ============================================================================ */
.qc-cheatsheet-overlay {
  position: fixed; inset: 0;
  background: oklch(0.20 0.010 200 / 0.40);
  z-index: 1400;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: qcCheatsheetIn 150ms var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1));
}
@keyframes qcCheatsheetIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.qc-cheatsheet-card {
  width: 100%; max-width: 480px;
  background: var(--omv2-surface-near-white, #FFFFFF);
  border: 1px solid var(--color-glass-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
  overflow: hidden;
  font-family: 'Geist', system-ui, sans-serif;
  color: var(--color-text-primary);
}
/* Reset the global header{background:#13161a} from layout.css:6 — the
   cheat sheet card uses <header> for semantic structure but needs a light
   surface to match the rest of the card. */
.qc-cheatsheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-glass-border);
  background: transparent;
  height: auto;
  position: static;
  box-shadow: none;
}
/* Prefix with :root[data-v2="1"] so this compound selector wins over
   variables-v2.css's `:root[data-v2="1"] h2` (same prefix specificity,
   our compound adds class + tag, beating their tag alone). */
:root[data-v2="1"] .qc-cheatsheet-head h2,
.qc-cheatsheet-head h2 {
  margin: 0;
  font: 600 14px/1 'Geist', system-ui, sans-serif;
  color: var(--color-text-primary);
}
.qc-cheatsheet-close {
  width: 26px; height: 26px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: background var(--duration-fast, 150ms) ease,
              color var(--duration-fast, 150ms) ease;
}
.qc-cheatsheet-close:hover {
  background: var(--color-surface-1);
  color: var(--color-text-primary);
}
.qc-cheatsheet-close svg { width: 14px; height: 14px; }
.qc-cheatsheet-section {
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-glass-border);
}
.qc-cheatsheet-section:last-of-type { border-bottom: 0; }
/* Prefix with :root[data-v2="1"] so this compound selector wins over
   variables-v2.css's `:root[data-v2="1"] h3`. */
:root[data-v2="1"] .qc-cheatsheet-section h3,
.qc-cheatsheet-section h3 {
  margin: 0 0 8px;
  font: 700 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.qc-cheatsheet-section dl {
  margin: 0;
  display: grid;
  grid-template-columns: 64px 1fr;
  row-gap: 6px;
  column-gap: 16px;
  align-items: center;
}
.qc-cheatsheet-section dt {
  margin: 0;
  display: inline-flex; align-items: center;
}
.qc-cheatsheet-section dd {
  margin: 0;
  font: 13px 'Geist', system-ui, sans-serif;
  color: var(--color-text-primary);
}
.qc-cheatsheet-section kbd {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-1);
  border: 1px solid var(--color-glass-border-strong);
  box-shadow: 0 1px 0 var(--color-glass-border-strong);
  font: 600 11px 'JetBrains Mono', monospace;
  color: var(--color-text-primary);
  min-width: 22px;
  text-align: center;
}
