/* ============================================================================
   Capability OS (Powered by ResonaCX) · Concentrix Enterprise Design System
   ============================================================================ */
:root {
  --navy-900: #012532;
  --navy-800: #003046;
  --navy-700: #003D5B;
  --teal-700: #007380;
  --teal-500: #0E9AA7;
  --teal-300: #25E2CC;
  --canvas: #F4F6F9;
  --surface: #FFFFFF;
  --surface-muted: #F8FAFC;
  --border: #DCE3EB;
  --border-strong: #C2CEDB;
  --text-900: #0F2233;
  --text-700: #334A5E;
  --text-500: #60758A;
  --ok-bg: #E9F6EF;
  --ok-fg: #146C43;
  --warn-bg: #FEF6E7;
  --warn-fg: #996515;
  --risk-bg: #FDECEC;
  --risk-fg: #B42318;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  font-size: 14px; line-height: 1.55;
  color: var(--text-900); background: var(--canvas);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* Unified Shell */
.app-shell { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--navy-900); color: #E6EFF5;
  display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-top { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--navy-700); border: 2px solid var(--teal-300);
  position: relative; flex-shrink: 0;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid #FFFFFF;
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; color: var(--text-500); }
.brand-light .brand-name { color: #FFFFFF; }
.brand-light .brand-sub { color: #8FB2C4; }

.side-nav { padding: 10px 10px 14px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.nav-group-label {
  font-size: 11px; font-weight: 600; color: #7DA2B6;
  letter-spacing: 0.5px; padding: 12px 10px 5px;
}
.nav-item {
  width: 100%; border: 0; background: transparent; color: #CFE0EA;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; cursor: pointer; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
.nav-item.active {
  background: var(--navy-700); color: #FFFFFF; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--teal-300);
}
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-300); flex-shrink: 0; }
.nav-dot-muted { background: #6D90A3; }
.nav-tag-teal {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  color: var(--navy-900); background: var(--teal-300);
  padding: 1px 6px; border-radius: 4px;
}
.nav-badge {
  margin-left: auto; background: #D94848; color: #FFFFFF;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
}

.sidebar-footer { padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.tenant-pill {
  font-size: 11px; color: #A6C8D8; background: rgba(255, 255, 255, 0.07);
  padding: 4px 8px; border-radius: var(--radius-sm); margin-bottom: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-meta { min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: #8FB2C4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-ghost-light {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.24);
  color: #DCEBF2; padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 12px; cursor: pointer; flex-shrink: 0;
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.12); }

/* Topbar & Main Container */
.main-wrap { display: flex; flex-direction: column; min-width: 0; }
.mobile-header { display: none; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.crumb { font-size: 13px; color: var(--text-500); }
.crumb b { color: var(--navy-900); }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sandbox-mini { font-size: 11.5px; color: var(--text-500); }
.main-content { padding: 20px 24px 44px; max-width: 1220px; width: 100%; margin: 0 auto; }

/* Page Header & Hero Banner */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-title { margin: 0; font-size: 20px; font-weight: 700; color: var(--navy-900); }
.page-sub { margin: 3px 0 0; font-size: 13px; color: var(--text-500); }

.hero-banner {
  background: var(--navy-700); color: #FFFFFF;
  border-radius: var(--radius-lg); padding: 18px 22px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-left: 4px solid var(--teal-300);
}
.hero-kicker { font-size: 11.5px; color: #9ED3E0; font-weight: 600; letter-spacing: 0.4px; }
.hero-title { margin: 3px 0 2px; font-size: 18px; font-weight: 700; color: #FFFFFF; }
.hero-sub { margin: 0; font-size: 13px; color: #CFE3EC; }

/* Cards & Grids */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 13px; flex-wrap: wrap;
}
.card-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--navy-900); }
.card-sub { font-size: 12.5px; color: var(--text-500); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.split-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.95fr); gap: 16px; align-items: start; }
@media (max-width: 1140px) {
  .split-main { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.metric-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 13px 15px;
}
.metric-label { font-size: 12px; color: var(--text-500); margin-bottom: 3px; }
.metric-val { font-size: 22px; font-weight: 700; color: var(--navy-900); }
.metric-foot { font-size: 11.5px; color: var(--text-500); margin-top: 2px; }

/* Capability OS Timeline & List Rows */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.step {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1px solid #EDF1F5; background: var(--surface-muted);
}
.step.current { border-color: var(--teal-700); background: #EFF8F9; }
.step.done { border-color: #C4E5D2; background: #F2FAF5; }
.stepnum {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: #DDE5EE; color: var(--text-700);
}
.step.current .stepnum { background: var(--navy-700); color: #FFFFFF; }
.step.done .stepnum { background: var(--ok-fg); color: #FFFFFF; }
.step b { display: block; font-size: 13.5px; color: var(--navy-900); }
.step small { font-size: 12px; color: var(--text-500); }

.listrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 0; border-bottom: 1px solid #EDF1F5; flex-wrap: wrap;
}
.listrow:last-child { border-bottom: 0; }
.listrow-desc { min-width: 160px; flex: 1; }
.listrow-desc h4 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--navy-900); }
.listrow-desc small { font-size: 12px; color: var(--text-500); }
.listrow-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* Progress & Skima Skill Gap Bars */
.bar-track { position: relative; height: 8px; background: #E6ECF2; border-radius: 99px; overflow: visible; }
.bar-fill { height: 100%; background: var(--teal-700); border-radius: 99px; transition: width 0.25s; }
.bar-fill.low { background: #C26A1D; }
.bar-target {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--navy-900); border-radius: 1px;
}

.skill-row { padding: 10px 0; border-bottom: 1px solid #EDF1F5; }
.skill-row:last-child { border-bottom: 0; }
.skill-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }

/* Woven Voice Feature Callout inside Capability OS Tabs */
.voice-weave-box {
  background: #F1F8F9; border: 1px solid #BFE0E4; border-left: 4px solid var(--teal-700);
  border-radius: var(--radius-md); padding: 14px 16px; margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.voice-weave-box h4 { margin: 0 0 3px; font-size: 14px; color: var(--navy-900); }
.voice-weave-box p { margin: 0; font-size: 12.5px; color: var(--text-700); }

/* Scenario & Voice Selector Cards */
.scenario-card {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 13px 15px; background: var(--surface); cursor: pointer;
  transition: border-color 0.15s, background 0.15s; text-align: left; width: 100%;
  display: flex; flex-direction: column; gap: 6px;
}
.scenario-card:hover { border-color: var(--teal-700); background: #FAFCFD; }
.scenario-card.selected {
  border: 1.5px solid var(--navy-700); background: #F2F7FA;
  box-shadow: inset 3px 0 0 var(--teal-700);
}
.scenario-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.scenario-name { font-size: 14px; font-weight: 700; color: var(--navy-900); line-height: 1.4; }
.scenario-desc { font-size: 12.5px; color: var(--text-500); line-height: 1.45; }
.score-pill { white-space: nowrap; flex-shrink: 0; font-weight: 700; color: var(--navy-700); }

.voice-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 8px; }
.voice-pill {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm); padding: 9px 11px; cursor: pointer;
  text-align: left; font-size: 12.5px; color: var(--text-700); line-height: 1.35;
}
.voice-pill.selected { border-color: var(--navy-700); background: var(--navy-700); color: #FFFFFF; font-weight: 600; }

/* Live Voice Stage */
.stage-card {
  background: var(--surface); border: 1.5px solid var(--navy-700);
  border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px;
}
.stage-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.stage-status-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; background: var(--surface-muted); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 11px 15px; margin: 13px 0;
}
.state-indicator { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy-900); }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal-700); }
.pulse-dot.speaking { background: var(--navy-700); box-shadow: 0 0 0 4px rgba(0, 61, 91, 0.16); }
.pulse-dot.listening { background: #146C43; box-shadow: 0 0 0 4px rgba(20, 108, 67, 0.16); }
.pulse-dot.thinking { background: #996515; }
.pulse-dot.muted { background: #94A3B8; }

.caption-box {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 13px 15px; min-height: 76px; background: #FFFFFF; margin-bottom: 10px;
}
.caption-role { font-size: 11.5px; font-weight: 700; color: var(--teal-700); margin-bottom: 4px; }
.caption-text { font-size: 15px; color: var(--text-900); line-height: 1.55; }
.caption-user { background: var(--surface-muted); min-height: 52px; }
.caption-user .caption-role { color: var(--text-500); }

.hints-drawer {
  background: #F2F9FA; border: 1px solid #C6E5E8; border-radius: var(--radius-md);
  padding: 10px 14px; margin: 10px 0 13px; font-size: 12.5px; color: var(--navy-900);
}
.hints-drawer ul { margin: 5px 0 0; padding-left: 18px; }
.stage-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.text-fallback-row { display: flex; gap: 8px; margin-top: 10px; }

/* Safe Dify Chatflow Renderer inside Task Tab */
.live-reply { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.live-reply p { margin: 0; font-size: 14px; color: var(--text-900); }
.live-reply pre {
  margin: 0; padding: 10px 12px; background: var(--surface-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-x: auto; font-size: 12.5px;
}
.dify-options { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.dify-option {
  border: 1px solid var(--border-strong); background: #FFFFFF; color: var(--text-900);
  border-radius: var(--radius-sm); padding: 10px 13px; text-align: left;
  cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 13.5px;
}
.dify-option:hover:not(:disabled) { border-color: var(--teal-700); background: #F2F9FA; }
.radio-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--teal-700); flex-shrink: 0; }
.dify-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-md); }
.busy-bar {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  background: #EFF6FA; border: 1px solid #C6DCE8; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--navy-700); margin-bottom: 12px;
}

/* Badges, Buttons, Inputs */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}
.badge-navy { background: #E6EFF5; color: var(--navy-700); }
.badge-teal { background: #E3F5F7; color: var(--teal-700); }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge-risk { background: var(--risk-bg); color: var(--risk-fg); }
.badge-muted { background: #EEF2F6; color: var(--text-500); }

.btn {
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 15px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s, border-color 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--navy-700); color: #FFFFFF; }
.btn-primary:hover:not(:disabled) { background: var(--navy-900); }
.btn-teal { background: var(--teal-700); color: #FFFFFF; }
.btn-teal:hover:not(:disabled) { background: #005B66; }
.btn-light { background: #FFFFFF; color: var(--navy-900); }
.btn-light:hover:not(:disabled) { background: #E9F2F7; }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text-900); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-muted); }
.btn:disabled { opacity: 0.52; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 11px; font-size: 13.5px; font-family: inherit; color: var(--text-900); background: #FFFFFF;
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid rgba(0, 115, 128, 0.22); border-color: var(--teal-700); }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-700); margin-bottom: 5px; }

/* Scorecard, Turns, Tables, Tabs */
.score-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 15px; background: var(--surface-muted); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 12px; flex-wrap: wrap;
}
.score-big { font-size: 30px; font-weight: 800; color: var(--navy-900); line-height: 1; }
.dim-row { padding: 9px 0; border-bottom: 1px solid #EDF1F5; cursor: pointer; }
.dim-row:last-child { border-bottom: 0; }
.dim-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.dim-comment { font-size: 12px; color: var(--text-500); margin-top: 4px; }
.turn-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.turn-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px; font-size: 13px; background: #FFFFFF; }
.turn-item.highlighted { border-color: var(--teal-700); background: #EDF8F9; }
.turn-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-500); margin-bottom: 3px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn {
  border: 0; background: transparent; padding: 8px 11px; font-size: 13px;
  font-weight: 600; color: var(--text-500); cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn.active { color: var(--navy-700); border-bottom-color: var(--teal-700); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 8px; border-bottom: 1px solid #EDF1F5; text-align: left; vertical-align: middle; }
th { font-size: 11.5px; font-weight: 700; color: var(--text-500); background: var(--surface-muted); white-space: nowrap; }

.diag-grid { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; font-size: 13px; }
.diag-grid dt { color: var(--text-500); font-weight: 600; }
.diag-grid dd { margin: 0; color: var(--text-900); }

.alert-box {
  border-radius: var(--radius-md); padding: 11px 14px; font-size: 13px; margin-bottom: 14px;
  border: 1px solid var(--border); background: var(--warn-bg); color: var(--warn-fg);
}
.alert-box.bad { background: var(--risk-bg); color: var(--risk-fg); border-color: #F3C3C3; }

/* Auth Gate, Modals, Toast */
.auth-gate {
  position: fixed; inset: 0; background: var(--navy-900);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 90;
}
.auth-card {
  width: 100%; max-width: 420px; background: #FFFFFF; border-radius: var(--radius-lg);
  padding: 28px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.auth-desc { font-size: 13px; color: var(--text-500); margin: 14px 0 18px; }
.auth-footnote { font-size: 11.5px; color: var(--text-500); margin-top: 16px; text-align: center; }
.inline-error { background: var(--risk-bg); color: var(--risk-fg); padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12.5px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(1, 37, 50, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100;
}
.modal-card {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: #FFFFFF; border-radius: var(--radius-lg); padding: 20px 22px; border: 1px solid var(--border);
}
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy-900); color: #FFFFFF; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
.invite-shell { max-width: 680px; margin: 0 auto; padding: 24px 16px 48px; }

/* Responsive (Mobile 390px: Clean Compact Wrapped Pills, ZERO Horizontal Scrollbar) */
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: none; }
  .mobile-header {
    display: flex; flex-direction: column; gap: 10px;
    background: var(--navy-900); color: #FFFFFF; padding: 12px 14px;
    position: sticky; top: 0; z-index: 40;
  }
  .mobile-brand-row { display: flex; align-items: center; justify-content: space-between; }
  .mobile-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  .m-tab {
    border: 1px solid rgba(255, 255, 255, 0.22); background: transparent;
    color: #DCEBF2; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  }
  .m-tab.active { background: var(--teal-700); border-color: var(--teal-300); color: #FFFFFF; }
  .main-content { padding: 14px 14px 36px; }
  .grid-2, .grid-3, .grid-4, .split-main, .voice-pills { grid-template-columns: 1fr; }
}

/* ============================================================================
   Ace Cards 1-4 · 3-Column Mock Call Workbench, SVG Charts, Rewrites & Heatmap
   ============================================================================ */
.mock-workbench {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 256px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 1180px) {
  .mock-workbench { grid-template-columns: 1fr; }
}

.crm-card, .copilot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
}
.crm-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border);
}
.crm-kv { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
.crm-row { display: flex; justify-content: space-between; gap: 8px; }
.crm-row span { color: var(--text-500); flex-shrink: 0; }
.crm-row strong { color: var(--navy-900); text-align: right; word-break: break-word; }
.crm-sop-box {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: #F2F8FA; border: 1px solid #C6E2E6; font-size: 12px; color: var(--navy-900);
}
.crm-sop-box ul { margin: 5px 0 0; padding-left: 16px; }

.emo-meter { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.emo-step {
  padding: 7px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-muted); color: var(--text-500);
  display: flex; align-items: center; justify-content: space-between;
}
.emo-step.active.l1 { background: #E9F6EF; border-color: #9BD4B6; color: #146C43; }
.emo-step.active.l2 { background: #FEF6E7; border-color: #F0CA82; color: #996515; }
.emo-step.active.l3 { background: #FDECEC; border-color: #F2B5B5; color: #B42318; }

.check-list { display: flex; flex-direction: column; gap: 7px; }
.check-item {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  padding: 7px 9px; border-radius: var(--radius-sm);
  background: var(--surface-muted); border: 1px solid #EAEFF4; color: var(--text-700);
}
.check-item.done { background: #EEF8F2; border-color: #BCE3CC; color: #146C43; font-weight: 600; }
.check-item.danger { background: #FDECEC; border-color: #F2B5B5; color: #B42318; font-weight: 600; }

.call-timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; font-weight: 700; color: var(--navy-900);
  background: #E8F1F5; padding: 2px 8px; border-radius: 4px;
}

/* Charts & Heatmap */
.chart-wrap { width: 100%; }
.chart-legend {
  display: flex; justify-content: center; gap: 16px; font-size: 12px;
  color: var(--text-500); margin-top: 6px;
}
.lg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.lg-line { display: inline-block; width: 16px; border-top: 2px dashed #003D5B; margin-right: 5px; vertical-align: middle; }

.heat-cell {
  display: inline-block; min-width: 44px; padding: 4px 8px; border-radius: 5px;
  font-size: 12.5px; font-weight: 700; text-align: center;
}
.heat-high { background: #E3F4EB; color: #146C43; }
.heat-mid { background: #FEF3DC; color: #996515; }
.heat-low { background: #FDE7E7; color: #B42318; }
.heat-na { background: #EEF2F6; color: #7C8D9E; }

/* Before -> After Gold-Standard Script Rewrites */
.rewrite-card {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 14px; margin-bottom: 10px; background: #FFFFFF;
}
.rewrite-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0; }
@media (max-width: 720px) { .rewrite-grid { grid-template-columns: 1fr; } }
.rw-before {
  background: #FDF4F4; border: 1px solid #F3D1D1; border-radius: var(--radius-sm);
  padding: 9px 11px; font-size: 12.5px; color: #7A2323;
}
.rw-after {
  background: #EDF8F4; border: 1px solid #BDE3D3; border-radius: var(--radius-sm);
  padding: 9px 11px; font-size: 12.5px; color: #0F5132;
}
.rw-label { font-size: 11px; font-weight: 700; margin-bottom: 4px; opacity: 0.85; }
.rw-why { font-size: 12px; color: var(--text-500); margin-top: 4px; }

/* Filter Pills & Side-by-Side Comparison */
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-pill {
  border: 1px solid var(--border-strong); background: #FFFFFF; color: var(--text-700);
  padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.filter-pill.active { background: var(--navy-700); border-color: var(--navy-700); color: #FFFFFF; }

.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.compare-col { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; background: var(--surface-muted); }
.compare-best { color: var(--ok-fg); font-weight: 800; }
