  /* ============================================================
     CLEAR EARTH — DESIGN SYSTEM v2 (Premium / Apple-inspired)
     Tokens, primitives, components. Inline styles in markup
     still take precedence — those will be addressed in phase 2.
     ============================================================ */
  :root {
    /* — Surfaces (warm near-black, less stark than pure OLED) — */
    --bg-base: #0a0a0d;
    --bg-1: #131318;
    --bg-2: #1c1c22;
    --surface: rgba(255,255,255,0.025);
    --surface-hover: rgba(255,255,255,0.045);
    --surface-strong: rgba(255,255,255,0.08);

    /* — Hairlines (Apple's signature) — */
    --hairline: rgba(255,255,255,0.06);
    --hairline-strong: rgba(255,255,255,0.10);
    --hairline-subtle: rgba(255,255,255,0.035);

    /* — Text — */
    --text-1: #f5f5f7;                       /* primary */
    --text-2: rgba(245,245,247,0.62);        /* secondary */
    --text-3: rgba(245,245,247,0.38);        /* tertiary */
    --text-4: rgba(245,245,247,0.22);        /* quaternary */

    /* — Brand — */
    --brand: #00d4aa;
    --brand-2: #06b8a0;
    --brand-tint: rgba(0,212,170,0.10);
    --brand-glow: rgba(0,212,170,0.18);

    /* — System status (Apple system colors) — */
    --accent: #5e5ce6;                        /* Apple System Indigo — refined, used sparingly */
    --accent-tint: rgba(94,92,230,0.10);
    --success: #30d158;
    --warning: #ff9f0a;
    --danger:  #ff453a;
    --info:    #0a84ff;
    --gold:    #ffd60a;

    /* — Spacing scale (4px base) — */
    --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
    --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

    /* — Radii — */
    --r-xs: 6px;  --r-sm: 8px;  --r-md: 12px;
    --r-lg: 16px; --r-xl: 22px; --r-2xl: 28px; --r-pill: 999px;

    /* — Type scale — */
    --fs-xs: 11px;  --fs-sm: 12px;  --fs-base: 14px; --fs-md: 15px;
    --fs-lg: 17px;  --fs-xl: 20px;  --fs-2xl: 24px;  --fs-3xl: 32px;
    --fs-4xl: 44px; --fs-5xl: 56px;

    /* — Letter spacing — */
    --ls-display: -0.025em;
    --ls-heading: -0.015em;
    --ls-body:    -0.005em;
    --ls-label:   0;

    /* — Motion — */
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);    /* Apple "swift out" */
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --dur-fast: 150ms;
    --dur-base: 220ms;
    --dur-slow: 380ms;

    /* — Elevation (Apple-style very subtle) — */
    --elev-1: 0 1px 2px rgba(0,0,0,0.40);
    --elev-2: 0 4px 16px rgba(0,0,0,0.40);
    --elev-3: 0 16px 48px rgba(0,0,0,0.55);
    --elev-4: 0 32px 96px rgba(0,0,0,0.65);

    /* — Glass blur stacks — */
    --blur-sm: blur(12px) saturate(140%);
    --blur-md: blur(24px) saturate(160%);
    --blur-lg: blur(40px) saturate(180%);

    /* — Z-index scale — */
    --z-nav: 100;
    --z-sidebar: 90;
    --z-dropdown: 200;
    --z-modal: 1000;
    --z-toast: 2000;
    --z-tooltip: 3000;

    /* — Legacy aliases (do not break existing rules) — */
    --bg: var(--bg-base);
    --bg2: var(--bg-1);
    --bg3: var(--bg-2);
    --card: var(--surface);
    --card-hover: var(--surface-hover);
    --border: var(--hairline);
    --border-light: var(--hairline-strong);
    --primary: var(--brand);
    --primary-dark: var(--brand-2);
    --primary-glow: var(--brand-tint);
    --primary-glow-strong: var(--brand-glow);
    --accent-glow: var(--accent-tint);
    --text: var(--text-1);
    --text2: var(--text-2);
    --text3: var(--text-3);
    --glass: var(--surface);
    --glass-border: var(--hairline);
    --radius: var(--r-md);
    --shadow: var(--elev-2);
    --glow: 0 0 40px rgba(0,212,170,0.02);
    --transition: all var(--dur-base) var(--ease-spring);
  }

  /* — Reset & base — */
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; padding: 0; }
  html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-feature-settings: 'cv02','cv03','cv04','cv11','ss01';
    background: var(--bg-base);
    color: var(--text-1);
    font-size: var(--fs-base);
    line-height: 1.5;
    letter-spacing: var(--ls-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }
  /* Subtle ambient depth — barely visible aurora wash */
  body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
    background:
      radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(0,212,170,0.045), transparent 60%),
      radial-gradient(ellipse 900px 500px at 100% 110%, rgba(94,92,230,0.025), transparent 70%);
  }

  ::selection { background: var(--brand-tint); color: var(--text-1); }

  /* — Focus visible (replaces outlines) — */
  :focus { outline: none; }
  :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

  /* — Scrollbars — */
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); border: 2px solid transparent; background-clip: content-box; }

  /* — Reduced motion — */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

  /* — Form controls: select/option dark-mode legibility fix —————————————————
     Native <select> dropdowns render their option list outside the document's
     stacking context — they ignore most CSS. Two things make them readable:
     1. color-scheme: dark on the select element → tells the OS/browser to render
        the native popup in dark mode (works in Chrome/Edge/Safari on all platforms).
     2. Explicit background + color on <option> → works in Firefox and as a
        fallback in other browsers.
     The !important is intentional — inline styles on individual selects use
     rgba(255,255,255,0.03) backgrounds which render as near-transparent, letting
     the OS-native white popup bleed through and making text invisible.
  ————————————————————————————————————————————————————————————————————————————— */
  select {
    color-scheme: dark;
    color: var(--text-1);
  }
  option,
  select option,
  optgroup option {
    background-color: #1c1c22 !important;  /* var(--bg-2) — solid, no alpha */
    color: #f5f5f7 !important;             /* var(--text-1) */
  }
  option:hover,
  option:focus,
  option:checked {
    background-color: #00d4aa33 !important; /* brand tint */
    color: #f5f5f7 !important;
  }

  /* — Typography hierarchy — */
  h1, h2, h3, h4, h5, h6 { color: var(--text-1); font-weight: 600; letter-spacing: var(--ls-heading); line-height: 1.2; }
  h1 { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: var(--ls-display); line-height: 1.1; }
  h2 { font-size: var(--fs-xl); font-weight: 600; }
  h3 { font-size: var(--fs-lg); font-weight: 600; }
  small, .caption { font-size: var(--fs-xs); color: var(--text-3); }
  a { color: var(--brand); text-decoration: none; transition: opacity var(--dur-fast) var(--ease-standard); }
  a:hover { opacity: 0.8; }

  /* ============================================================
     AUTH SCREEN — refined Apple sign-in feel
     ============================================================ */
  .auth-screen {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: var(--bg-base);
    background-image:
      radial-gradient(ellipse at 50% -10%, rgba(0,212,170,0.06) 0%, transparent 55%),
      radial-gradient(ellipse at 50% 110%, rgba(94,92,230,0.035) 0%, transparent 60%);
  }
  .auth-box {
    background: rgba(20,20,26,0.72);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-2xl);
    padding: 56px 44px;
    width: 420px; max-width: 90vw;
    box-shadow: var(--elev-3), inset 0 1px 0 rgba(255,255,255,0.05);
  }
  .auth-box h1 {
    font-size: var(--fs-md); font-weight: 600; color: var(--text-1);
    margin-bottom: 6px; text-align: center; letter-spacing: var(--ls-heading);
    text-transform: none; font-family: inherit;
  }
  .auth-box .subtitle {
    text-align: center; color: var(--text-3); font-size: var(--fs-sm);
    margin-bottom: 36px; letter-spacing: 0; text-transform: none; font-weight: 400;
  }
  .auth-box input {
    width: 100%; padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    color: var(--text-1); font-family: inherit;
    font-size: var(--fs-md); margin-bottom: 12px;
    outline: none; transition: var(--transition);
  }
  .auth-box input::placeholder { color: var(--text-4); }
  .auth-box input:hover { border-color: var(--hairline-strong); }
  .auth-box input:focus {
    border-color: var(--brand);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 4px var(--brand-tint);
  }
  .auth-btn {
    width: 100%; padding: 13px;
    background: var(--brand); color: var(--bg-base);
    border: none; border-radius: var(--r-md);
    font-weight: 600; font-size: var(--fs-md);
    cursor: pointer; transition: var(--transition);
    margin-top: 12px;
    letter-spacing: 0; text-transform: none; font-family: inherit;
  }
  .auth-btn:hover { background: var(--brand-2); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,212,170,0.25); }
  .auth-btn:active { transform: translateY(0); }
  .auth-toggle { text-align: center; margin-top: 16px; font-size: var(--fs-sm); color: var(--text-3); }
  .auth-toggle a { color: var(--brand); cursor: pointer; }
  .auth-error { color: var(--danger); font-size: var(--fs-sm); margin-bottom: 10px; text-align: center; }

  /* ============================================================
     TOPBAR
     ============================================================ */
  .topbar {
    background: rgba(0,0,0,0.62);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border-bottom: 1px solid var(--hairline);
    padding: 0 var(--s-6);
    height: 56px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: var(--z-nav);
  }
  .topbar-brand { display: flex; align-items: center; gap: 12px; }
  .topbar-brand h1 {
    font-size: var(--fs-md); font-weight: 600; color: var(--text-1);
    letter-spacing: var(--ls-heading); text-transform: none; font-family: inherit;
  }
  .topbar-brand span {
    font-size: var(--fs-xs); color: var(--text-3);
    letter-spacing: 0; text-transform: none; font-weight: 400;
  }
  .topbar-user { display: flex; align-items: center; gap: 16px; }
  .topbar-user .user-name { font-size: var(--fs-sm); font-weight: 500; color: var(--text-1); }
  .topbar-user .user-role { font-size: var(--fs-xs); text-transform: capitalize; letter-spacing: 0; color: var(--text-3); font-weight: 400; }
  .logout-btn {
    background: transparent; border: 1px solid var(--hairline); color: var(--text-2);
    padding: 7px 14px; border-radius: var(--r-sm);
    cursor: pointer; font-size: var(--fs-sm); font-family: inherit;
    transition: var(--transition);
  }
  .logout-btn:hover { border-color: var(--danger); color: var(--danger); background: rgba(255,69,58,0.06); }

  /* ============================================================
     SIDEBAR
     ============================================================ */
  .sidebar {
    position: fixed; left: 0; top: 56px; bottom: 0;
    width: 220px; background: rgba(10,10,12,0.6);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border-right: 1px solid var(--hairline);
    padding: var(--s-5) 0; overflow-y: auto;
    z-index: var(--z-sidebar); scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-section {
    font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-4); padding: var(--s-5) var(--s-5) var(--s-2);
    font-weight: 600; font-family: inherit;
  }
  .sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; margin: 1px 12px;
    font-size: var(--fs-base); font-weight: 500; color: var(--text-2);
    cursor: pointer; transition: var(--transition);
    border-radius: var(--r-sm); letter-spacing: 0;
    position: relative;
  }
  .sidebar-item:hover { color: var(--text-1); background: var(--surface); }
  .sidebar-item.active {
    color: var(--text-1); background: var(--surface-strong);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--hairline-strong);
  }
  .sidebar-item .item-icon {
    width: 18px; height: 18px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-3); transition: color var(--dur-base) var(--ease-spring);
  }
  .sidebar-item .item-icon svg { width: 18px; height: 18px; stroke-width: 1.75; }
  .sidebar-item:hover .item-icon { color: var(--text-2); }
  .sidebar-item.active .item-icon { color: var(--brand); }

  /* ============================================================
     MAIN LAYOUT
     ============================================================ */
  .main {
    margin-left: 220px; padding: var(--s-7) var(--s-7);
    min-height: calc(100vh - 56px); max-width: 1280px;
  }
  .page { display: none; }
  .page.active { display: block; animation: fadeUp var(--dur-slow) var(--ease-spring); }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .main > .page > h1 {
    color: var(--text-1); font-size: var(--fs-3xl); font-weight: 700;
    letter-spacing: var(--ls-display); margin-bottom: var(--s-6);
  }

  /* ============================================================
     CARDS — section dividers (existing pattern, refined)
     ============================================================ */
  .card {
    background: transparent; border: none;
    border-top: 1px solid var(--hairline);
    border-radius: 0;
    padding: var(--s-7) 0; margin-bottom: 0;
  }
  .card:first-child { border-top: none; padding-top: 0; }
  .card h2 {
    font-size: var(--fs-sm); font-weight: 600; color: var(--text-3);
    margin-bottom: var(--s-4); display: flex; align-items: center; gap: 8px;
    text-transform: none; letter-spacing: 0; font-family: inherit;
  }
  .card h2 .h2-icon { color: var(--brand); font-size: var(--fs-md); display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; }
  .card h2 .h2-icon svg { width: 16px; height: 16px; stroke-width: 1.75; }

  /* — Collapsible cards (design pass slice 2) ————————————————————————————
     Any .card whose DIRECT child is an h2/h3 folds when the header is
     clicked (chevron shows state). Collapsed titles persist per browser in
     localStorage — reps fold the sections they never use, once. Interactive
     elements inside headers (filters, selects, buttons) never toggle. */
  .card > h2, .card > h3 { cursor: pointer; -webkit-user-select: none; user-select: none; }
  .card > h2::before, .card > h3::before {
    content: ''; width: 7px; height: 7px; flex: 0 0 auto; display: inline-block;
    border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
    transform: rotate(45deg) translateY(-2px); margin-right: 6px;
    transition: transform var(--dur-fast) var(--ease-standard);
  }
  .card.ce-clps > h2::before, .card.ce-clps > h3::before { transform: rotate(-45deg); }
  .card.ce-clps > h2, .card.ce-clps > h3 { margin-bottom: 0; }
  .card.ce-clps > *:not(h2):not(h3) { display: none !important; }

  /* Dashboard grid */
  .dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--s-5); }
  @media (max-width: 1024px) { .dash-grid { grid-template-columns: 1fr; } }
  .dash-greeting { display: flex; align-items: baseline; gap: var(--s-3); }
  .dash-greeting .greet-time { font-size: var(--fs-md); color: var(--text-3); font-weight: 400; letter-spacing: 0; }

  /* ============================================================
     DAILY GOAL + STREAK
     Research: goal-gradient effect (Kivetz/Urminsky/Zheng 2006) —
     effort accelerates as a salient goal nears. Streaks weaponise
     loss aversion (Kahneman/Tversky 1979): losses hurt ~2x more
     than equivalent gains, so a visible chain you don't want to
     break is a stronger motivator than the same target without one.
     ============================================================ */
  .goal-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: var(--s-3); margin-bottom: var(--s-6);
  }
  @media (max-width: 768px) { .goal-grid { grid-template-columns: 1fr; } }
  .goal-tile {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: var(--s-4) var(--s-5);
    transition: var(--transition);
    position: relative; overflow: hidden;
  }
  .goal-tile:hover { border-color: var(--hairline-strong); }
  .goal-tile.complete {
    background: linear-gradient(135deg, rgba(48,209,88,0.10), var(--surface));
    border-color: rgba(48,209,88,0.30);
  }
  .goal-tile.streak-active {
    background: linear-gradient(135deg, rgba(255,159,10,0.10), var(--surface));
    border-color: rgba(255,159,10,0.30);
  }
  .goal-label {
    font-size: var(--fs-sm); color: var(--text-3); font-weight: 500;
    display: flex; align-items: center; gap: 6px;
  }
  .goal-label svg { width: 14px; height: 14px; stroke-width: 1.75; opacity: 0.7; }
  .goal-value {
    margin-top: 6px; font-size: var(--fs-3xl); font-weight: 600;
    color: var(--text-1); letter-spacing: var(--ls-display);
    font-variant-numeric: tabular-nums; line-height: 1.1;
  }
  .goal-value .goal-target { font-size: var(--fs-md); color: var(--text-3); font-weight: 400; margin-left: 4px; letter-spacing: 0; }
  .goal-bar {
    margin-top: 10px; height: 4px; background: var(--hairline);
    border-radius: var(--r-pill); overflow: hidden;
  }
  .goal-bar-fill {
    height: 100%; background: var(--brand);
    border-radius: var(--r-pill);
    transition: width var(--dur-slow) var(--ease-spring);
  }
  .goal-tile.complete .goal-bar-fill { background: var(--success); }
  .goal-meta { font-size: var(--fs-xs); color: var(--text-3); margin-top: 6px; }
  .goal-meta.urgent { color: var(--warning); font-weight: 500; }
  .streak-flame { color: var(--warning); }

  /* Page subtitle — sits under H1 to set context */
  .page-subtitle {
    font-size: var(--fs-md); color: var(--text-3);
    margin-top: calc(var(--s-6) * -1 + 4px);
    margin-bottom: var(--s-6);
    max-width: 65ch; line-height: 1.55;
  }
  /* Card helper text */
  .card-helper { font-size: var(--fs-base); color: var(--text-3); margin-bottom: var(--s-3); line-height: 1.5; }

  /* Adder total summary row */
  .adder-total-row {
    margin-top: var(--s-4); padding: 14px 16px;
    background: var(--bg-1);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    display: flex; justify-content: space-between; align-items: center;
  }
  .adder-total-label { font-size: var(--fs-base); color: var(--text-2); font-weight: 500; }
  .adder-total-val { font-size: var(--fs-xl); font-weight: 600; color: var(--warning); font-variant-numeric: tabular-nums; letter-spacing: var(--ls-display); }

  /* Right-aligned form actions */
  .form-actions { display: flex; gap: var(--s-3); justify-content: flex-end; padding-top: var(--s-5); }

  /* Glass card variant — for floating panels */
  .card-glass {
    background: rgba(20,20,26,0.6);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-xl);
    padding: var(--s-5);
    box-shadow: var(--elev-2), inset 0 1px 0 rgba(255,255,255,0.04);
  }

  /* ============================================================
     STATS GRID
     ============================================================ */
  .stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px; background: var(--hairline);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg); overflow: hidden;
    margin-bottom: var(--s-6);
  }
  .stat-card {
    background: var(--bg-base); padding: var(--s-5) var(--s-5);
    position: relative; overflow: hidden; transition: var(--transition);
  }
  .stat-card:hover { background: var(--surface-hover); }
  .stat-card::before { display: none; }
  .stat-card .stat-val {
    font-size: var(--fs-2xl); font-weight: 600; color: var(--text-1);
    font-family: inherit; letter-spacing: var(--ls-display);
    font-variant-numeric: tabular-nums;
  }
  .stat-card .stat-label {
    font-size: var(--fs-xs); text-transform: none; letter-spacing: 0;
    color: var(--text-3); font-weight: 500; margin-top: 6px; font-family: inherit;
  }
  .stat-card .stat-delta { font-size: var(--fs-sm); font-weight: 500; margin-top: 4px; }
  .stat-card .stat-up { color: var(--success); }
  .stat-card .stat-down { color: var(--danger); }

  /* ============================================================
     TABLES
     ============================================================ */
  table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
  th {
    text-align: left; padding: 12px 0;
    font-size: var(--fs-xs); text-transform: none; letter-spacing: 0;
    color: var(--text-3); font-weight: 600;
    border-bottom: 1px solid var(--hairline); font-family: inherit;
  }
  td {
    padding: 14px 0;
    border-bottom: 1px solid var(--hairline-subtle);
    color: var(--text-2);
  }
  tr { transition: background var(--dur-fast) var(--ease-standard); }
  tr:hover td { background: var(--surface); color: var(--text-1); }

  /* ============================================================
     STAGE BADGES — neutral hairline pills with status dot
     (Apple-style: hierarchy through subtle tint, not block color)
     ============================================================ */
  .stage-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 8px; border-radius: var(--r-pill);
    font-size: var(--fs-xs); font-weight: 500;
    text-transform: capitalize; letter-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--hairline);
    color: var(--text-2);
  }
  .stage-badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 999px;
    background: currentColor; opacity: 0.85;
  }
  .stage-new              { color: #79b8ff; }
  .stage-contact_attempted{ color: #a4caff; }
  .stage-warm             { color: var(--warning); }
  .stage-hot              { color: var(--danger); }
  .stage-cold             { color: var(--text-3); }
  .stage-appointment_set  { color: var(--success); }
  .stage-appointment_completed { color: var(--success); background: rgba(48,209,88,0.08); border-color: rgba(48,209,88,0.18); }
  .stage-proposal_sent    { color: #c084fc; }
  .stage-closed_won       { color: var(--success); background: rgba(48,209,88,0.10); border-color: rgba(48,209,88,0.22); }
  .stage-closed_lost      { color: var(--danger); }
  .stage-dead             { color: var(--text-4); }
  .stage-nurture          { color: var(--info); }

  /* ============================================================
     BUTTONS
     ============================================================ */
  .btn {
    padding: 8px 14px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    cursor: pointer; font-weight: 500; font-size: var(--fs-base);
    transition: var(--transition);
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--surface); color: var(--text-1);
    letter-spacing: 0; font-family: inherit;
    line-height: 1.2;
  }
  .btn:hover { border-color: var(--hairline-strong); background: var(--surface-hover); }
  .btn:active { transform: scale(0.97); }
  .btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
  .btn-sm { padding: 6px 11px; font-size: var(--fs-sm); }
  .btn-lg { padding: 12px 22px; font-size: var(--fs-md); }

  .btn-primary {
    background: var(--brand); border: 1px solid var(--brand); color: var(--bg-base);
    font-weight: 600; font-family: inherit;
    letter-spacing: 0; font-size: var(--fs-base); text-transform: none;
  }
  .btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,212,170,0.25); }
  .btn-primary:active { transform: translateY(0); }

  .btn-secondary { background: var(--surface-strong); border-color: var(--hairline-strong); color: var(--text-1); }
  .btn-secondary:hover { background: var(--surface-hover); }

  .btn-danger {
    background: transparent; border: 1px solid var(--danger); color: var(--danger);
  }
  .btn-danger:hover { background: var(--danger); border-color: var(--danger); color: white; transform: translateY(-1px); }

  .btn-outline { background: transparent; border-color: var(--hairline); color: var(--text-2); }
  .btn-outline:hover { border-color: var(--hairline-strong); color: var(--text-1); background: var(--surface); }

  /* Tinted button variants for disposition/status actions */
  .btn-success { background: rgba(48,209,88,0.12); border-color: rgba(48,209,88,0.30); color: var(--success); }
  .btn-success:hover { background: rgba(48,209,88,0.18); border-color: rgba(48,209,88,0.45); }
  .btn-warning { background: rgba(255,159,10,0.12); border-color: rgba(255,159,10,0.30); color: var(--warning); }
  .btn-warning:hover { background: rgba(255,159,10,0.18); border-color: rgba(255,159,10,0.45); }
  .btn-danger-soft { background: rgba(255,69,58,0.10); border-color: rgba(255,69,58,0.28); color: var(--danger); }
  .btn-danger-soft:hover { background: rgba(255,69,58,0.16); border-color: rgba(255,69,58,0.42); }
  .btn-accent { background: rgba(94,92,230,0.14); border-color: rgba(94,92,230,0.32); color: #a8a6ff; }
  .btn-accent:hover { background: rgba(94,92,230,0.20); border-color: rgba(94,92,230,0.48); }

  /* ============================================================
     STATUS PILL — for live/ready indicators (e.g. dialer status)
     ============================================================ */
  .status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 8px; border-radius: var(--r-pill);
    font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0;
    background: var(--surface); border: 1px solid var(--hairline);
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
  }
  .status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
  .status-pill.ready { color: var(--success); }
  .status-pill.live { color: var(--success); background: rgba(48,209,88,0.10); border-color: rgba(48,209,88,0.25); }
  .status-pill.live::before { animation: pulseDot 1.4s ease-in-out infinite; }
  .status-pill.warn { color: var(--warning); }
  .status-pill.error { color: var(--danger); }
  .status-pill.muted { color: var(--text-3); }

  /* ============================================================
     DIALER PANEL — premium call workspace
     ============================================================ */
  .dialer-panel {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    padding: var(--s-5);
    display: flex; flex-direction: column; gap: var(--s-4);
  }
  .dialer-header { display: flex; justify-content: space-between; align-items: center; }
  .dialer-header h2 { font-size: var(--fs-md); font-weight: 600; margin: 0; color: var(--text-1); }
  .dialer-header h2 .h2-icon { color: var(--brand); font-size: var(--fs-md); }
  .dialer-meta { display: flex; align-items: center; gap: 8px; }

  .dialer-quick {
    display: flex; gap: var(--s-2);
  }
  .dialer-quick input {
    flex: 1; padding: 11px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    color: var(--text-1); font-family: inherit;
    font-size: var(--fs-md); outline: none;
    transition: var(--transition);
    font-variant-numeric: tabular-nums;
  }
  .dialer-quick input::placeholder { color: var(--text-4); }
  .dialer-quick input:focus { border-color: var(--brand); background: rgba(255,255,255,0.06); box-shadow: 0 0 0 4px var(--brand-tint); }

  /* Active call tiles (the 3-line ringing display) */
  .call-tile {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-1);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    margin-bottom: 6px;
    transition: var(--transition);
  }
  .call-tile.connected { border-color: rgba(48,209,88,0.35); background: rgba(48,209,88,0.05); box-shadow: 0 0 0 3px rgba(48,209,88,0.06); }
  .call-tile.failed { opacity: 0.55; }
  .call-tile-name { font-weight: 600; font-size: var(--fs-base); color: var(--text-1); line-height: 1.2; }
  .call-tile-phone { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
  .call-tile-status { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
  .call-tile-status.ringing { color: var(--warning); }
  .call-tile-status.connected { color: var(--success); }
  .call-tile-status.ended { color: var(--text-4); }
  .call-tile-status.failed { color: var(--danger); }

  .dialer-section-label {
    font-size: var(--fs-xs); font-weight: 500; color: var(--text-3);
    text-transform: none; letter-spacing: 0;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
  }

  .disposition-panel {
    padding: var(--s-4);
    background: var(--bg-1);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-md);
  }
  .disposition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 6px;
  }
  /* Hick-Hyman: visible numeric hint cuts choice latency by giving
     the eye a stable target. Power users learn the keys; new users
     ignore them. */
  .disposition-grid .btn { position: relative; padding-left: 22px; }
  .disposition-grid .btn .kbd {
    position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
    font-size: 10px; font-weight: 600; line-height: 1;
    padding: 2px 5px; border-radius: 4px;
    background: rgba(255,255,255,0.06);
    color: var(--text-3); font-variant-numeric: tabular-nums;
    border: 1px solid var(--hairline);
  }
  .disposition-panel .dispo-hint {
    margin-top: 10px; font-size: var(--fs-xs); color: var(--text-4);
    text-align: right;
  }
  /* UI-1 (2026-08-01): alt-outcome variants for the disposition grid + transfer row.
     Replace inline `style="border-color:...;color:..."` so every button uses class-only
     styling. Colors match the ad-hoc inline values in warroom.js previously. */
  .btn-solar  { border-color: rgba(251,191,36,0.4); color: var(--warning); background: transparent; }
  .btn-nobill { border-color: rgba(139,92,246,0.4); color: #8b5cf6;         background: transparent; }
  .btn-renter { border-color: rgba(96,165,250,0.4); color: var(--info);     background: transparent; }
  .btn-dnc    { border-color: rgba(220,38,38,0.35); color: var(--danger);   background: rgba(220,38,38,0.07); width: 100%; margin-top: 8px; }
  .btn-warm-transfer { border-color: rgba(0,212,170,0.4);  color: var(--brand); background: rgba(0,212,170,0.15); }
  .btn-cold-transfer { border-color: rgba(139,92,246,0.4); color: #a78bfa;    background: rgba(139,92,246,0.15); }
  .btn-transfer-toggle { width: 100%; margin-top: 6px; font-size: 0.72rem; }
  .transfer-input-row { display: flex; gap: 6px; }
  .transfer-input-row input {
    flex: 1; padding: 5px 9px; font-size: 0.78rem;
    border: 1px solid var(--glass-border); border-radius: 6px;
    background: var(--bg3); color: var(--text-1);
  }
  #transfer-controls { margin-top: 8px; }


  .hangup-btn {
    width: 100%;
    padding: 14px;
    background: var(--danger); color: white;
    border: none; border-radius: var(--r-md);
    font-size: var(--fs-md); font-weight: 600;
    cursor: pointer; transition: var(--transition);
    margin-top: 10px;
    box-shadow: 0 4px 16px rgba(255,69,58,0.25);
  }
  .hangup-btn:hover { background: #d8392f; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,69,58,0.35); }
  .hangup-btn:active { transform: translateY(0); }
  .vm-skip-btn {
    width: 100%;
    padding: 10px 14px;
    background: rgba(251,191,36,0.10); color: #f59e0b;
    border: 1px solid rgba(251,191,36,0.35); border-radius: var(--r-md);
    font-size: var(--fs-sm); font-weight: 600;
    cursor: pointer; transition: var(--transition);
    margin-top: 6px;
  }
  .vm-skip-btn:hover { background: rgba(251,191,36,0.20); border-color: rgba(251,191,36,0.6); }

  /* ============================================================
     FORMS
     ============================================================ */
  .form-group { margin-bottom: var(--s-3); }
  .form-group label {
    display: block; font-size: var(--fs-sm);
    text-transform: none; letter-spacing: 0;
    color: var(--text-2); font-weight: 500; margin-bottom: 6px;
    font-family: inherit;
  }
  .form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 11px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    color: var(--text-1); font-family: inherit;
    font-size: var(--fs-md); outline: none; transition: var(--transition);
  }
  .form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-4); }
  .form-group input:hover, .form-group select:hover, .form-group textarea:hover { border-color: var(--hairline-strong); }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--brand);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 4px var(--brand-tint);
  }
  .form-group select { cursor: pointer; }
  .form-row { display: flex; gap: var(--s-3); }
  .form-row > .form-group { flex: 1; }

  /* ============================================================
     LEADERBOARD
     ============================================================ */
  .lb-row {
    display: flex; align-items: center; gap: var(--s-4);
    padding: 12px 14px;
    border-bottom: 1px solid var(--hairline-subtle);
    transition: var(--transition);
    margin: 0; border-radius: var(--r-sm);
  }
  .lb-row:hover { background: var(--surface); }
  .lb-row:first-child { background: rgba(255,214,10,0.02); }
  .lb-rank {
    font-size: var(--fs-lg); font-weight: 600;
    width: 32px; text-align: center; font-family: inherit;
    font-variant-numeric: tabular-nums;
  }
  .lb-rank.gold { color: var(--gold); }
  .lb-rank.silver { color: #c0c0c8; }
  .lb-rank.bronze { color: #cd7f32; }
  .lb-name { flex: 1; font-weight: 500; font-size: var(--fs-md); color: var(--text-1); }
  .lb-stat { font-family: inherit; font-weight: 600; font-size: var(--fs-md); color: var(--brand); font-variant-numeric: tabular-nums; }

  /* ============================================================
     CHAT
     ============================================================ */
  .chat-container {
    height: 320px; overflow-y: auto; padding: var(--s-4);
    background: var(--surface);
    border-radius: var(--r-lg);
    margin-bottom: var(--s-3);
    border: 1px solid var(--hairline);
    display: flex; flex-direction: column; gap: 8px;
  }
  .chat-msg { max-width: 76%; padding: 9px 14px; border-radius: 18px; font-size: var(--fs-base); line-height: 1.45; }
  .chat-msg.own { background: var(--brand); color: var(--bg-base); align-self: flex-end; border-bottom-right-radius: 4px; }
  .chat-msg.other { background: var(--surface-strong); color: var(--text-1); align-self: flex-start; border-bottom-left-radius: 4px; }
  .chat-msg .chat-sender { font-size: var(--fs-xs); font-weight: 600; color: var(--brand); margin-bottom: 2px; }
  .chat-msg.own .chat-sender { color: rgba(0,0,0,0.55); }
  .chat-msg.announcement {
    background: var(--accent-tint); border: 1px solid var(--accent);
    color: var(--text-1); align-self: stretch; max-width: 100%; text-align: center;
  }
  .chat-input-row { display: flex; gap: var(--s-2); }
  .chat-input-row input {
    flex: 1; padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md); color: var(--text-1);
    font-family: inherit; font-size: var(--fs-base); outline: none;
    transition: var(--transition);
  }
  .chat-input-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }

  /* ============================================================
     WAR ROOM
     ============================================================ */
  .warroom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }
  .warroom-tile {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    aspect-ratio: 4/3;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; transition: var(--transition);
  }
  .warroom-tile:hover { border-color: var(--hairline-strong); transform: translateY(-1px); box-shadow: var(--elev-2); }
  .warroom-tile video { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-md); }
  .warroom-tile .tile-name {
    position: absolute; bottom: 8px; left: 8px;
    background: rgba(0,0,0,0.72); backdrop-filter: var(--blur-sm);
    color: white; padding: 3px 10px; border-radius: var(--r-xs);
    font-size: var(--fs-xs); font-weight: 500;
  }
  .warroom-tile .tile-status { position: absolute; top: 10px; right: 10px; width: 10px; height: 10px; border-radius: 999px; }
  .warroom-tile .tile-status.on-call { background: var(--success); box-shadow: 0 0 0 4px rgba(48,209,88,0.18); }
  .warroom-tile .tile-status.idle { background: var(--warning); }
  .warroom-tile .tile-status.offline { background: var(--text-4); }
  .warroom-enter { text-align: center; padding: var(--s-8) var(--s-4); }
  .warroom-enter h2 { font-size: var(--fs-2xl); margin-bottom: var(--s-2); }
  .warroom-enter p { color: var(--text-3); margin-bottom: var(--s-5); font-size: var(--fs-md); }

  /* War Room workspace layout */
  .warroom-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--s-4);
    height: calc(100vh - 140px);
  }
  .warroom-main { display: flex; flex-direction: column; gap: var(--s-3); min-height: 0; }
  .warroom-video {
    flex: 1; min-height: 320px;
    border-radius: var(--r-xl); overflow: hidden;
    border: 1px solid var(--hairline);
    background: var(--bg-1);
    box-shadow: var(--elev-1);
  }
  .warroom-video iframe { width: 100%; height: 100%; border: none; display: block; background: var(--bg-1); }
  /* Discord-style channel switcher bar above the video grid */
  .warroom-channel-bar {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
    padding: 6px; margin-bottom: var(--s-2);
    background: var(--bg-1); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  }
  .warroom-channel-tabs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; }
  .warch-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 11px; font-size: 0.76rem; font-weight: 600; cursor: pointer;
    border-radius: var(--r-md); border: 1px solid transparent;
    background: transparent; color: var(--text-2); transition: all .12s;
  }
  .warch-tab:hover { background: var(--surface); color: var(--text-1); }
  .warch-tab.active {
    background: var(--brand, #06b6d4); color: #fff;
    border-color: var(--brand, #06b6d4);
  }
  .warch-count {
    font-size: 0.65rem; font-weight: 700; min-width: 16px; height: 16px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; background: rgba(0,0,0,0.25); color: inherit;
  }
  .warch-count:empty { display: none; }
  .warch-deafen {
    flex-shrink: 0; padding: 6px 12px; font-size: 0.76rem; font-weight: 600; cursor: pointer;
    border-radius: var(--r-md); border: 1px solid var(--hairline);
    background: var(--surface); color: var(--text-2); transition: all .12s;
  }
  .warch-deafen:hover { color: var(--text-1); }
  .warch-deafen.deafened {
    background: rgba(220,38,38,0.12); border-color: rgba(220,38,38,0.4); color: #f87171;
  }
  .warroom-aside {
    display: flex; flex-direction: column; gap: var(--s-3); min-height: 0;
  }
  .warroom-aside-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    padding: var(--s-4);
    display: flex; flex-direction: column; gap: var(--s-3);
  }
  .warroom-aside-card h2 {
    font-size: var(--fs-sm); font-weight: 600; color: var(--text-3);
    margin: 0; letter-spacing: 0; text-transform: none;
  }
  .warroom-aside-leads { flex: 1; overflow-y: auto; }
  .warroom-chat-compact { height: 140px; font-size: var(--fs-sm); }

  @media (max-width: 1024px) {
    .warroom-layout { grid-template-columns: 1fr; height: auto; }
    .warroom-aside { flex-direction: row; flex-wrap: wrap; }
    .warroom-aside-card { flex: 1 1 240px; }
  }

  /* War Room Picture-in-Picture — one persistent body-level video host. The Daily
     frame is NEVER re-parented (that would reload the iframe and drop the call);
     only CSS position/size changes between docked (overlaying the page slot) and
     floating PiP (a draggable corner window shown while the rep is on another tab). */
  #warroom-pip {
    position: fixed; display: none; overflow: hidden; background: var(--bg-1);
    border: 1px solid var(--hairline); box-shadow: var(--elev-1);
  }
  #warroom-pip.active { display: block; }
  #warroom-pip.docked { z-index: 50; border-radius: var(--r-xl); }
  #warroom-pip.pip {
    z-index: 1500; border-radius: var(--r-lg); border-color: var(--hairline-strong);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  }
  #warroom-pip #daily-sdk-container { position: absolute; inset: 0; }
  #warroom-pip.pip #daily-sdk-container { top: 30px; }
  #warroom-pip-header { display: none; }
  #warroom-pip.pip #warroom-pip-header {
    display: flex; align-items: center; gap: 8px;
    position: absolute; top: 0; left: 0; right: 0; height: 30px; z-index: 3;
    padding: 0 6px 0 10px; background: rgba(0,0,0,0.78); color: #fff;
    font-size: 0.72rem; font-weight: 600; cursor: move; user-select: none;
  }
  #warroom-pip-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #warroom-pip .pip-btn {
    flex-shrink: 0; width: 22px; height: 22px; display: inline-flex; align-items: center;
    justify-content: center; border: none; border-radius: 6px; cursor: pointer;
    background: rgba(255,255,255,0.14); color: #fff; font-size: 0.82rem; line-height: 1;
  }
  #warroom-pip .pip-btn:hover { background: rgba(255,255,255,0.30); }
  #warroom-pip .pip-btn.muted { background: var(--danger); }
  #warroom-pip-resize { display: none; }
  #warroom-pip.pip #warroom-pip-resize {
    display: block; position: absolute; right: 0; bottom: 0; width: 18px; height: 18px;
    z-index: 3; cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 45%, var(--hairline-strong) 45%, var(--hairline-strong) 55%, transparent 55%, transparent 70%, var(--hairline-strong) 70%, var(--hairline-strong) 80%, transparent 80%);
  }

  /* ============================================================
     PIPELINE BOARD
     ============================================================ */
  /* Pipeline is a fixed-height kanban — board scrolls horizontally at a
     constant position; each column body scrolls vertically on its own.
     Uses calc(100vh - topbar 56px - main padding ~80px - page header ~80px). */
  #page-pipeline { flex-direction: column; height: calc(100vh - 220px); }
  #page-pipeline.active { display: flex; }
  #page-pipeline > div:first-child { flex-shrink: 0; }
  .pipeline-scroll-bar {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 6px; margin-bottom: 10px; flex-shrink: 0;
  }
  .pipeline-scroll-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--surface-strong); border: 1px solid var(--hairline-strong);
    color: var(--text-2); cursor: pointer; font-size: 0.9rem;
    transition: background var(--dur-fast);
    user-select: none;
  }
  .pipeline-scroll-btn:hover { background: var(--surface-stronger); color: var(--text-1); }
  .pipeline-board {
    display: flex; gap: var(--s-3); overflow-x: auto; overflow-y: hidden;
    padding: 0 var(--s-2) var(--s-3);
    margin: 0 calc(var(--s-2) * -1);
    scrollbar-width: thin; scrollbar-color: var(--primary) transparent;
    flex: 1; /* fill remaining height so scrollbar is always at the bottom of visible area */
    align-items: flex-start;
  }
  .pipeline-board::-webkit-scrollbar { height: 6px; }
  .pipeline-board::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
  .pipeline-board::-webkit-scrollbar-track { background: transparent; }
  .pipeline-col {
    min-width: 248px; max-width: 280px; flex-shrink: 0;
    display: flex; flex-direction: column;
    max-height: 100%; /* stretch to board height so body can scroll */
  }
  .pipeline-col-header {
    padding: 12px 14px; border-radius: var(--r-md) var(--r-md) 0 0;
    font-size: var(--fs-base); font-weight: 600; text-transform: none;
    letter-spacing: 0; display: flex; justify-content: space-between; align-items: center;
    gap: 12px;
    background: var(--surface-strong);
    border: 1px solid var(--hairline-strong); border-bottom: none;
    color: var(--text-1);
    white-space: nowrap; overflow: hidden;
  }
  .pipeline-col-header > span:first-child {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .pipeline-col-header > span:first-child::before {
    content: ''; width: 8px; height: 8px; border-radius: 999px;
    background: var(--pipeline-dot, var(--text-3)); flex-shrink: 0;
  }
  .pipeline-col-header > span:last-child {
    font-size: var(--fs-sm); color: var(--text-3); font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .pipeline-col-body {
    background: var(--surface);
    border: 1px solid var(--hairline-strong); border-top: none;
    border-radius: 0 0 var(--r-md) var(--r-md);
    padding: var(--s-2); min-height: 120px;
    overflow-y: auto; flex: 1;
    scrollbar-width: thin; scrollbar-color: var(--text-4) transparent;
  }
  .pipeline-card {
    background: var(--bg-1);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    padding: 12px 14px; margin-bottom: 8px;
    cursor: pointer; transition: var(--transition);
  }
  .pipeline-card:hover {
    border-color: var(--hairline-strong); transform: translateY(-2px);
    box-shadow: var(--elev-2);
  }
  .pipeline-card .pc-name { font-weight: 600; font-size: var(--fs-base); color: var(--text-1); }
  .pipeline-card .pc-meta { font-size: var(--fs-sm); color: var(--text-3); margin-top: 4px; line-height: 1.5; }
  .pipeline-card[draggable="true"] { cursor: grab; }
  .pipeline-card[draggable="true"]:active { cursor: grabbing; }
  .pipeline-col.drag-over .pipeline-col-body {
    background: rgba(74, 144, 217, 0.08);
    border: 2px dashed var(--primary);
    border-radius: var(--r-md);
  }

  /* ============================================================
     MODAL
     ============================================================ */
  .modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    z-index: var(--z-modal);
    align-items: center; justify-content: center;
    animation: fadeIn var(--dur-base) var(--ease-standard);
  }
  .modal-overlay.show { display: flex; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  .modal {
    background: rgba(20,20,26,0.88);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-2xl);
    padding: var(--s-6);
    max-width: 520px; width: 90%; max-height: 85vh; overflow-y: auto;
    box-shadow: var(--elev-3), inset 0 1px 0 rgba(255,255,255,0.05);
    animation: scaleIn var(--dur-slow) var(--ease-spring);
  }
  @keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }
  .modal h2 { margin-bottom: var(--s-4); font-size: var(--fs-xl); font-weight: 600; }
  .modal-actions { display: flex; gap: var(--s-2); justify-content: flex-end; margin-top: var(--s-5); }

  /* ============================================================
     TOASTS — global notification + reward feedback
     Research: Skinner operant conditioning + variable reward
     schedules build habit loops. A small, occasional celebration
     on positive dispositions ("Appt set!") creates a dopamine
     micro-spike that compounds across thousands of calls.
     ============================================================ */
  #toast-stack {
    position: fixed; top: 76px; right: 20px;
    z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 40px));
  }
  .toast {
    pointer-events: auto;
    background: rgba(20,20,26,0.92);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-md);
    padding: 12px 16px;
    box-shadow: var(--elev-3);
    display: flex; align-items: flex-start; gap: 12px;
    color: var(--text-1); font-size: var(--fs-base);
    animation: toastIn var(--dur-slow) var(--ease-spring);
    transform-origin: top right;
  }
  .toast.toast-out { animation: toastOut var(--dur-base) var(--ease-standard) forwards; }
  @keyframes toastIn {
    from { opacity: 0; transform: translateX(20px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
  }
  @keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(20px) scale(0.96); }
  }
  .toast .toast-icon {
    width: 20px; height: 20px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px;
    background: var(--surface-strong);
  }
  .toast .toast-icon svg { width: 14px; height: 14px; stroke-width: 2; }
  .toast.toast-success .toast-icon { background: rgba(48,209,88,0.18); color: var(--success); }
  .toast.toast-info .toast-icon    { background: rgba(10,132,255,0.18); color: var(--info); }
  .toast.toast-warn .toast-icon    { background: rgba(255,159,10,0.18); color: var(--warning); }
  .toast.toast-error .toast-icon   { background: rgba(255,69,58,0.18); color: var(--danger); }
  .toast .toast-body { flex: 1; min-width: 0; }
  .toast .toast-title { font-weight: 600; font-size: var(--fs-base); line-height: 1.3; }
  .toast .toast-msg { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; line-height: 1.4; }
  .toast.toast-success { border-color: rgba(48,209,88,0.30); box-shadow: var(--elev-3), 0 0 24px rgba(48,209,88,0.15); }

  /* Subtle confetti-free celebration ping for big wins (appt set, deal). */
  .reward-burst {
    position: fixed; pointer-events: none;
    z-index: calc(var(--z-toast) - 1);
    width: 12px; height: 12px; border-radius: 999px;
    background: var(--success);
    animation: burst 700ms var(--ease-spring) forwards;
  }
  @keyframes burst {
    0%   { opacity: 0.9; transform: scale(0.6); }
    60%  { opacity: 0.4; transform: scale(8); }
    100% { opacity: 0; transform: scale(14); }
  }

  /* ============================================================
     SPEED-TO-LEAD BADGE
     Research: contacting a web lead within 5 minutes is ~9x more
     likely to qualify than waiting 30+ min (Oldroyd HBR 2011).
     ============================================================ */
  .fresh-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px 3px 7px;
    border-radius: var(--r-pill);
    background: rgba(255,69,58,0.12);
    border: 1px solid rgba(255,69,58,0.35);
    color: var(--danger);
    font-size: var(--fs-xs); font-weight: 600;
    text-transform: none; letter-spacing: 0;
    line-height: 1; white-space: nowrap;
  }
  .fresh-badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 999px;
    background: var(--danger);
    box-shadow: 0 0 0 0 rgba(255,69,58,0.55);
    animation: freshPulse 1.6s ease-in-out infinite;
  }
  @keyframes freshPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,69,58,0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(255,69,58,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,69,58,0); }
  }
  .queue-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--hairline-subtle);
    font-size: var(--fs-base);
  }
  .queue-row:last-child { border-bottom: none; }
  .queue-row.fresh {
    background: rgba(255,69,58,0.04);
    margin: 0 -8px; padding: 8px;
    border-radius: var(--r-sm);
    border-bottom-color: transparent;
  }
  .queue-row.queued-next { background: var(--brand-tint); margin: 0 -8px; padding: 8px; border-radius: var(--r-sm); border-bottom-color: transparent; }
  .queue-row .queue-rank { color: var(--text-3); font-size: var(--fs-sm); width: 20px; font-variant-numeric: tabular-nums; }
  .queue-row .queue-name { flex: 1; font-weight: 500; color: var(--text-1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .queue-row .queue-attempts { color: var(--text-3); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

  /* ============================================================
     UTILITIES
     ============================================================ */
  .skeleton {
    background: linear-gradient(90deg, var(--surface) 0%, var(--surface-hover) 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: skel 1.4s ease-in-out infinite;
    border-radius: var(--r-sm);
  }
  @keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
  .pulse-dot { animation: pulseDot 2s var(--ease-standard) infinite; }
  @keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
  @keyframes slideUpFade { from { opacity: 0; transform: translateX(-50%) translateY(16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
  .tabular { font-variant-numeric: tabular-nums; }

  /* ============================================================
     RESPONSIVE
     ============================================================ */

  /* Hamburger toggle — hidden on desktop */
  .hamburger-btn {
    display: none; background: transparent; border: 1px solid var(--hairline);
    border-radius: var(--r-sm); color: var(--text-2); cursor: pointer;
    width: 40px; height: 40px; align-items: center; justify-content: center;
    flex-shrink: 0; padding: 0; margin-right: 8px;
  }
  .hamburger-btn svg { width: 20px; height: 20px; }
  .hamburger-btn:active { background: var(--surface); }

  /* Mobile sidebar overlay backdrop */
  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.55); z-index: 89;
  }
  .sidebar-overlay.show { display: block; }

  @media (max-width: 1024px) {
    .sidebar { width: 200px; }
    .main { margin-left: 200px; padding: var(--s-6); }
  }

  /* ── TABLET (768px) ── */
  @media (max-width: 768px) {
    .hamburger-btn { display: flex; }

    /* Sidebar: off-screen by default, slides in with .mobile-open */
    .sidebar {
      width: 260px; transform: translateX(-100%);
      transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    }
    .sidebar.mobile-open { transform: translateX(0); }

    .main { margin-left: 0; padding: var(--s-5); max-width: 100%; }

    /* Topbar: compact */
    .topbar { padding: 0 var(--s-3); gap: 4px; }
    .topbar-brand span { display: none; }
    .topbar-brand h1 { font-size: var(--fs-sm); }
    #cmdk-trigger kbd, #cmdk-trigger span { display: none; }
    #view-as-banner, #view-as-switcher, #team-switcher { display: none !important; }
    .logout-btn { padding: 5px 10px; font-size: var(--fs-xs); }

    h1 { font-size: var(--fs-2xl); }
    .form-row { flex-direction: column; }

    /* Pipeline: horizontal scroll */
    .pipeline-board { flex-direction: row; overflow-x: auto; }
    .pipeline-col { min-width: 80vw; max-width: 88vw; }
    #page-pipeline { height: auto; }
    .pipeline-col-body { max-height: 60vh; }

    /* Tables: horizontal scroll wrapper */
    .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    #leads-table, #page-mycalls table { min-width: 800px; }

    /* Dialer: full-width, larger controls */
    .dialer-panel { border-radius: var(--r-md); }
    .dialer-quick { flex-direction: column; }
    .dialer-quick input { font-size: 16px; padding: 14px; }

    /* Buttons: 44px min touch target */
    .btn, .sidebar-item, select { min-height: 44px; }
    .sidebar-item { padding: 12px 16px; font-size: var(--fs-md); }

    /* Stats grid: 2 columns */
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .goal-grid { grid-template-columns: 1fr !important; }

    /* Settings cards: single column */
    .settings-card { margin-bottom: 12px; }

    /* Modals: full-width on mobile */
    .modal { max-width: 96%; width: 96%; padding: var(--s-4); border-radius: var(--r-lg); }
  }

  /* ── PHONE (480px) ── */
  @media (max-width: 480px) {
    .main { padding: var(--s-3); }
    h1 { font-size: var(--fs-xl); }
    .topbar-brand h1 { font-size: var(--fs-xs); letter-spacing: 0.04em; }

    /* Single-column stats */
    .stats-grid { grid-template-columns: 1fr !important; }

    /* Buttons: even larger touch targets */
    .btn { min-height: 48px; padding: 12px 16px; font-size: 15px; }
    .btn-sm { min-height: 44px; padding: 10px 14px; }

    /* Dialer: large dial/hangup */
    .dialer-panel .btn { min-height: 52px; font-size: 16px; font-weight: 600; }
    .call-tile { padding: 14px; }
    .call-tile-name { font-size: var(--fs-md); }

    /* Screen pop: full bleed */
    .sp-overlay { top: 0; border-left: none; border-radius: 0; }
    .sp-header { padding: 16px; }

    /* Table text */
    table th, table td { font-size: var(--fs-xs); padding: 8px 6px; }

    /* Settings: tighter */
    .card { padding: var(--s-3); border-radius: var(--r-md); }

    /* Notification bell: bigger tap area */
    #notif-bell { padding: 10px; }

    /* Form inputs: prevent iOS zoom (must be ≥16px) */
    input, select, textarea { font-size: 16px; }
  }

/* ── RECRUITER STYLES ── */
/* RECRUITER — Conversation Viewer Panel (mirrors screen pop premium) */
.rcv-panel {
  position: fixed; top: 56px; right: 0; bottom: 0;
  width: 420px;
  background: rgba(10,10,12,0.78);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-left: 1px solid var(--hairline-strong);
  z-index: 150;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-spring);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: -16px 0 60px rgba(0,0,0,0.45);
}
.rcv-panel.show { transform: translateX(0); }
.rcv-header {
  padding: 14px 20px; border-bottom: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.rcv-header h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text-1); font-family: inherit; text-transform: none; letter-spacing: 0; }
.rcv-close {
  background: transparent; border: 1px solid var(--hairline); color: var(--text-3);
  cursor: pointer; width: 28px; height: 28px; border-radius: var(--r-pill);
  font-size: 1.05rem; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.rcv-close:hover { color: var(--text-1); border-color: var(--hairline-strong); background: var(--surface); }
.rcv-applicant { padding: 16px 20px; border-bottom: 1px solid var(--hairline); flex-shrink: 0; }
.rcv-applicant-name { font-size: var(--fs-xl); font-weight: 600; color: var(--text-1); letter-spacing: var(--ls-heading); }
.rcv-applicant-phone { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.rcv-applicant-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 500; text-transform: capitalize; margin-top: 8px;
  background: var(--brand-tint); color: var(--brand); border: 1px solid rgba(0,212,170,0.25);
  font-family: inherit; letter-spacing: 0;
}
.rcv-messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.rcv-msg { max-width: 84%; padding: 9px 14px; border-radius: 18px; font-size: var(--fs-base); line-height: 1.45; }
.rcv-msg.outbound { background: var(--brand); color: var(--bg-base); align-self: flex-end; border-bottom-right-radius: 4px; }
.rcv-msg.inbound { background: var(--surface-strong); color: var(--text-1); align-self: flex-start; border-bottom-left-radius: 4px; }
.rcv-msg-time { font-size: var(--fs-xs); color: var(--text-3); margin-top: 3px; }
.rcv-msg.outbound .rcv-msg-time { text-align: right; color: rgba(0,0,0,0.45); }
.rcv-empty { color: var(--text-3); text-align: center; padding: 40px; font-size: var(--fs-base); }
.rcv-takeover { padding: 14px 20px; border-top: 1px solid var(--hairline); flex-shrink: 0; background: rgba(0,0,0,0.25); }
.rcv-takeover-label { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; margin-bottom: 6px; font-family: inherit; letter-spacing: 0; text-transform: none; }
.rcv-takeover-row { display: flex; gap: 8px; }
.rcv-takeover-input {
  flex: 1; padding: 9px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md); color: var(--text-1);
  font-family: inherit; font-size: var(--fs-base); outline: none;
  transition: var(--transition);
}
.rcv-takeover-input::placeholder { color: var(--text-4); }
.rcv-takeover-input:focus { border-color: var(--brand); background: rgba(255,255,255,0.06); box-shadow: 0 0 0 4px var(--brand-tint); }
.rcv-takeover-btn {
  padding: 9px 16px; background: var(--brand); color: var(--bg-base);
  border: 1px solid var(--brand); border-radius: var(--r-md);
  cursor: pointer; font-size: var(--fs-base); font-weight: 600;
  transition: var(--transition); font-family: inherit;
}
.rcv-takeover-btn:hover { background: var(--brand-2); }

/* INTERVIEW CALENDAR */
.ical-container { margin-top: var(--s-5); }
.ical-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-4); }
.ical-nav { display: flex; gap: 8px; align-items: center; }
.ical-nav-btn {
  padding: 6px 14px; background: transparent;
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  cursor: pointer; color: var(--text-2); font-size: var(--fs-base);
  transition: var(--transition); font-family: inherit;
}
.ical-nav-btn:hover { border-color: var(--hairline-strong); color: var(--text-1); background: var(--surface); }
.ical-month { font-size: var(--fs-md); font-weight: 600; color: var(--text-1); min-width: 180px; text-align: center; letter-spacing: var(--ls-heading); }
.ical-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; }
.ical-day-header {
  background: var(--bg-1); padding: 8px; text-align: center;
  font-size: var(--fs-xs); text-transform: none; letter-spacing: 0;
  color: var(--text-3); font-family: inherit; font-weight: 500;
}
.ical-day { background: var(--bg-base); padding: 8px; min-height: 88px; cursor: pointer; transition: background var(--dur-fast) var(--ease-standard); }
.ical-day:hover { background: var(--surface); }
.ical-day.other-month { opacity: 0.32; }
.ical-day.today { background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.ical-day-num { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.ical-event {
  padding: 3px 6px; border-radius: 4px;
  font-size: var(--fs-xs); font-weight: 500;
  margin-bottom: 2px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ical-event.booked { background: var(--accent-tint); color: #a8a6ff; border-left: 2px solid var(--accent); }
.ical-event.confirmed { background: var(--brand-tint); color: var(--brand); border-left: 2px solid var(--brand); }
.ical-event.completed { background: rgba(48,209,88,0.08); color: var(--success); border-left: 2px solid var(--success); }
.ical-event.no_show { background: rgba(255,69,58,0.10); color: var(--danger); border-left: 2px solid var(--danger); }
.ical-event.cancelled { background: var(--surface); color: var(--text-3); border-left: 2px solid var(--text-3); text-decoration: line-through; }
.ical-upcoming { margin-top: var(--s-4); }
.ical-upcoming-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--hairline-subtle); }
.ical-upcoming-item:last-child { border: none; }
.ical-upcoming-time { font-family: inherit; font-size: var(--fs-base); font-weight: 600; color: var(--brand); min-width: 70px; font-variant-numeric: tabular-nums; }
.ical-upcoming-name { font-weight: 500; font-size: var(--fs-md); color: var(--text-1); }
.ical-upcoming-meta { font-size: var(--fs-sm); color: var(--text-3); }
.ical-upcoming-status select {
  padding: 5px 10px; font-size: var(--fs-sm);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); color: var(--text-1); font-family: inherit;
}

/* ── MESSAGES / CONVERSATION STYLES ── */
.conv-container{display:flex;height:calc(100vh - 60px);background:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif}
.conv-threads{width:360px;border-right:1px solid #e0e0e0;display:flex;flex-direction:column;background:#fafafa}
.conv-threads-header{padding:16px;border-bottom:1px solid #e0e0e0;background:#fff}
.conv-threads-header h3{margin:0 0 12px;font-size:18px;color:#1a1a2e}
.conv-search{width:100%;padding:8px 12px;border:1px solid #ddd;border-radius:20px;font-size:14px;outline:none;box-sizing:border-box}
.conv-search:focus{border-color:#4a90d9}
.conv-thread-list{flex:1;overflow-y:auto}
.conv-thread{display:flex;align-items:center;padding:12px 16px;cursor:pointer;border-bottom:1px solid #f0f0f0;transition:background .15s}
.conv-thread:hover{background:#f0f4ff}
.conv-thread.active{background:#e8f0fe}
.conv-thread-avatar{width:44px;height:44px;border-radius:50%;background:#4a90d9;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:16px;flex-shrink:0}
.conv-thread-info{flex:1;margin-left:12px;min-width:0}
.conv-thread-top{display:flex;justify-content:space-between;align-items:center}
.conv-thread-name{font-weight:600;font-size:14px;color:#1a1a2e}
.conv-thread-time{font-size:11px;color:#999;flex-shrink:0}
.conv-thread-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:2px}
.conv-thread-preview{font-size:13px;color:#666;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px}
.conv-thread-unread{width:10px;height:10px;border-radius:50%;background:#4a90d9;flex-shrink:0;margin-left:8px}
.conv-stage-badge{font-size:10px;padding:2px 6px;border-radius:10px;font-weight:600;margin-left:8px;white-space:nowrap}
.stage-new{background:#e3f2fd;color:#1565c0}.stage-contacted{background:#fff3e0;color:#e65100}
.stage-qualified{background:#e8f5e9;color:#2e7d32}.stage-appointment{background:#f3e5f5;color:#7b1fa2}
.stage-proposal{background:#fff8e1;color:#f57f17}.stage-sold{background:#e8f5e9;color:#1b5e20}
.stage-dead{background:#fce4ec;color:#c62828}.stage-dq{background:#efebe9;color:#4e342e}

.conv-messages{flex:1;display:flex;flex-direction:column;background:#fff}
.conv-messages-header{padding:16px;border-bottom:1px solid #e0e0e0;display:flex;justify-content:space-between;align-items:center}
.conv-messages-header h3{margin:0;font-size:16px;color:#1a1a2e}
.conv-actions-btn{padding:6px 12px;background:#f5f5f5;border:1px solid #ddd;border-radius:6px;cursor:pointer;font-size:13px}
.conv-actions-btn:hover{background:#e8e8e8}
.conv-msg-list{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column}
.conv-msg-empty{display:flex;align-items:center;justify-content:center;height:100%;color:#999;font-size:15px}
.conv-date-divider{text-align:center;margin:16px 0 8px;font-size:12px;color:#999;position:relative}
.conv-date-divider span{background:#fff;padding:0 12px;position:relative;z-index:1}
.conv-date-divider::before{content:'';position:absolute;left:0;right:0;top:50%;border-top:1px solid #e0e0e0}

.conv-bubble-wrap{display:flex;margin-bottom:2px;max-width:75%}
.conv-bubble-wrap.outbound{align-self:flex-end;justify-content:flex-end}
.conv-bubble-wrap.inbound{align-self:flex-start}
.conv-bubble{padding:8px 14px;border-radius:18px;font-size:14px;line-height:1.4;word-wrap:break-word;max-width:100%}
.conv-bubble.outbound{background:#4a90d9;color:#fff;border-bottom-right-radius:4px}
.conv-bubble.inbound{background:#f0f0f0;color:#1a1a2e;border-bottom-left-radius:4px}
.conv-bubble-wrap.outbound.first .conv-bubble{border-top-right-radius:18px;border-bottom-right-radius:4px}
.conv-bubble-wrap.outbound.middle .conv-bubble{border-top-right-radius:4px;border-bottom-right-radius:4px}
.conv-bubble-wrap.outbound.last .conv-bubble{border-top-right-radius:4px;border-bottom-right-radius:18px}
.conv-bubble-wrap.inbound.first .conv-bubble{border-top-left-radius:18px;border-bottom-left-radius:4px}
.conv-bubble-wrap.inbound.middle .conv-bubble{border-top-left-radius:4px;border-bottom-left-radius:4px}
.conv-bubble-wrap.inbound.last .conv-bubble{border-top-left-radius:4px;border-bottom-left-radius:18px}
.conv-bubble-time{font-size:10px;color:#999;margin-top:2px;text-align:right}
.conv-bubble-wrap.inbound .conv-bubble-time{text-align:left}
.conv-bubble-status{font-size:10px;margin-left:4px}
.conv-bubble-status.sent{color:rgba(255,255,255,0.7)}
.conv-bubble-status.failed{color:#ff6b6b}

.conv-compose{padding:12px 16px;border-top:1px solid #e0e0e0;background:#fff}
.conv-compose-row{display:flex;align-items:flex-end;gap:8px}
.conv-compose-input{flex:1;resize:none;border:1px solid #ddd;border-radius:20px;padding:8px 16px;font-size:14px;font-family:inherit;outline:none;max-height:120px;overflow-y:auto;line-height:1.4}
.conv-compose-input:focus{border-color:#4a90d9}
.conv-send-btn{width:36px;height:36px;border-radius:50%;background:#4a90d9;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:16px}
.conv-send-btn:hover{background:#3a7bc8}
.conv-send-btn:disabled{background:#ccc;cursor:not-allowed}
.conv-compose-meta{display:flex;justify-content:space-between;align-items:center;margin-top:4px;padding:0 4px}
.conv-segment-counter{font-size:11px;color:#999}
.conv-segment-counter.warn{color:#f5a623}
.conv-segment-counter.danger{color:#e74c3c}
.conv-templates-btn{font-size:12px;color:#4a90d9;cursor:pointer;background:none;border:none;padding:0}
.conv-templates-btn:hover{text-decoration:underline}

.conv-templates-dropdown{position:absolute;bottom:100%;left:0;right:0;background:#fff;border:1px solid #ddd;border-radius:8px;box-shadow:0 -4px 12px rgba(0,0,0,0.1);max-height:300px;overflow-y:auto;z-index:10;display:none}
.conv-templates-dropdown.show{display:block}
.conv-template-item{padding:10px 16px;cursor:pointer;border-bottom:1px solid #f0f0f0;font-size:13px}
.conv-template-item:hover{background:#f0f4ff}
.conv-template-item strong{display:block;font-size:12px;color:#4a90d9;margin-bottom:2px}

.conv-toast{position:fixed;top:20px;right:20px;background:#1a1a2e;color:#fff;padding:12px 20px;border-radius:8px;font-size:13px;z-index:9999;cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,0.3);animation:slideIn .3s ease}
@keyframes slideIn{from{transform:translateX(100%);opacity:0}to{transform:translateX(0);opacity:1}}

.conv-quick-actions{padding:12px 16px;border-top:1px solid #e0e0e0;background:#fafafa;display:none}
.conv-quick-actions.show{display:flex;gap:8px;flex-wrap:wrap}
.conv-qa-btn{padding:6px 12px;border:1px solid #ddd;border-radius:6px;background:#fff;cursor:pointer;font-size:12px}
.conv-qa-btn:hover{background:#4a90d9;color:#fff;border-color:#4a90d9}

.conv-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:9999;display:flex;align-items:center;justify-content:center}
.conv-modal{background:#fff;border-radius:12px;padding:24px;min-width:320px;max-width:480px;box-shadow:0 8px 32px rgba(0,0,0,0.2)}
.conv-modal h4{margin:0 0 16px;font-size:16px;color:#1a1a2e}
.conv-modal select,.conv-modal input,.conv-modal textarea{width:100%;padding:8px 12px;border:1px solid #ddd;border-radius:6px;font-size:14px;margin-bottom:12px;box-sizing:border-box}
.conv-modal-btns{display:flex;gap:8px;justify-content:flex-end}
.conv-modal-btns button{padding:8px 16px;border-radius:6px;cursor:pointer;font-size:13px}
.conv-modal-cancel{background:#f5f5f5;border:1px solid #ddd}
.conv-modal-save{background:#4a90d9;color:#fff;border:none}

@media(max-width:768px){
.conv-threads{width:100%;position:absolute;left:0;top:0;bottom:0;z-index:2;transition:transform .3s}
.conv-threads.hidden{transform:translateX(-100%)}
.conv-messages{width:100%}
.conv-back-btn{display:inline-block;margin-right:8px;cursor:pointer;font-size:18px}
}
@media(min-width:769px){.conv-back-btn{display:none}}

/* ── WORKFLOW STYLES ── */
.wf-container{padding:24px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif}
.wf-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.wf-header h2{font-size:22px;color:#1a1a2e;margin:0}
.wf-create-btn{padding:10px 20px;background:#4a90d9;color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:14px;font-weight:600}
.wf-create-btn:hover{background:#3a7bc8}
.wf-tabs{display:flex;gap:4px;margin-bottom:20px;border-bottom:2px solid #e0e0e0}
.wf-tab{padding:10px 20px;cursor:pointer;font-size:14px;color:#666;border-bottom:2px solid transparent;margin-bottom:-2px}
.wf-tab.active{color:#4a90d9;border-bottom-color:#4a90d9;font-weight:600}
.wf-tab:hover{color:#4a90d9}
.wf-search{padding:8px 14px;border:1px solid #ddd;border-radius:8px;font-size:14px;width:300px;margin-bottom:16px}
.wf-table{width:100%;border-collapse:collapse;background:#fff;border-radius:8px;overflow:hidden;border:1px solid #e0e0e0}
.wf-table th{text-align:left;padding:12px 16px;background:#fafafa;font-size:12px;color:#666;border-bottom:1px solid #e0e0e0}
.wf-table td{padding:12px 16px;font-size:14px;border-bottom:1px solid #f0f0f0}
.wf-table tr:hover{background:#f8f9ff}
.wf-name{font-weight:600;color:#4a90d9;cursor:pointer}
.wf-name:hover{text-decoration:underline}
.wf-trigger-badge{padding:3px 10px;border-radius:12px;font-size:11px;font-weight:600}
.wf-trigger-badge.lead_created{background:#e3f2fd;color:#1565c0}
.wf-trigger-badge.stage_changed{background:#f3e5f5;color:#7b1fa2}
.wf-trigger-badge.tag_added{background:#e8f5e9;color:#2e7d32}
.wf-trigger-badge.inbound_sms{background:#fff3e0;color:#e65100}
.wf-trigger-badge.manual{background:#efebe9;color:#4e342e}
.wf-toggle{position:relative;width:44px;height:24px;cursor:pointer}
.wf-toggle input{display:none}
.wf-toggle-slider{position:absolute;top:0;left:0;right:0;bottom:0;background:#ccc;border-radius:12px;transition:.3s}
.wf-toggle-slider::before{content:'';position:absolute;height:18px;width:18px;left:3px;bottom:3px;background:#fff;border-radius:50%;transition:.3s}
.wf-toggle input:checked+.wf-toggle-slider{background:#4a90d9}
.wf-toggle input:checked+.wf-toggle-slider::before{transform:translateX(20px)}
.wf-actions-cell{display:flex;gap:4px}
.wf-action-btn{padding:4px 10px;border:1px solid #ddd;border-radius:4px;cursor:pointer;font-size:12px;background:#fff}
.wf-action-btn:hover{background:#f0f4ff}
.wf-action-btn.delete{color:#e74c3c;border-color:#e74c3c}
.wf-action-btn.delete:hover{background:#fce4ec}

/* Modal */
.wf-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:9999;display:flex;align-items:center;justify-content:center}
.wf-modal{background:#fff;border-radius:12px;padding:0;width:90%;max-width:700px;max-height:85vh;overflow-y:auto;box-shadow:0 8px 32px rgba(0,0,0,0.2)}
.wf-modal-header{padding:20px 24px;border-bottom:1px solid #e0e0e0;display:flex;justify-content:space-between;align-items:center}
.wf-modal-header h3{margin:0;font-size:18px;color:#1a1a2e}
.wf-modal-close{font-size:24px;cursor:pointer;color:#999;background:none;border:none}
.wf-modal-body{padding:24px}
.wf-form-group{margin-bottom:16px}
.wf-form-group label{display:block;font-size:13px;font-weight:600;color:#333;margin-bottom:4px}
.wf-form-group input,.wf-form-group select,.wf-form-group textarea{width:100%;padding:8px 12px;border:1px solid #ddd;border-radius:6px;font-size:14px;box-sizing:border-box}
.wf-form-group textarea{resize:vertical;min-height:80px}
.wf-modal-footer{padding:16px 24px;border-top:1px solid #e0e0e0;display:flex;justify-content:flex-end;gap:8px}
.wf-modal-footer button{padding:8px 20px;border-radius:6px;cursor:pointer;font-size:14px}
.wf-btn-cancel{background:#f5f5f5;border:1px solid #ddd;color:#333}
.wf-btn-save{background:#4a90d9;border:none;color:#fff;font-weight:600}
.wf-btn-save:hover{background:#3a7bc8}

/* Steps */
.wf-steps-header{display:flex;justify-content:space-between;align-items:center;margin:20px 0 12px}
.wf-steps-header h4{margin:0;font-size:15px;color:#1a1a2e}
.wf-add-step-btn{padding:6px 14px;background:#e8f5e9;color:#2e7d32;border:1px solid #a5d6a7;border-radius:6px;cursor:pointer;font-size:13px}
.wf-step-card{display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid #e0e0e0;border-radius:8px;margin-bottom:8px;background:#fafafa}
.wf-step-icon{width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0}
.wf-step-icon.send_sms{background:#e3f2fd;color:#1565c0}
.wf-step-icon.wait{background:#fff3e0;color:#e65100}
.wf-step-icon.change_stage{background:#f3e5f5;color:#7b1fa2}
.wf-step-icon.add_tag{background:#e8f5e9;color:#2e7d32}
.wf-step-icon.remove_tag{background:#fce4ec;color:#c62828}
.wf-step-icon.notify_rep{background:#fff8e1;color:#f57f17}
.wf-step-icon.condition{background:#efebe9;color:#4e342e}
.wf-step-info{flex:1}
.wf-step-type{font-weight:600;font-size:13px;color:#1a1a2e}
.wf-step-summary{font-size:12px;color:#666;margin-top:2px}
.wf-step-actions{display:flex;gap:4px}
.wf-step-btn{width:28px;height:28px;border:1px solid #ddd;border-radius:4px;cursor:pointer;background:#fff;font-size:14px;display:flex;align-items:center;justify-content:center}
.wf-step-btn:hover{background:#f0f4ff}
.wf-step-btn.del:hover{background:#fce4ec;color:#c62828}

/* Stats */
.wf-stats{display:flex;gap:16px;margin-bottom:20px;flex-wrap:wrap}
.wf-stat-card{background:#fff;border:1px solid #e0e0e0;border-radius:8px;padding:16px 24px;text-align:center;min-width:140px}
.wf-stat-val{font-size:28px;font-weight:700;color:#1a1a2e}
.wf-stat-label{font-size:12px;color:#666;margin-top:4px}

.wf-empty{text-align:center;padding:60px;color:#999;font-size:15px}

/* ── SCREEN POP STYLES ── */
/* SCREEN POP — premium right-rail lead profile */
.sp-overlay {
  position: fixed; top: 56px; right: 0; bottom: 0;
  width: 400px;
  background: rgba(10,10,12,0.78);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-left: 1px solid var(--hairline-strong);
  z-index: 150;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-spring);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: -16px 0 60px rgba(0,0,0,0.45);
}
.sp-overlay.show { transform: translateX(0); }
.sp-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.sp-header h3 {
  margin: 0; font-size: var(--fs-md); font-weight: 600;
  color: var(--text-1); font-family: inherit;
  text-transform: none; letter-spacing: 0;
}
.sp-close {
  background: transparent; border: 1px solid var(--hairline);
  color: var(--text-3); cursor: pointer;
  width: 28px; height: 28px; border-radius: var(--r-pill);
  font-size: 1.05rem; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.sp-close:hover { color: var(--text-1); border-color: var(--hairline-strong); background: var(--surface); }
.sp-body { flex: 1; overflow-y: auto; padding: 0; }
.sp-section { padding: 18px 20px; border-bottom: 1px solid var(--hairline); }
.sp-section:last-child { border-bottom: none; }
.sp-section-title {
  font-size: var(--fs-xs); text-transform: none; letter-spacing: 0;
  color: var(--text-3); font-weight: 500; font-family: inherit;
  margin-bottom: 10px;
}
.sp-name {
  font-size: 28px; font-weight: 700;
  color: var(--text-1); margin-bottom: 6px;
  letter-spacing: -0.01em; line-height: 1.15;
}
.sp-stage { display: inline-flex; margin-top: 6px; }
.sp-contact { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-base); color: var(--text-2); }
.sp-contact-row { display: inline-flex; align-items: center; gap: 8px; }
.sp-contact-row svg { width: 14px; height: 14px; stroke-width: 1.75; color: var(--text-3); flex-shrink: 0; }
/* UI-3 (2026-08-01): phone number as monospace tabular so digits line up across rows;
   current-number badge is a pill so it reads at a glance. */
.sp-phone {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 15px; color: var(--text-1); letter-spacing: 0.01em;
}
.sp-alt-label { font-size: 0.6rem; color: var(--text-3); font-weight: 500; }
.sp-current-badge {
  display: inline-flex; align-items: center;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 10px; text-transform: uppercase;
  background: rgba(48,209,88,0.14); color: var(--success);
  border: 1px solid rgba(48,209,88,0.35);
}
.sp-hints { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.sp-hint {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 9px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--hairline-subtle);
  font-size: var(--fs-xs); color: var(--text-3);
  line-height: 1.35;
}
.sp-hint svg { width: 13px; height: 13px; stroke-width: 1.85; flex-shrink: 0; }
.sp-hint-time { color: var(--text-2); border-color: rgba(48,209,88,0.20); background: rgba(48,209,88,0.04); }
.sp-hint-time svg { color: var(--success); }
.sp-hint-time strong { color: var(--text-1); font-weight: 600; }
.sp-hint-warn { color: var(--warning); border-color: rgba(255,159,10,0.25); background: rgba(255,159,10,0.05); }
.sp-score {
  font-family: inherit; font-size: var(--fs-2xl); font-weight: 600;
  color: var(--brand); letter-spacing: var(--ls-display);
  font-variant-numeric: tabular-nums;
}
.sp-score-label {
  font-size: var(--fs-xs); text-transform: none; letter-spacing: 0;
  color: var(--text-3); margin-top: 2px;
}
.sp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md); overflow: hidden;
}
.sp-grid-item { background: var(--bg-base); padding: 10px 12px; }
.sp-grid-label {
  font-size: var(--fs-xs); text-transform: none; letter-spacing: 0;
  color: var(--text-3); font-family: inherit;
}
.sp-grid-val { font-size: var(--fs-base); color: var(--text-1); margin-top: 2px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sp-history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--hairline-subtle);
  font-size: var(--fs-base);
}
.sp-history-item:last-child { border: none; }
.sp-history-type {
  color: var(--text-3); font-size: var(--fs-xs);
  text-transform: capitalize; letter-spacing: 0;
}
.sp-history-result { font-weight: 500; text-transform: capitalize; }
.sp-sms-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline-subtle);
  font-size: var(--fs-base);
}
.sp-sms-item:last-child { border: none; }
.sp-sms-dir {
  font-size: var(--fs-xs); text-transform: capitalize; letter-spacing: 0;
  font-weight: 600; margin-bottom: 2px;
}
.sp-sms-dir.inbound { color: var(--info); }
.sp-sms-dir.outbound { color: var(--brand); }
.sp-sms-msg { color: var(--text-2); line-height: 1.45; }
.sp-sms-time { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.tl-item { display:flex;gap:10px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,0.04); }
.tl-icon { width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:0.82rem; }
.tl-icon-call { background:rgba(59,130,246,0.12); }
.tl-icon-sms { background:rgba(16,185,129,0.12); }
.tl-icon-appt { background:rgba(251,191,36,0.12); }
.tl-icon-dispo { background:rgba(168,85,247,0.12); }
.tl-body { flex:1;min-width:0; }
.tl-meta { font-size:0.7rem;color:var(--text-3);margin-top:2px; }
.settings-tab { padding:6px 14px;border-radius:6px;border:1px solid var(--glass-border);background:transparent;color:var(--text-2);cursor:pointer;font-size:0.78rem;font-weight:600;transition:all .15s; }
.settings-tab.active { background:var(--primary);color:#111;border-color:var(--primary); }
.settings-tab:hover:not(.active) { background:rgba(255,255,255,0.06); }
.mycalls-row { display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid rgba(255,255,255,0.04);font-size:0.8rem; }
.mycalls-row:hover { background:rgba(255,255,255,0.02); }
.myset-card { padding:12px 16px;border:1px solid var(--glass-border);border-radius:10px;background:var(--glass);margin-bottom:8px; }
.myset-status { display:inline-block;padding:2px 8px;border-radius:4px;font-size:0.7rem;font-weight:700;text-transform:uppercase; }
.myset-status-pending { background:rgba(251,191,36,0.15);color:#f59e0b; }
.myset-status-sat { background:rgba(16,185,129,0.15);color:#10b981; }
.myset-status-closed { background:rgba(59,130,246,0.15);color:#3b82f6; }
.myset-status-canceled,.myset-status-no_show { background:rgba(239,68,68,0.15);color:#ef4444; }
#smart-refresh-banner { position:fixed;top:0;left:0;right:0;z-index:99999;background:#f59e0b;color:#111;padding:10px 16px;text-align:center;font-weight:700;font-size:0.9rem;display:flex;align-items:center;justify-content:center;gap:10px; }
#smart-refresh-banner button { padding:4px 14px;border-radius:6px;border:none;cursor:pointer;font-weight:700;font-size:0.8rem;background:#111;color:#f59e0b; }
.sp-notes { font-size: var(--fs-base); color: var(--text-2); line-height: 1.55; white-space: pre-wrap; }
.sp-actions {
  padding: 14px 20px;
  border-top: 1px solid var(--hairline);
  display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0;
  background: rgba(0,0,0,0.25);
}
.sp-btn {
  padding: 7px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--fs-sm); font-weight: 500;
  background: var(--surface); color: var(--text-1);
  transition: var(--transition);
  text-transform: none; letter-spacing: 0; font-family: inherit;
}
.sp-btn:hover { border-color: var(--hairline-strong); background: var(--surface-hover); }
.sp-btn.primary {
  background: var(--brand); border-color: var(--brand); color: var(--bg-base);
  font-weight: 600;
}
.sp-btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.sp-quick-sms-input {
  flex: 1; padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  color: var(--text-1); font-family: inherit;
  font-size: var(--fs-base); outline: none; transition: var(--transition);
}
.sp-quick-sms-input::placeholder { color: var(--text-4); }
.sp-quick-sms-input:focus { border-color: var(--brand); background: rgba(255,255,255,0.06); box-shadow: 0 0 0 4px var(--brand-tint); }
.sp-empty { color: var(--text-3); font-size: var(--fs-sm); font-style: italic; }
@media (max-width: 768px) { .sp-overlay { width: 100%; } }

/* ── Option A Feature #12 (2026-07-31): styled data-tooltip system ─────────
   Replaces browser-default title= popups with a proper CSS-only tooltip:
   dark background, white text, rounded, arrow pointer, positioned above.
   Applied by _fillButtonTooltips() in dialer.js — it migrates title= →
   data-tooltip= and generates from text/aria for buttons without either.
   Pure CSS so it works on dynamically-injected buttons without extra JS. */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 26, 0.98);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.35;
  white-space: nowrap;
  max-width: 320px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease-out;
  z-index: 10000;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}
[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(20, 20, 26, 0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease-out;
  z-index: 10000;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before {
  opacity: 1;
}
/* Wrap long tooltips instead of overflowing the viewport. */
[data-tooltip][data-tooltip-wrap]::after,
[data-tooltip-long]::after {
  white-space: normal;
  min-width: 200px;
  text-align: left;
}
/* Auto-flip: when the button is near the top of the viewport, tooltip goes below. */
[data-tooltip-below]::after {
  bottom: auto;
  top: calc(100% + 8px);
}
[data-tooltip-below]::before {
  bottom: auto;
  top: calc(100% + 3px);
  border-top-color: transparent;
  border-bottom-color: rgba(20, 20, 26, 0.98);
}

/* ── War Room UI pass (2026-08-01) ────────────────────────────────────────
   Three focused cleanups: extracted repeated inline styles, normalized
   the rtc-* call control buttons, and added a prominent unified call-state
   pill that renders one obvious status during an active call. */

/* Repeated tile pattern from stat cards (was 6× inline). */
.wr-stat-tile {
  text-align: center;
  padding: 8px 4px;
  background: var(--bg-2, rgba(255,255,255,0.04));
  border-radius: 8px;
  border: 1px solid var(--hairline-subtle);
}
.wr-stat-tile-label {
  font-size: 0.62rem;
  color: var(--text-3);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.wr-stat-tile-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Small toolbar pill (was 3× inline). Used for Numbers/Health/DNC nav buttons. */
.wr-toolbar-btn {
  padding: 3px 9px;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--bg3);
  color: var(--text3);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.wr-toolbar-btn:hover { color: var(--text-1); }
.wr-toolbar-btn.danger {
  border-color: rgba(220,38,38,0.35);
  background: rgba(220,38,38,0.07);
  color: var(--danger);
}

/* Empty/placeholder message (was 3× inline). */
.wr-empty { color: var(--text-3); font-size: 0.75rem; text-align: center; padding: 8px; }

/* Coach action button (👂/🗣️/🔊 in the active-reps row — was 2× inline). */
.wr-coach-btn {
  padding: 2px 6px;
  font-size: 0.66rem;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.wr-coach-btn.danger {
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.07);
  color: var(--danger);
}

/* Card title/header (was 2× inline). */
.wr-panel-title { font-size: 0.82rem; letter-spacing: 0.02em; font-weight: 700; }

/* ── UI-B: Call-control toolbar buttons (rtc-*) ─────────────────────────
   Unified style for Mute / Hold / Keypad. Matches other btn variants:
   consistent padding, border, hover feedback, active state. */
.call-control-btn {
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--bg3);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.call-control-btn:hover  { background: var(--surface-hover); color: var(--text-1); border-color: var(--hairline-strong); }
.call-control-btn.active { background: var(--brand-tint, rgba(6,182,212,0.14)); color: var(--brand, #06b6d4); border-color: rgba(6,182,212,0.35); }
.call-control-btn.danger { background: rgba(239,68,68,0.1); color: var(--danger); border-color: rgba(239,68,68,0.4); }

/* ── UI-C: Prominent unified call-state pill ─────────────────────────────
   One big status indicator that renders when an active call exists. Sits at
   the top of the active-calls area. Replaces the small fragmented pills
   (dialer-status + predictive-status) during a call so the rep always knows
   the call state at a glance. */
.call-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.call-state-pill .csp-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}
.call-state-idle       { color: var(--text-3);     background: rgba(255,255,255,0.04); border-color: var(--hairline); }
.call-state-ringing    { color: var(--warning);    background: rgba(234,179,8,0.10);  border-color: rgba(234,179,8,0.4); }
.call-state-ringing .csp-dot { animation: csp-pulse 1s ease-in-out infinite; }
.call-state-connected  { color: var(--success);    background: rgba(34,197,94,0.10);  border-color: rgba(34,197,94,0.4); }
.call-state-connected .csp-dot { animation: csp-glow 2s ease-in-out infinite; }
.call-state-dispo      { color: var(--info,#7dd3fc); background: rgba(56,189,248,0.10); border-color: rgba(56,189,248,0.4); }
.call-state-wrap       { color: #c084fc;           background: rgba(192,132,252,0.10); border-color: rgba(192,132,252,0.4); }
.call-state-ended      { color: var(--danger);     background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.35); }
@keyframes csp-pulse { 0%,100% { opacity: 0.4; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes csp-glow  { 0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.35); } 50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); } }

/* ═══════════════════════════════════════════════════════════════════════════
   War Room UI rewrite (2026-08-02, off-hours full pass)
   ──────────────────────────────────────────────────────────────────────────
   Design goal: VICIdial-clean but modern. Top status bar, middle tabbed
   content, bottom call controls, right sidebar collapsible.

   Approach: this layer sits ON TOP of the existing DOM and reshapes it via
   wrapper classes + tab visibility rules. Every existing ID stays put so
   the JS layer keeps working.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout containers ─────────────────────────────────────────────────── */
.wr-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.wr-shell.wr-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr) 44px;
}
.wr-main-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* ── TOP: unified status bar ──────────────────────────────────────────── */
.wr-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  flex-wrap: wrap;
}
.wr-top-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.wr-top-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand, #06b6d4), var(--info, #7dd3fc));
  display: inline-flex; align-items: center; justify-content: center;
  color: #0a0a0d; font-weight: 800; font-size: 0.82rem;
}
.wr-top-name {
  font-weight: 700; font-size: 0.9rem; color: var(--text-1);
  letter-spacing: -0.01em; white-space: nowrap;
}
.wr-top-role {
  font-size: 0.66rem; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.wr-top-status-slot { display: inline-flex; align-items: center; gap: 8px; }
.wr-top-actions {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.wr-top-timer {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem; font-weight: 700; color: var(--success, #22c55e);
  background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.3);
  border-radius: 999px;
}

/* ── MIDDLE: tabbed content shell ─────────────────────────────────────── */
.wr-panel {
  background: var(--bg-1);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  overflow: hidden;
}
.wr-tab-bar {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 6px 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-2, rgba(255,255,255,0.02));
  overflow-x: auto;
}
.wr-tab {
  padding: 8px 14px;
  font-size: 0.78rem; font-weight: 600;
  border: 1px solid transparent; border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: transparent; color: var(--text-3);
  cursor: pointer; white-space: nowrap;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.wr-tab:hover { color: var(--text-1); background: var(--surface-hover); }
.wr-tab.active {
  color: var(--text-1);
  background: var(--bg-1);
  border-color: var(--hairline);
  border-bottom-color: var(--bg-1);
  position: relative; top: 1px;
}
.wr-tab-badge {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px; font-size: 0.6rem; font-weight: 700;
  border-radius: 10px; background: var(--brand, #06b6d4); color: #0a0a0d;
}
.wr-tab-panel {
  padding: 14px 16px;
  min-height: 200px;
}
.wr-tab-panel[hidden] { display: none; }

/* ── BOTTOM: call controls bar ────────────────────────────────────────── */
.wr-call-controls {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg-1);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  flex-wrap: wrap;
}
.wr-cc-group {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 6px;
}
.wr-cc-group + .wr-cc-group {
  border-left: 1px solid var(--hairline);
}
.wr-cc-hotkeys {
  margin-left: auto;
  font-size: 0.66rem; color: var(--text-3);
  letter-spacing: 0.04em;
}
.wr-cc-hotkeys kbd {
  display: inline-block; padding: 1px 5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6rem; font-weight: 700;
  background: rgba(255,255,255,0.06); color: var(--text-2);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  margin: 0 2px;
}

/* ── RIGHT SIDEBAR: admin panel, collapsible ──────────────────────────── */
.wr-sidebar {
  display: flex; flex-direction: column; gap: 10px;
  background: transparent;
  transition: transform 0.2s ease;
}
.wr-shell.wr-sidebar-collapsed .wr-sidebar > .wr-sidebar-card { display: none; }
.wr-sidebar-toggle {
  position: sticky; top: 8px;
  align-self: flex-end;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-1); color: var(--text-2);
  cursor: pointer; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.wr-sidebar-toggle:hover { background: var(--surface-hover); color: var(--text-1); }
.wr-sidebar-card {
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.wr-sidebar-card > h2 {
  font-size: 0.72rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 8px 0;
}

/* ── Collapsible cards (details/summary substitute) ───────────────────── */
.wr-collapse {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-2, rgba(255,255,255,0.02));
}
.wr-collapse-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.74rem; font-weight: 600; color: var(--text-2);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.wr-collapse-header:hover { background: var(--surface-hover); }
.wr-collapse[open] .wr-collapse-header { border-bottom-color: var(--hairline); }
.wr-collapse-header::after {
  content: '▸'; font-size: 0.7rem; color: var(--text-3);
  transition: transform 0.12s;
}
.wr-collapse[open] .wr-collapse-header::after { transform: rotate(90deg); }
.wr-collapse-body { padding: 10px 12px; display: none; }
.wr-collapse[open] .wr-collapse-body { display: block; }

/* ── Utility rows for grouping small controls ─────────────────────────── */
.wr-inline-row  { display: inline-flex; align-items: center; gap: 6px; }
.wr-inline-row.gap-sm { gap: 4px; }
.wr-inline-row.gap-lg { gap: 12px; }
.wr-flex-col { display: flex; flex-direction: column; gap: 6px; }

/* ── Responsive: mobile stacks the sidebar below the main column ─────── */
@media (max-width: 900px) {
  .wr-shell { grid-template-columns: 1fr; }
  .wr-sidebar-toggle { display: none; }
}

/* ── Loading / error states for panels ────────────────────────────────── */
.wr-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 24px; color: var(--text-3); font-size: 0.8rem;
  gap: 8px;
}
.wr-loading::before {
  content: ''; width: 14px; height: 14px;
  border: 2px solid var(--hairline);
  border-top-color: var(--brand, #06b6d4);
  border-radius: 50%;
  animation: wr-spin 0.9s linear infinite;
}
@keyframes wr-spin { to { transform: rotate(360deg); } }
.wr-error {
  padding: 12px 14px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 8px;
  color: var(--danger); font-size: 0.78rem;
}

/* ── Kill remaining inline-style drift on retained sections ───────────── */
/* Prior CSS pass added .wr-toolbar-btn / .call-control-btn / .call-state-pill / etc. */

/* Toolbar row spacer used by the header — replaces flex+gap inline styles */
.wr-header-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* Section labels inside the dialer panel — replaces ad-hoc `.dialer-section-label` bumps. */
.wr-section-label {
  font-size: 0.66rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 4px 0 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

/* ── War Room CSS pass 2 (2026-08-02) — replace remaining inline-style repeats ── */

/* From-number row (was inline flex+gap+font-size on 3 elements). */
.wr-call-from-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px; margin-bottom: 2px;
}
.wr-call-from-label {
  font-size: 0.7rem; color: var(--text-3); white-space: nowrap;
}
.wr-call-from-select {
  flex: 1; font-size: 0.72rem;
  padding: 3px 6px; border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--bg3); color: var(--text-2);
  cursor: pointer;
}

/* Lead autocomplete dropdown (was inline positioned dropdown, z-index, shadow). */
.wr-lead-autocomplete {
  display: none; position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--bg2, #1e1e2e);
  border: 1px solid var(--hairline, rgba(255,255,255,0.1));
  border-radius: 8px;
  z-index: 999;
  max-height: 220px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  margin-top: 4px;
}
.wr-quick-input-wrap { position: relative; flex: 1; }

/* Warm-leads toggle (was ad-hoc inline pill). */
.wr-toggle-pill {
  padding: 3px 10px; font-size: 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--bg3); color: var(--text-3);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.wr-toggle-pill:hover { color: var(--text-1); background: var(--surface-hover); }
.wr-toggle-pill.active { background: var(--brand-tint, rgba(6,182,212,0.14)); color: var(--brand); border-color: rgba(6,182,212,0.35); }

/* VM status row (was inline flex + colors). */
.wr-vm-status-row {
  font-size: 0.7rem; color: var(--text-3);
  margin: -6px 0 4px;
  display: flex; align-items: center; gap: 4px;
}
.wr-vm-status-row .wr-vm-name  { color: var(--text-2); }
.wr-vm-status-row .wr-vm-change { color: var(--accent); text-decoration: none; font-size: 0.68rem; }

/* Manager dial-speed slider row (was inline padding + background). */
.wr-dial-speed {
  margin: -2px 0 6px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 7px;
}
.wr-dial-speed-row {
  display: flex; align-items: center; gap: 8px;
}
.wr-dial-speed-label {
  font-size: 0.68rem; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.wr-dial-speed-slider { flex: 1; accent-color: var(--brand); }
.wr-dial-speed-val {
  font-size: 0.78rem; font-weight: 600; color: var(--brand);
  min-width: 28px; text-align: right;
  font-variant-numeric: tabular-nums;
}

/* In-call notepad card (was inline padding + border + bg on the wrapper + label). */
.wr-notepad-card {
  display: none; margin-top: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
}
.wr-card-label {
  font-size: 0.68rem; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 6px;
}
.wr-notepad-input {
  width: 100%; box-sizing: border-box;
  padding: 7px 9px; font-size: 0.78rem;
  background: var(--bg3);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-1);
  resize: vertical; font-family: inherit;
}

/* Call script (collapsible talk-track). */
.wr-script-card { display: none; margin-top: 10px; }
.wr-script-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.wr-script-header .wr-card-label { margin-bottom: 0; }
.wr-script-toggle {
  background: none; border: none;
  color: var(--text-3); font-size: 0.72rem; cursor: pointer;
}
.wr-script-body {
  font-size: 0.78rem; color: var(--text-2); line-height: 1.55;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  white-space: pre-wrap;
  max-height: 200px; overflow-y: auto;
}

/* Aside card header (was 2 places had inline flex on the h2). */
.warroom-aside-card h2 { display: flex; align-items: center; justify-content: space-between; }
.wr-aside-count {
  font-size: 0.68rem; font-weight: 500; color: var(--text-3);
}
.wr-aside-live-badge {
  font-size: 0.65rem; font-weight: 500; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.04em; margin-left: 4px;
}

/* Video-participants + active-reps loading text (was 4 inline copies of a "Waiting…" line). */
.wr-aside-placeholder {
  font-size: 0.75rem; color: var(--text-3);
}
.wr-aside-list {
  display: flex; flex-direction: column; gap: 6px; min-height: 32px;
}

/* Dial queue container (was inline max-height + overflow). */
.wr-dial-queue { max-height: 160px; overflow-y: auto; }

/* Dial queue count inline label */
.wr-queue-count {
  font-weight: 400; color: var(--text-3); font-size: 0.72rem;
}

/* Dialer quick input (was inline width:100%; box-sizing) */
.wr-quick-input {
  width: 100%; box-sizing: border-box;
}
