:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #e5eaf2;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --nav: #0b1831;
  --nav-hover: #17315d;
  --primary: #2457f5;
  --primary-dark: #1744d4;
  --primary-soft: #eaf0ff;
  --green: #11845b;
  --green-soft: #e8f7f0;
  --orange: #b54708;
  --orange-soft: #fff2e2;
  --red: #b42318;
  --red-soft: #ffebee;
  --purple: #6941c6;
  --purple-soft: #f1edff;
  --shadow: 0 12px 30px rgb(26 44 82 / 8%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, .92fr) minmax(420px, 1.08fr);
  background: #f7f8fc;
}

.login-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px;
}

.login-form { width: min(100%, 410px); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.03em; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--primary); color: white; font-size: 18px; box-shadow: 0 8px 18px rgb(36 87 245 / 25%);
}
.brand span { font-size: 20px; }

.login-form h1 { margin: 48px 0 10px; font-size: 34px; line-height: 1.08; letter-spacing: -.05em; }
.login-form p { margin: 0 0 28px; color: var(--muted); line-height: 1.55; }

.field { display: grid; gap: 7px; margin: 16px 0; }
.field label { color: #344054; font-size: 14px; font-weight: 650; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #d8dee9; border-radius: 9px; padding: 11px 12px;
  background: white; color: var(--ink); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(36 87 245 / 13%); }
.field textarea { min-height: 96px; resize: vertical; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }

.btn {
  border: 1px solid #d8dee9; background: white; color: #344054; border-radius: 9px;
  padding: 10px 14px; font-size: 14px; font-weight: 650; line-height: 1.2; transition: .18s ease;
}
.btn:hover { background: #f8fafc; border-color: #bdc7d8; }
.btn-primary { color: white; border-color: var(--primary); background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--red); border-color: #f4c7ce; background: white; }
.btn-text { border-color: transparent; background: transparent; color: var(--primary); padding-inline: 0; }
.btn-large { width: 100%; margin-top: 8px; padding: 13px 16px; }
.btn-icon { padding: 8px 10px; }
.btn[disabled] { cursor: not-allowed; opacity: .6; }

.login-visual {
  position: relative; overflow: hidden; display: flex; align-items: center; padding: 72px;
  background: radial-gradient(circle at 70% 20%, #315fd5 0, #142b59 45%, #0b1831 100%); color: #f7f9ff;
}
.login-visual::before, .login-visual::after { content: ""; position: absolute; border-radius: 999px; filter: blur(4px); opacity: .7; }
.login-visual::before { width: 460px; height: 460px; border: 1px solid rgb(177 199 255 / 30%); right: -160px; top: -130px; }
.login-visual::after { width: 310px; height: 310px; border: 1px solid rgb(177 199 255 / 28%); left: -170px; bottom: -130px; }
.visual-copy { position: relative; z-index: 1; width: min(100%, 520px); }
.visual-copy .eyebrow { color: #b9ccff; }
.visual-copy h2 { font-size: clamp(34px, 4vw, 56px); line-height: 1.03; letter-spacing: -.055em; margin: 17px 0; }
.visual-copy > p { color: #cbd8f7; font-size: 17px; line-height: 1.58; max-width: 470px; }
.visual-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 42px; }
.visual-stat { border: 1px solid rgb(212 224 255 / 18%); background: rgb(255 255 255 / 8%); border-radius: 14px; padding: 17px; backdrop-filter: blur(8px); }
.visual-stat strong { display: block; font-size: 26px; letter-spacing: -.04em; }
.visual-stat span { color: #cbd8f7; display: block; font-size: 13px; margin-top: 5px; }

.app-shell { min-width: 0; min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: var(--nav); color: #e9efff; padding: 20px 12px; display: flex; flex-direction: column; min-height: 100vh; }
.sidebar .brand { padding: 4px 9px 26px; color: white; }
.sidebar .brand-mark { background: #4d7cff; }
.nav-label { margin: 17px 11px 8px; color: #9db1d8; font-size: 11px; letter-spacing: .08em; font-weight: 750; text-transform: uppercase; }
.nav-item {
  border: 0; background: transparent; color: #c6d3ee; border-radius: 8px; padding: 10px 11px; width: 100%; text-align: left;
  display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 560; margin: 2px 0;
}
.nav-item:hover { background: rgb(255 255 255 / 8%); color: white; }
.nav-item.active { background: #1d3e78; color: white; }
.nav-item .nav-icon { width: 19px; text-align: center; color: #8fb0ff; }
.nav-item .counter { margin-left: auto; color: #dfe8ff; background: rgb(255 255 255 / 12%); padding: 1px 7px; border-radius: 30px; font-size: 12px; }
.sidebar-bottom { margin-top: auto; padding-top: 20px; border-top: 1px solid rgb(255 255 255 / 11%); }
.person-chip { width: 100%; padding: 10px; background: rgb(255 255 255 / 6%); border: 0; color: white; border-radius: 9px; text-align: left; display: flex; gap: 9px; align-items: center; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #d9e4ff; color: #183563; font-size: 12px; font-weight: 750; flex: 0 0 auto; }
.person-chip small { display: block; margin-top: 2px; color: #a9bbdb; }

.app-main { min-width: 0; }
.topbar { height: 68px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; gap: 18px; }
.crumbs { color: var(--muted); font-size: 14px; }
.crumbs strong { color: var(--ink); font-weight: 650; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.environment { background: var(--green-soft); color: var(--green); border-radius: 20px; padding: 5px 9px; font-weight: 700; font-size: 12px; }
.environment.offline { color: #8a2d24; background: #fff0ee; border: 1px solid #fac9c3; }
.environment.online::before, .environment.offline::before { content: "● "; }
.notification { border: 1px solid var(--line); background: white; border-radius: 8px; padding: 7px 9px; color: var(--muted); }

.content { width: 100%; min-width: 0; max-width: 1540px; padding: 29px 30px 42px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.045em; line-height: 1.1; }
.page-head p { color: var(--muted); margin: 8px 0 0; line-height: 1.45; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { color: var(--primary); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; font-weight: 760; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgb(16 24 40 / 2%); }
.metric-card { padding: 17px; }
.metric-card .metric-label { color: var(--muted); font-size: 13px; }
.metric-card .metric-value { font-size: 27px; letter-spacing: -.045em; margin: 8px 0 4px; font-weight: 740; }
.metric-card .metric-delta { color: var(--green); font-size: 12px; font-weight: 650; }
.metric-card .metric-delta.warn { color: var(--orange); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .85fr); gap: 18px; margin-top: 18px; }
.section-card { padding: 20px; }
.section-card h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.section-card .section-subtitle { color: var(--muted); font-size: 13px; margin: 7px 0 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head a { color: var(--primary); font-size: 13px; cursor: pointer; font-weight: 650; }
.bar-list { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) 2.2fr 60px; align-items: center; gap: 14px; }
.bar-row .name { font-size: 13px; font-weight: 620; }
.bar { height: 9px; overflow: hidden; border-radius: 99px; background: #eef1f6; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.bar-row:nth-child(2) .bar > span { background: #6b8af8; }
.bar-row:nth-child(3) .bar > span { background: #a8baff; }
.bar-row strong { font-size: 13px; text-align: right; }

.alert-list { display: grid; gap: 10px; }
.alert { border-left: 3px solid var(--orange); background: #fffaf4; padding: 12px 13px; border-radius: 6px; }
.alert.good { border-left-color: var(--green); background: #f4fbf7; }
.alert h3 { margin: 0 0 5px; font-size: 13px; }
.alert p { margin: 0; color: #5b6475; font-size: 13px; line-height: 1.45; }
.alert button { margin-top: 8px; }

.filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; padding: 14px; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 150px; flex: 1; }
.filters .field label { font-size: 12px; }
.filters .field select, .filters .field input { padding: 9px 10px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 12px 14px; background: #fbfcfe; white-space: nowrap; }
td { border-top: 1px solid var(--line); padding: 13px 14px; vertical-align: middle; font-size: 13px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fafcff; }
.subline { color: var(--muted); font-size: 12px; margin-top: 3px; }
.tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 4px 8px; background: #f1f4f9; color: #475467; font-size: 12px; font-weight: 650; white-space: nowrap; }
.tag.green { color: var(--green); background: var(--green-soft); }
.tag.orange { color: var(--orange); background: var(--orange-soft); }
.tag.red { color: var(--red); background: var(--red-soft); }
.tag.purple { color: var(--purple); background: var(--purple-soft); }
.tag.blue { color: #2457c5; background: var(--primary-soft); }
.tag.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.call-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .72fr); gap: 18px; }
.call-main { display: grid; gap: 18px; }
.audio-card { padding: 18px; }
.call-audio { display: block; width: 100%; margin-top: 16px; }
.audio-top { display: flex; align-items: center; gap: 11px; }
.play { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--primary); color: white; font-size: 14px; }
.audio-meta strong { display: block; font-size: 14px; }
.audio-meta span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.audio-time { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.wave { display: flex; align-items: center; gap: 3px; margin: 18px 0 3px; height: 48px; }
.wave i { width: 3px; background: #b7c8ff; border-radius: 8px; }
.wave i:nth-child(4n) { background: var(--primary); }
.wave i:nth-child(5n) { background: #809ffb; }
.audio-track { height: 4px; border-radius: 9px; background: #e5eaf5; overflow: hidden; }
.audio-track span { display: block; height: 100%; width: 34%; background: var(--primary); }

.transcript-card { padding: 0; overflow: hidden; }
.transcript-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 19px; border-bottom: 1px solid var(--line); }
.transcript-head h2 { margin: 0; font-size: 17px; }
.transcript { padding: 10px 19px 18px; }
.segment { display: grid; grid-template-columns: 48px 92px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf0f5; }
.segment:last-child { border-bottom: 0; }
.segment time { color: var(--primary); font-size: 12px; padding-top: 2px; font-variant-numeric: tabular-nums; cursor: pointer; }
.speaker { font-size: 12px; font-weight: 720; padding-top: 2px; }
.speaker.client { color: var(--purple); }
.speaker.agent { color: var(--green); }
.segment p { margin: 0; font-size: 14px; line-height: 1.5; }
.segment.active { margin: 0 -10px; padding: 12px 10px; background: var(--primary-soft); border-radius: 8px; border-bottom-color: transparent; }

.side-stack { display: grid; gap: 14px; align-content: start; }
.side-card { padding: 17px; }
.side-card h2 { font-size: 15px; margin: 0 0 12px; }
.detail-list { margin: 0; display: grid; gap: 11px; }
.detail-list div { display: grid; gap: 3px; }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { margin: 0; font-size: 13px; font-weight: 600; }
.recommendation { border: 1px solid #cad8ff; background: #f5f8ff; border-radius: 9px; padding: 12px; }
.recommendation strong { display: block; font-size: 13px; margin-bottom: 6px; }
.recommendation p { margin: 0; color: #405073; font-size: 13px; line-height: 1.45; }
.recommendation a { display: inline-block; margin-top: 8px; color: var(--primary); font-size: 13px; font-weight: 700; cursor: pointer; }

.split-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 18px; }
.topic-list { display: grid; gap: 10px; }
.topic-row { display: grid; grid-template-columns: 1.2fr repeat(4, .58fr) 100px; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.topic-row:last-child { border-bottom: 0; }
.topic-row button { text-align: left; background: transparent; border: 0; padding: 0; color: var(--ink); font-weight: 700; }
.topic-row span { font-size: 13px; }
.topic-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.priority { font-weight: 750; color: var(--primary); }
.score-explanation { display: grid; gap: 12px; }
.score-explanation .reason { display: flex; gap: 9px; align-items: flex-start; }
.reason .reason-number { background: var(--primary-soft); color: var(--primary); width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 750; flex: 0 0 auto; }
.reason strong { display: block; font-size: 13px; }
.reason p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }

.topic-hero { padding: 22px; background: linear-gradient(110deg, #f2f6ff, #fbfcff); border-color: #dbe5ff; }
.topic-hero .topic-hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.topic-hero h2 { margin: 5px 0 7px; font-size: 23px; letter-spacing: -.04em; }
.topic-hero p { margin: 0; color: #52617e; line-height: 1.5; }
.topic-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 21px; }
.topic-stat { background: white; border: 1px solid #e2e9fb; border-radius: 9px; padding: 12px; }
.topic-stat span { display: block; color: var(--muted); font-size: 12px; }
.topic-stat strong { display: block; margin-top: 5px; font-size: 20px; letter-spacing: -.04em; }

.case-timeline { position: relative; display: grid; gap: 0; padding-left: 29px; }
.case-timeline::before { content: ""; position: absolute; left: 10px; top: 15px; bottom: 15px; width: 2px; background: #dbe4fb; }
.timeline-item { position: relative; padding: 0 0 21px; }
.timeline-item::before { content: ""; position: absolute; width: 10px; height: 10px; left: -24px; top: 5px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px #edf2ff; }
.timeline-item.repeat::before { background: var(--orange); box-shadow: 0 0 0 4px #fff4e7; }
.timeline-item .time { color: var(--muted); font-size: 12px; }
.timeline-item strong { display: block; margin: 4px 0; font-size: 14px; }
.timeline-item p { margin: 0; color: #52617e; font-size: 13px; line-height: 1.45; }

.job-list { display: grid; gap: 11px; }
.job { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; }
.job-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.job strong { display: block; font-size: 13px; }
.job span { color: var(--muted); display: block; margin-top: 3px; font-size: 12px; }
.progress-line { height: 6px; background: #edf0f4; overflow: hidden; border-radius: 50px; margin-top: 8px; }
.progress-line span { height: 100%; display: block; background: var(--primary); border-radius: inherit; }
.job.failed .job-icon { color: var(--red); background: var(--red-soft); }
.job.failed .progress-line span { background: var(--red); }

.setup-shell { max-width: 1000px; margin: 10px auto; }
.setup-card { padding: 28px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 32px; }
.step { position: relative; display: flex; align-items: center; gap: 8px; color: #98a2b3; font-size: 12px; font-weight: 700; }
.step::after { content: ""; position: absolute; height: 2px; background: #e5eaf2; left: 26px; right: 0; top: 11px; z-index: 0; }
.step:last-child::after { display: none; }
.step .step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 23px; height: 23px; border: 2px solid #d7deeb; background: white; border-radius: 50%; }
.step.active, .step.done { color: var(--primary); }
.step.active .step-dot, .step.done .step-dot { border-color: var(--primary); background: var(--primary); color: white; }
.step.done::after { background: var(--primary); }
.setup-body { max-width: 640px; margin: 0 auto; }
.setup-body h1 { letter-spacing: -.04em; margin: 0 0 8px; font-size: 26px; }
.setup-body > p { color: var(--muted); margin: 0 0 24px; line-height: 1.5; }
.provider-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.provider-option { text-align: left; border: 1px solid var(--line); background: white; border-radius: 10px; padding: 13px; color: var(--ink); }
.provider-option.active { border: 2px solid var(--primary); background: #f7f9ff; }
.provider-option strong { display: block; font-size: 13px; }
.provider-option span { display: block; color: var(--muted); margin-top: 5px; font-size: 12px; line-height: 1.35; }
.setup-footer { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 20px; }

.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; }
.settings-menu { padding: 8px; height: min-content; }
.settings-menu button { display: block; width: 100%; text-align: left; border: 0; border-radius: 7px; padding: 10px; background: transparent; color: #475467; font-size: 13px; }
.settings-menu button.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.settings-main { padding: 23px; }
.settings-main h2 { margin: 0 0 7px; font-size: 20px; letter-spacing: -.03em; }
.settings-main > p { color: var(--muted); line-height: 1.5; margin: 0 0 22px; }
.settings-main-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.settings-main-head h2 { margin: 4px 0 6px; }
.settings-main-head p { max-width: 720px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.settings-main-head > .provider-logo { flex: 0 0 42px; height: 42px; }
.workspace-note { display: flex; gap: 12px; margin: 0 0 20px; padding: 14px; border: 1px solid #dce5fa; border-radius: 10px; background: #f7f9ff; }
.workspace-note > span { display: grid; place-items: center; flex: 0 0 31px; height: 31px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.workspace-note strong { display: block; margin-bottom: 4px; font-size: 13px; }
.workspace-note p { margin: 0; color: #52617e; font-size: 12px; line-height: 1.45; }
.connection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.connection-card { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 1px solid var(--line); border-top: 3px solid #172033; border-radius: 10px; background: #fff; }
.connection-card.yandex { border-top-color: #ffcc00; }
.connection-card.sber { border-top-color: #22a764; }
.connection-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.connection-card h3 { margin: 15px 0 6px; font-size: 15px; }
.connection-card > p { min-height: 54px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.connection-card .btn { width: 100%; margin-top: 15px; }
.connection-model { margin-top: auto; padding-top: 14px; }
.connection-model span, .connection-model strong { display: block; }
.connection-model span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.connection-model strong { margin-top: 4px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.provider-policy { display: grid; grid-template-columns: 210px 1fr; gap: 14px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.provider-policy strong { font-size: 12px; }
.provider-policy span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.provider-logo.yandex-logo { background: #ffcc00; color: #171717; }
.provider-logo.sber-logo { background: #22a764; }
.analytics-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.metric-value.metric-text { max-width: 100%; overflow: hidden; font-size: 20px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.analytics-settings-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.analytics-profile-list, .analytics-profile-editor, .phone-rules-section { padding: 20px; }
.analytics-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.analytics-panel-head h2 { margin: 4px 0 6px; font-size: 18px; letter-spacing: -.025em; }
.analytics-panel-head p, .analytics-profile-list > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.profile-list { display: grid; gap: 9px; margin-top: 17px; }
.analysis-profile-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; }
.analysis-profile-card:hover { border-color: #aebce0; }
.analysis-profile-card.active { border-color: var(--primary); background: #f5f8ff; box-shadow: 0 0 0 1px var(--primary) inset; }
.analysis-profile-card strong, .analysis-profile-card small { display: block; }
.analysis-profile-card strong { font-size: 13px; }
.analysis-profile-card small { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 500; }
.analysis-profile-card .tag { flex: 0 0 auto; }
.profile-fallback { margin-top: 16px; padding: 13px; border-radius: 9px; background: #f7f8fa; }
.profile-fallback strong { font-size: 12px; }
.profile-fallback p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.analytics-profile-editor .analytics-panel-head { margin-bottom: 19px; }
.analysis-output-fieldset { margin: 18px 0; padding: 0; border: 0; }
.analysis-output-fieldset legend { margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.analysis-output-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.analysis-check { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: #344054; font-size: 12px; line-height: 1.25; }
.analysis-check:has(input:checked) { border-color: #a8bced; background: #f5f8ff; color: #2448a6; }
.analysis-check input { accent-color: var(--primary); }
.analytics-save-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.analytics-save-row span { max-width: 540px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.phone-rules-section { margin-top: 18px; }
.rule-priority { display: flex; align-items: center; gap: 8px; margin: 16px 0; padding: 11px 13px; border-radius: 9px; background: #f7f9ff; color: #475467; font-size: 11px; }
.rule-priority span { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--primary); color: white; font-weight: 800; }
.rule-priority i { color: #98a2b3; font-style: normal; }
.analytics-rules-table { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.analytics-rules-table table { min-width: 920px; }
.compact-select { min-width: 190px; padding: 8px 30px 8px 9px; font-size: 12px; }
.rule-status { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.rule-status span { width: 8px; height: 8px; border-radius: 50%; background: #98a2b3; }
.rule-status.enabled { color: #157347; }
.rule-status.enabled span { background: #24a66a; box-shadow: 0 0 0 3px #e9f8f0; }
.analytics-privacy-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 15px; padding: 13px; border: 1px solid #cee9da; border-radius: 9px; background: #f4fbf7; color: #35644b; }
.analytics-privacy-note > span { display: grid; place-items: center; flex: 0 0 22px; height: 22px; border-radius: 50%; background: #dff5e8; font-weight: 800; }
.analytics-privacy-note p { margin: 0; font-size: 11px; line-height: 1.5; }
.prototype-banner.compact { margin: 0 0 18px; padding: 11px 13px; }
.setting-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); align-items: center; }
.setting-row:last-child { border-bottom: 0; }
.setting-row strong { font-size: 14px; }
.setting-row p { color: var(--muted); font-size: 13px; margin: 4px 0 0; line-height: 1.4; }
.switch { width: 43px; height: 24px; border: 0; border-radius: 30px; padding: 3px; background: #cbd5e1; }
.switch span { display: block; width: 18px; height: 18px; border-radius: 50%; background: white; transition: transform .18s; }
.switch.active { background: var(--primary); }
.switch.active span { transform: translateX(19px); }
.notice { display: flex; gap: 11px; padding: 12px; border-radius: 9px; background: var(--orange-soft); color: #7a3d08; font-size: 13px; line-height: 1.45; margin: 18px 0; }

.modal-backdrop { position: fixed; inset: 0; background: rgb(16 24 40 / 42%); display: grid; place-items: center; padding: 20px; z-index: 10; }
.modal { width: min(100%, 570px); max-height: calc(100vh - 40px); overflow: auto; background: white; border-radius: 14px; box-shadow: 0 22px 70px rgb(16 24 40 / 28%); }
.modal-wide { width: min(100%, 760px); }
.modal-head { padding: 19px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 20px; border-top: 1px solid var(--line); }
.check { display: flex; align-items: flex-start; gap: 8px; color: #475467; font-size: 13px; line-height: 1.4; margin-top: 14px; }
.check input { margin-top: 2px; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 18px; margin: 0 0 8px; }
.empty p { margin: 0 0 16px; }
.case-list { display: grid; gap: 18px; }
.inline-actions { padding: 15px 0 0; margin-top: 18px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 20; display: grid; gap: 10px; }
.toast { width: min(360px, calc(100vw - 44px)); padding: 13px 15px; background: #172033; color: white; border-radius: 10px; box-shadow: 0 12px 28px rgb(16 24 40 / 24%); font-size: 13px; }

.prototype-banner { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid #bed2ff; border-radius: 11px; background: #f3f7ff; color: #2448a6; }
.prototype-banner > span { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 8px; background: #dce7ff; font-weight: 800; }
.prototype-banner strong { display: block; margin-bottom: 3px; font-size: 13px; }
.prototype-banner p { margin: 0; color: #49639e; font-size: 13px; line-height: 1.45; }
.comparison-setup { padding: 24px; }
.comparison-setup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.comparison-setup-head h2 { margin: 3px 0 6px; font-size: 20px; letter-spacing: -.025em; }
.comparison-setup-head p { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.upload-zone { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 112px; padding: 20px; border: 1.5px dashed #9bb2e6; border-radius: 11px; background: #f8faff; color: #344054; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.upload-zone:hover, .upload-zone:focus-within { border-color: var(--primary); background: #f2f6ff; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-zone .upload-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--primary); color: white; font-size: 22px; font-weight: 700; }
.upload-zone strong, .upload-zone small { display: block; }
.upload-zone strong { margin-bottom: 5px; font-size: 14px; }
.upload-zone small { color: var(--muted); font-size: 12px; }
.comparison-fields { grid-template-columns: 1.2fr 1fr 1fr; margin-top: 18px; }
.comparison-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.comparison-actions > div:last-child { display: flex; gap: 9px; }
.privacy-note { display: flex; align-items: center; gap: 8px; color: #35644b; font-size: 12px; }
.privacy-note > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 800; }
.comparison-empty { margin-top: 18px; padding: 42px 20px; border: 1px dashed #cfd8e8; border-radius: 12px; color: var(--muted); text-align: center; }
.comparison-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 13px; background: #e9eef8; color: #667085; font-size: 24px; }
.comparison-empty h2 { margin: 0 0 7px; color: var(--ink); font-size: 17px; }
.comparison-empty p { max-width: 590px; margin: 0 auto; font-size: 13px; line-height: 1.5; }
.comparison-summary { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 1px; margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.comparison-summary > div { min-width: 0; padding: 14px 16px; background: white; }
.comparison-summary span, .comparison-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comparison-summary span { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.comparison-summary strong { font-size: 14px; }
.comparison-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.provider-result { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-top: 3px solid #172033; }
.provider-result.yandex { border-top-color: #ffcc00; }
.provider-result.sber { border-top-color: #22a764; }
.provider-result-head { display: flex; align-items: center; gap: 10px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.provider-result-head .tag { margin-left: auto; }
.provider-result-head h2 { margin: 0; font-size: 16px; }
.provider-result-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.provider-logo { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 9px; background: #172033; color: white; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.provider-result.yandex .provider-logo { background: #ffcc00; color: #171717; }
.provider-result.sber .provider-logo { background: #22a764; }
.result-metrics { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.result-metrics > div { padding: 14px 16px; }
.result-metrics > div + div { border-left: 1px solid var(--line); }
.result-metrics span, .result-metrics strong, .result-metrics small { display: block; }
.result-metrics span, .quality-line span { color: var(--muted); font-size: 11px; }
.result-metrics strong { margin: 5px 0 3px; font-size: 19px; letter-spacing: -.02em; }
.result-metrics small, .quality-line small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.quality-line { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.quality-line strong { display: block; margin: 4px 0 2px; font-size: 13px; }
.quality-line small { display: block; }
.transcript-preview { flex: 1; padding: 16px; background: #fbfcfe; }
.transcript-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.transcript-title strong { font-size: 12px; }
.transcript-title span { color: #b54708; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.transcript-preview p { margin: 0; color: #344054; font-size: 12px; line-height: 1.65; white-space: pre-line; }
.provider-result-footer { padding: 11px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .call-layout, .split-main { grid-template-columns: 1fr; }
  .topic-row { grid-template-columns: 1.3fr repeat(3, .6fr); }
  .topic-row > :nth-child(6), .topic-row > :nth-child(7) { display: none; }
  .comparison-grid { grid-template-columns: 1fr; }
  .connection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-settings-layout { grid-template-columns: 1fr; }
  .profile-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { width: 100%; min-width: 0; min-height: auto; padding: 12px; position: sticky; top: 0; z-index: 3; overflow: hidden; }
  .sidebar .brand, .nav-label, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; gap: 4px; }
  .nav-item { width: max-content; margin: 0; }
  .nav-item .counter { display: none; }
  .topbar { padding: 0 16px; }
  .content { padding: 22px 16px 32px; }
  .settings-layout, .settings-main { min-width: 0; max-width: 100%; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .settings-menu { display: flex; overflow: auto; }
  .settings-menu button { width: max-content; white-space: nowrap; }
  .comparison-summary { grid-template-columns: 1fr 1fr; }
  .comparison-fields { grid-template-columns: 1fr; }
  .comparison-actions { align-items: flex-start; flex-direction: column; }
  .connection-grid { grid-template-columns: 1fr; }
  .provider-policy { grid-template-columns: 1fr; gap: 6px; }
  .analytics-metrics { grid-template-columns: 1fr; }
  .analysis-output-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .login-panel { padding: 30px 24px; }
  .metric-grid, .topic-stats, .provider-grid { grid-template-columns: 1fr; }
  .page-head, .topbar { align-items: flex-start; flex-direction: column; height: auto; padding-block: 15px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .page-actions { justify-content: flex-start; }
  .bar-row { grid-template-columns: 1fr 1.3fr 45px; gap: 8px; }
  .segment { grid-template-columns: 42px 68px 1fr; gap: 7px; }
  .topic-row { grid-template-columns: 1fr 66px 66px; }
  .topic-row > :nth-child(4), .topic-row > :nth-child(5) { display: none; }
  .filters .field { min-width: 100%; }
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .step::after { display: none; }
  .comparison-summary { grid-template-columns: 1fr; }
  .comparison-actions > div:last-child { width: 100%; flex-direction: column; }
  .comparison-actions .btn { width: 100%; }
  .profile-list, .analysis-output-grid { grid-template-columns: 1fr; }
  .analytics-save-row { align-items: stretch; flex-direction: column; }
  .rule-priority { align-items: flex-start; flex-wrap: wrap; }
}
