/* v6 (2026-11-15): ManMetric identity. Deep cobalt brand on an ink sidebar,
   amber as the warm highlight; Plus Jakarta Sans for display, Inter for UI,
   JetBrains Mono for data labels. The sidebar accent picker still works
   (data-accent on <html>); key "indigo" is kept as the default's key so stored
   choices and the picker logic don't change -- it now means ManMetric cobalt.
   (v4's teal was rejected by the user, so the brand hue stays in the blue
   family.) Every rule below reads colour through these properties. */
:root {
  color-scheme: light;
  --page:            #f7f7f5;
  --surface-1:       #ffffff;
  --surface-2:       #f2f0eb;
  --surface-3:       #e7e3db;
  --text-primary:    #121628;
  --text-secondary:  #4a4e63;
  --text-muted:      #767a8e;
  --gridline:        #efece6;
  --baseline:        #d8d2c7;
  --border:          #e6e2da;
  --border-strong:   #d6d0c5;
  --accent:          #e8730c;
  --accent-2:        #c9600a;
  --accent-soft:     rgba(232,115,12,0.10);
  --on-accent:       #ffffff;
  --highlight:       #d97706;
  --good:            #12805c;
  --warning:         #b45309;
  --critical:        #d0334a;
  --mark-bg:         #fde7c4;
  --brand-ink:       #0b0d18;
  --brand-grad:      #e8730c;  /* Midnight brand: saffron */
  /* Second/third hues only for KPI icon chips (never buttons/links/nav). */
  --chip-violet:     #0e7490;
  --chip-amber:      #b45309;
  --radius-sm:       8px;
  --radius:          10px;
  --radius-lg:       16px;
  --shadow-sm:       0 1px 2px rgba(11,18,32,0.05);
  --shadow-md:       0 8px 24px rgba(11,18,32,0.07), 0 1px 3px rgba(11,18,32,0.05);
  --shadow-lg:       0 18px 44px rgba(11,18,32,0.12), 0 2px 6px rgba(11,18,32,0.06);
  --font-display:    'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans:       'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:       'JetBrains Mono', ui-monospace, "SF Mono", monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:            #0b0d18;
  --surface-1:       #141832;
  --surface-2:       #1a1f3d;
  --surface-3:       #252b52;
  --text-primary:    #f3f4fa;
  --text-secondary:  #b6bbd2;
  --text-muted:      #8288a6;
  --gridline:        #1d2244;
  --baseline:        #323a66;
  --border:          #272d55;
  --border-strong:   #363d6c;
  --accent:          #ffa04a;
  --accent-2:        #ffbd7f;
  --accent-soft:     rgba(255,160,74,0.15);
  --on-accent:       #1a0f05;
  --highlight:       #f2b14c;
  --good:            #3fc28d;
  --warning:         #e9a23b;
  --critical:        #f06a7d;
  --mark-bg:         #4a3214;
  --brand-ink:       #090b15;
  --chip-violet:     #4cc3dc;
  --chip-amber:      #e9a23b;
  --shadow-sm:       0 1px 2px rgba(0,0,0,0.35);
  --shadow-md:       0 8px 22px rgba(0,0,0,0.40), 0 2px 6px rgba(0,0,0,0.25);
  --shadow-lg:       0 20px 52px rgba(0,0,0,0.50), 0 4px 12px rgba(0,0,0,0.28);
}
/* Accent choices (sidebar picker). ManMetric saffron (Midnight) above is the default. */
:root[data-accent="classic"]  { --accent: #4f46e5; --accent-2: #4338ca; --accent-soft: rgba(79,70,229,0.09); --on-accent: #ffffff; }
:root[data-accent="blue"]     { --accent: #2563eb; --accent-2: #1d4ed8; --accent-soft: rgba(37,99,235,0.09); --on-accent: #ffffff; }
:root[data-accent="graphite"] { --accent: #1f2937; --accent-2: #111827; --accent-soft: rgba(31,41,55,0.08); --on-accent: #ffffff; }
:root[data-accent="rose"]     { --accent: #db2777; --accent-2: #be185d; --accent-soft: rgba(219,39,119,0.09); --on-accent: #ffffff; }
:root[data-theme="dark"][data-accent="classic"]  { --accent: #818cf8; --accent-2: #a5b4fc; --accent-soft: rgba(129,140,248,0.15); --on-accent: #10122b; }
:root[data-theme="dark"][data-accent="blue"]     { --accent: #60a5fa; --accent-2: #93c5fd; --accent-soft: rgba(96,165,250,0.15); --on-accent: #0b1730; }
:root[data-theme="dark"][data-accent="graphite"] { --accent: #e5e7eb; --accent-2: #f9fafb; --accent-soft: rgba(229,231,235,0.10); --on-accent: #111827; }
:root[data-theme="dark"][data-accent="rose"]     { --accent: #f472b6; --accent-2: #f9a8d4; --accent-soft: rgba(244,114,182,0.15); --on-accent: #2a0a1a; }
/* Headings take the display face app-wide -- one rule instead of touching
   every h1/h2 site scattered through this file; per-element rules below
   still set their own weight/size and simply inherit the family. */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0; color: var(--text-primary); background: var(--page);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s, color 0.2s;
}
/* max-width/margin here are a pre-sidebar-shell leftover, always overridden
   by .app-main .page below (every real page nests .page inside .app-main) --
   kept only for display/gap/animation. Don't reintroduce margin:auto here;
   see .app-main .page's comment on why content isn't centered. */
.page { display: flex; flex-direction: column; gap: 24px; animation: page-in 0.3s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }

/* ---------------- sidebar shell (renderShell in js/shared.js) ---------------- */
.app-shell { display: flex; min-height: 100vh; }
/* #sidebar-root (static in every page's HTML; renderShell injects the real
   <nav class="sidebar"> into it) is itself the flex item .app-shell
   stretches to full height -- but a plain block div doesn't pass that
   stretched height on to ITS OWN child, so .sidebar rendered at only its
   own content's height (bottom-aligned nav items + footer), leaving
   everything below transparent on any page taller than that -- visible as
   a hard seam where the sidebar's background stops and the page's own
   background shows through. display:flex here makes .sidebar the flex
   item that actually receives the stretch. */
#sidebar-root { display: flex; }
.sidebar {
  flex: none; width: 240px; display: flex; flex-direction: column;
  background: var(--surface-2); border-right: 1px solid var(--border); padding: 18px 12px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; }
.sidebar-brand .mark { width: 30px; height: 30px; border-radius: var(--radius); box-shadow: none; }
.sidebar-brand .mark svg { width: 17px; height: 17px; }
.sidebar-brand h1 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.sidebar-brand p.brand-tag { font-size: 10.5px; color: var(--text-muted); margin: 1px 0 0; font-weight: 500; }
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.sidebar-group { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 14px 12px 6px; }
.sidebar-group:first-child { padding-top: 2px; }
.ico { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.accent-picker { display: flex; gap: 8px; padding: 0 10px 4px; }
.accent-swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface-2); background: var(--sw); cursor: pointer; padding: 0;
  box-shadow: 0 0 0 1px var(--border-strong); transition: box-shadow .15s; }
.accent-swatch:hover { box-shadow: 0 0 0 1px var(--text-muted); }
.accent-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--text-primary); }
.sidebar-link {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500; color: var(--text-secondary); text-decoration: none;
  transition: background-color 0.12s, color 0.12s;
}
.sidebar-link svg { width: 17px; height: 17px; flex: none; }
.sidebar-link:hover { color: var(--text-primary); background: var(--surface-3); }
.sidebar-link.active { color: var(--text-primary); background: var(--accent-soft); font-weight: 600; box-shadow: none; }
.sidebar-link.active svg { color: var(--accent); }
/* A left accent bar on the active item -- a real, deliberate indicator
   of "you are here," not just a soft background tint that reads as
   barely different from hover. */
.sidebar-link.active::before {
  content: ""; position: absolute; left: -12px; top: 4px; bottom: 4px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.sidebar-badge {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--critical) 15%, transparent); color: var(--critical);
}
.sidebar-badge:empty, .sidebar-badge[hidden] { display: none; }
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--border); }
.sidebar-user { font-size: 12px; color: var(--text-muted); padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot-actions { display: flex; align-items: center; gap: 6px; }
.sidebar-logout { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sidebar-logout svg { width: 15px; height: 15px; flex: none; }
.app-main { flex: 1; min-width: 0; padding: 28px 32px; }
/* Deliberately NOT centered (no margin:auto) -- content hugs the sidebar
   and any unused width just trails off on the right, the way most real
   dashboards lay out (Linear, Stripe, Notion), instead of floating as a
   centered island with blank gutters on both sides. Centering a
   narrower-than-available block is exactly what made the sidebar read as
   "small next to all that blank space": symmetric empty margins frame the
   content and draw the eye to how little of the screen the sidebar
   occupies. 1800px remains a sanity cap for absurdly ultrawide monitors,
   not a target width to fill. */
.app-main .page { max-width: 1800px; animation: none; }
/* The single-call report (call.html) is dense, read-heavy content with
   fixed-aspect-ratio charts (pitch/waveform SVGs use viewBox, so width:100%
   scales height proportionally) -- widening it to the dashboard pages'
   width makes those charts nearly 2x their intended height for often-sparse
   data, which reads as empty/bloated rather than using the space well.
   Keep this one narrower, matching what it was actually designed at. */
.app-main .page.page-report { max-width: 1100px; }
/* Same idea, different pages: index.html (a drag-and-drop upload zone,
   sensibly narrow by design) and roster.html (a short form + a 3-column
   table) aren't wide multi-column dashboards either -- reuses the same
   narrower width, under its own name since the reason is "narrow task
   page," not "report." */
.app-main .page.page-narrow { max-width: 1100px; }

@media (max-width: 900px) {
  .sidebar { width: 64px; padding: 16px 8px; }
  /* The wordmark and "Log out" label are both full-width text -- left
     unhidden, they don't wrap to fit a 48px-wide rail, they just overflow
     it into the page content next to it (the bug: "ACT" and "Log out"
     spilling past the collapsed sidebar). Collapse everything to icons,
     same as the nav links already do. */
  .sidebar-brand h1, .sidebar-brand p.brand-tag, .sidebar-link span, .sidebar-user, .sidebar-logout span, .sidebar-group { display: none; }
  .accent-picker { flex-direction: column; align-items: center; padding: 0; }
  .sidebar-brand { justify-content: center; padding-bottom: 16px; }
  .sidebar-link { justify-content: center; }
  .sidebar-badge { position: absolute; top: 2px; right: 2px; margin-left: 0; }
  .sidebar-link { position: relative; }
  /* Icon-only theme toggle + logout no longer fit side by side in a
     48px-wide rail (30px + 30px + gap > 48px) -- stack them instead. */
  .sidebar-foot-actions { flex-direction: column; gap: 8px; }
  .sidebar-logout { flex: none; width: 30px; height: 30px; padding: 0; }
  .app-main { padding: 20px 16px; }
}

.app-actions { display: flex; align-items: center; gap: 10px; }
.environment { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; }
.environment::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.quiet-button { border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 13px; color: var(--text-secondary); background: var(--surface-1); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.quiet-button:hover { color: var(--text-primary); border-color: var(--border-strong); }

.mark {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent);
}

.theme-toggle-btn {
  border: 1px solid var(--border); border-radius: 8px; width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-secondary); background: var(--surface-1);
}
.theme-toggle-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.theme-toggle-btn svg { width: 15px; height: 15px; }
.theme-toggle-btn .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle-btn .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle-btn .icon-moon { display: block; }

/* data tables (agents, calls) */
/* Direct table-render containers -- scrolls horizontally at narrow widths
   instead of the rightmost columns (risk flags, handle time) clipping
   against the page edge with no scroll affordance. */
#calls-subtab, #agent-calls-table, #recent-uploads, #agents-table { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; color: var(--text-muted); font: 700 11px var(--font-mono); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border-strong); }
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--gridline); color: var(--text-secondary); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: var(--surface-2); }
.data-table .col-name { color: var(--text-primary); font-weight: 600; }
.data-table-empty { padding: 30px 12px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* agent performance leaderboard */
.metric-cell { display: flex; align-items: center; gap: 8px; min-width: 90px; }
.metric-bar-track { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 46px; }
.metric-bar-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.metric-value { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--text-secondary); min-width: 32px; text-align: right; }
.risk-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--critical); font-weight: 700; font-size: 12px; }
.perf-summary { font-size: 13px; color: var(--text-muted); margin: -6px 0 16px; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.form-row:last-child { margin-bottom: 0; }
.form-field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.form-field label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.form-field input, .form-field select { padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); font-size: 13px; }
.form-field input:focus, .form-field select:focus { outline: none; border-color: var(--accent); }
/* A standalone action (e.g. "download template") right before a form row
   needs space below it -- same idea as the h2 rule above, kept in CSS
   instead of a one-off inline margin at each call site. */
button.secondary + .form-row { margin-top: 14px; }

.filepicker { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1.5px dashed var(--border-strong); border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.filepicker:hover { border-color: var(--accent); color: var(--text-primary); }
.filepicker input { display: none; }

/* Groups a filepicker with its action buttons on one row, replacing
   margin-left hacks on each button with a single gap. */
.inline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.result-summary { margin-top: 16px; font-size: 13px; }
.result-summary .ok { color: var(--good); }
.result-summary .err { color: var(--critical); }
.result-errors { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }
.result-errors li { margin-bottom: 3px; }

.card { position: relative; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; box-shadow: var(--shadow-sm); }
.card h2 { font-size: 15.5px; line-height: 22px; color: var(--text-primary); margin: 0 0 16px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 .h2-actions { display: flex; gap: 8px; font-weight: 500; }
/* A card can stack more than one h2 as informal sections (roster.html's
   Add an agent / Bulk import / Roster) -- give repeats breathing room from
   the block above instead of every page repeating this as an inline style. */
.card h2:not(:first-child) { margin-top: 24px; }
/* Right after a heading, a note doesn't need its own top margin on top of
   the heading's bottom margin -- avoids the negative-margin hack that was
   needed to pull them back together. */
.card h2 + .summary-note { margin-top: 0; }
.card.hero { border-color: var(--border-strong); }

/* Single compact column, not a two-column marketing hero -- this is a
   tab in a daily-use internal tool, opened repeatedly by the same
   person, not a first-impression landing page. The old side-by-side
   layout with a "What happens next" explainer stretched to match the
   left column's height, leaving a large empty gap below its 3rd step
   every time the left column was taller -- direct feedback ("bogus UI",
   too much empty space) confirmed this by screenshot. */
.upload-card { max-width: 640px; }
.upload-copy { text-align: left; margin-bottom: 16px; }
.card .upload-title { display: block; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--text-primary); margin: 0 0 4px; }
.upload-description { color: var(--text-secondary); line-height: 1.5; font-size: 13.5px; margin: 0; }

.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 28px 20px; text-align: center;
  cursor: pointer; transition: border-color 0.15s, background 0.15s; background: var(--surface-2);
}
.dropzone:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface-2)); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 11px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.dropzone .icon svg { width: 18px; height: 18px; }
.dropzone strong { color: var(--text-primary); }
.dropzone .hint { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.dropzone input { display: none; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 13px; margin-top: 12px; }
#file-chip-wrap { text-align: center; }
.file-chip svg { width: 14px; height: 14px; color: var(--text-muted); }
.upload-meta { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; padding-top: 14px; color: var(--text-muted); font-size: 12px; }
.upload-meta span { display: inline-flex; align-items: center; gap: 6px; }
.upload-meta span::before { content: "✓"; color: var(--good); font-weight: 700; }

button { font-family: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, .dropzone:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent);
  outline-offset: 3px;
}
button.primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--on-accent); border: none; border-radius: var(--radius);
  padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s, box-shadow 0.15s;
}
/* The upload page is the one place a primary button sits below other
   content with no flex container managing the gap for it -- everywhere
   else (form rows, the login form) it's already the layout's job to space
   the button, which used to mean overriding this with margin-top:0. */
.upload-actions { text-align: center; }
.upload-actions button.primary { margin-top: 16px; }
button.primary:hover:not(:disabled) { background: var(--accent-2); }
button.primary:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
button.secondary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
button.secondary:hover { background: var(--surface-2); border-color: var(--border-strong); }
button.secondary svg { width: 14px; height: 14px; }
button.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary);
  transition: color 0.15s, border-color 0.15s;
}
button.icon-btn svg { width: 15px; height: 15px; }
button.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }

.processing { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 20px; text-align: center; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--gridline); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing .stage { font-size: 14px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.processing .filename { font-weight: 600; font-size: 15px; }
.processing-note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: -8px; }
.processing-card { background: var(--surface-1); }
.processing-header { text-align: center; padding: 10px 10px 0; }
.processing-header h2 { display: block; font-family: var(--font-sans); color: var(--text-primary); font-size: 20px; text-transform: none; letter-spacing: -.02em; margin-bottom: 5px; }
.processing-header p { color: var(--text-secondary); margin: 0; font-size: 13px; }
.progress-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 16px 8px 10px; }
.progress-step { min-width: 0; padding: 13px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); text-align: left; transition: .2s ease; }
.progress-step b { display: block; font: 700 11px var(--font-mono); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 5px; }
.progress-step span { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-step.active { color: var(--text-primary); border-color: color-mix(in srgb, var(--accent) 70%, var(--border)); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); }
.progress-step.done b::after { content: " ✓"; color: var(--good); }

.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.status-pill.success { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.status-pill.partial_success { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.status-pill.failed { color: var(--critical); background: color-mix(in srgb, var(--critical) 14%, transparent); }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 12px; color: var(--text-secondary); background: var(--gridline); padding: 4px 10px; border-radius: 999px; font-family: var(--font-mono); }
.summary-text { line-height: 1.55; font-size: 15px; margin: 0 0 14px; }
.summary-note { font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.entity-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* score panel */
.score-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.score-ring-wrap { position: relative; width: 128px; height: 128px; flex: none; cursor: pointer;  }
.score-ring-wrap svg { width: 100%; height: 100%; }
.score-ring-bg { fill: none; stroke: var(--gridline); }
.score-ring-fg { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.16,1,.3,1); }
.score-ring-value { font-family: var(--font-sans); font-size: 32px; font-weight: 700; fill: var(--text-primary); }
.score-ring-max { font-size: 10.5px; fill: var(--text-muted); }
.score-meta { display: flex; flex-direction: column; gap: 9px; }
.score-band { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 13px; font-weight: 700; padding: 5px 14px; border-radius: 999px; }
.score-band::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.score-band.Excellent { color: var(--good); background: color-mix(in srgb, var(--good) 15%, transparent); }
.score-band.Good { color: var(--accent); background: var(--accent-soft); }
.score-band.Fair { color: var(--warning); background: color-mix(in srgb, var(--warning) 15%, transparent); }
.score-band.Poor { color: var(--critical); background: color-mix(in srgb, var(--critical) 15%, transparent); }
.score-hint { font-size: 12.5px; color: var(--text-muted); }
.score-breakdown { display: none; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); width: 100%; }
.score-breakdown.open { display: grid; }
.score-breakdown .item { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-secondary); }
.score-breakdown .item b { color: var(--text-primary); font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.score-suppressed { font-size: 13px; color: var(--text-muted); }
.score-setup { margin-top: 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); padding: 12px 14px; color: var(--text-secondary); font-size: 12.5px; line-height: 1.55; }
.score-setup code { color: var(--text-primary); font-family: var(--font-mono); font-size: 11.5px; }

.overview-grid { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); gap: 10px; }
.overview-item { min-height: 100px; padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.overview-item.primary { background: var(--surface-1); border-color: var(--border-strong); }
.overview-label { color: var(--text-muted); font: 700 10.5px var(--font-mono); letter-spacing: .07em; text-transform: uppercase; }
.overview-value { margin-top: 9px; color: var(--text-primary); font: 600 24px var(--font-sans); letter-spacing: -.01em; }
.overview-detail { margin-top: 4px; color: var(--text-secondary); font-size: 12px; line-height: 1.4; }
.talk-bars { display: flex; gap: 2px; overflow: hidden; height: 8px; margin-top: 12px; border-radius: 99px; background: var(--surface-3); }
.talk-bars span { min-width: 4px; border-radius: 4px; }

/* agent report */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.report-item .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; margin-bottom: 6px; font-family: var(--font-mono); }
.report-item .value { font-size: 15px; line-height: 1.4; }
.resolution-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.resolution-pill.resolved { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.resolution-pill.pending { color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, transparent); }
.resolution-pill.unresolved { color: var(--critical); background: color-mix(in srgb, var(--critical) 16%, transparent); }
.resolution-pill.not_applicable { color: var(--text-muted); background: var(--surface-2); }
.resolution-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.calltype-badge { display: inline-flex; align-items: center; gap: 6px; font: 700 12px var(--font-mono); padding: 4px 11px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.calltype-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.calltype-badge.sales { color: var(--accent); background: var(--accent-soft); }
.calltype-badge.complaint { color: var(--critical); background: color-mix(in srgb, var(--critical) 16%, transparent); }
.calltype-badge.support { color: var(--good); background: color-mix(in srgb, var(--good) 15%, transparent); }
.calltype-badge.informational { color: var(--warning); background: color-mix(in srgb, var(--warning) 15%, transparent); }
.calltype-badge.other { color: var(--text-muted); background: var(--surface-3); }

.outcome-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.outcome-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.outcome-badge.won { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.outcome-badge.lost { color: var(--critical); background: color-mix(in srgb, var(--critical) 16%, transparent); }
.outcome-badge.follow_up_needed { color: var(--accent); background: var(--accent-soft); }
.outcome-badge.no_decision { color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, transparent); }

.agent-note { margin-top: 14px; font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); }
.agent-note b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-family: var(--font-mono); font-weight: 700; margin-bottom: 4px; }
.agent-note.risk-note-low b { color: var(--warning); }
.next-step-callout { margin-top: 16px; padding: 14px 16px; border-radius: 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.next-step-callout b { display: block; font: 700 11.5px var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 6px; }
.next-step-callout p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-primary); }

/* risk banner -- deliberately the loudest thing on the page when present;
   a reviewer scanning many calls must not be able to miss this. */
.risk-banner { border-left: 4px solid var(--critical); background: color-mix(in srgb, var(--critical) 10%, var(--surface-1)); }
.risk-banner-title { font: 700 15px var(--font-sans); color: var(--critical); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.risk-banner-text { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--text-primary); }
.risk-banner.risk-medium .risk-banner-title { color: var(--warning); }
.risk-banner.risk-medium { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--surface-1)); }

/* sentiment panel -- a glance, not a sentence: emoji + label per speaker */
.sentiment-row { display: flex; gap: 14px; flex-wrap: wrap; }
.sentiment-item { flex: 1; min-width: 120px; text-align: center; padding: 18px 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.sentiment-emoji { font-size: 34px; line-height: 1; }
.sentiment-name { margin-top: 9px; font-weight: 700; font-size: 13px; }
.sentiment-label { margin-top: 2px; font-size: 12px; color: var(--text-secondary); text-transform: capitalize; }
.sentiment-reasoning { margin-top: 8px; font-size: 12px; line-height: 1.45; color: var(--text-muted); }

/* pause context + emphasis lists */
.moment-list { display: flex; flex-direction: column; gap: 4px; }
.moment-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--gridline); font-size: 13.5px; cursor: pointer; border-radius: 8px; }
.moment-row:last-child { border-bottom: none; }
.moment-row:hover { background: var(--surface-2); }
.moment-row .m-time { font-family: var(--font-mono); color: var(--text-muted); font-size: 12px; width: 44px; flex: none; }
.moment-row .m-flow { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.moment-row .m-word { font-weight: 600; }
.moment-row .m-arrow { color: var(--text-muted); }
.moment-row .m-dur { font-size: 11.5px; color: var(--text-muted); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; flex: none; }
.moment-row .m-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; flex: none; }
.moment-row .m-badge.loud { color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, transparent); }
.moment-row .m-badge.high_pitch { color: var(--accent); background: var(--accent-soft); }
.moment-row .m-badge.both { color: var(--critical); background: color-mix(in srgb, var(--critical) 16%, transparent); }
.moment-row .m-badge.abusive { color: var(--critical); background: color-mix(in srgb, var(--critical) 16%, transparent); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-tile { padding: 15px 16px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.stat-tile .value { font: 600 24px var(--font-sans); letter-spacing: -.01em; color: var(--text-primary); }
.stat-tile .label { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.35; }

/* speaker comparison -- one single-axis mini bar-chart per metric, never
   two different units sharing a scale. See dataviz skill: bars <=24px
   thick, 4px rounded data-ends, direct value labels at the tip. */
.compare-metric { margin-bottom: 18px; }
.compare-metric:last-child { margin-bottom: 0; }
.compare-metric .metric-title { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 9px; }
.compare-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.compare-bar-row:last-child { margin-bottom: 0; }
.bar-label { width: 108px; flex: 0 0 108px; font-size: 12.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bar-track { flex: 1; height: 10px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.7s cubic-bezier(.16,1,.3,1); }
.bar-value { width: 64px; flex: none; text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.loudness-compare { font-size: 13px; color: var(--text-secondary); }
.loudness-compare b { color: var(--text-primary); font-family: var(--font-mono); font-weight: 600; }

/* delivery-style stat grid -- own-unit metrics (wpm, dB, sec) that can't
   share a 0-100 bar with the score-breakdown dims above, so each is its
   own small stat instead of a misleading shared-scale bar. */
.delivery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.delivery-stat { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.delivery-stat .label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 5px; }
.delivery-stat .value { font: 600 19px var(--font-mono); color: var(--text-primary); letter-spacing: -0.01em; }
.delivery-stat .compare { margin-top: 3px; font-size: 11px; color: var(--text-muted); }
.delivery-stat .compare .up { color: var(--good); }
.delivery-stat .compare .down { color: var(--critical); }

/* best/worst call spotlight */
.spotlight-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* Toggled by renderSpotlight() when there's no worst_call distinct from
   best_call (an agent with 1 scored call, or a tie) -- otherwise the lone
   card sits in a 2-column grid next to a stark empty half. */
.spotlight-row.single { grid-template-columns: 1fr; }
.spotlight-card { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); text-decoration: none; color: inherit; transition: box-shadow 0.15s, transform 0.15s; }
.spotlight-card:hover { box-shadow: var(--shadow-md); }
.spotlight-card.best { background: color-mix(in srgb, var(--good) 7%, var(--surface-2)); border-color: color-mix(in srgb, var(--good) 25%, var(--border)); }
.spotlight-card.worst { background: color-mix(in srgb, var(--critical) 6%, var(--surface-2)); border-color: color-mix(in srgb, var(--critical) 22%, var(--border)); }
.spotlight-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 6px; }
.spotlight-score { font: 700 22px var(--font-mono); }
.spotlight-card.best .spotlight-score { color: var(--good); }
.spotlight-card.worst .spotlight-score { color: var(--critical); }
.spotlight-meta { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* coaching-notes feed -- free-text objections/issues/churn signals/
   unanswered questions pulled from the LLM extraction across an agent's
   calls, each tagged and linked back to its call (see docs/DECISIONS.md:
   deliberately a raw feed, not a frequency count, since the text isn't a
   fixed taxonomy). */
.highlight-list { display: flex; flex-direction: column; gap: 8px; }
.highlight-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); text-decoration: none; color: inherit; }
.highlight-item:hover { background: var(--surface-3); }
.highlight-type { flex: none; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 8px; border-radius: 999px; margin-top: 1px; }
.highlight-type.objection { color: var(--warning); background: color-mix(in srgb, var(--warning) 15%, transparent); }
.highlight-type.key_issue { color: var(--accent); background: var(--accent-soft); }
.highlight-type.churn_signal { color: var(--critical); background: color-mix(in srgb, var(--critical) 15%, transparent); }
.highlight-type.unanswered_question { color: var(--chip-violet); background: color-mix(in srgb, var(--chip-violet) 15%, transparent); }
.highlight-text { flex: 1; font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.highlight-date { flex: none; font-size: 11px; color: var(--text-muted); white-space: nowrap; margin-top: 2px; }

/* Agent Analysis -> Compare subtab: one rating card per agent, ranked --
   reuses .score-band (already defined for the single-call report) so
   "Excellent/Good/Fair/Poor" means the same color everywhere in the app. */
.compare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.compare-card { display: block; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-1); text-decoration: none; color: inherit; transition: box-shadow 0.15s, border-color 0.15s; }
.compare-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.compare-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.compare-rank { font: 700 12px var(--font-mono); color: var(--text-muted); flex: none; }
.compare-score { font: 700 26px var(--font-mono); color: var(--text-primary); margin: 2px 0 8px; }
.compare-reason { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

.upload-card .more-metrics { margin-top: 14px; }
.more-metrics summary { cursor: pointer; font-size: 12.5px; color: var(--accent); font-weight: 700; list-style: none; }
.more-metrics summary::-webkit-details-marker { display: none; }
.more-metrics summary::before { content: "\25B8"; display: inline-block; margin-right: 6px; transition: transform 0.15s; }
.more-metrics[open] summary::before { transform: rotate(90deg); }
.more-metrics .form-row { margin: 14px 0 0; }

/* metrics rail */
.metrics-group { margin-bottom: 20px; }
.metrics-group:last-child { margin-bottom: 0; }
.metrics-group .group-title { font: 700 11.5px var(--font-mono); letter-spacing: 0.03em; color: var(--accent); margin-bottom: 10px; text-transform: uppercase; }
.metric-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gridline); font-size: 13px; }
.metric-row:last-child { border-bottom: none; }
.metric-row .m-label { color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.metric-row .m-info { color: var(--text-muted); font-size: 10.5px; border: 1px solid var(--border); border-radius: 50%; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; cursor: help; flex: none; }
.metric-row .m-val { font-family: var(--font-mono); font-weight: 500; text-align: right; }
.metric-row .m-flag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); white-space: nowrap; }
.nonspeech-toggle { font-size: 12.5px; color: var(--accent); cursor: pointer; background: none; border: none; padding: 4px 0; font-weight: 600; }
.nonspeech-detail { display: none; padding-left: 4px; }
.nonspeech-detail.open { display: block; }

/* speakers */
.legend { display: flex; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.legend-swatch { width: 12px; height: 3px; border-radius: 2px; }

.timeline-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.timeline-row .rlabel { width: 96px; flex: 0 0 96px; text-align: right; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-row .track { position: relative; flex: 1; height: 26px; background: var(--surface-2); border-radius: 6px; border: 1px solid var(--border); }
.timeline-row .track .seg { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; }
.timeline-axis { display: flex; justify-content: space-between; margin-left: 108px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis-label { fill: var(--text-muted); font-size: 10px; }
.gridline-el { stroke: var(--gridline); stroke-width: 1; }
.baseline-el { stroke: var(--baseline); stroke-width: 1; }
.crosshair { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; }

.tooltip { position: fixed; pointer-events: none; z-index: 50; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-primary); font-size: 12px; padding: 7px 10px; border-radius: 8px; line-height: 1.45; transform: translate(-50%, -115%); white-space: nowrap; box-shadow: var(--shadow-md); }
.tooltip[hidden] { display: none; }
.tooltip b { font-family: var(--font-mono); }

/* key questions/issues */
.qi-list { display: flex; flex-direction: column; gap: 8px; }
.qi-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; font-size: 13.5px; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.qi-item:hover { border-color: var(--accent); transform: translateX(2px); }
.qi-item.no-evidence { cursor: default; opacity: 0.5; }
.qi-item.no-evidence:hover { border-color: var(--border); transform: none; }
.qi-item .qi-text { flex: 1; }
.qi-item .qi-chip { font-size: 11px; color: var(--text-muted); white-space: nowrap; padding-top: 1px; font-family: var(--font-mono); }
.qi-empty { font-size: 13px; color: var(--text-muted); }

/* transcript */
.transcript-controls { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.search-box { flex: 1; min-width: 160px; position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-muted); pointer-events: none; }
.search-box input { width: 100%; padding: 9px 12px 9px 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); font-size: 13px; transition: border-color 0.15s; }
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-family: var(--font-mono); }
select.speaker-filter { padding: 9px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); font-size: 13px; }

.transcript-list { display: flex; flex-direction: column; gap: 14px; max-height: 480px; overflow-y: auto; padding-right: 4px; scroll-behavior: smooth; }
.transcript-list::-webkit-scrollbar { width: 8px; }
.transcript-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
.turn { display: flex; gap: 11px; padding: 7px; border-radius: 9px; transition: background 0.4s; }
.turn.evidence-highlight { background: var(--accent-soft); }
.turn.playing { background: var(--surface-2); }
.turn .avatar { width: 27px; height: 27px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.turn .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.turn .head { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.turn .who { font: inherit; font-weight: 700; cursor: pointer; background: none; border: 0; padding: 0; }
.turn .who:hover { text-decoration: underline dotted; }
.turn .time { color: var(--text-muted); font-family: var(--font-mono); font-size: 11.5px; }
.turn .text { font-size: 14.5px; line-height: 1.55; color: var(--text-primary); }
.turn .text mark { background: var(--mark-bg); color: inherit; border-radius: 3px; padding: 0 1px; }
.turn.hidden-by-filter { display: none; }

/* audio player */
.player { display: flex; flex-direction: column; gap: 14px; }
.player-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.player-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); min-width: 92px; }
.player-controls select, .player-controls input[type=range] { accent-color: var(--accent); }
select.speed-select { padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); font-size: 12.5px; }
input.volume-slider { width: 80px; }
.waveform-wrap { position: relative; height: 72px; cursor: pointer; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.waveform-wrap svg { width: 100%; height: 100%; display: block; }
.waveform-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; }

.trace-list { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.trace-row { display: flex; justify-content: space-between; gap: 10px; color: var(--text-secondary); font-family: var(--font-mono); }
.trace-row b { color: var(--text-primary); }
.trace-row.failed b { color: var(--critical); }
details.trace-details summary { cursor: pointer; font-size: 12.5px; color: var(--text-muted); }

.error-box { color: var(--critical); font-size: 13.5px; white-space: pre-wrap; font-family: var(--font-mono); }

footer.note { font-size: 12px; color: var(--text-muted); text-align: center; }

[hidden] { display: none !important; }

/* ---------------- page header / breadcrumb (analysis.html, call.html, alerts.html) ---------------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.page-header h1 { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; }
.page-header p { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.page-header-actions { display: flex; gap: 8px; flex: none; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 6px; }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

/* ---------------- filter bar ---------------- */
.filter-bar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.filter-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-chip.active { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.filter-bar input[type=date], .filter-bar select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); font-size: 13px; }
.filter-bar input[type=date]:focus, .filter-bar select:focus { outline: none; border-color: var(--accent); }
.filter-bar .filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-bar .filter-field label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }

/* ---------------- KPI strip ---------------- */
/* flex-wrap with a max-width, not a grid stretched to 1fr -- a handful of
   KPI tiles stretched to fill a wide row become mostly-empty boxes (a
   number and a label rattling around in 300px+ of card). Tiles pack from
   the left at a sensible width instead and only wrap when they must. */
.kpi-strip { display: flex; flex-wrap: wrap; gap: 12px; }
/* Direct children, not just .kpi-tile -- a clickable KPI is a <a> wrapping
   the .kpi-tile div (see analysis.js's kpiTile()), and it's the anchor
   that's the actual flex item then, not the div inside it. */
/* 340px (not 260px): a lone tile wrapped onto its own row still has
   flex-grow:1, so this cap is the only thing stopping it from stretching
   to fill that row -- 260px left it stranded next to dead space. */
.kpi-strip > a, .kpi-strip > .kpi-tile { flex: 1 1 200px; max-width: 340px; }
.kpi-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-1); box-shadow: var(--shadow-sm); transition: border-color 0.12s, box-shadow 0.12s; }
.kpi-tile.clickable { cursor: pointer; }
.kpi-tile.clickable:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
/* Icon chip, colored per metric (see analysis.js's KPI_ICONS) -- a real
   dashboard varies this per card instead of every tile looking identical
   except for the number inside it. */
.kpi-icon { flex: none; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.kpi-icon svg { width: 19px; height: 19px; }
.kpi-icon.chip-blue { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.kpi-icon.chip-violet { background: color-mix(in srgb, var(--chip-violet) 16%, transparent); color: var(--chip-violet); }
.kpi-icon.chip-green { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.kpi-icon.chip-amber { background: color-mix(in srgb, var(--chip-amber) 16%, transparent); color: var(--chip-amber); }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.kpi-value { margin-top: 2px; font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; line-height: 1.2; }
.kpi-value .kpi-unit { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.kpi-compare { margin-top: 2px; font-size: 11.5px; color: var(--text-muted); }
.kpi-compare .up { color: var(--good); }
.kpi-compare .down { color: var(--critical); }

/* avatar chips -- agent initials in a colored circle, same idea as the
   speaker-color system already used in the per-call report's transcript
   (js/report.js), reused here so a person becomes a color+initial you
   recognize at a glance in a table, not just another text cell. */
.avatar-chip { display: inline-flex; align-items: center; gap: 8px; }
.avatar-chip .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; color: #fff; }

/* ---------------- sub-tabs (analysis.html Agents/All calls, roster.html) ---------------- */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.subtab { padding: 9px 4px; margin-right: 18px; font-size: 13.5px; font-weight: 500; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; position: relative; top: 1px; }
.subtab:hover { color: var(--text-primary); }
.subtab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------------- unified badge (status/severity) ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good, .badge.won, .badge.resolved { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.badge.warn, .badge.pending, .badge.follow_up { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.badge.crit, .badge.critical, .badge.high, .badge.lost, .badge.unresolved, .badge.failed { color: var(--critical); background: color-mix(in srgb, var(--critical) 14%, transparent); }
.badge.info, .badge.medium { color: var(--accent); background: var(--accent-soft); }
.badge.neutral, .badge.ops, .badge.not_applicable { color: var(--text-muted); background: var(--surface-3); }

/* ---------------- alert cards (alerts.html) ---------------- */
.alert-summary-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.alert-chip { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1); font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.alert-chip:hover { border-color: var(--border-strong); }
.alert-chip.active { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.alert-chip .count { font-variant-numeric: tabular-nums; }
.alert-group { margin-bottom: 22px; }
.alert-group:last-child { margin-bottom: 0; }
.alert-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 10px; }
.alert-card { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: 10px; background: var(--surface-1); margin-bottom: 8px; }
.alert-card:last-child { margin-bottom: 0; }
.alert-card.critical { border-left-color: var(--critical); }
.alert-card.high { border-left-color: var(--warning); }
.alert-card.follow_up { border-left-color: var(--accent); }
.alert-card.ops { border-left-color: var(--text-muted); }
.alert-card-main { flex: 1; min-width: 0; }
.alert-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.alert-card-head .agent { font-weight: 600; color: var(--text-primary); }
.alert-card-head .meta { color: var(--text-muted); font-size: 12px; }
.alert-card-head .overdue { color: var(--critical); font-weight: 600; font-size: 11.5px; }
.alert-reasons { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.alert-reason-tag { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); }
.alert-next-step { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.alert-card-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.alert-note-box { display: none; gap: 6px; margin-top: 8px; }
.alert-note-box.open { display: flex; }
.alert-note-box input { flex: 1; padding: 7px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); font-size: 12.5px; }

@media (max-width: 720px) {
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-item.primary { grid-column: span 2; }
}

@media (max-width: 480px) {
  .app-actions .environment, .app-actions .quiet-button { display: none; }
  .progress-steps { grid-template-columns: repeat(2, 1fr); }
  .timeline-row .rlabel { width: 60px; flex-basis: 60px; }
  .timeline-axis { margin-left: 72px; }
  .score-ring-wrap { width: 92px; height: 92px; }
  .score-ring-value { font-size: 24px; }
  .metric-row { grid-template-columns: 1fr auto; }
}

/* ---------------- Ask ACT (chat) ----------------
   v5 (2026-10-22): a full-height workspace -- conversations on the left; the
   thread as a centred reading column. Answers are plain text beside an
   avatar (not bubbles), your questions a quiet bubble on the right, and a
   composer that grows with what you type. */
.app-main .page.page-chat { max-width: none; gap: 0; }
.chat-layout { display: flex; gap: 0; height: calc(100vh - 56px); min-height: 520px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-1); box-shadow: var(--shadow-sm); }
.chat-sidebar { flex: 0 0 264px; display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 14px 10px;
  border-right: 1px solid var(--border); background: var(--surface-2); }
.chat-new { justify-content: center; width: 100%; margin-bottom: 8px; }
.chat-new .ico { width: 15px; height: 15px; }
.chat-sidebar-label { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 6px 8px 2px; }
.chat-sidebar-empty { font-size: 12.5px; color: var(--text-muted); padding: 8px; line-height: 1.5; }
.chat-conversation-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.chat-conversation-item { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 10px; border-radius: var(--radius); cursor: pointer; color: var(--text-secondary); }
.chat-conversation-item:hover { background: var(--surface-3); }
.chat-conversation-item.active { background: var(--surface-1); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.chat-conversation-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-conversation-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conversation-item.active .chat-conversation-title { font-weight: 600; }
.chat-conversation-time { font-size: 11px; color: var(--text-muted); }
.chat-conversation-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.chat-conversation-item:hover .chat-conversation-actions, .chat-conversation-item:focus-within .chat-conversation-actions { opacity: 1; }
.chat-icon-btn { display: grid; place-items: center; width: 26px; height: 26px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); cursor: pointer; }
.chat-icon-btn .ico { width: 14px; height: 14px; }
.chat-icon-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.chat-icon-btn.danger:hover { color: var(--critical); }

.chat-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--surface-1); }
.chat-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.chat-thread-head h1 { font-size: 15.5px; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread-head p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.chat-messages { flex: 1; overflow-y: auto; padding: 28px 24px; display: flex; flex-direction: column; gap: 22px; }
.chat-messages > * { width: 100%; max-width: 780px; margin-left: auto; margin-right: auto; }

.chat-welcome { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0 24px; }
.chat-welcome-mark { width: 44px; height: 44px; border-radius: var(--radius-lg); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.chat-welcome-mark .ico { width: 22px; height: 22px; }
.chat-welcome h2 { font-size: 20px; font-weight: 600; margin: 0; }
.chat-welcome p { margin: 0 0 14px; color: var(--text-secondary); font-size: 13.5px; max-width: 460px; line-height: 1.55; }
.chat-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 640px; }
.chat-suggestion { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--surface-1); color: var(--text-primary); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .12s, background .12s; }
.chat-suggestion .ico { width: 16px; height: 16px; color: var(--accent); }
.chat-suggestion:hover { border-color: var(--border-strong); background: var(--surface-2); }
@media (max-width: 720px) { .chat-suggestions { grid-template-columns: 1fr; } }

.chat-message { display: flex; gap: 12px; }
.chat-message.user { justify-content: flex-end; }
.chat-message.user .chat-body { max-width: 78%; display: flex; flex-direction: column; align-items: flex-end; }
.chat-message.assistant .chat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.chat-avatar { flex: none; width: 28px; height: 28px; border-radius: var(--radius); display: grid; place-items: center; background: var(--accent); color: var(--on-accent); margin-top: 1px; }
.chat-avatar .ico { width: 15px; height: 15px; }
.chat-author { font-size: 12.5px; font-weight: 600; color: var(--text-primary); margin-bottom: -2px; }
.chat-bubble { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; color: var(--text-primary); }
.chat-message.user .chat-bubble { white-space: pre-wrap; padding: 10px 14px; border-radius: var(--radius-lg); border-bottom-right-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.chat-message.assistant .chat-bubble { white-space: normal; }
.chat-bubble table { font-size: 12.5px; margin: 8px 0; border-collapse: collapse; width: 100%; }
.chat-bubble th, .chat-bubble td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.chat-bubble p { margin: 0 0 10px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-list { margin: 4px 0 10px; padding-left: 20px; }
.chat-list li { margin: 4px 0; }
.chat-heading { font-weight: 600; margin: 14px 0 4px; color: var(--text-primary); }
.chat-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; border-collapse: separate !important; border-spacing: 0; }
.chat-table th { background: var(--surface-2); font-weight: 600; font-size: 12px; color: var(--text-secondary); }
.chat-table tr:last-child td { border-bottom: none; }
.chat-table td:not(:first-child), .chat-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.chat-bubble code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.chat-bubble strong { font-weight: 600; }
.chat-verify-note { font-size: 12px; color: var(--warning); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 6px 2px; }
.donut-svg { width: 140px; height: 140px; flex: none; }
.donut-total { font-size: 20px; font-weight: 700; fill: var(--text-primary); }
.donut-caption { font-size: 10px; fill: var(--text-muted); }
.donut-legend { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.donut-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.donut-label { flex: 1; color: var(--text-secondary); text-transform: capitalize; }
.donut-value { font-variant-numeric: tabular-nums; color: var(--text-primary); font-weight: 600; }

.chat-status { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); }
.chat-dots { display: inline-flex; gap: 4px; }
.chat-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: ac-dot 1s infinite ease-in-out; }
.chat-dots i:nth-child(2) { animation-delay: .15s; } .chat-dots i:nth-child(3) { animation-delay: .3s; }

.chat-citations { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-citation-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 10px; border-radius: var(--radius); background: var(--surface-1); color: var(--text-secondary); text-decoration: none; border: 1px solid var(--border); }
.chat-citation-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chat-next-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-next-step-chip { font-size: 12.5px; padding: 6px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); border: 1px solid transparent; cursor: pointer; font-family: inherit; transition: border-color .12s; }
.chat-citation-chip .ico, .chat-next-step-chip .ico { width: 13px; height: 13px; }
.chat-next-step-chip { display: inline-flex; align-items: center; gap: 6px; }
.chat-next-step-chip:hover { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.chat-chart-wrap { width: 100%; max-width: 560px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-1); }
.chat-chart-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.chat-actions { display: flex; gap: 4px; }
.chat-action { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 12px; color: var(--text-muted); background: none; border: none; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; }
.chat-action .ico { width: 13px; height: 13px; }
.chat-action:hover { color: var(--text-primary); background: var(--surface-2); }

.chat-composer { padding: 12px 24px 16px; border-top: 1px solid var(--border); background: var(--surface-1); }
.chat-composer-box { display: flex; align-items: flex-end; gap: 8px; max-width: 780px; margin: 0 auto; padding: 8px 8px 8px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); background: var(--surface-1); box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
.chat-composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-composer-box textarea { flex: 1; resize: none; border: none; outline: none; background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; line-height: 1.5; padding: 6px 0; max-height: 160px; }
.chat-composer-box textarea::placeholder { color: var(--text-muted); }
.chat-send { flex: none; width: 34px; height: 34px; border-radius: var(--radius); border: none; background: var(--accent); color: var(--on-accent); cursor: pointer; display: grid; place-items: center; transition: background .12s; }
.chat-send:hover:not(:disabled) { background: var(--accent-2); }
.chat-send:disabled { opacity: .4; cursor: default; }
.chat-send .ico { width: 17px; height: 17px; }
.chat-composer-box.busy { opacity: .85; }
.chat-composer-hint { max-width: 780px; margin: 6px auto 0; font-size: 11.5px; color: var(--text-muted); padding-left: 2px; }

@media (max-width: 900px) {
  .chat-layout { flex-direction: column; height: auto; }
  .chat-sidebar { flex: none; border-right: none; border-bottom: 1px solid var(--border); }
  .chat-conversation-list { max-height: 160px; }
  .chat-messages { min-height: 420px; }
}

/* ---------- AI Caller (caller.html) ----------
   Gallery (by call type, then industry) -> studio (agent profile + phone).
   Calm surfaces, one accent, motion only where it carries
   meaning (her avatar breathes while she speaks, typing dots while she thinks). */
/* Same hero as the Overview page (overview.html .ov-hero/.ov-title/.ov-grad). */
.ac-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.ac-hero > div { flex: 1 1 420px; min-width: 0; }
.ac-hero .ac-ready { flex: none; }
.ac-eyebrow { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.ac-title { font-size: 26px; line-height: 1.25; margin: 0; max-width: 680px; }
.ac-grad { color: var(--accent); }
.ac-sub { color: var(--text-muted); font-size: 13px; margin: 6px 0 0; }
.ac-ready { font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 6px 12px; border-radius: 999px; background: var(--surface-2); }
.ac-ready.ok { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.ac-kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

.ac-builder { display: grid; grid-template-columns: minmax(260px, 0.9fr) 1.4fr; gap: 28px; align-items: center;
  padding: 24px 26px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm); margin-bottom: 26px; }
@media (max-width: 900px) { .ac-builder { grid-template-columns: 1fr; } }
.ac-builder h2 { font-family: var(--font-display); font-size: 24px; line-height: 1.2; margin: 6px 0 8px; color: var(--text-primary); }
.ac-builder p { margin: 0; color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.ac-builder textarea { width: 100%; box-sizing: border-box; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border-strong);
  background: var(--surface-1); color: var(--text-primary); font: inherit; font-size: 14px; line-height: 1.5; resize: vertical; }
.ac-builder textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ac-builder-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.ac-examples { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ac-examples::before { content: "Try:"; font-size: 12px; color: var(--text-muted); margin-right: 2px; }
.ac-example { font: inherit; font-size: 12px; padding: 5px 11px; border-radius: 999px; border: 1px dashed var(--border-strong); background: transparent; color: var(--text-secondary); cursor: pointer; }
.ac-example:hover { border-color: var(--accent); color: var(--accent); }
.ac-error { color: var(--critical); font-size: 13px; margin: 10px 0 0; }

.ac-filters { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.ac-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-pill { font: inherit; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); cursor: pointer; transition: all .15s ease; }
.ac-pill:hover { border-color: var(--border-strong); color: var(--text-primary); }
.ac-pill.active { background: var(--text-primary); color: var(--surface-1); border-color: var(--text-primary); }
.ac-filters select { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); font: inherit; font-size: 13px; }
.ac-section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 12px; }
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 26px; }
.ac-empty { color: var(--text-muted); font-size: 13.5px; }
.ac-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--surface-1); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.ac-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.ac-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ac-card-kicker { font-size: 11.5px; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.ac-type-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
.ac-type-icon .ico { width: 13px; height: 13px; }
.ac-pill .ico, .ac-chip .ico, .ac-meta .ico { width: 13px; height: 13px; }
.ac-card h4 { margin: 0; font-size: 15.5px; line-height: 1.3; color: var(--text-primary); font-family: var(--font-display); }
.ac-card p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); flex: 1; }
.ac-card-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 4px; }
.ac-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-chip { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); }
.ac-chip-accent { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ac-play { white-space: nowrap; }
.ac-play .ico { width: 13px; height: 13px; }

.ac-avatar { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: white; font-weight: 700; font-size: 20px;
  background: var(--accent); color: var(--on-accent); position: relative; }
.ac-avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.ac-avatar-lg { width: 46px; height: 46px; font-size: 18px; }
.ac-avatar.speaking::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent); animation: ac-breathe 1.2s ease-in-out infinite; }
@keyframes ac-breathe { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.14); opacity: .25; } }

.ac-back { font: inherit; font-size: 13px; font-weight: 600; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px 0 14px; }
.ac-back:hover { color: var(--accent); }
.ac-studio { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(360px, 440px); gap: 22px; align-items: start; }
@media (max-width: 1100px) { .ac-studio { grid-template-columns: 1fr; } }
.ac-studio-left { display: flex; flex-direction: column; gap: 12px; }
.ac-profile { display: flex; gap: 16px; align-items: center; padding: 20px 22px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-1); box-shadow: var(--shadow-sm); }
.ac-profile-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ac-profile-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ac-profile-name span { color: var(--text-muted); font-size: 14px; }
.ac-profile input, .ac-section input { font: inherit; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-primary); padding: 3px 6px; margin-left: -6px; }
.ac-profile input:hover, .ac-section input:hover { border-color: var(--border); }
.ac-profile input:focus, .ac-section input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
#agent_name, #company { font-family: var(--font-display); font-size: 20px; font-weight: 700; width: auto; max-width: 100%; field-sizing: content; min-width: 3ch; }
.ac-profile-persona { font-size: 13.5px !important; color: var(--text-secondary) !important; width: 100%; }
.ac-engines { margin-top: -6px; }
.ac-engines .ac-ready { align-self: center; }
.ac-voice-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius-lg); background: var(--surface-2); }
.ac-voice-row label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); flex: 1; min-width: 130px; }
.ac-voice-row select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); font: inherit; font-size: 13px; }
.ac-section { border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-1); padding: 0 18px; }
.ac-section summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 0; font-weight: 700; font-size: 14px; color: var(--text-primary); }
.ac-section summary::-webkit-details-marker { display: none; }
.ac-section summary::before { content: "›"; display: inline-block; margin-right: 8px; color: var(--text-muted); transition: transform .15s ease; }
.ac-section[open] summary::before { transform: rotate(90deg); }
.ac-section summary span { flex: 1; }
.ac-section summary small { font-weight: 500; font-size: 12px; color: var(--text-muted); }
.ac-section textarea { width: 100%; box-sizing: border-box; margin: 0 0 14px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-primary); font: inherit; font-size: 13.5px; line-height: 1.55; resize: vertical; }
.ac-section textarea:focus { outline: none; border-color: var(--accent); background: var(--surface-1); }
.ac-inline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); margin: -4px 0 14px; }
.ac-save-row { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.ac-saved { font-size: 12.5px; color: var(--text-secondary); }

.ac-phone { position: sticky; top: 20px; display: flex; flex-direction: column; min-height: 620px; max-height: calc(100vh - 60px); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-strong); background: var(--surface-1); box-shadow: var(--shadow-md); }
.ac-phone-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.ac-phone-title { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.ac-phone-sub { font-size: 12.5px; color: var(--text-muted); }
.ac-phone.live .ac-phone-sub { color: var(--good); }
.ac-timer { margin-left: auto; font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.ac-phone-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ac-idle { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 30px; text-align: center; }
.ac-idle p { margin: 0; max-width: 300px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.ac-call-btn { width: 84px; height: 84px; border-radius: 50%; border: none; cursor: pointer; color: white; display: grid; place-items: center;
  background: var(--good); box-shadow: var(--shadow-md); transition: transform .15s ease; position: relative; }
.ac-call-btn::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--good) 45%, transparent); animation: ac-breathe 2.2s ease-in-out infinite; }
.ac-call-btn:hover { transform: scale(1.05); }
.ac-call-btn svg { width: 34px; height: 34px; }
.ac-call-label { font-weight: 700; color: var(--text-primary); }
.ac-log { flex: 1; overflow-y: auto; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 12px; }
.ac-msg { display: flex; flex-direction: column; gap: 4px; max-width: 86%; animation: ac-in .2s ease-out; }
@keyframes ac-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ac-msg.agent { align-self: flex-start; }
.ac-msg.customer { align-self: flex-end; align-items: flex-end; }
.ac-msg.note { align-self: center; max-width: 100%; font-size: 12px; color: var(--text-muted); }
.ac-msg.note.error { color: var(--critical); }
.ac-bubble { padding: 10px 14px; border-radius: var(--radius-lg); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ac-msg.agent .ac-bubble { background: var(--surface-2); color: var(--text-primary); border-bottom-left-radius: 6px; }
.ac-msg.customer .ac-bubble { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.ac-meta { font-size: 11.5px; color: var(--text-muted); padding: 0 6px; }
.ac-mood { color: var(--accent); font-weight: 700; text-transform: capitalize; }
.ac-dots { display: inline-flex; gap: 4px; }
.ac-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: ac-dot 1s infinite ease-in-out; }
.ac-dots i:nth-child(2) { animation-delay: .15s; } .ac-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ac-dot { 0%,80%,100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ac-phone-foot { padding: 10px 16px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.ac-status { font-size: 12px; color: var(--text-muted); min-height: 16px; }
.ac-composer { display: flex; gap: 8px; }
.ac-composer input { flex: 1; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); font: inherit; font-size: 14px; }
.ac-composer input:focus { outline: none; border-color: var(--accent); }
.ac-composer .primary { border-radius: 999px; }
.ac-mic { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-1); color: var(--text-secondary); cursor: pointer; display: grid; place-items: center; }
.ac-mic .ico { width: 18px; height: 18px; }
.ac-mic.recording { color: #fff; }
.ac-mic.recording { background: var(--critical); border-color: var(--critical); animation: ac-breathe 1.2s ease-in-out infinite; }
.ac-hangup { font: inherit; font-weight: 700; font-size: 13px; border: none; border-radius: 999px; padding: 10px; cursor: pointer; color: white; background: var(--critical); }
.ac-hangup:hover { filter: brightness(1.05); }
.ac-result { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ac-result-card { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 320px; }
.ac-result-card p { margin: 0; color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.ac-result-stats { display: flex; gap: 28px; }
.ac-result-stats div { display: flex; flex-direction: column; }
.ac-result-stats b { font-family: var(--font-display); font-size: 26px; color: var(--text-primary); }
.ac-result-stats span { font-size: 12px; color: var(--text-muted); }
a.ac-link-btn { text-decoration: none; display: inline-block; padding: 10px 18px; border-radius: var(--radius); color: var(--on-accent); font-weight: 600; font-size: 14px;
  background: var(--accent);  }

/* AI Caller modes: Browse agents (gallery) | Quick call (one screen, every field open). */
.ac-modes { display: flex; width: fit-content; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 18px; }
.ac-mode { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 999px; border: none; background: transparent; color: var(--text-secondary); cursor: pointer; }
.ac-mode.active { background: var(--surface-1); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.ac-quickbar { display: none; }
#studio-view.quick .ac-back { display: none; }
#studio-view.quick .ac-quickbar { display: grid; grid-template-columns: minmax(240px, 1fr) 1.6fr; gap: 14px; padding: 16px 18px; margin-bottom: 14px;
  border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-1); box-shadow: var(--shadow-sm); }
@media (max-width: 900px) { #studio-view.quick .ac-quickbar { grid-template-columns: 1fr; } }
.ac-quick-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ac-quick-field label { font-size: 11.5px; font-weight: 700; color: var(--text-secondary); }
.ac-quick-field select, .ac-quick-field input { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); font: inherit; font-size: 13px; }
.ac-quick-field select:focus, .ac-quick-field input:focus { outline: none; border-color: var(--accent); }
.ac-quick-row { display: flex; gap: 8px; }
.ac-quick-row input { flex: 1; min-width: 0; }
#studio-view.quick .ac-section summary { cursor: default; pointer-events: none; }
#studio-view.quick .ac-section summary::before { display: none; }

/* AI Caller: ring a real phone (Vobiz) */
.ac-dial { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; width: 100%; max-width: 300px; }
.ac-dial-or { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.ac-dial-row { display: flex; gap: 8px; width: 100%; }
.ac-dial-row input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface-1); color: var(--text-primary); font: inherit; font-size: 13.5px; }
.ac-dial-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ac-dial-note { font-size: 12px; color: var(--text-muted); text-align: center; }
.ac-dial-note.error { color: var(--critical); }

/* Paid OpenAI backup: monthly spend vs cap (js/shared.js _loadOpenAISpend) */
.spend-meter { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 12px; color: var(--text-muted);
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); position: relative; overflow: hidden; }
.spend-meter b { color: var(--text-primary); font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.spend-meter i { grid-column: 1 / -1; display: block; height: 3px; border-radius: 2px; background: var(--good); }
.spend-meter[data-level="mid"] i { background: var(--highlight); }
.spend-meter[data-level="high"] i { background: var(--warning); }
.spend-meter[data-level="over"] i { background: var(--critical); }
.spend-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
  background: color-mix(in srgb, var(--warning) 10%, transparent); }
.spend-banner.over { border-color: color-mix(in srgb, var(--critical) 45%, transparent);
  background: color-mix(in srgb, var(--critical) 10%, transparent); }
.spend-banner span { min-width: 0; flex: 1 1 260px; }

/* Client demo mode: internals off screen (js/shared.js loadAppSettings) */
html[data-client] .internal-only { display: none !important; }

/* ---- AI Caller polish (2026-11-01) ---- */
.ac-modes { margin-bottom: 22px; }
.ac-hero { align-items: center; }
.ac-filters { align-items: flex-start; }
.ac-pills { flex: 1 1 560px; }
.ac-filters select { flex: none; }
.ac-card { position: relative; overflow: hidden; }
.ac-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); opacity: 0; transition: opacity .18s ease; }
.ac-card:hover { transform: translateY(-2px); }
.ac-card:hover::before { opacity: 1; }
.ac-card-actions { margin-top: auto; padding-top: 4px; }

/* Voice settings: a tidy grid, labels never clip */
.ac-voice-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1.35fr) auto; align-items: end; gap: 12px;
  background: var(--surface-1); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.ac-voice-row label { min-width: 0; letter-spacing: .02em; }
.ac-voice-row select { width: 100%; min-width: 0; text-overflow: ellipsis; background: var(--surface-2); cursor: pointer; }
.ac-voice-row select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ac-voice-row .ac-play { height: 36px; }
@media (max-width: 700px) { .ac-voice-row { grid-template-columns: 1fr 1fr; } .ac-voice-row .ac-play { grid-column: 1 / -1; } }
.ac-section { box-shadow: var(--shadow-sm); transition: border-color .15s ease; }
.ac-section:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.ac-section summary::before { font-size: 16px; line-height: 1; }

/* Phone card: compact when idle, a soft "dial pad" stage */
.ac-phone { min-height: 0; }
.ac-phone.live, .ac-phone:has(#result:not([hidden])) { min-height: 620px; }
.ac-phone-head { background: color-mix(in srgb, var(--accent) 6%, var(--surface-1)); }
.ac-idle { gap: 12px; padding: 34px 28px 30px;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--good) 9%, transparent), transparent 70%); }
.ac-idle-kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.ac-call-label { font-family: var(--font-display); font-size: 17px; margin-top: 6px; }
.ac-idle p { font-size: 13px; color: var(--text-muted); }
.ac-dial { margin-top: 14px; padding-top: 18px; border-top: 1px dashed var(--border-strong); max-width: 320px; }
@media (max-width: 1100px) { .ac-phone { position: static; max-height: none; } }
@media (max-width: 600px) {
  .ac-title { font-size: 22px; }
  .ac-builder { padding: 18px; }
  .ac-profile { padding: 16px; }
  #agent_name, #company { font-size: 18px; }
}
@media (max-width: 600px) {
  .ac-voice-row { grid-template-columns: 1fr; }
  .ac-section summary small { display: none; }
  .ac-studio .ac-phone { order: -1; }
  .ac-profile { align-items: flex-start; }
  .ac-avatar { width: 42px; height: 42px; font-size: 17px; }
}

/* ======================================================================
   ManMetric identity layer (v6, 2026-11-15). Overrides on top of the
   component rules above; tokens live at the top of this file.
   ====================================================================== */

/* Type: Inter with its clearer digits/letterforms; display face for headings. */
body { font-feature-settings: "cv11", "ss01", "ss03"; letter-spacing: -0.003em; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }
.tabular, .kpi-value, .ov-kpi-value, .metric-value, .score-ring-value, .data-table td { font-variant-numeric: tabular-nums; }
.kpi-value, .ov-kpi-value { font-family: var(--font-display); letter-spacing: -0.025em; }

/* Logo mark: a listening head with म (for मन, mind) whose top line is a voice wave.
   The SVG draws its own blue tile, so the container only sizes it. */
.brand-mark { background: none; color: #fff; box-shadow: none; overflow: hidden; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.sidebar-brand .mark.brand-mark { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; }
.sidebar-brand .mark.brand-mark svg { width: 34px; height: 34px; }
.sidebar-brand h1 { font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }

/* Ink sidebar in both themes: the brand's anchor. Re-scopes the neutral
   tokens for everything inside it (links, swatches, toggle, logout). */
.sidebar {
  background: var(--brand-ink); border-right: 1px solid rgba(255,255,255,0.04);
  --text-primary: #f1f4fb; --text-secondary: #b8c1d6; --text-muted: #8a95ad;
  --surface-1: #141d33; --surface-2: var(--brand-ink); --surface-3: #1b2540;
  --border: #1e2944; --border-strong: #2b385a;
  color: var(--text-primary);
}
.sidebar-link { border-radius: 9px; }
.sidebar-link:hover { background: rgba(255,255,255,0.05); }
.sidebar-link.active { background: color-mix(in srgb, var(--accent) 24%, transparent); color: #fff; }
.sidebar-link.active svg { color: color-mix(in srgb, var(--accent) 45%, #ffffff); }
.sidebar-link.active::before { background: color-mix(in srgb, var(--accent) 55%, #ffffff); }
.sidebar-group { color: #6f7b95; letter-spacing: .1em; }
.sidebar-foot { border-top-color: rgba(255,255,255,0.06); }
.accent-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px #ffffff; }

/* Surfaces: softer, larger radius, a hairline that reads in both themes. */
.card { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.kpi-tile { border-radius: 14px; }
.kpi-tile.clickable:hover, .card.clickable:hover { transform: translateY(-1px); }
.kpi-tile { transition: border-color .12s, box-shadow .12s, transform .12s; }
@media (prefers-reduced-motion: reduce) { .kpi-tile, .kpi-tile.clickable:hover { transition: none; transform: none; } }

/* Buttons: a confident primary with a hairline highlight; calm secondaries. */
button.primary { border-radius: 10px; font-weight: 600; letter-spacing: -0.005em;
  box-shadow: 0 1px 2px rgba(11,18,32,0.10), inset 0 1px 0 rgba(255,255,255,0.14); }
button.primary:hover:not(:disabled) { box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 1px 0 rgba(255,255,255,0.14); }
button.secondary, .quiet-button { border-radius: 10px; }

/* Tables: quieter header, gentle row hover. */
.data-table th { color: var(--text-muted); font-weight: 600; letter-spacing: .06em; background: transparent; }
.data-table tr.clickable:hover td { background: color-mix(in srgb, var(--accent) 5%, var(--surface-1)); }

/* Chips / tags read as pills. */
.tag { border-radius: 999px; }

/* Login: brand lockup + a soft branded backdrop. */
body:has(.login-wrap) { background: var(--page); }
.login-wrap.card { border-radius: 20px; padding: 32px 30px 28px; box-shadow: var(--shadow-lg); }
.login-brand { flex-direction: column; gap: 14px; }
.login-brand .mark.brand-mark { width: 52px; height: 52px; border-radius: 15px; }
.login-brand .mark.brand-mark svg { width: 52px; height: 52px; }
.login-brand h1 { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.035em; }
.login-brand::after { content: "Know their mind. Close the deal."; font-size: 13px; color: var(--text-muted); margin-top: -8px; }
.login-field input { border-radius: 10px; }
.login-field input:focus { box-shadow: 0 0 0 4px var(--accent-soft); }
.sidebar .accent-swatch { border-color: var(--brand-ink); box-shadow: 0 0 0 1px #3a4766; }
.sidebar .accent-swatch:hover { box-shadow: 0 0 0 1px #8a95ad; }
.sidebar .accent-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px #ffffff; }
