:root {
  --paper: #f5f6f8;
  --surface: #ffffff;
  --ink: #1c2430;
  --ink-2: #5a6472;
  --line: #e1e4ea;
  --sea: #0f5f66;
  --sea-soft: #e3f0f0;
  --saffron: #e3a21a;
  --saffron-soft: #fff4dc;
  --brick: #b9432e;
  --forest: #2f7a4f;
  --forest-soft: #e4f2e9;
  --bubble-in: #ffffff;
  --bubble-out: #e6eef3;
  --radius-s: 8px;
  --radius-m: 12px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12171d;
    --surface: #1a2129;
    --ink: #e6ebf0;
    --ink-2: #98a3b0;
    --line: #2a333d;
    --sea: #4fb3b9;
    --sea-soft: #173236;
    --saffron: #f0b43a;
    --saffron-soft: #33290f;
    --brick: #e5735d;
    --forest: #5cbf85;
    --forest-soft: #183324;
    --bubble-in: #1f2730;
    --bubble-out: #20323a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--brick); min-height: 1.2em; margin: 8px 0 0; font-size: 14px; }
.hint { color: var(--ink-2); font-size: 13.5px; margin: 4px 0 12px; max-width: 70ch; }
.empty { color: var(--ink-2); padding: 24px 4px; }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.2; font-weight: 700; }
h3 { font-size: 17px; }
h4 { font-size: 15px; margin-top: 16px; }
a { color: var(--sea); }

:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }

input, textarea, select {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 9px 11px;
}
input:focus, textarea:focus, select:focus { border-color: var(--sea); outline: none; box-shadow: 0 0 0 3px var(--sea-soft); }
textarea { resize: vertical; }
input[type='checkbox'], input[type='radio'] { width: auto; accent-color: var(--sea); }
label { display: block; font-size: 14px; font-weight: 500; margin: 10px 0; }
label > input, label > textarea, label > select { margin-top: 5px; font-weight: 400; }
label.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; cursor: pointer; margin: 8px 0; }
label.check input { margin-top: 4px; }

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 15px;
  border-radius: var(--radius-s);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--sea); border-color: var(--sea); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--brick); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; padding: 11px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border-radius: var(--radius-s);
  border: 0; background: transparent; color: var(--ink-2);
  cursor: pointer; position: relative; font-size: 17px;
}
.icon-btn:hover { background: var(--paper); color: var(--ink); }
.icon-btn.recording { color: #fff; background: var(--brick); }

/* ================= вход ================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side {
  background: var(--sea);
  color: #fff;
  padding: 56px clamp(24px, 6vw, 80px);
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
}
.wordmark { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -0.01em; margin: 0; max-width: 12ch; }
.auth-lead { font-size: 17px; max-width: 46ch; opacity: .92; margin: 0; }
.demo { display: flex; flex-direction: column; gap: 8px; max-width: 380px; margin-top: 12px; }
.demo .bubble { color: var(--ink); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-form { width: 100%; max-width: 360px; }
.auth-form h2 { font-family: var(--display); font-weight: 500; font-size: 24px; margin-bottom: 18px; }
.switch-line { font-size: 14px; color: var(--ink-2); margin-top: 18px; }

/* ================= пузыри (общие) ================= */
.bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bubble-in);
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: 0 1px 0 var(--line);
}
.bubble.in { align-self: flex-start; border-top-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--bubble-out); border-top-right-radius: 4px; }
/* Главная деталь: всё, что написал бот, прошито шафраном */
.bubble.bot { background: var(--saffron-soft); box-shadow: inset 3px 0 0 var(--saffron); }
.demo .bubble.bot { background: #fff4dc; }
.bubble .meta { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 3px; text-align: right; }
.bubble .meta .who { color: #9a6a00; font-weight: 600; }
@media (prefers-color-scheme: dark) { .bubble .meta .who { color: var(--saffron); } }
.bubble .author { display: block; font-size: 12.5px; font-weight: 700; color: var(--sea); }
.bubble img.media { display: block; max-width: 260px; max-height: 300px; border-radius: 8px; margin-bottom: 4px; cursor: zoom-in; }
.bubble audio { display: block; max-width: 260px; margin-bottom: 4px; }
.bubble a.doc { display: block; margin-top: 2px; font-weight: 600; }

/* ================= каркас ================= */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 12px;
}
.side-brand { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.15; padding: 0 10px 22px; color: var(--sea); }
.nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-list button {
  font: inherit; font-weight: 500; text-align: left;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 0; border-radius: var(--radius-s);
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.nav-list button:hover { color: var(--ink); background: var(--paper); }
.nav-list button.active { color: var(--sea); background: var(--sea-soft); font-weight: 700; }
.nav-list .nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-list .dot { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--saffron); color: #2b1d00; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.side-user { border-top: 1px solid var(--line); padding: 14px 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-user-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.view-title { font-family: var(--display); font-weight: 500; font-size: 21px; margin: 0; flex: 1; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.bell-count { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--brick); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.bell-panel {
  position: absolute; right: 20px; top: 62px; z-index: 30;
  width: min(380px, calc(100vw - 32px)); max-height: 60vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: 0 12px 32px rgba(20, 30, 40, .16);
}
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bell-panel ul { list-style: none; margin: 0; padding: 0; }
.bell-panel li { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.bell-panel li.unread { background: var(--sea-soft); }
.bell-panel li time { display: block; font-size: 12px; color: var(--ink-2); }

.bot-switch { display: flex; align-items: center; gap: 9px; margin: 0; cursor: pointer; font-size: 14px; font-weight: 600; user-select: none; }
.bot-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bot-switch .track { width: 42px; height: 24px; border-radius: 12px; background: var(--line); position: relative; transition: background .2s; }
.bot-switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.bot-switch input:checked + .track { background: var(--saffron); }
.bot-switch input:checked + .track .knob { transform: translateX(18px); }
.bot-switch input:focus-visible + .track { outline: 2px solid var(--sea); outline-offset: 2px; }

#banners { padding: 0 28px; }
.banner { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-s); font-size: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.warn { background: var(--saffron-soft); }
.banner.error { background: color-mix(in srgb, var(--brick) 12%, var(--surface)); }
.banner.info { background: var(--sea-soft); }

#views { padding: 24px 28px 48px; }
.view { display: none; }
.view.active { display: block; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; margin: 0 0 16px; min-width: 0; }
fieldset.panel { margin: 0; }
legend { float: left; width: 100%; font-weight: 700; font-size: 17px; padding: 0; margin: 0 0 6px; }
legend + * { clear: both; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ================= номера ================= */
.numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 18px; }
.number { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.number.is-primary { border-color: var(--sea); }
.number-head { display: flex; align-items: center; gap: 10px; }
.role-tag { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--paper); color: var(--ink-2); }
.number.is-primary .role-tag { background: var(--sea-soft); color: var(--sea); }
.number-phone { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: .01em; }
.number-label { color: var(--ink-2); font-size: 14px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); }
.status.open { color: var(--forest); }
.status.open::before { background: var(--forest); box-shadow: 0 0 0 3px var(--forest-soft); }
.status.bad { color: var(--brick); }
.status.bad::before { background: var(--brick); }
.status.wait::before { background: var(--saffron); }
.qr { display: grid; justify-items: center; gap: 10px; padding: 12px; background: var(--paper); border-radius: var(--radius-s); }
.qr img { width: 240px; max-width: 100%; background: #fff; padding: 8px; border-radius: 8px; }
.pair-code { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: .08em; color: var(--sea); }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 13.5px; }
.number-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

/* ================= чаты ================= */
/* экран чатов занимает ровно оставшуюся высоту, сколько бы баннеров ни было сверху */
.main:has(.view.active[data-view='chats']) { height: 100vh; height: 100dvh; }
.main:has(.view.active[data-view='chats']) #views { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 16px; }
.view.active[data-view='chats'] { flex: 1; min-height: 0; display: flex; }
.chats { flex: 1; display: grid; grid-template-columns: 340px 1fr; min-height: 380px; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--surface); }
.chat-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.chat-list-tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.chat-list-tools input { grid-column: 1 / -1; }
.chat-list ul { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; }
.chat-list li { padding: 10px 14px; cursor: pointer; display: grid; gap: 1px; border-left: 3px solid transparent; }
.chat-list li:hover { background: var(--paper); }
.chat-list li.active { background: var(--sea-soft); border-left-color: var(--sea); }
.chat-list .row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-list .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list time { font-size: 12px; color: var(--ink-2); flex: none; }
.chat-list .last { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 0 6px; border-radius: 5px; background: var(--paper); color: var(--ink-2); margin-left: 4px; vertical-align: 1px; }
.tag.backup { background: var(--saffron-soft); color: #8a5c00; }
@media (prefers-color-scheme: dark) { .tag.backup { color: var(--saffron); } }

.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-pane > .empty { margin: auto; }
.chat-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chat-head-main { flex: 1; min-width: 160px; }
.chat-title { font-weight: 700; font-size: 16px; }
.chat-sub { font-size: 13px; color: var(--ink-2); }
.chat-sub .why { color: #8a5c00; }
@media (prefers-color-scheme: dark) { .chat-sub .why { color: var(--saffron); } }
.chat-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chat-head-actions .check { margin: 0; }
.back { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; background: var(--paper); }
.day-sep { align-self: center; font-size: 12.5px; color: var(--ink-2); background: var(--surface); padding: 2px 10px; border-radius: 10px; margin: 10px 0 4px; }
.attach-preview { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 14px; background: var(--sea-soft); }
.attach-preview audio { height: 32px; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { min-height: 40px; max-height: 160px; flex: 1; }
.library-pick { width: 150px; flex: none; font-size: 13px; padding: 9px 6px; }

/* ================= настройки ================= */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings .panel:first-child { grid-row: span 2; }
.radios { margin: 4px 0 8px; }
.test-box { display: flex; gap: 8px; margin-top: 8px; }
.test-reply { margin-top: 12px; }
.test-reply .bubble { max-width: 100%; }
.save-bar { grid-column: 1 / -1; position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 0; background: var(--paper); }

/* ================= файлы ================= */
#views [data-view='files'] { max-width: 880px; }
.file-form input[type='file'] { padding: 8px; }
.storage { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.storage-bar { flex: 1; height: 6px; background: var(--paper); border-radius: 3px; overflow: hidden; }
.storage-bar span { display: block; height: 100%; background: var(--sea); width: 0; }
.files { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.files li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.file-icon { width: 44px; height: 44px; border-radius: 8px; background: var(--paper); display: grid; place-items: center; font-size: 20px; overflow: hidden; }
.file-icon img { width: 100%; height: 100%; object-fit: cover; }
.file-name { font-weight: 600; }
.file-desc { font-size: 13.5px; color: var(--ink-2); }
.file-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.file-actions .check { margin: 0; font-size: 13px; }

/* ================= отложенные ================= */
#views [data-view='scheduled'] { max-width: 880px; }
.sched-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.sched-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; display: flex; gap: 14px; }
.sched-list .body { flex: 1; min-width: 0; }
.sched-list .text { white-space: pre-wrap; word-wrap: break-word; margin-top: 4px; }
.pill { font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 6px; background: var(--paper); color: var(--ink-2); }
.pill.sent { background: var(--forest-soft); color: var(--forest); }
.pill.failed { background: color-mix(in srgb, var(--brick) 12%, var(--surface)); color: var(--brick); }
.pill.pending { background: var(--saffron-soft); color: #8a5c00; }
@media (prefers-color-scheme: dark) { .pill.pending { color: var(--saffron); } }

/* ================= аккаунт ================= */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.account-grid .panel { margin: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0 0; font-size: 14px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* ================= админка ================= */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; }
.stat .big { font-family: var(--display); font-size: 30px; font-weight: 500; line-height: 1.1; }
.stat .cap { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.stat .sub { font-size: 13px; margin-top: 8px; }
.clients-tools { display: flex; gap: 10px; margin-bottom: 14px; }
.clients-tools input { max-width: 360px; }
.clients-tools select { width: 200px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.clients-table td:last-child { white-space: nowrap; text-align: right; }
.clients-table .who b { display: block; }
.num-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; margin-right: 10px; white-space: nowrap; }
.num-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); }
.num-dot.open::before { background: var(--forest); }
.num-dot.bad::before { background: var(--brick); }
.menu { position: relative; display: inline-block; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 10px 28px rgba(20,30,40,.16); padding: 4px; text-align: left; }
.menu-list button { display: block; width: 100%; text-align: left; font: inherit; font-size: 14px; padding: 8px 12px; border: 0; background: none; color: var(--ink); border-radius: 6px; cursor: pointer; }
.menu-list button:hover { background: var(--paper); }
.menu-list button.danger { color: var(--brick); }

/* ================= диалог и тост ================= */
.dialog { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: rgba(15, 22, 30, .45); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: var(--radius-s); max-width: calc(100% - 32px); font-size: 14px; }

/* ================= телефоны ================= */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 36px 22px 28px; }
  .demo { display: none; }
  .app { grid-template-columns: 1fr; padding-bottom: 64px; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 20;
    flex-direction: row; padding: 0; border-right: 0; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .side-brand, .side-user { display: none; }
  .nav-list { flex-direction: row; overflow-x: auto; gap: 0; }
  .nav-list .nav-sep { display: none; }
  .nav-list button { flex: 1 0 auto; flex-direction: column; gap: 2px; font-size: 12px; padding: 9px 10px; border-radius: 0; }
  .nav-list .dot { margin: 0; position: absolute; transform: translate(14px, -4px); min-width: 16px; height: 16px; font-size: 10px; }
  .topbar { padding: 12px 16px; }
  .view-title { font-size: 18px; }
  #bot-label-text { display: none; }
  #banners { padding: 0 16px; }
  #views { padding: 16px 16px 32px; }
  .row2, .settings, .account-grid { grid-template-columns: 1fr; }
  .settings .panel:first-child { grid-row: auto; }
  .main:has(.view.active[data-view='chats']) { height: calc(100dvh - 64px - env(safe-area-inset-bottom)); }
  .main:has(.view.active[data-view='chats']) #views { padding: 10px 10px 8px; }
  .main:has(.view.active[data-view='chats']) .banner { margin-top: 8px; padding: 8px 12px; font-size: 13px; }
  .chats { grid-template-columns: 1fr; min-height: 0; border-radius: var(--radius-s); }
  .chats.open .chat-list { display: none; }
  .chats:not(.open) .chat-pane { display: none; }
  .back { display: inline-block; }
  .bubble { max-width: 88%; }
  .library-pick { display: none; }
  .composer .btn.primary { padding: 9px 12px; }
  .files li { grid-template-columns: 44px 1fr; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .clients-tools { flex-direction: column; }
  .clients-tools input, .clients-tools select { max-width: none; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ================= версия 2: тарифы, база знаний, настройки ================= */
.wordmark-link { color: inherit; text-decoration: none; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 12px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.plan-card.current { border: 2px solid var(--sea); }
.plan-card h3 { margin: 0; }
.plan-price { font-family: var(--display); font-size: 24px; font-weight: 500; }
.plan-price span { font-family: var(--font); font-size: 14px; color: var(--ink-2); }
.plan-card ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.plan-card .btn { margin-top: auto; }
.billing-status p { font-size: 15.5px; }
.file-know { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.file-know.ok { color: var(--forest); }
.checklist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
.settings .panel.wide { grid-column: 1 / -1; }
#siteForm .panel:first-child { grid-row: auto; }
.switch-line.small { font-size: 12.5px; }

/* голосовые ответы */
.voice-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 6px 0 8px; }
.voice-row label { flex: 1 1 220px; margin: 0; }
.voice-row .btn { white-space: nowrap; }
#voiceTestAudio { width: 100%; max-width: 360px; height: 36px; margin-bottom: 6px; }
