:root {
  --paper: #f7f6ff;
  --ink: #12122b;
  --ink-soft: #5a5b7d;
  --navy: #06038d;
  --navy-2: #2a27c9;
  --coral: #f75128;
  --coral-soft: #fde8df;
  --mist: #e3e5f4;
  --white: #ffffff;
  --green: #1e9e5a;
  --screen: #070736;
  --screen-2: #14127a;
  --font: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: #fbfbff;
  background-image:
    radial-gradient(55% 45% at 8% 0%, rgba(6, 3, 141, .16), transparent 62%),
    radial-gradient(45% 40% at 96% 8%, rgba(247, 81, 40, .18), transparent 60%),
    radial-gradient(60% 50% at 50% 110%, rgba(42, 39, 201, .12), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f6f4ff 60%, #fff3ee 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
button { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* Кнопки */
.btn {
  border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.btn:disabled { cursor: default; opacity: .45; }
.btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.btn-primary { background: var(--navy); color: var(--white); font-weight: 600; }
.btn-primary:hover { background: var(--navy-2); }
.btn-wide { width: 100%; padding: 14px 22px; }
.btn-ghost { background: transparent; color: var(--ink-soft); padding: 8px 14px; }
.btn-ghost:hover { background: var(--mist); color: var(--ink); }
.btn-outline { background: var(--white); color: var(--navy); border: 1.5px solid var(--navy); padding: 7px 14px; font-weight: 600; font-size: 14px; }
.btn-outline:hover { background: var(--navy); color: var(--white); }

/* Переключатель языка интерфейса */
.lang-switch { display: inline-flex; border: 1.5px solid var(--mist); border-radius: 999px; padding: 2px; background: var(--white); }
.lang-switch button { border: 0; background: transparent; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.lang-switch button:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* Вход */
.view { min-height: 100dvh; }
#view-login { display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login-scene { position: absolute; inset: auto 0 0 0; height: 40vh; pointer-events: none; opacity: .9; }
.login-scene canvas { width: 100%; height: 100%; display: block; }
.login { position: relative; width: min(440px, 100%); background: var(--white); border-radius: 26px; padding: 36px 36px 28px; box-shadow: 0 30px 80px rgba(6, 3, 141, .14); }
.login-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.login-logo { height: 30px; width: auto; display: block; }
.login h1 { font-size: 32px; letter-spacing: -.01em; font-weight: 700; }
.login-lead { color: var(--ink-soft); margin: 8px 0 24px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.field input { width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid var(--mist); border-radius: 12px; background: var(--paper); color: var(--ink); }
.field input:focus { outline: none; border-color: var(--navy); background: var(--white); }
.form-error { color: #c8321a; margin: 0 0 12px; font-size: 14px; }
.login .btn-wide { margin-top: 6px; }
.login-foot { margin: 20px 0 0; font-size: 13px; color: var(--ink-soft); text-align: center; }

/* Шапка */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px clamp(16px, 4vw, 40px); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; font-weight: 600; }
.brand img { height: 26px; width: auto; }
.brand span { padding-left: 14px; border-left: 1.5px solid var(--mist); color: var(--ink-soft); font-weight: 500; }
.top-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

@media (max-width: 1120px) {
  .brand span { display: none; }
  .top-nav { gap: 2px; }
  .top-nav .btn { padding: 8px 10px; font-size: 14px; }
}

/* Раскладка */
.layout { display: grid; grid-template-columns: minmax(260px, 300px) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); padding: 8px clamp(16px, 4vw, 40px) 56px; max-width: 1280px; margin: 0 auto; }


/* Линии */
.lines { display: grid; gap: 10px; align-content: start; }
.lines h2 { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; letter-spacing: .04em; text-transform: none; margin: 0 0 -4px 4px; }
.lines-list { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border: 1.5px solid rgba(6, 3, 141, .06); border-radius: 14px; }
.line { width: 100%; text-align: left; background: transparent; border: 0; border-radius: 10px; padding: 7px 10px; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; cursor: pointer; color: inherit; transition: background .15s ease; }
.line:hover { background: rgba(6, 3, 141, .06); }
.line[aria-selected="true"] { background: var(--navy); color: var(--white); }
.line[aria-selected="true"] .line-sub { color: rgba(255,255,255,.7); }
.line:not([aria-selected="true"]) .line-sub { display: none; }
.line:focus-visible { outline: 3px solid var(--coral); outline-offset: -3px; }
.line:disabled { cursor: default; opacity: .7; }
.line-avatar { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 11px; color: var(--white); background: linear-gradient(135deg, var(--navy), #3d3bd6); }
.line[aria-selected="true"] .line-avatar { background: var(--white); color: var(--navy); }
.line[data-id="collection"] .line-avatar, .pb-avatar[data-id="collection"] { background: linear-gradient(135deg, var(--coral), #ff8a5c); }
.line[data-id="pharma"] .line-avatar, .pb-avatar[data-id="pharma"] { background: linear-gradient(135deg, #1e9e5a, #5fd49a); }
.line[data-id="ofb-en"] .line-avatar, .pb-avatar[data-id="ofb-en"] { background: linear-gradient(135deg, #0f6fbf, #5db4ff); }
.line-title { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.line-sub { font-size: 12px; color: var(--ink-soft); line-height: 1.3; }

.settings { background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border: 1.5px solid rgba(6, 3, 141, .06); border-radius: 14px; padding: 10px 12px; display: grid; gap: 8px; }
.variant-box { margin: 0; display: grid; grid-template-columns: 60px 1fr; gap: 6px; align-items: start; }
.variant-box h3 { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; margin: 6px 0 0; line-height: 1.2; overflow-wrap: anywhere; }
.variant-list { display: flex; flex-wrap: wrap; gap: 4px; }
.variant { border: 1.5px solid var(--mist); background: var(--white); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; cursor: pointer; color: var(--ink); }
.variant[aria-checked="true"] { border-color: var(--navy); background: var(--navy); color: var(--white); }
.variant:disabled { opacity: .4; cursor: default; }
.variant:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.variant-note { width: 100%; font-size: 11px; color: var(--ink-soft); margin: 0; line-height: 1.3; }

.notice { background: var(--coral-soft); border-radius: 12px; padding: 8px 12px; font-size: 11.5px; margin: 0; line-height: 1.4; color: #6b2a17; }
.notice-stand { margin: 0; }
.help { font-size: 12px; color: var(--ink-soft); background: rgba(255,255,255,.7); border-radius: 12px; padding: 7px 12px; }
.help summary { cursor: pointer; color: var(--ink); font-weight: 600; font-size: 12.5px; }
.help ol { padding-left: 18px; margin: 6px 0 2px; }
.help li { margin-bottom: 2px; }
.disclaimer { margin: 0 4px; font-size: 10.5px; color: var(--ink-soft); line-height: 1.35; }

/* Сводка параметров (телефон) */
.param-bar, .sheet-close, .sheet-backdrop { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 14px; padding-top: 4px; }
  .lines { order: 2; display: none; }
  .lines.open { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 86vh; overflow-y: auto; padding: 14px 16px 24px; background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px rgba(6, 3, 141, .25); }
  .lines.open .line:not([aria-selected="true"]) .line-sub { display: block; }
  .sheet-close { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -14px; margin: -14px -16px 0; padding: 10px 16px; background: var(--paper); z-index: 1; }
  .sheet-close b { font-size: 15px; }
  .sheet-backdrop { position: fixed; inset: 0; background: rgba(7, 7, 54, .45); z-index: 29; }
  .param-bar { display: grid; gap: 10px; width: 100%; text-align: left; background: var(--white); border: 1.5px solid rgba(6, 3, 141, .12); border-radius: 18px; padding: 14px 14px 12px; cursor: pointer; color: var(--ink); font: inherit; box-shadow: 0 10px 30px rgba(6, 3, 141, .08); }
  .pb-head { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
  .pb-avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--white); background: linear-gradient(135deg, var(--navy), #3d3bd6); }
  .pb-text { display: grid; line-height: 1.2; }
  .pb-text b { font-size: 17px; font-weight: 700; }
  .pb-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
  .pb-chips { display: flex; gap: 8px; flex-wrap: wrap; }
  .pb-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 1.5px solid var(--mist); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
  .pb-chip b { color: var(--navy); }
  .pb-key { color: var(--ink-soft); }
  .pb-more { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--navy); color: var(--white); border-radius: 999px; padding: 11px 16px; font-weight: 600; font-size: 14.5px; }
  .pb-more svg { width: 18px; height: 18px; }
  .param-bar[aria-expanded="true"] { border-color: var(--navy); }
  .top { padding: 12px 16px; }
  .top-nav .btn-outline { display: none; }
}

/* Экран звонка */
.phone { display: grid; gap: 20px; align-content: start; }
.screen {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 80% at 50% -10%, var(--screen-2), var(--screen) 60%);
  color: var(--white); border-radius: 30px; padding: 26px 24px 22px;
  display: grid; gap: 14px;
  box-shadow: 0 40px 90px rgba(6, 3, 141, .28);
}
.screen::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(80% 60% at 50% 30%, #000, transparent); pointer-events: none; }
.screen > * { position: relative; }
.screen-head { text-align: center; }
.screen-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.screen-sub { margin: 2px 0 0; color: rgba(255,255,255,.62); font-size: 15px; }

/* Возможности линии */
.features { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.feature { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); }
.feature .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.3); flex: none; }
.feature.on { color: var(--white); border-color: rgba(127, 224, 168, .35); }
.feature.on .dot { background: #7fe0a8; box-shadow: 0 0 10px rgba(127, 224, 168, .8); }
.feature.live .dot { animation: blink 1.1s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

/* Волны */
.wave-wrap { position: relative; height: 150px; margin: 4px 0 0; }
.wave { width: 100%; height: 100%; display: block; }
.wave-legend { position: absolute; right: 8px; top: 4px; display: flex; gap: 12px; font-size: 11px; color: rgba(255,255,255,.55); }
.lg::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg-bot::before { background: var(--coral); }
.lg-user::before { background: #7fe0a8; }

.status-row { display: flex; justify-content: center; align-items: baseline; gap: 16px; }
.screen-status { margin: 0; color: rgba(255,255,255,.78); font-size: 15px; }
.timer { margin: 0; font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.timer.warn { color: #ffb08a; }

.captions-wrap { position: relative; }
.captions { list-style: none; margin: 0; padding: 0 8px 0 4px; height: min(34vh, 280px); overflow-y: hidden; display: flex; flex-direction: column; gap: 7px; overscroll-behavior: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent; cursor: pointer; outline: none; }
.captions.active { overflow-y: auto; overscroll-behavior: contain; cursor: auto; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); border-radius: 12px; }
.captions:empty { height: 0; }
.captions-hint { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); background: rgba(6,3,141,.85); color: var(--white); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 11.5px; cursor: pointer; }
.captions-hint:hover { background: rgba(6,3,141,1); }
.captions::-webkit-scrollbar { width: 6px; }
.captions::-webkit-scrollbar-thumb { background: rgba(255,255,255,.35); border-radius: 3px; }
.caption { padding: 7px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; max-width: 88%; flex: none; }
.caption.bot { background: rgba(255,255,255,.10); align-self: flex-start; border-bottom-left-radius: 4px; }
.caption.user { background: var(--coral); align-self: flex-end; border-bottom-right-radius: 4px; }
.caption.sys { background: transparent; align-self: center; color: rgba(255,255,255,.55); font-size: 13px; }

/* Состояние линии */
.health { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: 12px; color: rgba(255,255,255,.8); }
.chip-val { font-weight: 600; color: var(--white); }
.chip[data-state="ok"] .chip-val { color: #7fe0a8; }
.chip[data-state="warn"] .chip-val { color: #ffb08a; }
.chip[data-state="bad"] .chip-val { color: #ff7a7a; }
.meter { width: 56px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7fe0a8, #ffd37a, #ff7a7a); transition: width .08s linear; }

/* Оценка */
.rating { text-align: center; }
.rating-title { margin: 0 0 6px; color: rgba(255,255,255,.8); font-size: 15px; }
.stars { display: inline-flex; gap: 4px; }
.star { background: transparent; border: 0; font-size: 34px; line-height: 1; color: rgba(255,255,255,.25); cursor: pointer; padding: 2px 4px; transition: transform .1s ease, color .1s ease; }
.star:hover, .star.lit { color: #ffc14d; }
.star:hover { transform: scale(1.12); }
.star:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 8px; }
.rating.done .star { cursor: default; }
.rating-thanks { margin: 6px 0 0; color: #7fe0a8; font-size: 14px; }

.controls { display: flex; justify-content: center; gap: 14px; align-items: center; }
.btn-call { background: var(--green); color: var(--white); font-weight: 600; padding: 14px 30px; font-size: 17px; box-shadow: 0 10px 30px rgba(30, 158, 90, .35); }
.btn-call:hover:not(:disabled) { background: #22b366; }
.btn-end { background: #d9331a; color: var(--white); font-weight: 600; padding: 14px 28px; font-size: 17px; }
.btn-end:hover { background: #ef3d1f; }
.btn-round { width: 52px; height: 52px; padding: 0; background: rgba(255,255,255,.14); color: var(--white); }
.btn-round[aria-pressed="true"] { background: var(--white); color: var(--screen); }

/* Подсказки и промо */
.tips h3 { font-size: 14px; color: var(--ink-soft); font-weight: 500; margin-bottom: 8px; }
.tips ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tips li { background: var(--white); border: 1.5px solid var(--mist); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.promo { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--white); border-radius: 22px; padding: 20px 24px; border: 1.5px solid var(--mist); }
.promo-title { margin: 0 0 4px; font-weight: 700; font-size: 17px; }
.promo-text { margin: 0; color: var(--ink-soft); font-size: 14px; max-width: 60ch; }
@media (max-width: 640px) { .promo { flex-direction: column; align-items: stretch; } }

/* Прошлые разговоры */
.calls { max-width: 900px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 48px; }
.calls h1 { font-size: 24px; margin-bottom: 4px; }
.calls-lead { color: var(--ink-soft); margin: 0 0 20px; }
.call-card { background: var(--white); border-radius: 18px; padding: 16px 18px; margin-bottom: 12px; }
.call-card summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.call-card summary b { font-weight: 600; }
.call-card summary span { color: var(--ink-soft); font-size: 14px; }
.call-card summary .stars-inline { color: #e0a400; letter-spacing: 1px; }
.call-log { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.call-log li { padding: 7px 12px; border-radius: 14px; max-width: 85%; font-size: 15px; line-height: 1.4; }
.call-log li.bot { background: var(--mist); align-self: flex-start; }
.call-log li.user { background: var(--coral-soft); align-self: flex-end; }
.call-log li.sys { color: var(--ink-soft); align-self: center; font-size: 13px; }
.call-log time { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.calls audio { width: 100%; margin-top: 10px; }
.calls-admin { background: var(--white); border-radius: 18px; padding: 24px; text-align: center; }

@media (max-width: 480px) {
  .screen { padding: 22px 16px 18px; border-radius: 22px; }
  .brand span { display: none; }
  .wave-wrap { height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .feature.live .dot { animation: none; }
  .star { transition: none; }
}

/* Фильтры прошлых разговоров */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 12px; align-items: end; background: var(--white); border: 1.5px solid var(--mist); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.filters .f-wide { grid-column: 1 / -1; }
.filters input, .filters select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1.5px solid var(--mist); border-radius: 10px; background: var(--paper); color: var(--ink); min-width: 0; }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--navy); background: var(--white); }
.filters .f-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); padding-bottom: 8px; }
.filters .f-check input { width: 16px; height: 16px; accent-color: var(--navy); }
.filters .f-count { font-size: 13px; color: var(--ink-soft); }
.filters .f-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.filters .f-actions .btn { white-space: nowrap; }
.call-log mark { background: #fff1a8; border-radius: 3px; padding: 0 2px; }
.call-card summary .err-flag { color: #d9331a; }

.track-label { margin: 12px 0 2px; font-size: 12.5px; color: var(--ink-soft); }
.cfg { margin-top: 10px; font-size: 12.5px; color: var(--ink-soft); }
.cfg pre { background: var(--paper); border-radius: 10px; padding: 10px; overflow: auto; font-size: 11.5px; max-height: 260px; }
.call-log li.seg { font-size: 11.5px; color: #4a7f5f; padding: 2px 8px; }
.call-log li.seg-empty { color: #b9502f; }

/* Эксперимент (администратор) */
.lab { background: rgba(255,255,255,.85); border: 1.5px dashed rgba(6, 3, 141, .3); border-radius: 14px; padding: 8px 12px; font-size: 12.5px; }
.lab summary { cursor: pointer; font-weight: 600; color: var(--navy); display: flex; gap: 8px; align-items: center; }
.lab-badge { font-size: 10.5px; font-weight: 600; background: var(--coral); color: var(--white); border-radius: 999px; padding: 1px 7px; }
.lab-body { display: grid; gap: 6px; margin-top: 8px; }
.lab-row { display: flex; align-items: center; gap: 8px; }
.lab-row input { accent-color: var(--navy); width: 15px; height: 15px; }
.lab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 2px; }
.lab-grid label { display: grid; gap: 2px; font-size: 10.5px; color: var(--ink-soft); }
.lab-grid input { font: inherit; font-size: 12.5px; padding: 4px 6px; border: 1.5px solid var(--mist); border-radius: 8px; width: 100%; min-width: 0; }
.lab-note { margin: 2px 0 0; font-size: 11px; color: var(--ink-soft); }
.lab .btn-ghost { justify-self: start; padding: 4px 10px; font-size: 12px; }

.call-card summary .where { color: var(--navy); font-size: 13px; }
.where-line { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); }
.where-line code { font-size: 12px; }

/* Итог звонка */
.summary { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.summary li { background: rgba(255,255,255,.08); border-radius: 12px; padding: 8px 10px; text-align: center; }
.summary b { display: block; font-size: 18px; font-weight: 700; }
.summary span { font-size: 11.5px; color: rgba(255,255,255,.65); }

/* Итог для CRM */
.result { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 12px 16px; }
.result-title { margin: 0 0 8px; font-weight: 600; font-size: 14px; color: rgba(255,255,255,.85); }
.result dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13.5px; }
.result dt { color: rgba(255,255,255,.6); }
.result dd { margin: 0; }
.call-card .crm { margin: 10px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; font-size: 13px; background: #eef7f1; border-radius: 12px; padding: 10px 12px; }
.call-card .crm dt { color: var(--ink-soft); }
.call-card .crm dd { margin: 0; }
@media (max-width: 480px) { .result dl, .call-card .crm { grid-template-columns: 1fr; } }

/* После звонка: сравнение, ссылки, подсказки, темп */
.after { display: grid; gap: 8px; text-align: center; }
.compare { margin: 0; font-size: 13.5px; color: rgba(255,255,255,.85); background: rgba(127, 224, 168, .12); border: 1px solid rgba(127, 224, 168, .3); border-radius: 12px; padding: 8px 12px; }
.after-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.btn-round-text { background: rgba(255,255,255,.12); color: var(--white); font-size: 13px; padding: 8px 14px; }
.btn-round-text:hover { background: rgba(255,255,255,.2); }
.share-done { margin: 0; font-size: 13px; color: #7fe0a8; word-break: break-all; }
.hint { margin: 0; text-align: center; font-size: 13px; color: #ffd37a; background: rgba(255, 211, 122, .12); border-radius: 10px; padding: 6px 10px; animation: hintin .3s ease; }
@keyframes hintin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Аналитика */
.an { background: var(--white); border: 1.5px solid var(--mist); border-radius: 16px; padding: 12px 16px 16px; margin-bottom: 16px; }
.an summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.tile { background: var(--paper); border-radius: 12px; padding: 10px 12px; }
.tile b { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; }
.tile span { font-size: 11.5px; color: var(--ink-soft); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.chart h4 { margin: 0 0 6px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: #4b5fe6; }
.chart .bar:hover { fill: #2a27c9; }
.chart text { font-family: inherit; font-size: 10px; fill: var(--ink-soft); }
.chart text.v { fill: var(--ink); font-weight: 600; }
.hbars { display: grid; gap: 5px; font-size: 12.5px; }
.hbars div { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr auto; gap: 8px; align-items: center; }
.hbars i { display: block; height: 10px; border-radius: 4px; background: #4b5fe6; }
.hbars span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl { margin: 10px 0 4px; }
.tl svg { width: 100%; height: auto; display: block; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; }
.tl-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }

/* Самопроверка качества */
.checks { list-style: none; margin: 10px 0 0; padding: 8px 12px; background: var(--paper); border-radius: 12px; display: grid; gap: 3px; font-size: 12.5px; }
.checks li b { display: inline-block; width: 16px; }
.checks li.ok b { color: var(--green); }
.checks li.bad b { color: #d9331a; }
.checks li.bad { color: var(--ink); }
.checks li.ok { color: var(--ink-soft); }
.checks li.na { color: var(--ink-soft); opacity: .6; }
.checks li.na b { color: var(--ink-soft); }
.checks li span { color: #8a3a22; }
.call-card summary .q-ok { color: var(--green); }
.call-card summary .q-bad { color: #d9331a; font-weight: 600; }

/* Метки и комментарии */
.meta { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin: 10px 0 0; }
.meta-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.lbl { border: 1.5px solid var(--mist); background: var(--white); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--ink-soft); }
.lbl.on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.lbl-inline { background: var(--navy); color: var(--white) !important; border-radius: 999px; padding: 1px 8px; font-size: 11px !important; }
.meta-comment { font: inherit; font-size: 13px; padding: 6px 10px; border: 1.5px solid var(--mist); border-radius: 10px; resize: vertical; min-width: 0; }
.meta-comment:focus { outline: none; border-color: var(--navy); }
.meta-saved { color: var(--green); font-weight: 700; }
@media (max-width: 640px) { .meta { grid-template-columns: 1fr; } }

/* Редактор сценариев */
.sc { max-width: 1100px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 48px; }
.sc h1 { font-size: 24px; margin-bottom: 4px; }
.sc-app { display: grid; grid-template-columns: 240px 1fr; gap: 18px; }
.sc-list ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.sc-list li button { width: 100%; text-align: left; background: var(--white); border: 1.5px solid var(--mist); border-radius: 12px; padding: 8px 12px; cursor: pointer; font: inherit; font-weight: 600; color: var(--ink); }
.sc-list li button span { display: block; font-weight: 400; font-size: 11.5px; color: var(--ink-soft); }
.sc-list li button.on { border-color: var(--navy); background: var(--navy); color: var(--white); }
.sc-list li button.on span { color: rgba(255,255,255,.7); }
.sc-history { margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); }
.sc-history ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 3px; }
.sc-history button { background: none; border: 0; color: var(--navy); cursor: pointer; font: inherit; font-size: 12px; text-align: left; padding: 0; }
.sc-editor { background: var(--white); border: 1.5px solid var(--mist); border-radius: 16px; padding: 14px 16px; }
.sc-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.sc-tabs button { border: 1.5px solid var(--mist); background: var(--white); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.sc-tabs button.on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.sc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px 14px; }
.sc-form label { display: grid; gap: 3px; font-size: 12px; color: var(--ink-soft); }
.sc-form input, .sc-form textarea, .sc-form select { font: inherit; font-size: 13.5px; padding: 6px 9px; border: 1.5px solid var(--mist); border-radius: 9px; background: var(--paper); color: var(--ink); min-width: 0; }
.sc-form textarea { resize: vertical; }
.sc-form input:focus, .sc-form textarea:focus { outline: none; border-color: var(--navy); background: var(--white); }
.sc-vars { grid-column: 1 / -1; display: grid; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.sc-vars table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sc-vars th { text-align: left; font-weight: 600; padding: 2px 4px; }
.sc-vars td { padding: 2px 4px; }
.sc-vars td input, .sc-vars td select { width: 100%; }
.sc-vars td.ok { color: var(--green); font-weight: 700; }
.sc-vars td.bad { color: #d9331a; font-weight: 700; }
.sc-jsonbox { width: 100%; min-height: 480px; font: 12.5px/1.4 ui-monospace, Menlo, monospace; padding: 10px; border: 1.5px solid var(--mist); border-radius: 10px; }
.sc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.sc-msg { font-size: 13px; color: var(--ink-soft); }
@media (max-width: 800px) { .sc-app { grid-template-columns: 1fr; } }

/* Разбор разговора */
.analysis-box h4 { margin: 10px 0 3px; font-size: 12.5px; color: rgba(255,255,255,.6); font-weight: 600; }
.analysis-box p { margin: 0; font-size: 13.5px; }
.analysis-box .an-wait { color: rgba(255,255,255,.7); font-size: 13px; }
.analysis-box ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.analysis-box .qas { list-style: none; padding: 0; display: grid; gap: 6px; }
.analysis-box .qa em { font-style: normal; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.14); margin-left: 6px; white-space: nowrap; }
.analysis-box .qa.yes em { background: rgba(30,158,90,.35); }
.analysis-box .qa.partial em { background: rgba(255,190,60,.35); }
.analysis-box .qa.no em { background: rgba(247,81,40,.4); }
.analysis-box .qa span { color: rgba(255,255,255,.7); font-size: 12.5px; }
.calls .analysis { background: var(--paper); border-radius: 12px; padding: 10px 14px; margin-top: 10px; font-size: 13px; }
.calls .analysis h4 { margin: 8px 0 2px; font-size: 12px; color: var(--ink-soft); }
.calls .analysis p { margin: 0; }
.calls .analysis ul { margin: 0; padding-left: 18px; }
.calls .analysis .qas { list-style: none; padding: 0; display: grid; gap: 4px; }
.calls .analysis .qa em { font-style: normal; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #eef; margin-left: 6px; }
.calls .analysis .qa.yes em { background: #e3f5e9; color: #1e6e3a; }
.calls .analysis .qa.partial em { background: #fff3d6; color: #7a5200; }
.calls .analysis .qa.no em { background: #fde3dd; color: #9b2a12; }
.calls .analysis .qa span { color: var(--ink-soft); font-size: 12.5px; }

/* Разбор: свёрнутая шапка с мигающей точкой */
.an-toggle { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--white); font: inherit; font-weight: 600; font-size: 14px; padding: 0; text-align: left; cursor: default; }
.analysis-box.ready .an-toggle { cursor: pointer; }
.an-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.35); flex: none; }
.analysis-box.ready .an-dot { background: #7fe0a8; animation: an-blink 1.1s ease-in-out infinite; box-shadow: 0 0 0 0 rgba(127,224,168,.6); }
.analysis-box.open .an-dot { animation: none; box-shadow: none; }
@keyframes an-blink { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(127,224,168,.6); } 50% { opacity: .55; box-shadow: 0 0 0 6px rgba(127,224,168,0); } }
.an-chevron { width: 18px; height: 18px; margin-left: auto; flex: none; opacity: 0; transition: transform .2s; }
.analysis-box.ready .an-chevron { opacity: .8; }
.analysis-box.open .an-chevron { transform: rotate(180deg); }
.analysis-box #analysis-body { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .analysis-box.ready .an-dot { animation: none; } }
@media (max-width: 480px) { .captions { height: 200px; } }

/* Дашборд разбора под экраном звонка */
.dashboard-wrap { grid-column: 1 / -1; margin-top: 4px; }

/* Учётки */
.ac-new { background: var(--white); border: 1.5px solid var(--mist); border-radius: 16px; padding: 14px 16px; margin-bottom: 18px; }
.ac-new h2, .sc h2 { font-size: 16px; margin: 0 0 10px; }
.ac-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 12px; align-items: end; }
.ac-form label { display: grid; gap: 3px; font-size: 12px; color: var(--ink-soft); }
.ac-form input, .ac-form select { font: inherit; font-size: 13.5px; padding: 7px 9px; border: 1.5px solid var(--mist); border-radius: 9px; background: var(--paper); }
.ac-table-wrap { overflow-x: auto; background: var(--white); border: 1.5px solid var(--mist); border-radius: 16px; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ac-table th { text-align: left; font-weight: 600; padding: 10px 10px; color: var(--ink-soft); font-size: 12px; border-bottom: 1.5px solid var(--mist); }
.ac-table td { padding: 10px; vertical-align: top; border-bottom: 1px solid var(--mist); }
.ac-table tr.env td { color: var(--ink-soft); background: var(--paper); }
.ac-table tr.off td b { text-decoration: line-through; opacity: .6; }
.ac-table input, .ac-table select { font: inherit; font-size: 13px; padding: 5px 8px; border: 1.5px solid var(--mist); border-radius: 8px; background: var(--paper); max-width: 160px; }
.ac-boxes { display: grid; gap: 3px; min-width: 130px; }
.ac-chk { display: flex; gap: 6px; align-items: center; font-size: 12.5px; white-space: nowrap; }
.ac-chk input { width: 15px; height: 15px; accent-color: var(--navy); padding: 0; }
.ac-actions { display: grid; gap: 6px; }
.ac-actions .btn { padding: 6px 12px; font-size: 13px; }
/* Промпт стенда */
.sc-prompt { margin-top: 14px; border: 1.5px solid var(--navy); border-radius: 14px; padding: 12px 14px; background: var(--paper); }
.sc-prompt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sc-prompt-head b { font-size: 14px; }
.sc-prompt-head .btn { margin-left: auto; }
.sc-prompt-body { display: grid; grid-template-columns: 220px 1fr; gap: 12px; }
.sc-prompt-outline { font-size: 12px; color: var(--ink-soft); }
.sc-prompt-outline ul { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 3px; }
.sc-prompt-outline button { background: var(--white); border: 1.5px solid var(--mist); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; width: 100%; color: var(--ink); }
.sc-prompt-outline button:hover { border-color: var(--navy); }
#sc-prompt-text { width: 100%; min-height: 460px; font: 12.5px/1.45 ui-monospace, Menlo, monospace; padding: 10px; border: 1.5px solid var(--mist); border-radius: 10px; background: var(--white); resize: vertical; }
@media (max-width: 800px) { .sc-prompt-body { grid-template-columns: 1fr; } }

/* Полный скрипт в редакторе сценариев */
.sc-script-ctl { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 12px; }
.sc-script-ctl label { display: grid; gap: 3px; font-size: 12px; color: var(--ink-soft); }
.sc-script-ctl select { font: inherit; font-size: 13.5px; padding: 6px 9px; border: 1.5px solid var(--mist); border-radius: 9px; background: var(--paper); }
.sc-script-var { border: 1.5px solid var(--mist); border-radius: 12px; background: var(--white); margin-bottom: 8px; }
.sc-script-var summary { padding: 10px 14px; cursor: pointer; font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sc-script-var summary .btn { margin-left: auto; padding: 4px 10px; font-size: 12px; }
.sc-script-var pre { margin: 0; padding: 12px 14px; border-top: 1.5px solid var(--mist); white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.5 ui-monospace, Menlo, monospace; background: var(--paper); border-radius: 0 0 12px 12px; max-height: 70vh; overflow: auto; }

/* Страница «Стенд»: подключения к движку CAI */
.st-now h2, .st-add h2, .st-how h2 { font-size: 16px; margin: 18px 0 6px; }
.st-nowline { margin: 0 0 4px; font-size: 13.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.st-cards { display: grid; gap: 12px; }
.st-card { background: var(--white); border: 1.5px solid var(--mist); border-radius: 16px; padding: 12px 14px; }
.st-card.on { border-color: var(--navy); }
.st-card.env { background: var(--paper); }
.st-card header { margin-bottom: 10px; }
.st-card header h3 { margin: 0 0 2px; font-size: 15.5px; }
.st-card header small { color: var(--ink-soft); font-size: 12px; overflow-wrap: anywhere; }
.st-badge { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--navy); color: var(--white); font-size: 11px; font-weight: 600; }
.st-status { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--mist); }
.st-dot.ok { background: var(--green); }
.st-dot.bad { background: #d9331a; }
.st-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.st-how ol { margin: 6px 0 10px; padding-left: 20px; }
.st-how li { margin: 4px 0; font-size: 13.5px; }
.st-how p { margin: 6px 0; font-size: 13px; color: var(--ink-soft); }

/* Постраничный вывод в списке разговоров */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; padding: 8px 12px; background: var(--white); border: 1.5px solid var(--mist); border-radius: 12px; font-size: 13px; }
.pager .btn { padding: 4px 12px; font-size: 13px; }
.pager .btn[disabled] { opacity: .4; cursor: default; }
.pager-mid { color: var(--ink-soft); }
.pager-per { margin-left: auto; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.pager-per select { font: inherit; font-size: 13px; padding: 3px 6px; border: 1.5px solid var(--mist); border-radius: 8px; background: var(--paper); color: var(--ink); }

/* Замечания по чек-листу: сводка по линиям и общий пул */
.tile-link { cursor: pointer; border: 1.5px solid transparent; }
.tile-link:hover { border-color: var(--mist); background: var(--white); }
.qp h3 { margin: 18px 0 2px; font-size: 15px; }
.qp-tablewrap { overflow-x: auto; margin: 10px 0 4px; }
.qp-table { border-collapse: collapse; font-size: 12.5px; min-width: 520px; }
.qp-table th, .qp-table td { border-bottom: 1px solid var(--mist); padding: 5px 8px; text-align: center; }
.qp-table th:first-child, .qp-table td:first-child, .qp-table th:nth-child(2), .qp-table td:nth-child(2) { text-align: left; }
.qp-table th { font-weight: 600; color: var(--ink-soft); font-size: 11.5px; cursor: help; }
.qp-table td.qp-bad { background: #fdece8; }
.qp-table td button { border: 0; background: none; font: inherit; font-weight: 700; color: #d9331a; cursor: pointer; padding: 0 4px; }
.qp-table td button:hover { text-decoration: underline; }
.qp-openonly { margin: 6px 0 10px; }
.qp-group { margin: 12px 0 0; padding: 10px 12px; background: var(--paper); border-radius: 12px; }
.qp-group h4 { margin: 0 0 6px; font-size: 13.5px; display: inline-block; margin-right: 10px; }
.qp-group > a.btn { padding: 3px 10px; font-size: 12px; }
.qp-notes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.qp-note { background: var(--white); border-radius: 10px; padding: 8px 10px; border-left: 3px solid #d9331a; }
.qp-note.st-done { border-left-color: var(--green); opacity: .75; }
.qp-note.st-skip { border-left-color: var(--mist); opacity: .6; }
.qp-note p { margin: 0 0 4px; font-size: 13px; }
.qp-note-meta { font-size: 11.5px; color: var(--ink-soft); }
.qp-times { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }
.qp-more { display: inline-block; font-size: 11.5px; }
.qp-more summary { cursor: pointer; color: var(--ink-soft); }
.qp-more ul { margin: 4px 0 0 14px; padding: 0; font-size: 11.5px; color: var(--ink-soft); }
.qp-note-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qp-st { border: 1.5px solid var(--mist); background: var(--white); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 11.5px; cursor: pointer; }
.qp-st.on { background: var(--ink); color: var(--white); border-color: var(--ink); }
.qp-calls { padding: 3px 10px; font-size: 11.5px; }
.qp-comment { width: 100%; border: 1.5px solid var(--mist); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 12.5px; margin-top: 4px; }
@media (max-width: 700px) { .qp-note-act { gap: 4px; } .qp-table { min-width: 420px; } }
.sc-qp { margin-top: 14px; border-top: 1.5px solid var(--mist); padding-top: 12px; }
.sc-qp h4 { margin: 0 0 4px; font-size: 13.5px; }
.sc-qp h4 a { margin-left: 8px; }
.sc-qp .qp-notes { margin-top: 8px; }
.qp-more-btn { margin-top: 6px; padding: 4px 12px; font-size: 12px; }
.qp-check { margin-top: 10px; }
.qp-check h5 { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.an-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--paper); font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }
