/* ============================================================
   Talker Admin — dark theme.
   Base: DressRoom Admin palette. Ambient orbs: ElectroCalc.
   ============================================================ */

:root {
  --bg-0: #0b0b12;
  --bg-1: #11111b;
  --bg-2: #161624;
  --bg-3: #1d1d2e;
  --line: #25253a;
  --line-soft: #1d1d2e;

  --fg-0: #f3f4f8;
  --fg-1: #c7c9d6;
  --fg-2: #8b8ea3;
  --fg-3: #5a5d72;

  --accent:   #8b5cf6;
  --accent-2: #6366f1;
  --accent-3: #ec4899;
  --good:  #10b981;
  --warn:  #f59e0b;
  --bad:   #ef4444;

  --shadow: 0 16px 32px -16px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.02) inset;
  --radius: 14px;
  --radius-sm: 10px;
  --duration: 220ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100vh;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto,
               "Helvetica Neue", sans-serif;
  font-size: 14px;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

body {
  display: grid;
  grid-template-columns: 232px 1fr;
  position: relative;
}

/* ============ AMBIENT BACKGROUND ============ */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  animation: orb-float 24s ease-in-out infinite;
}
.orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(99,102,241,0.55) 0%, transparent 70%);
  top: -180px; left: -80px;
  opacity: 0.4;
}
.orb-2 {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(236,72,153,0.5) 0%, transparent 70%);
  bottom: -140px; right: -100px;
  opacity: 0.28;
  animation-delay: -8s;
}
.orb-3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(139,92,246,0.45) 0%, transparent 70%);
  top: 38%; right: 28%;
  opacity: 0.15;
  animation-delay: -16s;
}
.grid-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px) 0 0 / 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 75%);
}
@keyframes orb-float {
  0%,100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(28px, -36px) scale(1.04); }
  66%      { transform: translate(-18px, 26px) scale(0.96); }
}

/* =================== sidebar =================== */
.sidebar {
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: relative;
  z-index: 2;
  height: 100vh;
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(139,92,246,.10), transparent 60%),
    radial-gradient(400px 200px at 0% 100%, rgba(99,102,241,.08), transparent 60%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 22px 10px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.lang-btn {
  background: var(--bg-2);
  color: var(--fg-2);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.lang-btn.active {
  background: #7c5cff;
  color: #fff;
  border-color: #7c5cff;
}
.lang-btn:hover:not(.active) {
  background: var(--bg-3);
  color: var(--fg-0);
}
.logo {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px -8px rgba(139,92,246,.6);
  position: relative;
}
/* Waveform icon inside logo */
.logo-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 18px;
}
.logo-wave span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.9);
}
.logo-wave span:nth-child(1) { height: 6px; }
.logo-wave span:nth-child(2) { height: 14px; }
.logo-wave span:nth-child(3) { height: 10px; }
.logo-wave span:nth-child(4) { height: 16px; }
.logo-wave span:nth-child(5) { height: 8px; }

.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand-sub  { font-size: 11px; color: var(--fg-2); margin-top: 2px; text-transform: uppercase; letter-spacing: .12em; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; position: relative; z-index: 1; overflow: hidden; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-1);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  text-align: left;
  transition: background var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              color var(--duration) var(--ease);
  font-family: inherit;
  width: 100%;
}
.nav-item svg { width: 16px; height: 16px; fill: currentColor; opacity: .75; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-2); color: var(--fg-0); }
.nav-item.active {
  background: linear-gradient(180deg, rgba(139,92,246,.14), rgba(99,102,241,.07));
  border-color: rgba(139,92,246,.32);
  color: var(--fg-0);
  box-shadow: 0 0 0 1px rgba(139,92,246,.05) inset;
}
.nav-item.active svg { opacity: 1; }
.nav-divider { height: 1px; background: var(--line-soft); margin: 10px 6px; }

.sidebar-footer {
  padding: 12px 10px 4px;
  border-top: 1px solid var(--line-soft);
  margin-top: 12px;
  position: relative;
  z-index: 1;
}
.status-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-2); }
.led {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-3);
  box-shadow: 0 0 0 3px rgba(90,93,114,.18);
  flex-shrink: 0;
  transition: background .3s, box-shadow .3s;
}
.led.idle { background: var(--good); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.led.calling {
  background: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(236,72,153,.2);
  animation: led-pulse 1.4s ease-out infinite;
}
@keyframes led-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(236,72,153,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(236,72,153,0); }
  100% { box-shadow: 0 0 0 0   rgba(236,72,153,0); }
}
.version { margin-top: 5px; font-size: 11px; color: var(--fg-3); }

/* =================== main area =================== */
.main {
  position: relative;
  z-index: 1;
  overflow-y: auto;
  height: 100vh;
  background:
    radial-gradient(1100px 600px at 100% -10%, rgba(139,92,246,.06), transparent 70%),
    radial-gradient(900px 500px at 0% 110%, rgba(236,72,153,.04), transparent 70%),
    var(--bg-0);
}

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 28px 32px 16px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0;
  background: rgba(11,11,18,0.85);
  backdrop-filter: blur(12px);
  z-index: 10;
}
.topbar h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.topbar .subtitle { color: var(--fg-2); margin-top: 4px; font-size: 13px; }

/* =================== sections =================== */
.section { padding: 24px 32px 48px; display: none; flex-direction: column; gap: 18px; }
/* fill-mode 'backwards' (not 'both'): after the entrance settles the element
   keeps NO transform, so it does not become a containing block that would trap
   the fullscreen dashboard (position:fixed) inside the section. */
.section.active { display: flex; animation: fade-up var(--duration) var(--ease) backwards; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-toolbar {
  display: flex; align-items: center; gap: 10px;
}
.section-toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* =================== card =================== */
.card {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

/* =================== operator cards =================== */
.operators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;          /* карточки разной высоты не растягиваются */
}
.operator-card {
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: visible;            /* было hidden — обрезало кнопки/тултипы */
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
  /* color-bar остаётся на левом краю — у него radius 14px 0 0 14px и
     position:absolute. overflow:visible не даёт ему вылезать, потому что
     у самой карточки border-radius. */
}
.operator-card:hover { border-color: rgba(139,92,246,.4); transform: translateY(-1px); }
.operator-color-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
}
.operator-card-head {
  display: flex; align-items: center; gap: 12px;
  padding-left: 8px;
}
.operator-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
  color: white;
  flex-shrink: 0;
}
.operator-name { font-weight: 600; font-size: 14px; }
.operator-meta { font-size: 12px; color: var(--fg-2); margin-top: 2px; }
.operator-persona { color: var(--fg-3, #8b8f9a); font-weight: 500; }
.operator-badges { display: flex; gap: 6px; padding-left: 8px; flex-wrap: wrap; }
.operator-actions {
  display: flex;
  gap: 6px;
  padding-left: 8px;
  flex-wrap: wrap;          /* кнопки переносятся когда не помещаются */
  margin-top: auto;          /* прижать вниз карточки если контента больше */
}

/* Operator warm-up progress (Wave 45.29) — shown while models load + the
   operator's TTS precache renders; hidden once the operator is ready. */
.warmup-row { display: flex; align-items: center; gap: 8px; padding: 2px 8px 0; }
.warmup-bar {
  flex: 1; height: 6px; background: var(--bg-1);
  border-radius: 999px; overflow: hidden; position: relative;
}
.warmup-fill {
  height: 100%; width: 0%; border-radius: 999px; position: relative;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width .3s cubic-bezier(.4,0,.2,1);
}
.warmup-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-100%); animation: exp-sheen 1.6s linear infinite;
}
.warmup-label { font-size: 11px; color: var(--fg-2); white-space: nowrap; }
.btn-start-call:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }

/* =================== KPI cards =================== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
.kpi {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow);
  min-height: 120px;
}
.kpi-label { color: var(--fg-2); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.kpi-value {
  font-size: 30px; font-weight: 600; margin-top: 8px;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff, #c5c9d8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.kpi-value .unit { font-size: 14px; color: var(--fg-2); margin-left: 4px; -webkit-text-fill-color: var(--fg-2); }
.kpi-sub { color: var(--fg-2); font-size: 12px; margin-top: 6px; }
.kpi-bar { margin-top: 10px; height: 5px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.kpi-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  transition: width .35s ease;
}

/* =================== table =================== */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.data-table th {
  color: var(--fg-2);
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  background: var(--bg-1);
  position: sticky; top: 0;
  white-space: nowrap;
}
.data-table tr:hover td { background: rgba(139,92,246,.025); }
.data-table .empty { text-align: center; padding: 32px; color: var(--fg-2); }

/* =================== badge =================== */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--fg-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-accent  { color: var(--accent);   border-color: rgba(139,92,246,.4); background: rgba(139,92,246,.08); }
.badge-good    { color: var(--good);     border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.07); }
.badge-warn    { color: var(--warn);     border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.07); }
.badge-bad     { color: var(--bad);      border-color: rgba(239,68,68,.4);  background: rgba(239,68,68,.07); }
.badge-pink    { color: var(--accent-3); border-color: rgba(236,72,153,.4); background: rgba(236,72,153,.07); }

/* =================== buttons =================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  padding: 8px 14px;
  height: 34px;
  border: none;
  transition: filter var(--duration) var(--ease), background var(--duration) var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: white;
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--fg-1);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--bg-3); border-color: var(--accent); color: var(--fg-0); }
.btn-ghost.danger { color: var(--bad); border-color: rgba(239,68,68,.35); }
.btn-ghost.danger:hover { border-color: var(--bad); background: rgba(239,68,68,.07); }
.btn-sm { height: 28px; padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* =================== form inputs =================== */
.input, .textarea {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--fg-0);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color var(--duration) var(--ease);
}
.input:focus, .textarea:focus { border-color: var(--accent); }
.textarea { resize: vertical; min-height: 90px; }
.textarea.mono {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
}

/* =================== modal =================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(7,7,13,0.74);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(4px);
  animation: fade-in 150ms ease both;
}
.modal-backdrop.hidden { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 460px; max-width: 620px;
  width: 100%; max-height: 86vh;
  overflow: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  display: flex; flex-direction: column;
  animation: modal-in 180ms var(--ease) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; color: var(--fg-0); font-weight: 600; }
.modal-close {
  background: transparent; border: none; color: var(--fg-2);
  cursor: pointer; font-size: 20px; line-height: 1; padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--duration), background var(--duration);
}
.modal-close:hover { color: var(--fg-0); background: var(--bg-3); }
.modal-body { padding: 18px 18px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

/* form field */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  font-size: 11.5px; color: var(--fg-2);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }

/* =================== placeholder =================== */
.placeholder-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  padding: 64px 32px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--fg-2);
  text-align: center;
}
.placeholder-box svg { width: 40px; height: 40px; fill: var(--fg-3); }
.placeholder-box p { font-size: 14px; max-width: 360px; line-height: 1.6; }

/* =================== live monitor =================== */
.monitor-status-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.monitor-status-bar .led { margin: 0; }

/* =================== operator goal =================== */
.operator-goal {
  padding: 7px 10px 7px 18px;
  font-size: 12px;
  color: var(--fg-1);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}
.operator-goal-empty { color: var(--fg-3); font-style: italic; }

/* =================== field hint =================== */
.field-hint {
  font-size: 11.5px;
  color: var(--fg-3);
  line-height: 1.5;
  margin-bottom: 4px;
}

/* =================== conversation transcript =================== */
.transcript-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.msg-bubble {
  padding: 10px 14px;
  border-radius: 10px;
  max-width: 88%;
  font-size: 13px;
  line-height: 1.55;
}
.msg-user {
  background: var(--bg-3);
  border: 1px solid var(--line);
  align-self: flex-start;
}
.msg-assistant {
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(139,92,246,.25);
  align-self: flex-end;
}
.msg-role {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-3);
  margin-bottom: 4px;
}
.msg-text { color: var(--fg-0); }
.msg-meta { font-size: 10.5px; color: var(--fg-3); margin-top: 5px; }

/* =================== artifacts =================== */
.artifacts-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.artifact-card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.artifact-kind {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--fg-2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.artifact-value {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-0);
  letter-spacing: .02em;
}
.artifact-meta { font-size: 11px; color: var(--fg-3); }
.artifact-ctx {
  font-size: 11.5px;
  color: var(--fg-2);
  background: var(--bg-2);
  border-radius: 5px;
  padding: 4px 8px;
  font-family: "JetBrains Mono", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* =================== voice cards =================== */
.voices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.voice-card {
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.voice-card:hover { border-color: rgba(139,92,246,.4); transform: translateY(-1px); }

.voice-color-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
}

.voice-card-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding-left: 8px;
}
.voice-card-info { flex: 1; min-width: 0; }
.voice-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-desc { font-size: 12px; color: var(--fg-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-ref-text { font-size: 11px; color: var(--fg-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: italic; }
.voice-meta { font-size: 11.5px; color: var(--fg-3); padding-left: 8px; }
.voice-actions { display: flex; gap: 6px; padding-left: 8px; }

.voice-audio { padding-left: 8px; }
.voice-audio audio {
  width: 100%;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-3);
}

/* Test panel (inline in voice card) */
.test-panel {
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-left: 8px;
}
.test-panel.open { display: flex; }
.test-panel textarea {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--fg-0);
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  font-size: 12.5px;
  resize: vertical;
  min-height: 56px;
  width: 100%;
  outline: none;
}
.test-panel textarea:focus { border-color: var(--accent); }
.test-panel-foot { display: flex; align-items: center; gap: 8px; }
.test-synth-status { font-size: 12px; color: var(--fg-2); }

/* =================== tab bar =================== */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg-2);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 8px 16px;
  margin-bottom: -1px;
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.tab-btn:hover { color: var(--fg-0); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* =================== dropzone =================== */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  color: var(--fg-2);
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
  font-size: 13px;
  line-height: 1.6;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(139,92,246,.05);
  color: var(--fg-0);
}
.dropzone svg { width: 32px; height: 32px; fill: var(--fg-3); display: block; margin: 0 auto 8px; }

.file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--fg-1);
}
.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-meta { color: var(--fg-3); white-space: nowrap; }

/* =================== record button =================== */
.record-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0 8px;
}
.record-button {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--bad);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  box-shadow: 0 8px 24px -8px rgba(239,68,68,.5);
}
.record-button:hover { transform: scale(1.06); }
.record-button.recording {
  animation: rec-pulse 1.3s ease-out infinite;
}
@keyframes rec-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(239,68,68,.6); }
  70%  { box-shadow: 0 0 0 14px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0   rgba(239,68,68,0); }
}
.record-button svg { fill: white; width: 28px; height: 28px; }

.record-timer {
  font-size: 22px; font-weight: 600; color: var(--fg-0);
  font-variant-numeric: tabular-nums;
  letter-spacing: .05em;
}
.record-hint { font-size: 12px; color: var(--fg-2); }

/* Level meter */
.level-meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
  width: 100%;
  max-width: 180px;
}
.level-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--good);
  min-height: 4px;
  transition: height 60ms linear, background 120ms;
}
.level-bar.medium { background: var(--warn); }
.level-bar.high   { background: var(--bad); }

.record-preview { width: 100%; }
.record-preview audio { width: 100%; height: 28px; }

/* =================== scrollbars =================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--line); }

/* =================== toast =================== */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 99999;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--fg-0);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  animation: toast-in 200ms var(--ease) both;
  max-width: 320px;
}
.toast.success { border-color: rgba(16,185,129,.5); color: var(--good); }
.toast.error   { border-color: rgba(239,68,68,.5);  color: var(--bad); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =================== emotion badges =================== */
.emo-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 6px;
  white-space: nowrap;
  opacity: 0.92;
  letter-spacing: 0.02em;
}

.emo-cell {
  white-space: nowrap;
}

/* Emotion stats bar in operator detail */
.emotion-stats-section {
  margin-top: 18px;
}
.emotion-stats-section .section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.emotion-stats-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.emotion-stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.emotion-stat-label {
  width: 110px;
  flex-shrink: 0;
}
.emotion-stat-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
}
.emotion-stat-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 400ms var(--ease);
}
.emotion-stat-pct {
  width: 38px;
  text-align: right;
  color: var(--fg-2);
  font-size: 12px;
}

/* =================== logs section =================== */
.input-sm {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg-0);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 10px;
  outline: none;
  transition: border-color var(--duration) var(--ease);
}
.input-sm:focus { border-color: var(--accent); }
.input-sm::placeholder { color: var(--fg-3); }

.logs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.logs-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--fg-2);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.logs-toggle input { cursor: pointer; accent-color: var(--accent); }

.logs-status {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-3);
  white-space: nowrap;
}

.logs-list {
  width: 100%;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  font-family: Consolas, Menlo, "Courier New", monospace;
  font-size: 13px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.log-entry {
  display: grid;
  grid-template-columns: 88px 72px 200px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 4px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  min-width: 0;
}
.log-entry:last-child { border-bottom: none; }
.log-entry:hover { background: rgba(255,255,255,0.04); }

.log-ts {
  color: var(--fg-3);
  font-size: 11px;
  flex-shrink: 0;
  white-space: nowrap;
}

.log-level {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  color: #fff;
  white-space: nowrap;
  justify-self: start;
}

.log-module {
  color: var(--fg-3);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.log-msg {
  color: var(--fg-1);
  white-space: pre-wrap;
  word-break: break-all;
  min-width: 0;
}

/* =================== settings section =================== */

.settings-api-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.35);
  border-radius: var(--radius-sm);
  color: var(--bad);
  font-size: 13px;
}
.settings-api-error.hidden { display: none; }

.settings-warn-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.35);
  border-radius: var(--radius-sm);
  color: var(--warn);
  font-size: 13px;
  line-height: 1.5;
}

.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
}
.settings-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg-2);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 9px 18px;
  margin-bottom: -1px;
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.settings-tab:hover { color: var(--fg-0); }
.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.settings-cat-panel { display: none; flex-direction: column; gap: 14px; }
.settings-cat-panel.active { display: flex; }

.settings-card {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-2);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 2px;
}

/* individual setting item */
.settings-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.settings-item-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-1);
}
.settings-item-desc {
  font-size: 11.5px;
  color: var(--fg-3);
  line-height: 1.5;
}
.settings-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.settings-item-controls .input {
  flex: 1;
  min-width: 180px;
  max-width: 360px;
}
.settings-item-controls select.input {
  max-width: 360px;
}

/* ── Settings subcategory accordion ──────────────────────────────────── */
.settings-subcat {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.settings-subcat + .settings-subcat {
  margin-top: 8px;
}

.settings-subcat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-2);
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--fg-1);
  border-bottom: 1px solid transparent;
}

.settings-subcat[open] .settings-subcat-header {
  border-bottom-color: var(--line);
}

.settings-subcat-header::-webkit-details-marker { display: none; }

.settings-subcat-header::before {
  content: '▶';
  font-size: 9px;
  color: var(--fg-3);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.settings-subcat[open] .settings-subcat-header::before {
  transform: rotate(90deg);
}

.settings-subcat-label {
  flex: 1;
}

.settings-subcat-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--bg-1);
}

/* env badge */
.badge-env {
  color: var(--warn);
  border-color: rgba(245,158,11,.4);
  background: rgba(245,158,11,.07);
  font-size: 10.5px;
  padding: 2px 7px;
}

/* secret input wrapper */
.secret-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 360px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.secret-wrap .input {
  flex: 1;
  min-width: 0;
  max-width: none;
}
.btn-show-secret {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg-2);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  padding: 4px 9px;
  height: 34px;
  white-space: nowrap;
  transition: color var(--duration), border-color var(--duration);
  flex-shrink: 0;
}
.btn-show-secret:hover { color: var(--fg-0); border-color: var(--accent); }

/* toggle switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-1);
  user-select: none;
}
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  position: relative;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--fg-3);
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease);
}
.toggle-switch input:checked ~ .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(16px); background: #fff; }

/* test provider button row */
.settings-test-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

/* EL Voice Manager subsection */
.el-voice-manager {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.el-voice-manager-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
}
.el-voice-manager-head span { flex: 1; }
.el-voices-list {
  max-height: 240px;
  overflow-y: auto;
}
.el-voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.el-voice-row:last-child { border-bottom: none; }
.el-voice-name { flex: 1; color: var(--fg-0); }
.el-voice-id { font-size: 11px; color: var(--fg-3); font-family: Consolas, monospace; }
.el-voice-use-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg-2);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  padding: 3px 8px;
  transition: color var(--duration), border-color var(--duration);
}
.el-voice-use-btn:hover { color: var(--accent); border-color: var(--accent); }
.el-voices-empty {
  padding: 20px;
  text-align: center;
  color: var(--fg-3);
  font-size: 13px;
}

/* =================== Call Modal =================== */
.modal-call {
  max-width: 720px;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.call-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.call-header-info {
  flex: 1;
  min-width: 0;
}

.call-header-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-header-meta {
  font-size: 12px;
  color: var(--fg-2);
  margin-top: 2px;
}

/* Status dot with pulse animation */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--fg-3);
  transition: background 0.3s ease;
}

.status-dot.idle    { background: var(--fg-3); }
.status-dot.connecting { background: var(--warn); animation: dot-pulse 1.4s ease-in-out infinite; }
.status-dot.listening  { background: var(--good); animation: dot-pulse 1.2s ease-in-out infinite; }
.status-dot.thinking   { background: var(--warn); animation: dot-pulse 0.9s ease-in-out infinite; }
.status-dot.speaking   { background: #38bdf8;     animation: dot-pulse 1.6s ease-in-out infinite; }

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* Transcript area */
.call-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

/* Chat bubbles */
.bubble {
  max-width: 72%;
  padding: 9px 14px 7px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

.bubble.user {
  align-self: flex-start;
  background: var(--bg-3);
  color: var(--fg-1);
  border-bottom-left-radius: 3px;
}

.bubble.assistant {
  align-self: flex-end;
  background: var(--call-accent, var(--accent));
  color: #fff;
  border-bottom-right-radius: 3px;
  opacity: 1;
}

.bubble.assistant.partial {
  opacity: 0.75;
}

.bubble-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.6;
}

.bubble.user .bubble-meta  { justify-content: flex-start; }
.bubble.assistant .bubble-meta { justify-content: flex-end; }

/* Wave 44.25: floating chip when call modal is minimized */
.call-floating-chip {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 12px 18px;
  background: var(--call-accent, #8b5cf6);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: chip-pulse 2s ease-in-out infinite;
}
.call-floating-chip:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
@keyframes chip-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4); }
  50%      { box-shadow: 0 4px 22px rgba(139, 92, 246, 0.75); }
}

/* Wave 44.25: minimize button in call footer */
.btn-minimize-call {
  background: transparent;
  border: 1px solid var(--border, #444);
  color: var(--fg, #ddd);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.btn-minimize-call:hover {
  background: var(--bg-2, #2a2a2a);
}

/* Wave 44.23: live pipeline-stage indicator under user msg */
.bubble-pipeline-stage {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted, #888);
  opacity: 0.75;
  font-style: italic;
  animation: pulse-stage 1.4s ease-in-out infinite;
}
@keyframes pulse-stage {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.9; }
}

/* Live status line */
.call-status-bar {
  padding: 8px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--fg-2);
  flex-shrink: 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Footer actions */
.call-footer {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-stop-call {
  background: var(--bad);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-stop-call:hover { opacity: 0.85; }

/* Start Call button on operator card — единственная кнопка звонка (сиреневая) */
.btn-start-call {
  background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  box-shadow: 0 4px 14px -6px rgba(139, 92, 246, 0.7);
}
.btn-start-call:hover { filter: brightness(1.09); box-shadow: 0 7px 18px -6px rgba(139, 92, 246, 0.85); }

/* =================== recording panel =================== */
.recording-panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recording-panel-empty {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px dashed var(--line);
  padding: 12px 16px;
}

.recording-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1);
}

.recording-icon {
  font-size: 16px;
}

.recording-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-0);
}

.recording-audio {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  accent-color: var(--accent);
  background: var(--bg-3);
}

/* Custom audio element theming where supported */
.recording-audio::-webkit-media-controls-panel {
  background: var(--bg-3);
}

.recording-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recording-meta {
  font-size: 12px;
  color: var(--fg-2);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Recording badge in conversations table */
.rec-badge {
  font-size: 15px;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.15s var(--ease);
  user-select: none;
}

.rec-badge:hover {
  transform: scale(1.25);
}

.rec-cell {
  text-align: center;
  width: 40px;
}
.btn-start-call:hover { opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════════════════
   Experimental Call (Wave 45) — pre-emptive LLM execution UI
   ═══════════════════════════════════════════════════════════════════════ */

.btn-start-call.experimental {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #fff;
  margin-left: 4px;
}
.btn-start-call.experimental:hover {
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
  opacity: 1;
}

.modal-call-experimental {
  max-width: 1180px;
  width: 96vw;
  max-height: 90vh;
  overflow: hidden;            /* only the inner columns scroll, not the whole modal */
}

.exp-call-header {
  background: linear-gradient(100deg, #7c3aed 0%, #6d28d9 55%, #5b21b6 100%) !important;
  color: #fff;
  box-shadow: 0 2px 14px rgba(124, 58, 237, 0.3);
}
.exp-call-header .call-header-name { color: #fff; }
.exp-call-header .call-header-meta { color: rgba(255, 255, 255, 0.82); }

.exp-wave-badge {
  font-size: 11px;
  font-weight: 600;
  margin-left: 10px;
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  vertical-align: middle;
}

.exp-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 14px;
  padding: 14px;
}

.exp-transcript-col {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.exp-transcript {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  font-size: 14px;
}

/* Chat bubbles — client (you) on the RIGHT, operator (Светлана) on the LEFT */
.exp-transcript .bubble {
  max-width: 76%;
  padding: 10px 14px 8px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  animation: exp-bubble-in 0.22s ease;
}
.exp-transcript .bubble.assistant {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--accent, #8b5cf6), #7c3aed);
  color: #fff;
  border-bottom-left-radius: 5px;
}
.exp-transcript .bubble.user {
  align-self: flex-end;
  background: var(--bg-3);
  color: var(--fg-0);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-right-radius: 5px;
}
.exp-transcript .bubble.partial { opacity: 0.7; }
.exp-transcript .bubble.system {
  align-self: center;
  max-width: 92%;
  background: transparent;
  box-shadow: none;
  color: var(--fg-3);
  text-align: center;
}
.exp-transcript .bubble-meta {
  margin-top: 5px;
  font-size: 10px;
  opacity: 0.75;
  font-family: 'Cascadia Code', 'JetBrains Mono', monospace;
}
.exp-transcript .bubble.assistant .bubble-meta { color: rgba(255, 255, 255, 0.85); }
@keyframes exp-bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.exp-empty-hint {
  color: var(--fg-3);
  font-size: 12px;
  text-align: center;
  margin-top: 30px;
}

.exp-panel-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 6px;
}

/* ── cards ─────────────────────────────────────────────────────────── */
.exp-card {
  background-color: var(--bg-2);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.exp-card-dim { opacity: 0.78; }

.exp-card h4 {
  margin: 0 0 9px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--fg-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.exp-h4-sub {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--fg-3);
  text-transform: none;
}

/* ── HERO: live capture ────────────────────────────────────────────── */
.exp-capture {
  background-color: var(--bg-2);
  background-image:
    radial-gradient(120% 140% at 0% 0%, rgba(139,92,246,0.16), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  border-color: rgba(139, 92, 246, 0.22);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.exp-capture.is-active {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(139,92,246,0.25), 0 0 28px -6px rgba(139,92,246,0.5);
}
.exp-capture-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.exp-live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #6b7280; flex-shrink: 0; transition: background .3s ease;
}
.exp-capture.is-active .exp-live-dot {
  background: #ef4444;
  animation: exp-rec-pulse 1.4s ease-out infinite;
}
@keyframes exp-rec-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.exp-card-title { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: var(--fg-1); }

/* equalizer — ambient "capturing audio" affordance, animated ONLY while we
   are really listening (real state, not a fabricated amplitude readout). */
.exp-eq { display: inline-flex; align-items: flex-end; gap: 2px; margin-left: auto; height: 14px; }
.exp-eq i { width: 3px; height: 4px; border-radius: 2px; background: var(--fg-3); transition: background .3s ease; }
.exp-capture.is-active .exp-eq i {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
  animation: exp-eq-bounce 0.9s ease-in-out infinite;
}
.exp-capture.is-active .exp-eq i:nth-child(1){animation-delay:0s}
.exp-capture.is-active .exp-eq i:nth-child(2){animation-delay:.12s}
.exp-capture.is-active .exp-eq i:nth-child(3){animation-delay:.24s}
.exp-capture.is-active .exp-eq i:nth-child(4){animation-delay:.36s}
.exp-capture.is-active .exp-eq i:nth-child(5){animation-delay:.18s}
.exp-capture.is-active .exp-eq i:nth-child(6){animation-delay:.30s}
.exp-capture.is-active .exp-eq i:nth-child(7){animation-delay:.06s}
@keyframes exp-eq-bounce { 0%,100%{height:4px} 50%{height:14px} }

.exp-capture-text {
  font-size: 16px; line-height: 1.45; color: var(--fg-0); font-weight: 500;
  min-height: 48px; margin-bottom: 12px; word-break: break-word;
}
.exp-capture-text.is-placeholder { color: var(--fg-3); font-weight: 400; font-style: italic; }

/* ── meters (stability / EOU) ──────────────────────────────────────── */
.exp-meter { margin-bottom: 9px; }
.exp-meter:last-child { margin-bottom: 0; }
.exp-meter-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.exp-meter-label { font-size: 9.5px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--fg-3); }
.exp-meter-val { font-family: 'Cascadia Code', 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: var(--fg-1); }

.exp-progress-bar {
  width: 100%; height: 8px; background: var(--bg-1);
  border-radius: 999px; overflow: hidden; position: relative;
}
.exp-progress-fill {
  height: 100%; border-radius: 999px; background: #3b82f6; position: relative;
  transition: width .25s cubic-bezier(.4,0,.2,1), background .3s ease;
}
.exp-progress-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-100%); animation: exp-sheen 1.6s linear infinite;
}
.exp-progress-fill.lvl-low  { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.exp-progress-fill.lvl-mid  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.exp-progress-fill.lvl-high { background: linear-gradient(90deg, #10b981, #34d399); box-shadow: 0 0 12px -2px rgba(16,185,129,0.7); }
@keyframes exp-sheen { to { transform: translateX(100%); } }

.exp-mini { font-size: 10px; color: var(--fg-3); font-family: 'Cascadia Code', monospace; }

/* Humanization slider (Wave 45.22) */
.exp-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-1);
  outline: none;
  cursor: pointer;
  margin: 4px 0 8px;
}
.exp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(124, 58, 237, 0.6);
  cursor: pointer;
}

/* ── pipeline tracker ──────────────────────────────────────────────── */
.exp-pipeline { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.exp-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 2px; border-radius: 9px; position: relative; opacity: 0.45;
  transition: opacity .25s ease, background .25s ease, transform .25s ease;
}
.exp-stage:not(:last-child)::after {
  content: ''; position: absolute; top: 18px; right: -2px; width: 8px; height: 2px;
  background: var(--fg-3); opacity: 0.4;
}
.exp-stage-ico { font-size: 18px; line-height: 1; filter: grayscale(1); transition: filter .25s ease; }
.exp-stage-lbl { font-size: 9px; letter-spacing: 0.3px; color: var(--fg-2); text-transform: uppercase; }
.exp-stage.done { opacity: 0.8; }
.exp-stage.done .exp-stage-ico { filter: grayscale(0); }
.exp-stage.active {
  opacity: 1; transform: translateY(-1px);
  background: radial-gradient(120% 120% at 50% 0%, rgba(139,92,246,0.28), transparent 70%);
}
.exp-stage.active .exp-stage-ico { filter: grayscale(0); animation: exp-stage-glow 1.2s ease-in-out infinite; }
.exp-stage.active .exp-stage-lbl { color: #c4b5fd; font-weight: 700; }
@keyframes exp-stage-glow { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.18); } }

/* ── speculative LLM ───────────────────────────────────────────────── */
.exp-status-badge {
  display: inline-block; margin-left: auto;
  padding: 2px 9px; border-radius: 999px;
  background: #6b7280; color: #fff;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.exp-status-badge.st-idle      { background: #6b7280; }
.exp-status-badge.st-waiting   { background: #0ea5e9; }
.exp-status-badge.st-running   { background: #3b82f6; animation: exp-badge-pulse 1s ease-in-out infinite; }
.exp-status-badge.st-buffered  { background: #8b5cf6; }
.exp-status-badge.st-accepted  { background: #10b981; }
.exp-status-badge.st-discarded { background: #ef4444; }
@keyframes exp-badge-pulse { 0%,100%{opacity:1} 50%{opacity:0.55} }

.exp-shadow-tokens {
  font-family: 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--fg-1);
  padding: 8px 10px; background: var(--bg-1); border-radius: 8px;
  min-height: 40px; max-height: 90px; overflow-y: auto;
  word-break: break-word; white-space: pre-wrap;
  border-left: 2px solid transparent; transition: border-color .3s ease;
}
.exp-shadow-tokens.is-hint { color: var(--fg-3); font-style: italic; }
.exp-shadow-tokens.is-streaming { border-left-color: #3b82f6; }

/* ── latency ───────────────────────────────────────────────────────── */
.exp-lat-track { display: flex; gap: 3px; height: 30px; margin-bottom: 7px; }
.exp-lat-seg {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 6px; min-width: 30px; overflow: hidden; font-size: 9px; color: #fff;
}
.exp-lat-seg b { font-size: 8px; font-weight: 700; opacity: 0.85; letter-spacing: 0.4px; }
.exp-lat-seg span { font-family: 'Cascadia Code', monospace; font-size: 11px; font-weight: 700; }
.exp-lat-seg.seg-stt { background: linear-gradient(180deg,#06b6d4,#0891b2); }
.exp-lat-seg.seg-llm { background: linear-gradient(180deg,#8b5cf6,#7c3aed); }
.exp-lat-seg.seg-tts { background: linear-gradient(180deg,#ec4899,#db2777); }
.exp-lat-foot { display: flex; align-items: center; gap: 8px; }
.exp-lat-total { font-family: 'Cascadia Code', monospace; font-size: 18px; font-weight: 700; color: var(--fg-0); }
.exp-lat-total small { font-size: 10px; color: var(--fg-3); font-weight: 500; margin-left: 2px; }
.exp-lat-eou { font-size: 10px; color: #34d399; font-family: monospace; }
.exp-lat-history { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.exp-spark-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; color: var(--fg-3); font-family: 'Cascadia Code', monospace;
  padding: 2px 4px; border-radius: 4px; background: rgba(255,255,255,0.02);
}

/* ── logs ──────────────────────────────────────────────────────────── */
.exp-log { font-size: 11px; display: flex; flex-direction: column; gap: 5px; max-height: 120px; overflow-y: auto; }
.exp-log-item {
  padding: 5px 8px; background: var(--bg-1); border-radius: 7px;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.exp-log-key { color: var(--fg-2); font-weight: 600; }
.exp-log-val { color: var(--fg-3); font-family: 'Cascadia Code', monospace; font-size: 10px; white-space: nowrap; }
.exp-count {
  flex-shrink: 0; font-family: monospace; font-size: 10px; font-weight: 700;
  color: #fbbf24; background: rgba(251,191,36,0.14); padding: 1px 6px; border-radius: 999px;
}
.exp-hot-badge {
  display: inline-block; background: linear-gradient(135deg,#f59e0b,#f97316); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  margin-left: 6px; vertical-align: middle;
}

/* Source badges: how the operator reply was produced (cache vs LLM). */
.src-badge {
  display: inline-block; color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; margin-left: 6px;
  vertical-align: middle; letter-spacing: .2px; white-space: nowrap; cursor: help;
}
.src-llm      { background: linear-gradient(135deg,#3b82f6,#06b6d4); }  /* ✨ сгенерировано LLM — синий→циан */
.src-precache { background: linear-gradient(135deg,#f59e0b,#f97316); }  /* ⚡ фраза из звукового precache — янтарный */
.src-cache    { background: linear-gradient(135deg,#8b5cf6,#a855f7); }  /* 🧠 семантический кэш ответов — фиолетовый */
.src-script   { background: linear-gradient(135deg,#64748b,#94a3b8); }  /* 📋 скриптовая реплика (приветствие/прощание) — серый */

/* Premium thin scrollbars inside the experimental modal */
.exp-transcript::-webkit-scrollbar,
.exp-panel-col::-webkit-scrollbar,
.exp-shadow-tokens::-webkit-scrollbar,
.exp-log::-webkit-scrollbar { width: 8px; }
.exp-transcript::-webkit-scrollbar-thumb,
.exp-panel-col::-webkit-scrollbar-thumb,
.exp-shadow-tokens::-webkit-scrollbar-thumb,
.exp-log::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.13);
  border-radius: 999px;
}
.exp-transcript::-webkit-scrollbar-thumb:hover,
.exp-panel-col::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }
.exp-transcript::-webkit-scrollbar-track,
.exp-panel-col::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 920px) {
  .exp-layout {
    grid-template-columns: 1fr;
  }
  .exp-panel-col {
    max-height: 340px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Wave 48 — Call Cockpit (полноэкранное окно звонка: диалог + приборы +
   живая карта сценария с цветными ветками + таймлайн). Overlay поверх админки.
   ═══════════════════════════════════════════════════════════════════════════ */
.cockpit {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  color: var(--fg-0);
  background:
    radial-gradient(1200px 520px at 14% -8%, rgba(99, 102, 241, 0.12), transparent 60%),
    radial-gradient(900px 520px at 100% 112%, rgba(236, 72, 153, 0.08), transparent 60%),
    var(--bg-0);
  animation: ckpt-in 0.28s var(--ease);
}
@keyframes ckpt-in { from { opacity: 0; transform: scale(0.992); } to { opacity: 1; transform: none; } }

/* listen-in: "call ended" notice shown over the cockpit before bouncing back */
.ckpt-ended-overlay { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center;
  justify-content: center; padding: 24px; background: rgba(8,8,14,.62); backdrop-filter: blur(3px);
  animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.ckpt-ended-card { width: min(420px, 92vw); text-align: center; padding: 28px 26px 24px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.ckpt-ended-icon { font-size: 38px; margin-bottom: 10px; }
.ckpt-ended-title { font-size: 18px; font-weight: 700; color: var(--fg-0); margin-bottom: 8px; }
.ckpt-ended-msg { font-size: 13px; color: var(--fg-2); line-height: 1.5; margin-bottom: 20px; }
.ckpt-ended-card .btn { width: 100%; justify-content: center; }

/* ── topbar ─────────────────────────────────────────────────────────────── */
.ckpt-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-1), rgba(17, 17, 27, 0.55));
  flex-shrink: 0;
}
.ckpt-iconbtn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--fg-1);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ckpt-iconbtn:hover { background: var(--bg-3); color: var(--fg-0); }
.ckpt-close:hover { background: rgba(239, 68, 68, 0.16); color: #fff; border-color: rgba(239, 68, 68, 0.45); }
.ckpt-title-wrap { display: flex; align-items: center; gap: 11px; }
.ckpt-phone { font-size: 20px; filter: drop-shadow(0 0 7px rgba(139, 92, 246, 0.5)); }
.ckpt-title { font-size: 15px; font-weight: 600; color: var(--fg-0); }
.ckpt-title b { color: var(--accent); font-weight: 700; }
.ckpt-sub { font-size: 11px; color: var(--fg-3); margin-top: 1px; }
.ckpt-status-wrap { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ckpt-status-text { font-size: 12px; color: var(--fg-1); min-width: 96px; }
.ckpt-timer {
  font-family: 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 15px; font-weight: 600; letter-spacing: 1px;
  color: var(--fg-0);
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 10px;
}
.ckpt-health-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--line); color: var(--fg-1);
}
.ckpt-health-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); }
.ckpt-health-pill.lvl-green  { color: #34d399; border-color: rgba(16, 185, 129, 0.45); background: rgba(16, 185, 129, 0.10); }
.ckpt-health-pill.lvl-green  .ckpt-health-dot { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.8); }
.ckpt-health-pill.lvl-yellow { color: #fbbf24; border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.10); }
.ckpt-health-pill.lvl-yellow .ckpt-health-dot { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.8); }
.ckpt-health-pill.lvl-red    { color: #f87171; border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.12); animation: ckpt-pill-pulse 1.2s ease-in-out infinite; }
.ckpt-health-pill.lvl-red    .ckpt-health-dot { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.9); }
@keyframes ckpt-pill-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); } 50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); } }

/* ── body: верхняя строка (чат + приборы) + нижняя сцена (карта + таймлайн) ─ */
.ckpt-body {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 10px 14px 6px;   /* нижний отступ — панель графа не впритык к краю */
}
/* Верх: чат (заполняет) | сплиттер | приборы (фикс-ширина). Высота верха —
   через горизонтальный сплиттер (--ckpt-top-h). Без скейла: элементы фикс-размера. */
.ckpt-top {
  flex: 0 0 var(--ckpt-top-h, 44%); min-height: 130px;
  display: flex; min-width: 0;
}
.ckpt-chat { flex: 1 1 0; min-width: 280px; }
.ckpt-instruments {
  flex: 0 0 var(--ckpt-instr-w, 340px);
  min-width: 240px; max-width: 560px;
}
/* ── сплиттеры (перетаскиваются мышью, размеры запоминаются) ───────────── */
.ckpt-vsplit { flex: 0 0 12px; cursor: col-resize; position: relative; align-self: stretch; }
.ckpt-hsplit { flex: 0 0 12px; cursor: row-resize; position: relative; }
.ckpt-vsplit::before, .ckpt-hsplit::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  background: var(--line); border-radius: 999px; transition: background 0.15s;
}
.ckpt-vsplit::before { width: 3px; height: 44px; }
.ckpt-hsplit::before { height: 3px; width: 44px; }
.ckpt-vsplit:hover::before, .ckpt-hsplit:hover::before,
.ckpt-split-active::before { background: var(--accent); }
.ckpt-pane {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
}
.ckpt-pane-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; border-bottom: 1px solid var(--line-soft); flex-shrink: 0;
}
.ckpt-pane-title { font-size: 12px; font-weight: 700; letter-spacing: 0.3px; color: var(--fg-1); }
.ckpt-pane-sub { font-size: 10.5px; color: var(--fg-3); }

/* chat fills the pane (drop the standalone card chrome inside the cockpit) */
.ckpt-chat .exp-transcript {
  flex: 1; border: none; background: transparent; border-radius: 0; padding: 14px;
}

/* instruments: плитка карточек фикс-размера (не скейлятся; узко — в один столбец) */
.ckpt-instruments .exp-panel-col.ckpt-instr {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; align-content: start;
  padding: 12px; overflow-y: auto; overflow-x: hidden;
}
.ckpt-instr .span-2 { grid-column: 1 / -1; }
.ckpt-instr .exp-card { margin: 0; }

/* ── нижняя сцена: карта сценария + цель + таймлайн ─────────────────────── */
.ckpt-stage { flex: 1; min-height: 0; }
.ckpt-stage-head {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px 8px; flex-wrap: wrap;
}
.ckpt-stage-title { font-size: 12.5px; font-weight: 700; color: var(--fg-1); white-space: nowrap; }
.ckpt-stage-sub { font-size: 10.5px; color: var(--fg-3); font-weight: 400; margin-left: 6px; }

/* goal readout */
.ckpt-goal-readout {
  margin-left: auto;
  display: flex; align-items: stretch; gap: 16px; flex-wrap: wrap;
}
.gr-block { min-width: 0; }
.gr-k {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--fg-3); margin-bottom: 3px; display: flex; align-items: center; gap: 7px;
}
.gr-v { font-size: 14px; font-weight: 700; color: var(--fg-0); line-height: 1.2; }
.gr-goal { font-size: 11px; color: var(--fg-2); margin-top: 2px; max-width: 300px; line-height: 1.35; }
.gr-sep { color: var(--fg-3); align-self: center; font-size: 18px; }
.gr-final { min-width: 210px; }
.gr-progress { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); margin-top: 7px; overflow: hidden; }
.gr-progress-fill { height: 100%; border-radius: 999px; transition: width 0.45s var(--ease), background 0.4s ease; }
.gr-progress-lbl { font-size: 9.5px; color: var(--fg-3); margin-top: 4px; }
.gr-dev { font-size: 9px; padding: 1px 7px; border-radius: 999px; font-weight: 600; }
.gr-dev.lvl-yellow { color: #fbbf24; background: rgba(245, 158, 11, 0.16); }
.gr-dev.lvl-red { color: #f87171; background: rgba(239, 68, 68, 0.16); }
.gr-dev.lvl-green { color: #34d399; background: rgba(16, 185, 129, 0.16); }
.gr-health {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 13px; border-radius: 13px; min-width: 190px;
  border: 1px solid var(--line); background: var(--bg-2);
}
.gr-health-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--fg-3); }
.gr-health-lbl { font-size: 12px; font-weight: 700; }
.gr-health-reason { font-size: 10px; color: var(--fg-2); margin-top: 1px; max-width: 260px; line-height: 1.3; }
.gr-health.lvl-green  { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.08); }
.gr-health.lvl-green  .gr-health-dot { background: #10b981; box-shadow: 0 0 9px rgba(16, 185, 129, 0.85); }
.gr-health.lvl-green  .gr-health-lbl { color: #34d399; }
.gr-health.lvl-yellow { border-color: rgba(245, 158, 11, 0.42); background: rgba(245, 158, 11, 0.08); }
.gr-health.lvl-yellow .gr-health-dot { background: #f59e0b; box-shadow: 0 0 9px rgba(245, 158, 11, 0.85); }
.gr-health.lvl-yellow .gr-health-lbl { color: #fbbf24; }
.gr-health.lvl-red    { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.1); }
.gr-health.lvl-red    .gr-health-dot { background: #ef4444; box-shadow: 0 0 9px rgba(239, 68, 68, 0.9); }
.gr-health.lvl-red    .gr-health-lbl { color: #f87171; }

/* scenario map (SVG) — НАТУРАЛЬНЫЙ размер (без скейла), прокрутка/панорама
   мышью, авто-фокус на текущей ноде. Полотно тянется, элементы фикс-размера. */
.ckpt-map-scroll {
  flex: 1; min-height: 120px;
  overflow: hidden; position: relative;
  cursor: grab;
  /* background-image + background-position set dynamically by _applyMapView so
     the infinite grid follows pan and scales with zoom */
  background-color: var(--bg-0);
}
.ckpt-map-scroll.panning { cursor: grabbing; }
.ckpt-map-scroll.panning * { user-select: none; }
.ckpt-map { display: inline-block; transform-origin: 0 0; }
.ckpt-zoom-widget {
  position: absolute; top: 8px; right: 10px; z-index: 10;
  display: flex; align-items: center; gap: 3px;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 2px 5px; pointer-events: all;
}
.ck-svg { display: block; }
.ck-edge { transition: stroke 0.4s ease, stroke-width 0.3s ease; }
.ck-edge-flow { stroke-dasharray: 7 8; animation: ck-flow 0.7s linear infinite; }
@keyframes ck-flow { to { stroke-dashoffset: -15; } }
.ck-node rect { transition: fill 0.35s ease, stroke 0.35s ease, stroke-width 0.3s ease; }
.ck-node text { pointer-events: none; }
/* Active node: a pulsing glow (пульсирующий свет) + a dashed outline whose
   dashes march around the border (вращающийся штрихпунктир). Reads as "this is
   live right now" and stays smooth thanks to the map's signature-guard rebuild. */
.ck-node-cur { animation: ck-glow 1.6s ease-in-out infinite; }
@keyframes ck-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.12)); }
  50%      { filter: drop-shadow(0 0 13px rgba(255, 255, 255, 0.34)); }
}
.ck-node-ring {
  transform-box: fill-box; transform-origin: center;
  stroke-dasharray: 7 6;
  animation: ck-ring 1.9s ease-in-out infinite, ck-ring-spin 1.05s linear infinite;
}
@keyframes ck-ring { 0%, 100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 0.95; transform: scale(1.03); } }
@keyframes ck-ring-spin { to { stroke-dashoffset: -26; } }

/* timeline */
.ckpt-timeline-head { display: flex; align-items: center; gap: 10px; padding: 6px 16px 4px; }
.ckpt-tl-title { font-size: 11px; font-weight: 700; letter-spacing: 0.3px; color: var(--fg-2); text-transform: uppercase; }
.ckpt-tl-hint { font-size: 10px; color: var(--fg-3); }
.ckpt-timeline {
  display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  padding: 4px 16px 14px; min-height: 76px; align-items: stretch;
}
.tl-empty { color: var(--fg-3); font-size: 11px; padding: 20px 4px; }
.tl-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 9px;
  max-width: 240px; padding: 7px 11px;
  border-radius: 11px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--fg-3);
  animation: tl-chip-in 0.25s ease;
}
@keyframes tl-chip-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.tl-chip.lvl-green  { border-left-color: var(--good); }
.tl-chip.lvl-yellow { border-left-color: var(--warn); }
.tl-chip.lvl-red    { border-left-color: var(--bad); }
.tl-chip.kind-user  { background: var(--bg-3); }
.tl-chip.kind-goal  { border-color: rgba(16, 185, 129, 0.4); }
.tl-chip.kind-hangup{ border-color: rgba(239, 68, 68, 0.4); }
.tl-ico { font-size: 15px; line-height: 1; }
.tl-body { min-width: 0; }
.tl-lbl { font-size: 11.5px; font-weight: 600; color: var(--fg-0); white-space: nowrap; }
.tl-detail { font-size: 10px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.tl-time { font-size: 9.5px; color: var(--fg-3); font-family: 'Cascadia Code', monospace; margin-left: auto; align-self: flex-start; }

/* footer */
.ckpt-footer {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; border-top: 1px solid var(--line); flex-shrink: 0;
}
.ckpt-foot-legend { display: flex; gap: 16px; }
.ckpt-foot-legend .lg { font-size: 11px; font-weight: 600; }
.ckpt-foot-legend .lg-g { color: #34d399; }
.ckpt-foot-legend .lg-y { color: #fbbf24; }
.ckpt-foot-legend .lg-r { color: #f87171; }
.ckpt-foot-spacer { flex: 1; }
.ckpt-foot-note { font-size: 11px; color: var(--fg-3); }

/* режим (реплей) + контролы воспроизведения */
.ckpt-mode-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.6px;
  padding: 2px 7px; border-radius: 999px; vertical-align: middle; margin-left: 8px;
  background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.35);
}
.ckpt-replay-controls { display: flex; align-items: center; gap: 8px; }
.ckpt-rc-btn {
  width: 34px; height: 30px; display: grid; place-items: center;
  border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--fg-1); cursor: pointer; font-size: 14px; transition: background 0.15s, color 0.15s;
}
.ckpt-rc-btn:hover { background: var(--bg-3); color: var(--fg-0); }
.ckpt-rc-play { background: var(--accent); color: #fff; border-color: transparent; }
.ckpt-rc-play:hover { filter: brightness(1.1); }
.ckpt-rc-speeds {
  display: inline-flex; gap: 3px; padding: 2px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px;
}
.ckpt-rc-speed {
  min-width: 30px; height: 24px; border: none; background: transparent; color: var(--fg-2);
  border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 600; transition: background 0.15s, color 0.15s;
}
.ckpt-rc-speed:hover { color: var(--fg-0); }
.ckpt-rc-speed.active { background: var(--accent); color: #fff; }

/* кнопка реплея в таблице разговоров */
.cockpit-replay-btn {
  display: inline-block; cursor: pointer; color: var(--accent);
  font-size: 13px; margin-right: 8px; user-select: none;
  transition: transform 0.15s var(--ease), color 0.15s;
}
.cockpit-replay-btn:hover { transform: scale(1.3); color: #a78bfa; }

/* адаптив: на узких окнах — приборы в один столбец, при крайней узости — чат
   над приборами; данные не прячем */
@media (max-width: 1024px) {
  .ckpt-instruments .exp-panel-col.ckpt-instr { grid-template-columns: 1fr; }
  .ckpt-instr .span-2 { grid-column: auto; }
  .ckpt-top { flex-basis: 56%; grid-template-columns: 1fr; grid-auto-rows: minmax(0, 1fr); }
  .ckpt-goal-readout { gap: 12px; }
}

/* ═══════════════════════════════════════════════════════════
   Wave 50 — Scenario Editor (.sce-*)
═══════════════════════════════════════════════════════════ */

/* Fullscreen modal backdrop variant */
.modal-backdrop.modal-fullscreen {
  align-items: stretch; justify-content: stretch;
  padding: 0;
}
.modal-backdrop.modal-fullscreen .sce-modal {
  width: 100%; height: 100vh; border-radius: 0;
  max-width: none; max-height: none;
}

/* Editor shell */
.sce-modal {
  background: var(--bg-0);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modal-in 180ms var(--ease) both;
}

/* Header bar */
.sce-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  flex-shrink: 0;
}
.sce-label-input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--fg-0);
  font-size: 13px; font-weight: 600;
}

/* Body split */
.sce-modal-body {
  display: flex; flex: 1; overflow: hidden;
}

/* Left panel — prompt + inspector */
.sce-left-panel {
  width: 290px; min-width: 230px; max-width: 360px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  overflow-y: auto; padding: 12px;
  background: var(--bg-1);
}
.sce-section-label {
  font-size: 11px; font-weight: 600; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 5px;
}
.sce-prompt-area {
  font-size: 11px; line-height: 1.45;
  flex: 1; min-height: 120px; max-height: 200px;
  resize: none;
  background: var(--bg-0);
  color: var(--fg-2);
}

/* Canvas right panel — grid lives here so it appears infinite */
.sce-canvas-wrap {
  flex: 1; position: relative; overflow: hidden;
  user-select: none; /* prevent text selection on any canvas drag */
  background-color: var(--bg-0);
  /* Subtle grid: minor 24px, major 120px — position/size updated by JS for pan+zoom */
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  cursor: grab;
}
.sce-canvas-wrap.panning { cursor: grabbing; }
.sce-canvas-wrap.panning * { user-select: none; }

/* World layer — virtual canvas that transforms for pan+zoom */
#sce-world {
  position: absolute;
  width: 4000px; height: 3000px;
  top: 0; left: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

/* Canvas toolbars / overlays */
.sce-canvas-toolbar {
  position: absolute; top: 10px; left: 10px; z-index: 20;
  display: flex; gap: 4px; pointer-events: all;
}
.sce-zoom-widget {
  position: absolute; top: 10px; right: 10px; z-index: 20;
  display: flex; align-items: center; gap: 3px;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 3px 6px; pointer-events: all;
}
/* Wave 62: system-nodes bar — translucent panel pinned to the bottom-centre of the
   canvas. Holds the four system nodes as MINI NODE-CARDS (not on the graph). The
   «системные ноды» caption is a small grey header centred ABOVE the cards; the panel
   sizes to its content and swallows mouse events (dragging it never pans the graph). */
.sce-sysbar {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 5px;
  max-width: calc(100% - 40px);
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 11px;
  padding: 6px 10px 8px; pointer-events: all;
}
.sce-sysbar-header {
  font-size: 9.5px; font-weight: 600; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: .09em; text-align: center; line-height: 1;
}
.sce-sysbar-cards { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sce-sysbar-empty { font-size: 11px; color: var(--fg-3); }
/* Mini node-card — same shape/border/select feel as a canvas node, with a «сис» tag. */
.sce-sysbar-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-width: 126px; max-width: 184px; text-align: left; cursor: pointer;
  background: var(--bg-1); border: 1.5px solid rgba(255,255,255,0.18); border-radius: 13px;
  padding: 7px 10px; transition: box-shadow 120ms, transform 80ms, border-color 120ms;
}
.sce-sysbar-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.sce-sysbar-card.sel { box-shadow: 0 0 0 3px rgba(194,198,214,0.32); }
/* Tags row — keep both badges on ONE baseline (cancel the kind-badge bottom margin it
   carries for canvas nodes, which otherwise shifts it up relative to the «сис» tag). */
.sce-sysbar-card-tags { display: flex; align-items: center; gap: 4px; }
.sce-sysbar-card-tags .sce-node-kind { margin-bottom: 0; }
.sce-sysbar-card-sys {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: #1a1d27; background: #c2c6d6; padding: 1px 5px; border-radius: 4px;
}
.sce-sysbar-card-label {
  font-size: 12px; font-weight: 600; color: var(--fg-0); line-height: 1.25; word-break: break-word;
}
/* Locked inspector field (name / type of system, anchor or handler nodes). */
.input.sce-locked, select.sce-locked {
  opacity: 0.72; cursor: not-allowed; background: rgba(255,255,255,0.03);
}
/* Wave 62-cont3: confirm / validation dialog stacked over the editor (its own overlay,
   never a 2nd openModal — that shares #modal-backdrop and would destroy the editor). */
#sce-confirm-overlay {
  position: fixed; inset: 0; z-index: 100001;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.sce-confirm-box {
  width: min(440px, 92vw);
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55); padding: 20px 22px;
}
.sce-confirm-title { font-weight: 700; font-size: 16px; color: var(--fg-0); margin-bottom: 10px; }
.sce-confirm-body { font-size: 13px; line-height: 1.55; color: var(--fg-1); margin-bottom: 18px; }
.sce-confirm-body p { margin: 0 0 8px; }
.sce-validation-list { margin: 8px 0 0; padding-left: 20px; }
.sce-validation-list li { color: #fca5a5; margin-bottom: 5px; font-size: 13px; line-height: 1.5; }
.sce-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Wave 62: header help button (square «?») + context-menu objection item as a
   yellow caution node-card. */
.sce-help-btn {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line);
  color: var(--fg-1); font-size: 14px; font-weight: 700; cursor: pointer; line-height: 1;
  transition: background 120ms, color 120ms;
}
.sce-help-btn:hover { background: rgba(139,92,246,0.22); color: var(--fg-0); border-color: rgba(139,92,246,0.6); }
.sce-ctx-item.sce-ctx-obj {
  margin: 4px 6px; padding: 7px 11px; border-radius: 9px;
  border: 1.5px solid #f59e0b; background: rgba(245,158,11,0.13);
  color: #fde3b3; font-weight: 600;
}
.sce-ctx-item.sce-ctx-obj:hover { background: rgba(245,158,11,0.24); color: #fff; }

/* Wave 62: help overlay (docs) — stacked over the editor, TOC + live search. */
#sce-help-overlay {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.sce-help-box {
  width: min(900px, 92vw); height: min(80vh, 760px);
  display: flex; flex-direction: column;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55); overflow: hidden;
}
.sce-help-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.sce-help-title { font-weight: 700; font-size: 15px; white-space: nowrap; }
.sce-help-search { flex: 1; min-width: 0; font-size: 13px; }
.sce-help-body { display: flex; flex: 1; min-height: 0; }
.sce-help-toc {
  width: 230px; flex-shrink: 0; overflow-y: auto; padding: 12px;
  border-right: 1px solid var(--line); background: var(--bg-2);
  display: flex; flex-direction: column; gap: 2px;
}
.sce-help-toc-link {
  font-size: 12.5px; color: var(--fg-2); cursor: pointer; padding: 5px 8px;
  border-radius: 6px; text-decoration: none; transition: background 100ms, color 100ms;
}
.sce-help-toc-link:hover { background: var(--hover); color: var(--fg-0); }
.sce-help-content { flex: 1; min-width: 0; overflow-y: auto; padding: 18px 22px; }
.sce-help-sec { margin-bottom: 22px; scroll-margin-top: 12px; }
.sce-help-sec h3 { font-size: 15px; color: var(--fg-0); margin: 0 0 8px; }
.sce-help-sec p { font-size: 13px; line-height: 1.6; color: var(--fg-1); margin: 0 0 8px; }
.sce-help-sec ul { margin: 0 0 8px; padding-left: 20px; }
.sce-help-sec li { font-size: 13px; line-height: 1.55; color: var(--fg-1); margin-bottom: 3px; }
.sce-help-sec b { color: var(--fg-0); }
.sce-tool-btn {
  background: rgba(255,255,255,0.08); border: 1px solid var(--line);
  color: var(--fg-1); border-radius: 5px;
  padding: 3px 8px; font-size: 12px; cursor: pointer;
  line-height: 1.4; min-width: 22px; text-align: center;
  transition: background 120ms; white-space: nowrap;
}
.sce-tool-btn:hover:not(:disabled) { background: rgba(255,255,255,0.16); color: var(--fg-0); }
.sce-tool-btn:disabled { opacity: 0.45; cursor: default; }
/* Context menu */
#sce-ctx-menu {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45);
  padding: 4px 0;
  min-width: 180px;
  font-size: 13px;
  user-select: none;
}
.sce-ctx-item {
  padding: 7px 14px;
  cursor: pointer;
  color: var(--fg-1);
  transition: background 0.1s;
}
.sce-ctx-item:hover { background: var(--hover); color: var(--fg-0); }
.sce-ctx-item.danger { color: #ef4444; }
.sce-ctx-item.danger:hover { background: rgba(239,68,68,0.12); }
.sce-zoom-select {
  background: rgba(255,255,255,0.08); border: 1px solid var(--line);
  color: var(--fg-0); border-radius: 5px; padding: 2px 2px;
  font-size: 12px; cursor: pointer; min-width: 58px;
}
/* Version bar */
.sce-version-bar {
  align-items: center;
  gap: 12px;
  padding: 5px 14px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  min-height: 32px;
}
.sce-version-sel {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--fg-0);
  font-size: 12px;
  padding: 2px 20px 2px 7px;
  cursor: pointer;
  min-width: 90px;
  max-width: 220px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
}
.sce-version-title-inp { font-size: 12px; }
.sce-edges-svg {
  position: absolute; top: 0; left: 0;
  width: 4000px; height: 3000px;
  pointer-events: none;
  overflow: visible;
}
.sce-edges-svg .sce-edge-hitbox { pointer-events: all; cursor: pointer; }
.sce-nodes-layer {
  position: absolute; top: 0; left: 0;
  width: 4000px; height: 3000px;
  pointer-events: none;
}
.sce-connecting-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(139,92,246,0.88); color: #fff;
  padding: 6px 14px; border-radius: 20px; font-size: 12px;
  pointer-events: none;
  z-index: 10;
}

/* Node div */
.sce-node {
  position: absolute;
  width: 144px;
  min-height: 52px;
  background: var(--bg-1); /* opaque — hides edges that pass underneath */
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 13px;
  padding: 6px 10px 7px 10px;
  cursor: grab;
  user-select: none;
  pointer-events: all;
  transition: box-shadow 120ms, border-color 120ms;
  transform: translate(-50%, -50%); /* positions are centres */
}
.sce-node:active { cursor: grabbing; }
.sce-node-selected {
  border-color: var(--accent, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.35);
}
.sce-node-kind {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #fff; padding: 1px 5px; border-radius: 4px;
  display: inline-block; margin-bottom: 4px;
}
.sce-node-label {
  font-size: 12px; font-weight: 600; color: var(--fg-0);
  line-height: 1.3;
  word-break: break-word;
}
.sce-node-star {
  position: absolute; top: 5px; right: 7px;
  font-size: 13px; color: #f59e0b;
}
/* Wave 62 [task 1]: system-node badge (contact-recovery, global objection, …).
   Colour matches the cockpit's system-node readability tint (#c2c6d6). */
.sce-node-sys {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: #1a1d27; background: #c2c6d6; padding: 1px 5px; border-radius: 4px;
  display: inline-block; margin-bottom: 4px; margin-left: 4px;
}
/* Connection handle — right edge dot */
.sce-node-handle {
  position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent, #8b5cf6);
  border: 2px solid var(--bg-0);
  cursor: crosshair;
  opacity: 0;
  transition: opacity 120ms;
  pointer-events: all;
  z-index: 2;
}
.sce-node:hover .sce-node-handle { opacity: 1; }

/* Node inspector / edge inspector inside left panel */
.sce-node-inspector, .sce-edge-inspector { display: flex; flex-direction: column; gap: 4px; }

/* kind color classes for node borders */
.sce-kind-entry    { border-color: #10b981; }
.sce-kind-progress { border-color: #8b5cf6; }
.sce-kind-success  { border-color: #22c55e; }
.sce-kind-terminal { border-color: #6b7280; }
.sce-kind-caution  { border-color: #f59e0b; }
.sce-kind-danger   { border-color: #ef4444; }

/* ════════════════════════════════════════════════════════════════════════
   BATTLE / OPERATIONS (Wave 55) — operations console
   ════════════════════════════════════════════════════════════════════════ */
.btn-danger { background: rgba(239,68,68,.12); color: var(--bad); border: 1px solid rgba(239,68,68,.4); }
.btn-danger:hover { background: rgba(239,68,68,.2); border-color: var(--bad); }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }

.nav-item-accent svg { fill: var(--accent); }
.nav-item-accent span { font-weight: 600; }

.battle-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.battle-kpis { margin-bottom: 8px; }
.kpi-value.kpi-accent { background: linear-gradient(180deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.battle-head { display: flex; align-items: center; gap: 10px; margin: 22px 2px 12px; font-size: 13px;
  text-transform: uppercase; letter-spacing: .08em; color: var(--fg-2); font-weight: 600; }
.battle-head-hint { font-size: 12px; color: var(--fg-3); text-transform: none; letter-spacing: 0; font-weight: 400; }

/* campaigns — rows double as the dashboard FOCUS selector (Wave 57): click a
   row to focus the live dashboard on that campaign. Exactly one row is always
   selected when any campaign/quick-launch exists. */
.camp-list { display: flex; flex-direction: column; gap: 8px; }
.camp-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; user-select: none; transition: background .18s ease, border-color .18s ease, box-shadow .25s ease; }
.camp-row:hover { border-color: rgba(139,92,246,.4); }
.camp-row.selected { background: linear-gradient(180deg, rgba(139,92,246,.16), rgba(99,102,241,.07));
  border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(139,92,246,.18); }
/* animated focus ring on the selected campaign */
.camp-row.selected::after { content: ''; position: absolute; inset: -1px; border-radius: inherit;
  border: 1.5px solid var(--accent); pointer-events: none; animation: camp-ring 1.9s ease-in-out infinite; }
@keyframes camp-ring { 0%,100% { opacity: .85; box-shadow: 0 0 0 0 rgba(139,92,246,.0); }
  50% { opacity: .35; box-shadow: 0 0 0 3px rgba(139,92,246,.16); } }
/* quick launch pseudo-row — pinned at the top, amber outline */
.camp-row.camp-quick { border-color: rgba(245,158,11,.55); background: rgba(245,158,11,.07); }
.camp-row.camp-quick:hover { border-color: rgba(245,158,11,.85); }
.camp-row.camp-quick.selected { background: linear-gradient(180deg, rgba(245,158,11,.18), rgba(245,158,11,.06));
  border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn), 0 0 16px rgba(245,158,11,.22); }
.camp-row.camp-quick.selected::after { border-color: var(--warn); animation-name: camp-ring-amber; }
@keyframes camp-ring-amber { 0%,100% { opacity: .85; box-shadow: 0 0 0 0 rgba(245,158,11,.0); }
  50% { opacity: .35; box-shadow: 0 0 0 3px rgba(245,158,11,.2); } }
.camp-main { flex: 1; min-width: 0; }
.camp-name { font-size: 14px; font-weight: 600; color: var(--fg-0); display: flex; align-items: center; gap: 8px; }
.camp-sub { font-size: 12px; color: var(--fg-2); margin-top: 3px; }
.camp-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.camp-pin { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--warn); border: 1px solid rgba(245,158,11,.5); background: rgba(245,158,11,.1);
  padding: 2px 8px; border-radius: 999px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line); color: var(--fg-2); background: var(--bg-3); }
.pill-success { color: var(--good); border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.08); }
.pill-warning { color: var(--warn); border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.08); }
.pill-danger  { color: var(--bad);  border-color: rgba(239,68,68,.4);  background: rgba(239,68,68,.08); }

/* live call grid */
.calls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.call-card { background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--fg-3);
  border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.call-card.st-active { border-left-color: var(--good); }
.call-card.st-connecting { border-left-color: var(--accent); }
.call-card.st-paused { border-left-color: var(--warn); }
.call-card.st-stopping { border-left-color: var(--bad); }
.call-card.st-idle { border-left-color: var(--fg-3); opacity: .6; }
.call-card-top { display: flex; align-items: center; gap: 8px; }
.op-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.call-op { font-size: 14px; font-weight: 600; color: var(--fg-0); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-card-mid { display: flex; align-items: center; justify-content: space-between; }
.call-dur { font-size: 13px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.call-card-foot { display: flex; align-items: center; gap: 6px; }
.call-card-foot .btn { flex: 0 0 auto; }
.call-card-foot .btn:first-child { flex: 1; }
.mode-sip { color: var(--accent); border-color: rgba(139,92,246,.4); background: rgba(139,92,246,.08); }
.mode-emu { color: var(--fg-2); }

.call-state { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.call-state.st-active { color: var(--good); background: rgba(16,185,129,.1); }
.call-state.st-connecting { color: var(--accent); background: rgba(139,92,246,.1); }
.call-state.st-paused { color: var(--warn); background: rgba(245,158,11,.1); }
.call-state.st-stopping { color: var(--bad); background: rgba(239,68,68,.1); }
.call-state.st-idle { color: var(--fg-3); background: var(--bg-3); }

/* campaign modal checkboxes */
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; max-height: 180px;
  overflow-y: auto; padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-1); cursor: pointer; padding: 3px 0; }
.op-pick-list { grid-template-columns: 1fr; max-height: 220px; }
.op-pick { justify-content: flex-start; gap: 10px; padding: 5px 4px; border-radius: 6px; }
.op-pick:hover { background: var(--bg-3); }
.op-pick-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-pick-sc { color: var(--good); font-size: 11px; background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); border-radius: 999px; padding: 1px 8px; flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── card Picker overlay (operators / telephonies) ── */
.picker-backdrop { position: fixed; inset: 0; background: rgba(8,8,14,.72); backdrop-filter: blur(3px);
  z-index: 9500; display: flex; align-items: center; justify-content: center; padding: 24px; }
.picker-modal { width: min(820px, 96vw); max-height: 86vh; background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.6); }
.picker-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.picker-head h3 { font-size: 15px; font-weight: 700; color: var(--fg-0); margin-right: 6px; }
.picker-grid { flex: 1; overflow-y: auto; padding: 16px 18px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; align-content: start; }
.picker-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .12s, background .12s; }
.picker-card:hover { border-color: var(--accent); background: var(--bg-3); }
.picker-card.selected { border-color: var(--accent); background: rgba(139,92,246,.1); }
.pick-main { flex: 1; min-width: 0; }
.pick-name { font-size: 14px; font-weight: 600; color: var(--fg-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-sub { font-size: 11px; color: var(--fg-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-check { width: 20px; text-align: center; color: var(--accent); font-weight: 700; flex-shrink: 0; }
.picker-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.picker-count { font-size: 12px; color: var(--fg-2); }

/* ── selected-chips row (in the campaign modal) ── */
.picker-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px;
  background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.3); color: var(--fg-0); font-size: 12px; }
.chip-x { cursor: pointer; color: var(--fg-2); font-size: 11px; padding: 0 3px; }
.chip-x:hover { color: var(--bad); }
.chip-empty { font-size: 12px; color: var(--fg-3); }

/* ════════════════════════════════════════════════════════════════════════
   LIVE DASHBOARD (Wave 56) — mission-control canvas for a campaign
   ════════════════════════════════════════════════════════════════════════ */
.dash-layers { display: inline-flex; gap: 2px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 2px; }
.dash-layer { font-size: 12px; font-weight: 600; color: var(--fg-2); background: transparent; border: none;
  padding: 3px 12px; border-radius: 6px; cursor: pointer; font-family: inherit; }
.dash-layer.active { background: rgba(139,92,246,.18); color: var(--fg-0); }
.dash-layer:disabled { opacity: .4; cursor: not-allowed; }

/* Same "graph paper" grid as the call cockpit (.ckpt-map-scroll): a fine 24px
   grid layered with a coarse 120px grid. JS (_applyPan) shifts background-position
   so the grid scrolls with the panned world, exactly like the cockpit map. */
/* The battle section is locked to the scroll-viewport height (.main is 100vh) so
   the dashboard — its last flex child — grows to fill ALL the free space below the
   campaigns list. Was `height: min(680px, calc(100vh-280px))`: the 680px cap left
   dead space on tall windows, and the magic 280px offset didn't track the KPIs/
   campaigns above. flex:1 adapts to whatever sits above it; definite height:100%
   on the section makes flex distribute EXACTLY (no growth-overflow). */
.section[data-section="battle"].active { height: 100%; }
.dash-viewport { position: relative; flex: 1 1 auto; min-height: 460px;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: grab; background-color: var(--bg-0); user-select: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px; }
.dash-viewport.panning { cursor: grabbing; }
.dash-viewport.fullscreen { position: fixed; inset: 0; height: auto; z-index: 8000; border-radius: 0; }
.dash-world { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.dash-edges { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
.dash-nodes { position: absolute; top: 0; left: 0; }

.dn { position: absolute; box-sizing: border-box; background: var(--bg-2); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 10px 12px; opacity: 1; transform: scale(1);
  transition: opacity .42s ease, transform .42s cubic-bezier(.2,.7,.3,1), border-color .7s ease, box-shadow .7s ease; }
.dn.spawning { opacity: 0; transform: scale(.88) translateY(6px); }
.dn.despawning { opacity: 0; transform: scale(.9); }
.dn-gen { width: 130px; text-align: center; border-color: rgba(139,92,246,.6); background: rgba(139,92,246,.06); }
.dn-spawner { width: 140px; text-align: center; border-color: rgba(139,92,246,.5); background: rgba(139,92,246,.05); }
.dn-op { width: 208px; cursor: pointer; }
.dn-op:hover { border-color: var(--accent); }
.dn-op.selected { box-shadow: 0 0 0 2px var(--accent); }
.dn-op.h-green  { border-color: rgba(16,185,129,.6); }
.dn-op.h-yellow { border-color: rgba(245,158,11,.7); }
.dn-op.h-red    { border-color: rgba(239,68,68,.8); box-shadow: 0 0 0 1px rgba(239,68,68,.25); }
/* telephony layer — trunk nodes (capacity bar + load/health) */
.dn-trunk { width: 220px; cursor: default; }
.dn-trunk.h-green  { border-color: rgba(16,185,129,.6); }
.dn-trunk.h-yellow { border-color: rgba(245,158,11,.7); }
.dn-trunk.h-red    { border-color: rgba(239,68,68,.8); box-shadow: 0 0 0 1px rgba(239,68,68,.25); }
.dn-cap { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 8px; }
.dn-cap-fill { height: 100%; border-radius: 999px; width: 0; transition: width .5s var(--ease), background .4s ease;
  background: linear-gradient(90deg, var(--good), var(--warn)); }
.dn-trunk.h-yellow .dn-cap-fill { background: linear-gradient(90deg, var(--warn), #fb923c); }
.dn-trunk.h-red .dn-cap-fill { background: linear-gradient(90deg, #fb923c, var(--bad)); }
.dn-cap-lbl { font-size: 11px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.dn-title { font-size: 13px; font-weight: 700; color: var(--fg-0); display: flex; align-items: center; gap: 7px; }
.dn-title .hdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; transition: background .6s ease; }
.h-green .hdot { background: var(--good); } .h-yellow .hdot { background: var(--warn); } .h-red .hdot { background: var(--bad); }
.dn-sub { font-size: 11px; color: var(--fg-2); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-sub.warn { color: var(--warn); } .dn-sub.bad { color: var(--bad); }
.dn-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.dn-dur { font-size: 11px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.dn-pulse { animation: dnpulse 1.6s ease-in-out infinite; }
@keyframes dnpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.0); } 50% { box-shadow: 0 0 0 4px rgba(245,158,11,.18); } }
.dash-imp { fill: var(--accent); }
.dash-edge { fill: none; stroke: rgba(139,92,246,.4); stroke-width: 2; transition: stroke .6s ease; }
.dash-edge.h-yellow { stroke: rgba(245,158,11,.5); } .dash-edge.h-red { stroke: rgba(239,68,68,.6); }

/* floating side panel (does not pan) — full dashboard height with symmetric
   14px margins; the two sections scale to fill so push events get max space. */
.dash-side { position: absolute; top: 14px; right: 14px; bottom: 14px; width: 244px;
  display: flex; flex-direction: column; background: rgba(19,19,28,.94); border: 1px solid var(--line);
  border-radius: var(--radius-sm); backdrop-filter: blur(4px); overflow: hidden; user-select: none; }
.dash-side-h { flex-shrink: 0; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-3); font-weight: 600;
  padding: 10px 12px 6px; display: flex; gap: 6px; align-items: baseline; }
.dash-side-cnt { color: var(--fg-2); }
.dash-calls { flex: 1 1 38%; min-height: 56px; overflow-y: auto; padding: 0 8px 8px; }
.dash-call { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--fg-1); }
.dash-call:hover { background: var(--bg-3); }
.dash-call .cdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dash-call .cname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-0); }
.dash-call .cstage { color: var(--fg-3); font-size: 11px; }
.dash-events { flex: 1 1 62%; min-height: 70px; overflow-y: auto; padding: 0 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.dash-event { font-size: 11px; padding: 6px 9px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; animation: evin .35s ease; }
@keyframes evin { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.dash-event.warn { color: var(--warn); background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.25); }
.dash-event.bad  { color: var(--bad);  background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.25); }
.dash-event .evt { color: var(--fg-3); font-size: 10px; }

.dash-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--fg-3); font-size: 14px; text-align: center; padding: 24px; pointer-events: none; }
.dash-fs-exit { position: absolute; top: 14px; left: 14px; display: none; z-index: 5; font-size: 12px;
  background: rgba(19,19,28,.94); color: var(--fg-1); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.dash-viewport.fullscreen .dash-fs-exit { display: block; }

/* campaign progress overlay — floats top-left over the canvas, does not pan */
.dash-progress { position: absolute; top: 14px; left: 14px; z-index: 6; width: 300px; max-width: 42%;
  background: rgba(19,19,28,.94); border: 1px solid var(--line); border-radius: var(--radius-sm);
  backdrop-filter: blur(4px); padding: 10px 13px; user-select: none; }
/* in fullscreen the «выйти» button sits at top-left, so drop the panel below it */
.dash-viewport.fullscreen .dash-progress { top: 56px; }
.dash-progress.hidden { display: none; }
.dash-progress-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.dash-progress-title { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-3); font-weight: 600; }
.dash-progress-pct { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--fg-0); font-variant-numeric: tabular-nums; }
.dash-progress-bar { height: 7px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.dash-progress-fill { height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  transition: width .5s var(--ease); }
.dash-progress-sub { font-size: 11px; color: var(--fg-2); margin-top: 6px; }
.dash-progress-sub b { color: var(--fg-0); font-weight: 700; }

.gdot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* drill-in cockpit */
.battle-cockpit { width: min(1100px, 94vw); height: min(720px, 90vh); display: flex; flex-direction: column;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bc-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.bc-title { font-size: 16px; font-weight: 700; color: var(--fg-0); }
.bc-sub { font-size: 12px; color: var(--fg-2); margin-top: 2px; }
.bc-badges { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.bc-dur { font-size: 14px; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.bc-body { flex: 1; display: grid; grid-template-columns: 1fr 280px; min-height: 0; }
.bc-transcript { overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.bc-line { display: flex; flex-direction: column; gap: 3px; max-width: 85%; }
.bc-line.assistant { align-self: flex-start; }
.bc-line.user { align-self: flex-end; align-items: flex-end; }
.bc-role { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .05em; }
.bc-text { font-size: 14px; line-height: 1.5; padding: 8px 12px; border-radius: 10px; }
.bc-line.assistant .bc-text { background: var(--bg-2); color: var(--fg-0); border: 1px solid var(--line); }
.bc-line.user .bc-text { background: rgba(139,92,246,.12); color: var(--fg-0); border: 1px solid rgba(139,92,246,.3); }
.bc-side { border-left: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-2); }
.bc-panel { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.bc-panel-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); margin-bottom: 6px; }
.bc-fsm, .bc-health, .bc-lat { font-size: 13px; color: var(--fg-0); word-break: break-word; }
.bc-health.health-green { color: var(--good); }
.bc-health.health-yellow { color: var(--warn); }
.bc-health.health-red { color: var(--bad); }
.bc-controls { margin-top: auto; display: flex; gap: 8px; }
.bc-controls .btn { flex: 1; justify-content: center; }
@media (max-width: 760px) { .bc-body { grid-template-columns: 1fr; } .bc-side { border-left: none; border-top: 1px solid var(--line); } }

/* ── operator semantic-cache browser modal ─────────────────────────────────── */
.cache-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.cache-total { font-size: 12.5px; color: var(--fg-2); }
.cache-total b { color: var(--fg-0); }
.cache-browser { display: flex; height: min(64vh, 560px); }
.cache-scn-list { flex: 0 0 244px; border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; }
.cache-scn-item { padding: 10px 12px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; transition: background .12s, border-color .12s; }
.cache-scn-item:hover { background: var(--bg-2); }
.cache-scn-item.active { background: rgba(139,92,246,.13); border-color: rgba(139,92,246,.45); }
.cache-scn-name { font-size: 13.5px; color: var(--fg-0); font-weight: 600; word-break: break-word; }
.cache-scn-sub { font-size: 11px; color: var(--fg-2); margin-top: 3px; }
.cache-replies { flex: 1; overflow-y: auto; padding: 12px 16px; }
.cache-state-group { margin-bottom: 18px; }
.cache-state-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-2); margin: 0 0 9px; position: sticky; top: 0; background: var(--bg-1); padding: 7px 0 6px; z-index: 1; }
.cache-state-head .cnt { color: var(--accent); font-weight: 600; }
.cache-reply-row { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.cache-reply-utt { font-size: 12px; color: var(--fg-2); margin-bottom: 5px; word-break: break-word; }
.cache-reply-text { font-size: 13.5px; color: var(--fg-0); line-height: 1.45; word-break: break-word; }
.cache-reply-meta { display: flex; align-items: center; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.cache-chip { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: var(--bg-3); color: var(--fg-1); }
.cache-age { font-size: 10.5px; color: var(--fg-3); margin-left: auto; white-space: nowrap; }
.cache-empty { padding: 40px 28px; text-align: center; color: var(--fg-2); font-size: 13.5px; line-height: 1.6; }
@media (max-width: 720px) { .cache-browser { flex-direction: column; height: 72vh; } .cache-scn-list { flex: 0 0 auto; max-height: 30%; border-right: none; border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; } .cache-scn-item { flex: 0 0 auto; } }

/* ===================== Accounts / auth (Increment 6) ===================== */
.login-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 18, .82); backdrop-filter: blur(6px);
}
.login-overlay.hidden { display: none; }
.login-card {
  width: 340px; max-width: 90vw; padding: 28px 26px;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line, #2a2a3a); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 12px;
}
.login-brand { font-size: 24px; font-weight: 700; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { font-size: 12.5px; color: var(--fg-2); margin-top: -6px; margin-bottom: 6px; }
.login-error { color: #ff6b6b; font-size: 12.5px; min-height: 1em; }
.login-submit { margin-top: 6px; justify-content: center; }

.auth-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.auth-identity { font-size: 11.5px; color: var(--fg-2); flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.auth-logout { flex: 0 0 auto; }

/* My keys */
.keys-intro { font-size: 13px; color: var(--fg-2); margin-bottom: 14px; }
.key-card { padding: 16px 18px; margin-bottom: 12px; }
.key-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.key-hint { font-size: 12px; color: var(--fg-2); margin-bottom: 10px; }
.key-row { display: flex; gap: 8px; align-items: center; }
.key-input { flex: 1; }

/* Accounts admin */
.acc-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 18px 4px; }
.acc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-users { padding: 8px 4px; display: flex; flex-direction: column; gap: 8px; }
.acc-user { display: flex; align-items: center; gap: 8px; justify-content: space-between;
  flex-wrap: wrap; font-size: 13px; }
.acc-user-act { display: flex; align-items: center; gap: 6px; }
.acc-user-add { border-top: 1px dashed var(--line, #2a2a3a); padding-top: 10px; }
.acc-users-row > td { background: rgba(255,255,255,.02); }
