/* CEO Command Center — 2-Tab Architecture & Juiced Visual Polish (Aqua / Day / Night)
   Preserves every OWNER-RULES layout law (L1 >= 16px inset, L2 16px gutters, exact AQUIS slot alignment across
   all rows, transparent Pipeline River & Map plate, shared blur(3px) glass material, desktop zero-page-scroll). */

/* ==========================================================================
   1. TOP BAR 2-TAB SWITCHER (Command | AI Team) + SINGLE-LINE FIT + NO OVERFLOW
   ========================================================================== */
/* Theme-color source on <html> so Chrome/Safari/iPadOS top chrome matches Aqua, Day, and Night live */
:root, :root[data-theme="aqua"] { --iovo-theme-top: #034859; }
:root[data-theme="light"] { --iovo-theme-top: #f5f7f9; }
:root[data-theme="dark"] { --iovo-theme-top: #0a0705; }
html[data-theme="aqua"] { background-color: #034859 !important; }
html[data-theme="light"] { background-color: #f5f7f9 !important; }
html[data-theme="dark"] { background-color: #0a0705 !important; }

/* Never allow closed Display Settings dialog to appear over signed-out or dashboard UI */
dialog.ceo-visual-settings:not([open]) { display: none !important; }

/* Signed-out / Error State Card — Centered, High-Contrast, Unmissable Sign-In Button */
html body #main > #state:not([hidden]) {
  position: relative;
  z-index: 25;
  margin: auto;
  max-width: 480px;
  padding: 36px 32px;
  border-radius: 22px;
  background: var(--ceo-reading-plane, #062d36);
  border: 1px solid color-mix(in srgb, var(--platform-accent, #5ce6f2) 38%, transparent);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
html body #main > #state:not([hidden]) h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  color: var(--platform-ink, #eef9fc);
}
html body #main > #state:not([hidden]) p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--platform-muted, #9ec3d0);
}
html body #main > #state:not([hidden]) .primary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 28px;
  margin-top: 8px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #03202b;
  background: linear-gradient(135deg, #b8fbff 0%, #52e3ec 100%);
  box-shadow: 0 6px 24px rgba(82, 227, 236, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  text-decoration: none;
}
html[data-theme="light"] body #main > #state:not([hidden]) .primary {
  color: #ffffff;
  background: linear-gradient(135deg, #0b88a3 0%, #076b82 100%);
}
html[data-theme="dark"] body #main > #state:not([hidden]) .primary {
  color: #160a02;
  background: linear-gradient(135deg, #ffca8a 0%, #f48628 100%);
}

@media (min-width: 1280px) {
  /* Frame #12: Align top bar right edge flush with all 4 content rows below (ending cleanly before the AQUIS slot). */
  html:root body .top[data-no-world-launcher] {
    margin: var(--ceo-m) calc(var(--ceo-m) + var(--slot-w)) 0 var(--ceo-m) !important;
    gap: 8px !important;
    padding: 0 12px !important;
    overflow: hidden;
  }
  html body .top .brand { flex: 1 1 132px; min-width: 0; gap: 8px; overflow: hidden; }
  /* Frame #6: Clean circular transparent IOVO mark — zero dark box or square halo */
  html body .top .brand .logo {
    width: 32px !important;
    height: 32px !important;
    flex: none;
    background: transparent !important;
    border: 0 !important;
    border-radius: 50% !important;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(64, 232, 248, 0.34));
  }
  html[data-theme="light"] body .top .brand .logo { filter: drop-shadow(0 1px 4px rgba(10, 110, 140, 0.22)); }
  html[data-theme="dark"] body .top .brand .logo { filter: drop-shadow(0 0 8px rgba(255, 166, 92, 0.28)); }
  html body .top .ttl { min-width: 0; overflow: hidden; }
  html body .top .ttl b { font-size: 14px !important; white-space: nowrap; display: block; overflow: hidden; text-overflow: ellipsis; }
  html body .top .tools { gap: 5px !important; flex: 0 1 auto; min-width: 0; overflow: hidden; }
  html body .top .when { font-size: 10.5px; gap: 4px; flex: 0 1 auto; min-width: 0; }
  html body .top .when b { font-size: 10.5px; white-space: nowrap; }
  html body .top .live { padding: 0 7px; font-size: 11px; flex: none; }
  html body .top .seg button { padding: 0 6px; font-size: 11px; min-width: 28px; }
  html body .top .iovo-sea-seg--themes button { min-width: 34px; padding: 4px 6px; font-size: 11px; }
  html body .top #ceo-visual-settings { white-space: nowrap; font-size: 11px; padding: 0 9px; flex: none; height: 30px; }
  html body .top .ceo-account-trigger { padding: 0 7px 0 4px; flex: none; max-width: 118px; }
}
@media (min-width: 1280px) and (max-width: 1620px) {
  html body .top .ttl b { font-size: 13px !important; }
  html body .top .when { display: none; }
  html body .top .live { display: none; }
  html body .top .ceo-tab { padding: 5px 10px; font-size: 11.5px; }
  html body .top #ceo-visual-settings { font-size: 10.5px; padding: 0 8px; }
}
/* Clean circular logo on narrow/tablet screens too */
html body .brand .logo { background: transparent !important; border: 0 !important; border-radius: 50% !important; object-fit: contain; }
/* Inline SVG trend arrows (replaces Unicode arrows that rendered as blue emoji squares on iPadOS) */
.trend-arr { display: inline-block; vertical-align: -1px; flex: none; }
.trend-arr.tri { vertical-align: 0; margin-right: 1px; }
/* Keep #aquis and #ceo-dive (moved into #dash > .foot by ceo-platform.js) visible on Tab 2 while collapsing #dash height to 0 */
html[data-ceo-tab="ai-team"] body #main > #dash,
html[data-ceo-tab="ai-team"] body #main > #dash > .foot {
  display: contents !important;
}
html[data-ceo-tab="ai-team"] body #main > #dash > :not(.foot),
html[data-ceo-tab="ai-team"] body #main > #dash > .foot > :not(#aquis):not(#ceo-dive) {
  display: none !important;
}

.ceo-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(3, 18, 28, 0.56);
  border: 1px solid color-mix(in srgb, var(--platform-accent, #5ce6f2) 24%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin: 0 auto;
  flex: none;
}
html[data-theme="light"] .ceo-tabs {
  background: rgba(232, 244, 248, 0.78);
  border-color: rgba(12, 118, 142, 0.22);
}
html[data-theme="dark"] .ceo-tabs {
  background: rgba(14, 10, 7, 0.72);
  border-color: rgba(255, 166, 92, 0.28);
}

.ceo-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--platform-muted, #8eb9c8);
  font: 600 12.5px/1 var(--font, Inter, system-ui, sans-serif);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.ceo-tab:hover { color: var(--platform-ink, #eef9fc); }
.ceo-tab.is-active {
  color: #03202b;
  background: linear-gradient(135deg, #b8fbff 0%, #52e3ec 100%);
  box-shadow: 0 0 16px rgba(82, 227, 236, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
html[data-theme="light"] .ceo-tab.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #0b88a3 0%, #076b82 100%);
  box-shadow: 0 3px 12px rgba(7, 107, 130, 0.28);
}
html[data-theme="dark"] .ceo-tab.is-active {
  color: #160a02;
  background: linear-gradient(135deg, #ffca8a 0%, #f48628 100%);
  box-shadow: 0 0 16px rgba(244, 134, 40, 0.42);
}

.ceo-tab-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(5, 30, 42, 0.24);
}
.ceo-tab:not(.is-active) .ceo-tab-badge {
  color: #79ffd9;
  background: rgba(52, 245, 197, 0.14);
}
.ceo-tab-badge > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}
.ceo-tab.is-active .ceo-tab-badge > i {
  background: #047857;
  box-shadow: 0 0 6px rgba(4, 120, 87, 0.7);
}
.ceo-tab-badge.is-idle > i {
  background: currentColor;
  opacity: 0.45;
  box-shadow: none;
}

@media (max-width: 1279px) {
  .ceo-tabs { order: 3; width: 100%; justify-content: center; margin-top: 6px; }
  .ceo-tab { flex: 1 1 0; justify-content: center; }
}

/* ==========================================================================
   2. TAB 1 (COMMAND) — SURGICAL BUG FIXES + VISUAL JUICE
   ========================================================================== */

/* FIX #1: Header icon chips — override inline --ic-size:24px so glyph sits centered inside 24/28px rounded box */
@media (min-width: 1280px) {
  html body #main .card .ch > .ico,
  html body #main .ach > .ic-badge {
    display: inline-grid !important;
    place-items: center !important;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px color-mix(in srgb, var(--platform-accent, #5ce6f2) 34%, transparent), 0 0 10px color-mix(in srgb, var(--platform-accent, #5ce6f2) 16%, transparent);
  }
  html body #main .card .ch > .ico .ic,
  html body #main .ach > .ic-badge .ic {
    --ic-size: 16px !important;
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 1 !important;
  }
}
@media (min-width: 1280px) and (max-height: 940px) {
  html body #main .card .ch > .ico .ic,
  html body #main .ach > .ic-badge .ic {
    --ic-size: 14px !important;
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
  }
}
html body #main .kband .kpi.pv .kic {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
}
html body #main .kband .kpi.pv .kic .ic {
  --ic-size: 13px !important;
  font-size: 13px !important;
  width: 13px !important;
  height: 13px !important;
}

/* FIX #2: Clean, legible, non-colliding KPI cards (Frame #6):
   - Value + inline SVG trend badge on the left; crisp sparkline seated on the right (NEVER behind text!)
   - Single-line readable subtitle (.d) + IOVO Office native ledger subline (.kn) cleanly below with zero overlap/clipping
   - Uniform height across populated & empty cards (passes ceo-money-cards.test.mjs & Law L1 >= 16px inset) */
html body #main .kband .kpi.pv .kpi-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  min-width: 0;
}
html body #main .kband .kpi.pv .kpi-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
html body #main .kband .kpi.pv .kpi-val-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
html body #main .kband .kpi.pv .kpi-chg {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--good, #3ddc97);
  background: color-mix(in srgb, var(--good, #3ddc97) 14%, transparent);
}
html body #main .kband .kpi.pv .kpi-chg.dn {
  color: var(--bad, #ff6b6b);
  background: color-mix(in srgb, var(--bad, #ff6b6b) 14%, transparent);
}
html body #main .kband .kpi.pv .kpi-chg.w {
  color: var(--warn, #ffbb3d);
  background: color-mix(in srgb, var(--warn, #ffbb3d) 14%, transparent);
}
html body #main .kband .kpi.pv svg.spark {
  display: block !important;
  position: static !important;
  flex: 0 0 88px;
  width: 88px;
  height: 28px;
  opacity: 0.92;
  pointer-events: none;
}
html body #main .kband .kpi.pv svg.spark.flat { opacity: 0.34; }

@media (min-width: 1280px) {
  html body #main .kband .kpi.pv {
    height: 114px;
    min-height: 114px;
    padding: 16px var(--r4-pad);
    align-items: stretch;
    justify-content: center;
    text-align: left;
    gap: 3px;
    overflow: hidden;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
  }
  html body #main .kband .kpi.pv:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--platform-accent, #5ce6f2) 55%, transparent);
    box-shadow: var(--platform-shadow), 0 0 18px color-mix(in srgb, var(--platform-accent, #5ce6f2) 18%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }
  html body #main .kband .kpi.pv .lab {
    justify-content: flex-start;
    padding-right: 22px;
    font-size: 13px;
    line-height: 1.15;
  }
  html body #main .kband .kpi.pv .v,
  html body #main .kband .kpi.pv .v.none {
    text-align: left;
    font-size: 26px;
    line-height: 1.05;
  }
  html body #main .kband .kpi.pv .v.none { font-size: 20px; }
  html body #main .kband .kpi.pv .d {
    text-align: left;
    font-size: 11.5px;
    line-height: 1.25;
    color: var(--platform-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  html body #main .kband .kpi.pv .kn {
    display: block;
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-size: 10.5px;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: color-mix(in srgb, var(--platform-accent, #5ce6f2) 88%, var(--platform-ink, #eef9fc));
  }
}
@media (min-width: 1280px) and (max-height: 940px) {
  html body #main .kband .kpi.pv {
    height: 102px;
    min-height: 102px;
    padding: 16px var(--r4-pad);
    gap: 2px;
  }
  html body #main .kband .kpi.pv .lab { font-size: 12px; line-height: 1.1; }
  html body #main .kband .kpi.pv .v { font-size: 22px; line-height: 1.05; }
  html body #main .kband .kpi.pv .v.none { font-size: 18px; line-height: 1.05; }
  html body #main .kband .kpi.pv .kpi-chg { font-size: 10px; padding: 1.5px 5px; }
  html body #main .kband .kpi.pv .d { font-size: 10.5px; line-height: 1.15; }
  html body #main .kband .kpi.pv .kn { font-size: 9.5px; line-height: 1.1; }
  html body #main .kband .kpi.pv svg.spark { flex: 0 0 70px; width: 70px; height: 22px; }
}

/* FIX #3: Juiced-Up Pipeline River — keep 100% transparent aquarium glass (L-river law), elevate beads & specular rim */
html body #main .card.river {
  --rv-border: rgba(132, 246, 242, 0.48);
  --rv-shadow: inset 0 1px 1px rgba(224, 255, 255, 0.50), inset 0 0 26px rgba(64, 240, 242, 0.14), 0 0 16px rgba(42, 218, 232, 0.14);
}
html body #main .river .rnode {
  border-width: 2px;
  background: radial-gradient(circle at 38% 34%, #ffffff 0 18%, var(--rv-node) 22% 46%, rgba(3, 30, 44, 0.65) 56% 100%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--rv-node) 80%, transparent), inset 0 1px 2px rgba(255, 255, 255, 0.7);
}
html body #main .river .rnode.bn {
  box-shadow: 0 0 16px color-mix(in srgb, var(--warn) 90%, transparent), inset 0 1px 2px rgba(255, 240, 200, 0.8);
}
html body #main .river .stages button .num {
  border: 1px solid color-mix(in srgb, var(--platform-accent, #5ce6f2) 38%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--platform-accent, #5ce6f2) 20%, transparent);
}
html body #main .river .stages li.bn button .num {
  border-color: color-mix(in srgb, var(--warn) 68%, transparent);
  color: var(--warn);
}

/* FIX #4: Significantly Improved & Fitted US Installation & Service Map (Frames #1 & #6)
   - Kill the ~120px dead gap by resetting .cols > .decide to grid-column: 1 (overriding ceo-command.css:310)
   - Balanced middle row ratio so the US Map fits cleanly without horizontal dead air */
@media (min-width: 1280px) {
  html body #main .mid {
    grid-template-columns: minmax(0, 1.95fr) minmax(320px, 1fr) !important;
  }
  html body #main .mid .cols,
  html body #main .mid .cols-sk {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html body #main .mid .cols > .decide,
  html body #main .mid .cols > .card,
  html body #main .mid .cols-sk > :first-child {
    grid-column: 1 !important;
  }
  html body #main .atlas {
    --map-col: 244px;
  }
  html[lang="es"] body #main .atlas {
    --map-col: 274px;
  }
  html body #main .atlas .ach > h2 {
    padding-right: 250px;
    max-width: 100%;
    box-sizing: border-box;
  }
  html body #main .atlas .fit {
    position: absolute;
    top: var(--r4-pad);
    right: calc(var(--r4-pad) + 106px);
    bottom: auto;
    height: 30px;
  }
}
.ceo-watch-installs {
  flex: none;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--platform-row-line);
  background: var(--platform-row);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ceo-wi-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--platform-ink);
}
.ceo-wi-hd b { font-variant-numeric: tabular-nums; color: var(--platform-accent); }
.ceo-wi-empty { font-size: 11px; color: var(--platform-muted); }
.ceo-watch-installs .bar {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(140, 200, 215, 0.16);
  display: flex;
}
.ceo-watch-installs .bar i { display: block; height: 100%; }
.ceo-wi-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11px;
  color: var(--platform-muted);
}
.ceo-wi-chips span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ceo-wi-chips i { width: 6px; height: 6px; border-radius: 50%; flex: none; }

html body #main .atlas #amap .land-glow {
  fill: rgba(58, 224, 242, 0.20);
  opacity: 0.9;
}
html body #main .atlas #amap .coast-glow {
  fill: none;
  stroke: rgba(114, 244, 255, 0.72);
  stroke-width: 2.2;
}
html body #main .atlas #amap .land {
  fill: url(#landG);
  fill-opacity: 0.92;
  stroke: rgba(132, 246, 255, 0.56);
  stroke-width: 1.0;
}
html body #main .atlas #amap .land-dots {
  opacity: 0.72;
}
html body #main .atlas #amap .states-glow {
  stroke: rgba(92, 234, 248, 0.42);
  stroke-width: 1.1;
}
html body #main .atlas #amap .states {
  stroke: rgba(146, 244, 255, 0.44);
  stroke-width: 0.7;
}
html[data-theme="light"] body #main .atlas #amap .land-glow {
  fill: rgba(10, 140, 168, 0.14);
}
html[data-theme="light"] body #main .atlas #amap .coast-glow {
  stroke: rgba(10, 134, 160, 0.46);
}
html[data-theme="light"] body #main .atlas #amap .states {
  stroke: rgba(8, 114, 138, 0.42);
}
html[data-theme="dark"] body #main .atlas #amap .land-glow {
  fill: rgba(244, 134, 40, 0.18);
}
html[data-theme="dark"] body #main .atlas #amap .coast-glow {
  stroke: rgba(255, 178, 102, 0.68);
}
html[data-theme="dark"] body #main .atlas #amap .states {
  stroke: rgba(255, 178, 108, 0.42);
}
html body #main .atlas .atlas-motion {
  opacity: 0.38 !important;
}
html body #main .atlas #amap .pools circle {
  fill: rgba(56, 226, 240, 0.06);
}
html body #main .atlas #amap .pt-bloom {
  opacity: 0.12 !important;
}
html body #main .atlas #amap .pts .halo {
  fill: rgba(56, 226, 240, 0.04);
}
html body #main .atlas #amap .pts .pt {
  fill: #66f0ff;
  stroke: rgba(180, 252, 255, 0.65);
  stroke-width: 0.32;
}
html[data-theme="light"] body #main .atlas #amap .pts .pt {
  fill: #05839c;
  stroke: #ffffff;
}
html[data-theme="dark"] body #main .atlas #amap .pts .pt {
  fill: #ffb964;
  stroke: #fff2de;
}
html body #main .atlas #amap .wh-disc {
  fill: rgba(4, 28, 40, 0.92);
  stroke: #ffd274;
  stroke-width: 1.9;
  filter: drop-shadow(0 0 6px rgba(255, 206, 102, 0.72));
}
html body #main .atlas #amap .wh-ico {
  stroke: #ffe7ad;
}
html body #main .atlas .fit,
html body #main .atlas .atlas-expand {
  border-color: color-mix(in srgb, var(--platform-accent, #5ce6f2) 38%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* FIX #5: Glowing Vector Equipment Icon for Inventory lines without manufacturer photo */
html body #main .bottom .inv-tile:not(.has-photo) .inv-tile__stage {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--platform-accent, #48e5f5) 24%, transparent), color-mix(in srgb, var(--platform-accent, #48e5f5) 6%, transparent)) !important;
  border: 1px solid color-mix(in srgb, var(--platform-accent, #48e5f5) 30%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--platform-accent, #48e5f5) 18%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.inv-eq-svg {
  width: 18px;
  height: 18px;
  stroke: var(--platform-accent, #7af4ff);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--platform-accent, #48e5f5) 55%, transparent));
}

/* FIX #6: Clean labeled People activity tiles & honest AI Voice Pulse strip inside Verification card */
html body #main .bottom .card-scroll > .act-strip {
  padding: 2px 4px !important;
  gap: 4px !important;
}
html body #main .bottom .card-scroll .act-chip {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2px 3px !important;
  gap: 1px !important;
  height: auto !important;
  min-height: 28px !important;
  border-radius: 8px !important;
  line-height: 1 !important;
}
html body #main .bottom .card-scroll .act-chip i { display: none !important; }
html body #main .bottom .card-scroll .act-chip span {
  display: block !important;
  font-size: 8.5px !important;
  font-weight: 600;
  opacity: 0.86;
  line-height: 1 !important;
}
html body #main .bottom .card-scroll .act-chip b {
  font-size: 11.5px !important;
  line-height: 1.05 !important;
}
html body #main .bottom .card-scroll .act-chip[data-band="active"] {
  background: rgba(52, 245, 197, 0.14);
  border-color: rgba(52, 245, 197, 0.34);
  color: #9ffce3;
}
html body #main .bottom .card-scroll .act-chip[data-band="recent"] {
  background: rgba(88, 196, 255, 0.14);
  border-color: rgba(88, 196, 255, 0.34);
  color: #b4e6ff;
}
html body #main .bottom .card-scroll .act-chip[data-band="slowing"] {
  background: rgba(247, 199, 104, 0.14);
  border-color: rgba(247, 199, 104, 0.34);
  color: #ffe3a3;
}
html body #main .bottom .card-scroll .act-chip[data-band="inactive"] {
  background: rgba(255, 127, 110, 0.14);
  border-color: rgba(255, 127, 110, 0.32);
  color: #ffb8ad;
}
html body #main .bottom .card-scroll .act-chip[data-band="never"] {
  background: rgba(148, 184, 198, 0.10);
  border-color: rgba(148, 184, 198, 0.24);
}
html[data-theme="light"] body #main .bottom .card-scroll .act-chip[data-band="active"] { color: #047857; }
html[data-theme="light"] body #main .bottom .card-scroll .act-chip[data-band="recent"] { color: #0369a1; }
html[data-theme="light"] body #main .bottom .card-scroll .act-chip[data-band="slowing"] { color: #9a5b07; }
html[data-theme="light"] body #main .bottom .card-scroll .act-chip[data-band="inactive"] { color: #b91c1c; }
.ceo-tabs[hidden] { display: none !important; }
@media (min-width: 1280px) {
  html body #main .verify.pv[data-ceo-compact] > .ceo-voice-mini {
    display: none !important;
  }
}
.ceo-voice-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.ceo-voice-pill {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--platform-row-line);
  background: var(--platform-row);
  color: var(--platform-ink);
  font: 600 10.5px/1 var(--font, Inter, system-ui, sans-serif);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ceo-voice-pill:hover {
  border-color: var(--platform-accent);
  background: color-mix(in srgb, var(--platform-accent) 14%, var(--platform-row));
}
.ceo-voice-pill > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}
.ceo-voice-pill[data-tone="em"] > i { background: #34f5c5; box-shadow: 0 0 6px #34f5c5; }
.ceo-voice-pill[data-tone="bl"] > i { background: #58c4ff; box-shadow: 0 0 6px #58c4ff; }
.ceo-voice-pill[data-tone="go"] > i { background: #f7c768; box-shadow: 0 0 6px #f7c768; }
.ceo-voice-pill[data-tone="off"] > i { background: var(--platform-muted); opacity: 0.55; }
.ceo-calls-quiet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--platform-row-line);
  background: var(--platform-row);
  font-size: 12px;
  color: var(--platform-muted);
}
.ceo-calls-quiet strong { color: var(--platform-ink); font-weight: 600; }
.ceo-calls-open-ai {
  border: 1px solid color-mix(in srgb, var(--platform-accent) 42%, transparent);
  background: color-mix(in srgb, var(--platform-accent) 14%, transparent);
  color: var(--platform-ink);
  font: 600 11px/1 var(--font, Inter, system-ui, sans-serif);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

/* ==========================================================================
   3. TAB 2 (AI TEAM) — OPEN-OCEAN PRISMATIC LIQUID-GLASS PRESENCE
   ========================================================================== */
.ai-team-view {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 28px minmax(0, 1fr) var(--foot-h, 206px);
  gap: 12px;
  color: var(--platform-ink, #eef9fc);
}
.ai-team-view[hidden] { display: none !important; }

.ai-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}
.ai-kpi-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.ai-kpi {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--platform-muted, #8ab4c4);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}
html[data-theme="light"] .ai-kpi { text-shadow: none; }
.ai-kpi strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--platform-ink, #eef9fc);
  font-variant-numeric: tabular-nums;
}
.ai-kpi strong.em { color: #34f5c5; }
.ai-kpi strong.go { color: #f7c768; }
.ai-kpi strong.bl { color: #58c4ff; }
html[data-theme="light"] .ai-kpi strong.em { color: #058a6a; }
html[data-theme="light"] .ai-kpi strong.go { color: #b4690e; }
html[data-theme="light"] .ai-kpi strong.bl { color: #0369a1; }

.ai-refresh-note {
  font-size: 11px;
  color: var(--platform-muted, #8ab4c4);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Open-Ocean 3-Agent Floating Stage — ZERO rectangular boxes */
.ai-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 18px;
  padding: 0 8px;
  min-height: 0;
}
.ai-agent {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 4px 8px;
  outline: none;
}
.ai-agent:focus-visible .ai-orb-wrap {
  filter: drop-shadow(0 0 14px var(--platform-accent, #5ce6f2));
}
.ai-agent::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 280px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  filter: blur(40px);
  z-index: -1;
}
.ai-agent[data-agent="lead_caller"]::before { background: radial-gradient(circle, rgba(52, 245, 197, 0.34), transparent 68%); }
.ai-agent[data-agent="front_desk"]::before { background: radial-gradient(circle, rgba(88, 196, 255, 0.34), transparent 68%); }
.ai-agent[data-agent="verification"]::before { background: radial-gradient(circle, rgba(247, 199, 104, 0.34), transparent 68%); }
.ai-agent.is-active::before { opacity: 1; animation: aiAuraPulse 2.4s ease-in-out infinite alternate; }
@keyframes aiAuraPulse { 0% { transform: translateX(-50%) scale(0.96); opacity: 0.78; } 100% { transform: translateX(-50%) scale(1.12); opacity: 1; } }

.ai-rt-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  color: #8dffdf;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 245, 197, 0.32);
}
.ai-rt-dot > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34f5c5;
  box-shadow: 0 0 8px #34f5c5;
}
html[data-theme="light"] .ai-rt-dot { color: #047857; }

/* Live Audio Listen-In Controls (Orb & Drawer) */
.ai-listen-bar {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ai-listen-bar:not(.is-compact),
.ai-dr-row .ai-listen-bar { justify-content: flex-start; margin-top: 6px; }
.ai-listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(52, 245, 197, 0.55);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(52, 245, 197, 0.16));
  color: #e6fff8;
  font: 650 11.5px/1 var(--font, Inter, system-ui, sans-serif);
  cursor: pointer;
  box-shadow: 0 0 14px rgba(52, 245, 197, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ai-listen-btn:hover { transform: translateY(-1px); box-shadow: 0 0 18px rgba(52, 245, 197, 0.45); }
.ai-listen-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-listen-slot:empty { display: none; }
.ai-listen-slot { width: 100%; display: flex; justify-content: center; margin-bottom: 4px; }
.ai-listen-btn.boost { border-color: rgba(88, 196, 255, 0.45); background: rgba(88, 196, 255, 0.14); color: #d8f2ff; box-shadow: none; }
.ai-listen-btn.boost.is-max { border-color: rgba(244, 121, 32, 0.65); background: rgba(244, 121, 32, 0.22); color: #ffd9bd; }
.ai-listen-meter { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; padding: 2px 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(52, 245, 197, 0.28); }
.ai-listen-meter[hidden] { display: none !important; }
.ai-listen-meter i { display: block; width: 3.5px; height: 14px; border-radius: 999px; transform-origin: bottom center; transform: scaleY(0.15); transition: transform 0.06s linear; }
.ai-listen-meter i.m-cust { background: #58c4ff; }
.ai-listen-meter i.m-agent { background: #34f5c5; }
.ai-listen-btn.sec { border-color: rgba(132, 214, 232, 0.4); background: rgba(132, 214, 232, 0.14); color: var(--platform-ink); box-shadow: none; }
.ai-listen-btn.stop { border-color: rgba(255, 127, 110, 0.55); background: rgba(255, 127, 110, 0.18); color: #ffd4ce; box-shadow: none; }
.ai-listen-btn[hidden] { display: none !important; }
.ai-listen-stat { font-size: 11px; font-weight: 600; color: #8dffdf; }
html[data-theme="light"] .ai-listen-btn { color: #064e3b; background: rgba(16, 185, 129, 0.16); border-color: rgba(5, 150, 105, 0.45); box-shadow: 0 2px 10px rgba(5, 150, 105, 0.14); }
html[data-theme="light"] .ai-listen-btn:hover { background: rgba(16, 185, 129, 0.24); }
html[data-theme="light"] .ai-listen-btn.boost { color: #0369a1; background: rgba(14, 165, 233, 0.12); border-color: rgba(3, 105, 161, 0.34); }
html[data-theme="light"] .ai-listen-btn.boost.is-max { color: #9a3412; background: rgba(244, 121, 32, 0.16); border-color: rgba(194, 65, 12, 0.45); }
html[data-theme="light"] .ai-listen-meter { background: rgba(8, 32, 51, 0.06); border-color: rgba(5, 150, 105, 0.28); }
html[data-theme="light"] .ai-listen-btn.sec { color: #0f3d4c; background: rgba(12, 118, 142, 0.10); border-color: rgba(12, 118, 142, 0.28); box-shadow: none; }
html[data-theme="light"] .ai-listen-btn.stop { color: #991b1b; background: rgba(239, 68, 68, 0.12); border-color: rgba(220, 38, 38, 0.38); box-shadow: none; }
html[data-theme="light"] .ai-listen-stat { color: #047857; }

.ai-orb-wrap {
  position: relative;
  width: min(330px, 100%);
  height: clamp(148px, 23vh, 214px);
  display: grid;
  place-items: center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-agent:hover .ai-orb-wrap { transform: translateY(-3px) scale(1.02); }
.ai-orb-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.ai-orb-reflection {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 104px;
  height: 10px;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.22;
  pointer-events: none;
  transition: opacity 0.45s ease, width 0.45s ease;
}
.ai-agent.is-active .ai-orb-reflection { opacity: 0.60; width: 158px; }
.ai-agent[data-agent="lead_caller"] .ai-orb-reflection { background: #34f5c5; }
.ai-agent[data-agent="front_desk"] .ai-orb-reflection { background: #58c4ff; }
.ai-agent[data-agent="verification"] .ai-orb-reflection { background: #f7c768; }

.ai-orb-emblem {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0.56;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.ai-agent.is-active .ai-orb-emblem { opacity: 0.16; transform: scale(0.88); }
.ai-orb-emblem svg {
  width: 30px;
  height: 30px;
  stroke: rgba(242, 253, 255, 0.94);
  fill: none;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.48));
}

.ai-whisper {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(4, 24, 34, 0.80);
  border: 1px solid rgba(132, 214, 232, 0.28);
  font-size: 11px;
  color: #dcf9ff;
  font-style: italic;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.ai-agent.is-active .ai-whisper.has-text {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ai-name {
  margin-top: 6px;
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.42);
}
html[data-theme="light"] .ai-name { text-shadow: none; }
.ai-role {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--platform-muted, #8ab4c4);
}
.ai-status-row {
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  background: var(--platform-row);
  border: 1px solid var(--platform-row-line);
  color: var(--platform-muted);
}
.ai-pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ai-pill.live-em { color: #8dffdf; background: rgba(16, 185, 129, 0.16); border-color: rgba(52, 245, 197, 0.44); }
.ai-pill.live-bl { color: #b2e4ff; background: rgba(56, 189, 248, 0.16); border-color: rgba(88, 196, 255, 0.44); }
.ai-pill.live-go { color: #ffe4a3; background: rgba(245, 158, 11, 0.16); border-color: rgba(247, 199, 104, 0.46); }
.ai-pill.standby { color: #f4cd7c; background: rgba(245, 158, 11, 0.10); border-color: rgba(247, 199, 104, 0.30); }
.ai-pill.ready { color: #9ce9f6; background: rgba(56, 189, 248, 0.09); border-color: rgba(132, 214, 232, 0.28); }
html[data-theme="light"] .ai-pill.live-em { color: #047857; background: rgba(16, 185, 129, 0.14); }
html[data-theme="light"] .ai-pill.live-bl { color: #0369a1; background: rgba(14, 165, 233, 0.14); }
html[data-theme="light"] .ai-pill.live-go { color: #b45309; background: rgba(245, 158, 11, 0.16); }
html[data-theme="light"] .ai-pill.standby { color: #9a5b07; }
html[data-theme="light"] .ai-pill.ready { color: #08738b; }

.ai-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.ai-eq i { display: block; width: 2px; border-radius: 2px; background: currentColor; animation: aiEq 0.9s ease-in-out infinite alternate; }
.ai-eq i:nth-child(1) { height: 4px; animation-delay: 0s; }
.ai-eq i:nth-child(2) { height: 9px; animation-delay: 0.22s; }
.ai-eq i:nth-child(3) { height: 6px; animation-delay: 0.45s; }
@keyframes aiEq { 0% { transform: scaleY(0.35); } 100% { transform: scaleY(1); } }

.ai-staff-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 5px;
  border-radius: 999px;
  background: var(--platform-row);
  border: 1px solid rgba(247, 199, 104, 0.28);
  font-size: 10.5px;
  font-weight: 500;
  color: #f6dc9c;
}
html[data-theme="light"] .ai-staff-pill { color: #8c5206; }
.ai-mini-avs { display: inline-flex; flex-shrink: 0; flex-wrap: nowrap; align-items: center; }
.ai-mini-av {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 8px;
  font-weight: 700;
  color: #041d29;
  display: grid;
  place-items: center;
  margin-left: -4px;
  border: 1.5px solid #06212e;
}
.ai-mini-av:first-child { margin-left: 0; }
.ai-mini-av.c0 { background: #7de9ff; }
.ai-mini-av.c1 { background: #7bf4cd; }
.ai-mini-av.c2 { background: #f8d47c; }

.ai-hero {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.ai-hero strong {
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ai-hero span { font-size: 12px; color: var(--platform-muted); }

.ai-bar {
  margin-top: 7px;
  width: min(280px, 90%);
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(140, 200, 215, 0.14);
  display: flex;
  gap: 2px;
}
.ai-bar i { display: block; height: 100%; border-radius: 999px; }

.ai-legend {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--platform-muted);
  font-variant-numeric: tabular-nums;
}
.ai-legend b { color: var(--platform-ink); font-weight: 600; }
.ai-ldot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }

.ai-mini-stats {
  margin-top: 9px;
  width: min(280px, 92%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 8px;
  border-top: 1px solid var(--platform-row-line);
}
.ai-ms { position: relative; }
.ai-ms + .ai-ms::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--platform-row-line);
}
.ai-ms strong { display: block; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ai-ms strong.em { color: #34f5c5; }
.ai-ms strong.bl { color: #58c4ff; }
.ai-ms strong.go { color: #f7c768; }
html[data-theme="light"] .ai-ms strong.em { color: #058a6a; }
html[data-theme="light"] .ai-ms strong.bl { color: #0369a1; }
html[data-theme="light"] .ai-ms strong.go { color: #b4690e; }
.ai-ms span { display: block; margin-top: 1px; font-size: 10px; color: var(--platform-muted); }

.ai-cta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--platform-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.ai-agent:hover .ai-cta { background: var(--platform-row); color: var(--platform-ink); }
.ai-cta b { font-weight: 650; }
.ai-agent[data-agent="lead_caller"] .ai-cta b { color: #34f5c5; }
.ai-agent[data-agent="front_desk"] .ai-cta b { color: #58c4ff; }
.ai-agent[data-agent="verification"] .ai-cta b { color: #f7c768; }
html[data-theme="light"] .ai-agent[data-agent="lead_caller"] .ai-cta b { color: #058a6a; }
html[data-theme="light"] .ai-agent[data-agent="front_desk"] .ai-cta b { color: #0369a1; }
html[data-theme="light"] .ai-agent[data-agent="verification"] .ai-cta b { color: #b4690e; }

/* Bottom 3-Panel Glass Dock (aligned identically to Tab 1's foot row & clearing AQUIS slot!) */
.ai-dock {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 16px;
  min-height: 0;
  height: 100%;
}
.ai-panel {
  background: var(--platform-fill);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius, 16px);
  box-shadow: var(--platform-shadow);
  backdrop-filter: var(--gl-blur);
  -webkit-backdrop-filter: var(--gl-blur);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.ai-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex: none;
}
.ai-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--platform-ink);
}
.ai-panel-ico {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--platform-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--platform-accent) 28%, transparent);
  display: grid;
  place-items: center;
  flex: none;
}
.ai-panel-ico svg { width: 13px; height: 13px; stroke: var(--platform-accent); fill: none; stroke-width: 1.8; }

.ai-filters { display: inline-flex; gap: 3px; }
.ai-flt {
  border: 1px solid transparent;
  background: transparent;
  color: var(--platform-muted);
  font: 500 10.5px/1 var(--font, Inter, system-ui, sans-serif);
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
}
.ai-flt:hover { color: var(--platform-ink); }
.ai-flt.is-on {
  color: var(--platform-ink);
  background: color-mix(in srgb, var(--platform-accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--platform-accent) 32%, transparent);
}

.ai-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.ai-call-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--platform-row-line);
  background: var(--platform-row);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.ai-call-row:hover {
  border-color: color-mix(in srgb, var(--platform-accent) 42%, transparent);
}
.ai-call-row.is-live {
  border-color: rgba(52, 245, 197, 0.36);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.14), var(--platform-row) 45%);
}
.ai-tag {
  font-size: 10px;
  font-weight: 650;
  text-align: center;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.ai-tag.em { color: #8dffdf; background: rgba(52, 245, 197, 0.14); border: 1px solid rgba(52, 245, 197, 0.28); }
.ai-tag.bl { color: #a7e1ff; background: rgba(88, 196, 255, 0.14); border: 1px solid rgba(88, 196, 255, 0.28); }
.ai-tag.go { color: #ffe09a; background: rgba(247, 199, 104, 0.14); border: 1px solid rgba(247, 199, 104, 0.28); }
html[data-theme="light"] .ai-tag.em { color: #047857; }
html[data-theme="light"] .ai-tag.bl { color: #0369a1; }
html[data-theme="light"] .ai-tag.go { color: #9a5b07; }

.ai-call-meta { min-width: 0; }
.ai-call-meta strong { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-call-meta span { display: block; font-size: 10px; color: var(--platform-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-chip {
  font-size: 10.5px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--platform-row-line);
  white-space: nowrap;
  flex: none;
}
.ai-chip.tone-ok { color: #79ffd9; background: rgba(16, 185, 129, 0.16); border-color: rgba(52, 245, 197, 0.36); }
.ai-chip.tone-live { color: #03202b; background: linear-gradient(135deg, #b8fbff, #34f5c5); border-color: rgba(52, 245, 197, 0.8); box-shadow: 0 0 12px rgba(52, 245, 197, 0.4); }
.ai-chip.tone-info { color: #a7e1ff; background: rgba(56, 189, 248, 0.15); border-color: rgba(88, 196, 255, 0.34); }
.ai-chip.tone-warn { color: #ffe09a; background: rgba(245, 158, 11, 0.16); border-color: rgba(247, 199, 104, 0.38); }
.ai-chip.tone-bad { color: #ffb4a8; background: rgba(239, 68, 68, 0.16); border-color: rgba(255, 127, 110, 0.38); }
.ai-chip.tone-muted { color: var(--platform-muted); background: rgba(148, 184, 198, 0.10); border-color: rgba(148, 184, 198, 0.24); }
html[data-theme="light"] .ai-chip.tone-ok { color: #047857; background: rgba(16, 185, 129, 0.14); }
html[data-theme="light"] .ai-chip.tone-info { color: #0369a1; background: rgba(14, 165, 233, 0.14); }
html[data-theme="light"] .ai-chip.tone-warn { color: #9a5b07; background: rgba(245, 158, 11, 0.16); }
html[data-theme="light"] .ai-chip.tone-bad { color: #b91c1c; background: rgba(239, 68, 68, 0.14); }
.ai-row-cta { font-size: 10.5px; font-weight: 650; color: var(--platform-accent); white-space: nowrap; }

.ai-esc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--platform-row-line);
  background: var(--platform-row);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.ai-esc-card.hi {
  border-color: rgba(247, 199, 104, 0.34);
  background: linear-gradient(90deg, rgba(247, 199, 104, 0.12), var(--platform-row) 55%);
}
.ai-esc-card > div > strong { display: block; font-size: 11.5px; font-weight: 650; }
.ai-esc-card.hi > div > strong { color: #ffe39f; }
html[data-theme="light"] .ai-esc-card.hi > div > strong { color: #8c5206; }
.ai-esc-card > div > span { display: block; font-size: 10px; color: var(--platform-muted); margin-top: 1px; }

.ai-maya-pills { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.ai-mpill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: #9ffce3;
  background: rgba(52, 245, 197, 0.12);
  border: 1px solid rgba(52, 245, 197, 0.26);
}
.ai-mpill.off { color: var(--platform-muted); background: var(--platform-row); border-color: var(--platform-row-line); }
html[data-theme="light"] .ai-mpill:not(.off) { color: #047857; }
.ai-maya-bar { height: 4px; border-radius: 999px; background: rgba(140, 200, 215, 0.16); overflow: hidden; margin-bottom: 10px; }
.ai-maya-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #34f5c5, #58c4ff); }
.ai-maya-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ai-maya-grid strong { display: block; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ai-maya-grid span { display: block; font-size: 10px; color: var(--platform-muted); }
.ai-maya-ft {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 11.5px;
}
.ai-maya-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--platform-accent);
  font: 650 11.5px/1 var(--font, Inter, system-ui, sans-serif);
  cursor: pointer;
}
.ai-maya-btn:hover { text-decoration: underline; }

.ai-empty-msg {
  margin: auto 0;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px dashed var(--platform-row-line);
  font-size: 12px;
  color: var(--platform-muted);
  text-align: center;
}

/* Solid Opaque In-Place Slide-Over Drawer (Matches #records --ceo-reading-plane — ZERO bleed-through!) */
.ai-drawer-bg {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(1, 12, 19, 0.62);
}
.ai-drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(520px, calc(100vw - 24px));
  z-index: 61;
  background: var(--ceo-reading-plane, #062d36) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid color-mix(in srgb, var(--platform-accent, #5ce6f2) 38%, var(--platform-border));
  border-radius: 22px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: -24px 0 68px rgba(0, 0, 0, 0.65);
  color: var(--text, #eef9fc);
}
html[data-theme="light"] .ai-drawer {
  background: #ffffff !important;
  color: #0b2430;
  border-color: rgba(12, 118, 142, 0.25);
}
html[data-theme="dark"] .ai-drawer {
  background: #100e0c !important;
  color: #f8ede3;
  border-color: rgba(255, 166, 92, 0.3);
}
.ai-drawer[hidden], .ai-drawer-bg[hidden] { display: none !important; }
.ai-dr-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--platform-row-line); }
.ai-dr-title { font-size: 19px; font-weight: 700; line-height: 1.2; }
.ai-dr-sub { font-size: 12px; color: var(--platform-muted); margin-top: 3px; }
.ai-dr-x {
  width: 32px; height: 32px; border-radius: 999px;
  border: 1px solid var(--platform-border);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-size: 18px; cursor: pointer; flex: none;
  display: grid; place-items: center;
}
.ai-dr-x:hover { background: rgba(255, 255, 255, 0.14); }
.ai-dr-body { flex: 1 1 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; padding-right: 2px; }
.ai-dr-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(132, 214, 232, 0.18);
}
html[data-theme="light"] .ai-dr-card { background: #f4f9fb; border-color: rgba(12, 118, 142, 0.16); }
.ai-dr-card-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ai-dr-card h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--platform-muted); margin: 0; }
.ai-dr-sync { font-size: 11px; color: var(--platform-accent); }
.ai-dr-row {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(132, 214, 232, 0.16);
  background: rgba(3, 24, 34, 0.65);
  margin-bottom: 8px;
  font-size: 12.5px;
}
html[data-theme="light"] .ai-dr-row { background: #ffffff; border-color: rgba(12, 118, 142, 0.16); }
html[data-theme="dark"] .ai-dr-row { background: rgba(26, 20, 16, 0.9); border-color: rgba(255, 166, 92, 0.18); }
.ai-dr-row.is-live { border-color: rgba(52, 245, 197, 0.52); box-shadow: 0 0 16px rgba(52, 245, 197, 0.14); }
.ai-dr-row:last-child { margin-bottom: 0; }
.ai-dr-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; list-style: none; }
.ai-dr-who { font-size: 13px; font-weight: 650; }
.ai-dr-ts { font-size: 11px; font-weight: 400; color: var(--platform-muted); margin-left: 6px; }
.ai-dr-row-meta { font-size: 11.5px; color: var(--platform-muted); margin-top: 3px; line-height: 1.35; }

.ai-dr-exp { margin-top: 8px; }
.ai-dr-exp > summary {
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--platform-accent);
  list-style: none;
  user-select: none;
}
.ai-dr-exp > summary::-webkit-details-marker { display: none; }
.ai-dr-turns { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(132, 214, 232, 0.14); display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.45; }
.ai-turn { display: flex; gap: 8px; padding: 6px 9px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); }
.ai-turn.is-ai { background: rgba(52, 245, 197, 0.07); }
.ai-turn b { flex: none; min-width: 42px; color: var(--platform-accent); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 1px; }
.ai-turn.is-caller b { color: #f7c768; }
html[data-theme="light"] .ai-turn { background: #edf5f8; color: #0f172a; }
html[data-theme="light"] .ai-turn.is-ai { background: #e2f8f1; color: #0f172a; }
html[data-theme="light"] .ai-turn.is-caller b { color: #b45309; }

/* Live Call Banner pinned at top of #ai-drawer */
.ai-live-banner {
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(6, 45, 54, 0.92));
  border: 1px solid rgba(52, 245, 197, 0.48);
  box-shadow: 0 0 22px rgba(52, 245, 197, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
html[data-theme="light"] .ai-live-banner {
  background: linear-gradient(135deg, #ecfdf5, #e6f6f4);
  border-color: rgba(5, 150, 105, 0.42);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.12);
}
.ai-live-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ai-live-who { font-size: 12px; font-weight: 600; color: var(--platform-ink); }
html[data-theme="light"] .ai-live-who { color: #064e3b; }
.ai-live-audio-note { font-size: 11px; color: #8dffdf; }
html[data-theme="light"] .ai-live-audio-note { color: #047857; font-weight: 600; }
.ai-live-transcript { max-height: 190px; overflow-y: auto; scrollbar-width: thin; }
.ai-live-wait { font-size: 12px; font-style: italic; color: var(--platform-muted); padding: 6px 2px; }
html[data-theme="light"] .ai-live-wait { color: #0f5132; }

/* In-place Maya Messages & Notices Thread Cards */
.ai-maya-flt-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-maya-thread > summary { cursor: pointer; }
.ai-maya-thread-msgs { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.ai-maya-msg { padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.4; }
.ai-maya-msg.is-out { background: rgba(56, 189, 248, 0.10); border: 1px solid rgba(88, 196, 255, 0.22); }
.ai-maya-msg.is-in { background: rgba(52, 245, 197, 0.10); border: 1px solid rgba(52, 245, 197, 0.26); margin-left: 14px; }
html[data-theme="light"] .ai-maya-msg.is-out { background: #eaf6fc; }
html[data-theme="light"] .ai-maya-msg.is-in { background: #e5faf2; }
.ai-maya-msg-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 11px; }
.ai-maya-msg-top > span:nth-child(2) { color: var(--platform-muted); margin-right: auto; }
.ai-maya-msg-kind { font-weight: 600; font-size: 12px; margin-bottom: 3px; }
.ai-maya-msg-body { color: var(--platform-muted); font-size: 11.5px; white-space: pre-wrap; word-break: break-word; }

.ai-dr-ft {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 10px; border-top: 1px solid var(--platform-row-line);
}
.ai-dr-note { font-size: 11px; color: var(--platform-muted); }
.ai-dr-close-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--platform-border);
  color: inherit;
  font: 600 12px/1 var(--font, Inter, system-ui, sans-serif);
  cursor: pointer;
}
.ai-dr-close-btn:hover { background: rgba(255, 255, 255, 0.16); }

@media (max-width: 1279px) {
  .ai-team-view { display: flex; flex-direction: column; height: auto; gap: 16px; padding-bottom: 120px; }
  .ai-stage { grid-template-columns: 1fr; gap: 22px; }
  .ai-dock { grid-template-columns: 1fr; height: auto; }
  .ai-panel { min-height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-eq i { animation: none !important; }
}
