/* VOLNA — панель управления.
   Шрифты: Onest (интерфейс), Unbounded (логотип), JetBrains Mono (коды). Все под OFL 1.1, лежат в /static/fonts. */

@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/onest-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/onest-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/onest-rub-wght-normal.woff2") format("woff2"); unicode-range: U+20BD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/static/fonts/unbounded-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/static/fonts/unbounded-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0400-045F; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0400-045F; }

/* ---------------------------------------------------------------- токены */
:root {
  --font: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-brand: "Unbounded", var(--font);
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #f4f4f1;
  --side: #efefeb;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --sunken: #f0f0ec;
  --line: #e7e6e1;
  --line-2: #d6d5ce;
  --ink: #15161a;
  --ink-2: #4b4e56;
  --ink-3: #868992;
  --on-ink: #ffffff;

  --accent: #0b6e78;
  --accent-hover: #095c65;
  --accent-soft: #e2efef;
  --accent-ring: rgba(11, 110, 120, .22);

  --ok: #1d7a4c;   --ok-soft: #e4f2ea;
  --warn: #9a5a0c; --warn-soft: #fbefd9; --warn-dot: #d98a1c;
  --danger: #b3261e; --danger-soft: #fbe8e6;

  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --shadow-1: 0 1px 0 rgba(21, 22, 26, .04);
  --shadow-2: 0 1px 2px rgba(21, 22, 26, .06), 0 1px 1px rgba(21, 22, 26, .03);
  --shadow-pop: 0 12px 32px -8px rgba(21, 22, 26, .18), 0 2px 6px rgba(21, 22, 26, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --tg-bg: #0e1621; --tg-bubble: #182533; --tg-mine: #2b5278; --tg-text: #e9eef5; --tg-link: #6ab3f3; --tg-meta: #6d7f8f;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23868992' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214; --side: #0c0d0e; --surface: #18191c; --surface-2: #1c1d20; --sunken: #141517;
    --line: #26282c; --line-2: #34363b;
    --ink: #ececee; --ink-2: #a9acb3; --ink-3: #72757d; --on-ink: #111214;
    --accent: #52b7c1; --accent-hover: #6fc6cf; --accent-soft: rgba(82, 183, 193, .12); --accent-ring: rgba(82, 183, 193, .28);
    --ok: #53c28b; --ok-soft: rgba(83, 194, 139, .12);
    --warn: #e2a64e; --warn-soft: rgba(226, 166, 78, .12); --warn-dot: #e2a64e;
    --danger: #f07a6f; --danger-soft: rgba(240, 122, 111, .12);
    --shadow-1: none; --shadow-2: 0 1px 0 rgba(0, 0, 0, .25);
    --shadow-pop: 0 16px 40px -10px rgba(0, 0, 0, .6), 0 0 0 1px var(--line);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- основа */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55; font-weight: 400; color: var(--ink); background: var(--bg);
  font-feature-settings: "cv11", "ss01"; }
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
h2 { font-size: 15.5px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h3 { font-size: 14px; margin: 18px 0 8px; }
p { margin: 0 0 10px; } p:last-child { margin-bottom: 0; }
b, strong { font-weight: 600; }
code, kbd, pre, .mono { font-family: var(--font-mono); font-size: .88em; }
code { background: var(--sunken); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; color: var(--ink); white-space: nowrap; }
code.big { display: inline-block; font-size: 18px; font-weight: 500; letter-spacing: .02em; padding: 8px 14px; border-radius: var(--r); white-space: normal; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
img { max-width: 100%; }
.icon { flex: none; display: block; }
.muted { color: var(--ink-3); } .right { text-align: right; } .nowrap { white-space: nowrap; }
.small { font-size: 12.5px; } .big { font-size: 22px; line-height: 1.2; } .break { overflow-wrap: anywhere; word-break: break-word; }
.clip { max-width: 520px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); } .w-third { width: 34%; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.warn { color: var(--warn); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------------------------------------------------------------- каркас */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); padding: 14px 12px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.logo-mark { flex: none; }
.logo-mark rect { fill: var(--accent); }
.logo-mark path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.brand-name { font-family: var(--font-brand); font-weight: 600; font-size: 15px; letter-spacing: .14em; }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-group { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 16px 10px 6px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r); color: var(--ink-2); font-weight: 500; font-size: 14px; transition: background .12s, color .12s; }
.nav-item .icon { color: var(--ink-3); transition: color .12s; }
.nav-item:hover { background: rgba(21, 22, 26, .045); color: var(--ink); text-decoration: none; }
.nav-item:hover .icon { color: var(--ink-2); }
.nav-item.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); border: 1px solid var(--line); height: 34px; padding: 0 9px; }
.nav-item.active .icon { color: var(--accent); }
.nav-item .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .nav-item:hover { background: rgba(255, 255, 255, .04); } .nav-item .count { color: #0c0d0e; } }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 6px 2px; border-top: 1px solid var(--line); }
.sidebar-foot form { margin: 0 0 0 auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13.5px; }
.who { min-width: 0; line-height: 1.3; }
.who b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; font-size: 12px; color: var(--ink-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: flex-end; gap: 14px; padding: 22px 36px 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.titles { flex: 1; min-width: 0; display: grid; gap: 4px; }
.topbar h1 { font-size: 24px; font-weight: 600; letter-spacing: -.025em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar h1 .badge { font-size: 12px; letter-spacing: 0; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back-link, .crumbs { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.back-link { margin-left: -3px; } .back-link:hover { color: var(--ink); text-decoration: none; }
.crumbs { flex-wrap: wrap; gap: 6px; } .crumbs a { color: var(--ink-3); } .crumbs a:hover { color: var(--ink); } .crumb-sep { color: var(--line-2); }
.content { width: 100%; max-width: 1280px; padding: 4px 36px 64px; display: grid; gap: 20px; align-content: start; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); border: 0; background: transparent; color: var(--ink-3); cursor: pointer; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.menu-btn { display: none; }
.scrim { display: none; }

/* ---------------------------------------------------------------- карточки и сетки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-1); min-width: 0; }
.card > h2:first-child { margin-top: -2px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sticky { position: sticky; top: 96px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 18px; }

.stat { display: flex; flex-direction: column; gap: 6px; color: var(--ink); padding: 18px 20px; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
a.stat:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow-2); }
.stat-label { color: var(--ink-2); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .muted { font-size: 12.5px; }
.stat-go { margin-top: auto; padding-top: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
a.stat:hover .stat-go { color: var(--accent); }
.tone-warn .stat-label::before, .tone-info .stat-label::before, .tone-ok .stat-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.tone-warn .stat-label::before { background: var(--warn-dot); box-shadow: 0 0 0 3px var(--warn-soft); }
.tone-info .stat-label::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tone-ok .stat-value { color: var(--ink-3); }

.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px 20px; margin: 0; }
.kv dt { color: var(--ink-3); font-size: 13.5px; } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- таблицы */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.card > .table, .card > form > .table, .card.table-wrap .table { width: calc(100% + 44px); margin: 0 -22px; }
.card > .table:last-child, .card.table-wrap > .table:last-child { margin-bottom: -20px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 9px 12px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.card > .table:first-child th, .card.table-wrap > .table:first-child th { border-top: 0; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr, .table > tr { transition: background .1s; }
.table tbody tr:hover td, .table > tr:hover td { background: var(--surface-2); }
.table tr.row-link { cursor: pointer; }
.table tr.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.table td a:not(.btn) { color: var(--ink); font-weight: 500; }
.table td a:not(.btn):hover { color: var(--accent); text-decoration: none; }
.table .right { text-align: right; font-variant-numeric: tabular-nums; }
.card:has(> .table:last-child) { padding-bottom: 20px; }

/* ---------------------------------------------------------------- кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; line-height: 1;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-1); transition: background .12s, border-color .12s, box-shadow .12s, transform .06s, color .12s; }
.btn:hover { text-decoration: none; background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn .icon { margin: 0 -2px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); box-shadow: 0 1px 2px rgba(21, 22, 26, .18), inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); border-color: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { background: color-mix(in srgb, var(--ok) 88%, #000); border-color: color-mix(in srgb, var(--ok) 88%, #000); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.btn-danger:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); border-color: transparent; color: var(--ink); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
@media (prefers-color-scheme: dark) { .btn-success { color: #0c0d0e; } .btn-primary { box-shadow: none; } }
.actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form, .row-actions form { margin: 0; }
.row-actions > span { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- метки */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 500; line-height: 1;
  white-space: nowrap; background: var(--sunken); color: var(--ink-2); border: 1px solid var(--line); vertical-align: middle; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-muted::before { background: var(--ink-3); }

/* ---------------------------------------------------------------- формы */
label { display: grid; gap: 6px; font-weight: 500; font-size: 13px; color: var(--ink); align-content: start; }
label small, .hint { font-weight: 400; color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }
.hint { margin: 0; } .hint.warn { color: var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: var(--r); }
input[type=text], input[type=number], input[type=url], input[type=search], input[type=date], input[type=password], input[type=email], input[type=file], select, textarea {
  width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; line-height: 1.4; box-shadow: var(--shadow-1); transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
input[type=file] { padding: 6px; cursor: pointer; color: var(--ink-2); }
input[type=file]::file-selector-button { font: inherit; font-size: 13px; font-weight: 500; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); border-radius: var(--r-sm); padding: 5px 12px; margin-right: 10px; cursor: pointer; }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=search]::-webkit-search-cancel-button { filter: grayscale(1); opacity: .5; }
textarea { min-height: 110px; resize: vertical; }
textarea.mono { font-family: var(--font-mono); font-size: 13px; }
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; flex: none; border: 1.5px solid var(--line-2); border-radius: 5px;
  background: var(--surface); cursor: pointer; display: inline-grid; place-content: center; transition: background .12s, border-color .12s; }
input[type=checkbox]:hover { border-color: var(--ink-3); }
input[type=checkbox]:checked { background: var(--accent) var(--check-mark) center / 12px no-repeat; border-color: var(--accent); }
input[type=checkbox]:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); outline: none; }
input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 14px; cursor: pointer; }
form.stack, .stack { display: grid; gap: 16px; }
.card > form + form, .card > form + .hint { margin-top: 14px; }
form { margin: 0; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.toolbar > * { margin: 0; }
.toolbar label { min-width: 220px; flex: 0 1 280px; }
.toolbar label.check { min-width: 0; flex: none; height: 38px; }
details.add { margin-top: 16px; } details.add > summary { list-style: none; display: inline-flex; cursor: pointer; }
details.add > summary::-webkit-details-marker { display: none; } details.add[open] > summary { margin-bottom: 16px; }

/* ---------------------------------------------------------------- вкладки, страницы, пусто */
.tabs { display: flex; gap: 22px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: -4px; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 4px 1px 11px; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--ink); }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px; }
.tab .n { min-width: 20px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line); color: var(--ink-2); font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.tab.active .n { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pager-info { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; } .pager-info span { color: var(--ink-3); }
.empty { display: grid; justify-items: center; gap: 12px; text-align: center; color: var(--ink-2); padding: 36px 16px; font-size: 14px; }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--sunken); border: 1px solid var(--line); color: var(--ink-3); }

/* ---------------------------------------------------------------- уведомления */
.toast { position: fixed; z-index: 50; top: 18px; right: 18px; max-width: min(420px, calc(100vw - 36px)); display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  font-size: 14px; font-weight: 500; animation: toast-in .35s var(--ease); }
.toast.hide { animation: toast-out .25s ease forwards; }
.toast .icon { margin-top: 1px; }
.toast-ok .icon:first-child { color: var(--ok); } .toast-err .icon:first-child { color: var(--danger); }
.toast-text { flex: 1; }
.toast-close { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 2px; border-radius: 5px; }
.toast-close:hover { color: var(--ink); background: var(--sunken); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }
.flash { padding: 12px 14px; border-radius: var(--r); font-weight: 500; font-size: 14px; }
.flash-ok { background: var(--ok-soft); color: var(--ok); } .flash-err { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- вход и ошибки */
.solo { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.solo-art { position: relative; overflow: hidden; background: #0a3f45; color: #e6f2f3; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; }
.solo-art .brand { color: #fff; padding: 0; }
.solo-art .logo-mark rect { fill: rgba(255, 255, 255, .12); }
.solo-art svg.waves { position: absolute; inset: auto -5% -2% -5%; width: 110%; height: 46%; opacity: .9; pointer-events: none; }
.solo-art svg.waves path { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 1.2; }
.solo-art svg.waves path:nth-child(3n) { stroke: rgba(130, 210, 218, .35); }
.solo-art blockquote { position: relative; margin: 0; max-width: 420px; font-size: 26px; line-height: 1.25; font-weight: 500; letter-spacing: -.02em; color: #fff; }
.solo-art blockquote small { display: block; margin-top: 14px; font-size: 14px; font-weight: 400; letter-spacing: 0; color: rgba(230, 242, 243, .7); line-height: 1.5; }
.solo-art .foot { position: relative; font-size: 12.5px; color: rgba(230, 242, 243, .55); }
.solo-form { display: grid; place-items: center; padding: 40px 24px; }
.login { width: min(380px, 100%); display: grid; gap: 22px; }
.login h1 { font-size: 26px; letter-spacing: -.03em; }
.login .lead { color: var(--ink-2); margin: 6px 0 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); align-items: center; }
.steps li:last-child { border-bottom: 0; }
.steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 12.5px; }
.steps b { color: var(--ink); }
.login .note { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-3); align-items: flex-start; }
.login .note .icon { margin-top: 2px; }
.error-page { width: min(420px, 100%); display: grid; gap: 14px; justify-items: start; }
.error-page .code { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.error-page h1 { font-size: 26px; letter-spacing: -.03em; }
.error-page p { color: var(--ink-2); margin: 0; }

/* ---------------------------------------------------------------- переписка поддержки */
.chat { display: grid; gap: 12px; padding: 4px 0; }
.msg { max-width: 82%; padding: 10px 14px 8px; border-radius: 14px 14px 14px 4px; background: var(--sunken); border: 1px solid var(--line); overflow-wrap: anywhere; font-size: 14px; }
.msg.staff { margin-left: auto; background: var(--accent-soft); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 4px; }
.msg blockquote, .rich blockquote { margin: 6px 0; padding: 3px 10px; border-left: 2px solid var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, transparent); border-radius: 0 6px 6px 0; }
.msg .spoiler, .rich .spoiler { background: var(--ink-3); color: transparent; border-radius: 4px; cursor: pointer; }
.msg .spoiler.open, .rich .spoiler.open { background: var(--sunken); color: inherit; }
.msg pre, .rich pre { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 6px 0; white-space: pre-wrap; }
.attach { display: flex; align-items: center; gap: 6px; }
.thumb { max-width: 300px; max-height: 300px; border-radius: 10px; display: block; border: 1px solid var(--line); }
.payment { padding: 12px 0; border-bottom: 1px solid var(--line); } .payment:first-of-type { padding-top: 0; } .payment:last-child { border-bottom: 0; padding-bottom: 0; }
pre.secret { font-family: var(--font-mono); font-size: 13px; background: var(--sunken); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--r); overflow-x: auto; white-space: pre-wrap; margin: 0 0 8px; }

/* ---------------------------------------------------------------- предпросмотр «как в Telegram» */
.tg-preview { background: var(--tg-bg); background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 14px 14px;
  border-radius: var(--r-lg); padding: 14px 16px 16px; display: grid; gap: 6px; border: 1px solid rgba(0, 0, 0, .2); }
.tg-head { display: flex; align-items: center; gap: 8px; color: var(--tg-meta); font-size: 12px; font-weight: 500; letter-spacing: .02em; margin-bottom: 4px; }
.tg-dot { width: 7px; height: 7px; border-radius: 50%; background: #4fae4e; box-shadow: 0 0 0 3px rgba(79, 174, 78, .18); }
.tg-bubble { background: var(--tg-bubble); color: var(--tg-text); border-radius: 14px 14px 14px 5px; padding: 8px 12px 9px; max-width: 460px; overflow-wrap: anywhere; line-height: 1.42; font-size: 14.5px; }
.tg-bubble.mine { background: var(--tg-mine); border-radius: 14px 14px 5px 14px; margin-left: auto; }
.tg-bubble a { color: var(--tg-link); } .tg-bubble b { font-weight: 600; }
.tg-bubble code { background: rgba(255, 255, 255, .08); border: 0; color: #e9eef5; }
.tg-bubble pre { background: rgba(255, 255, 255, .06); border-radius: 6px; padding: 8px 10px; margin: 6px 0; white-space: pre-wrap; font-size: 13px; }
.tg-bubble blockquote { margin: 6px 0; padding: 3px 10px; border-left: 3px solid var(--tg-link); background: rgba(106, 179, 243, .1); border-radius: 0 6px 6px 0; }
.tg-bubble blockquote.expandable { position: relative; max-height: 3.4em; overflow: hidden; }
.tg-bubble blockquote.expandable::after { content: ""; position: absolute; right: 8px; bottom: 6px; width: 6px; height: 6px; border-right: 1.5px solid var(--tg-link); border-bottom: 1.5px solid var(--tg-link); transform: rotate(45deg); }
.tg-bubble .spoiler { background: #4a5664; color: transparent; border-radius: 4px; cursor: pointer; user-select: none; }
.tg-bubble .spoiler.open { background: rgba(255, 255, 255, .1); color: inherit; }
.tg-header { margin-bottom: 6px; }
.tg-buttons { display: grid; gap: 4px; max-width: 460px; } .tg-buttons .row { display: flex; gap: 4px; }
.tg-btn { flex: 1; text-align: center; background: rgba(40, 60, 80, .75); color: #fff; padding: 8px 6px; border-radius: 8px; font-size: 13.5px; font-weight: 500; }
.tg-time { color: var(--tg-meta); font-size: 11px; text-align: right; }

/* ---------------------------------------------------------------- редактор */
.editor-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.sticky-preview { position: sticky; top: 96px; }
.editor { border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.editor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.editor-bar button { height: 28px; min-width: 28px; padding: 0 7px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.editor-bar button:hover { background: var(--sunken); color: var(--ink); }
.editor-bar button code { background: none; border: 0; padding: 0; font-size: 12px; }
.editor-bar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.editor-bar select { width: auto; min-height: 28px; height: 28px; padding: 0 28px 0 10px; font-size: 13px; border-radius: var(--r-sm); box-shadow: none; background-position: right 8px center; margin-left: 2px; }
.editor textarea { border: 0; border-radius: 0; min-height: 200px; box-shadow: none; padding: 12px 14px; }
.editor textarea:focus { box-shadow: none; }

/* ---------------------------------------------------------------- обзор */
.hello { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hello .date { color: var(--ink-3); font-size: 13.5px; }
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; } .list-row:first-child { padding-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { color: var(--ink); font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .sub { color: var(--ink-3); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.list-row:hover { text-decoration: none; } a.list-row:hover .title { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; font-weight: 500; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head a { font-size: 13px; font-weight: 500; color: var(--ink-3); display: inline-flex; align-items: center; gap: 2px; }
.card-head a:hover { color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- телефон и планшет */
@media (max-width: 1100px) { .split, .editor-wrap { grid-template-columns: 1fr; } .sticky, .sticky-preview { position: static; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 272px; transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(10, 11, 12, .38); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; margin-left: -6px; }
  .topbar { padding: 14px 16px 12px; align-items: center; }
  .topbar h1 { font-size: 20px; }
  .content { padding: 4px 16px 48px; gap: 16px; }
  .card { padding: 16px; border-radius: 10px; }
  .card > .table, .card > form > .table, .card.table-wrap .table { width: calc(100% + 32px); margin: 0 -16px; }
  .card > .table:last-child, .card.table-wrap > .table:last-child { margin-bottom: -16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; } .table th:last-child, .table td:last-child { padding-right: 16px; }
  .grid-2 { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; }
  .solo { grid-template-columns: 1fr; } .solo-art { display: none; }
  .toolbar label { flex: 1 1 100%; }
  .stat-value { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* обзор: показатели и две колонки */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 -22px -20px; border-top: 1px solid var(--line); }
.kpi { padding: 18px 22px 20px; display: grid; gap: 6px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi .muted { font-size: 12.5px; }
.dash { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.dash > .stack { gap: 20px; }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(3) { border-left: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 900px) { .kpis { margin: 0 -16px -16px; } .kpi { padding: 14px 16px; } }

/* таблица первой строкой карточки: без верхнего отступа, углы шапки скруглены */
.card:has(> .table:first-child) { padding-top: 0; }
.card > .table:first-child th:first-child { border-top-left-radius: var(--r-lg); }
.card > .table:first-child th:last-child { border-top-right-radius: var(--r-lg); }
.card > .table:first-child thead tr:first-child th { border-top: 0; }
.card > .table:first-child:not(:has(thead)) tr:first-child td { border-top: 0; }
.card:has(> .table:first-child):not(:has(> .table thead)) { padding-top: 4px; }

/* кнопки в вертикальных формах не растягиваются на всю ширину */
form.stack > .btn, form.stack > button.btn, .stack > .btn { justify-self: start; }
.action-forms { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.action-forms:not(:has(form)) { display: none; }
.payment .tg-preview { max-width: 520px; margin-top: 10px; }

/* лента событий */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; }
.timeline li { position: relative; display: flex; justify-content: space-between; gap: 16px; padding: 0 0 16px 22px; flex-wrap: wrap; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 4px; top: 20px; bottom: 2px; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline li:not(:last-child)::before { border-color: var(--line-2); }
.tl-main { min-width: 0; } .tl-meta { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.col { display: grid; gap: 20px; align-content: start; min-width: 0; }
.spaced { margin-top: 16px; }

/* контейнерные запросы: редактор сам складывается в колонку, если карточка узкая */
.card { container-type: inline-size; }
@container (max-width: 760px) {
  .editor-wrap { grid-template-columns: 1fr; }
  .sticky-preview { position: static; }
}

/* своё поле выбора файла вместо системного «Choose File» */
.file { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 4px 4px 4px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface-2); cursor: pointer; font-weight: 400; transition: border-color .12s, background .12s; }
.file:hover { border-color: var(--ink-3); background: var(--surface); }
.file input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.file-name { font-size: 13px; color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file.has-file .file-name { color: var(--ink); }
.file:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

/* значок сущности (категория, товар): эмодзи из бота или нейтральная иконка */
.thing { width: 30px; height: 30px; flex: none; border-radius: 8px; display: inline-grid; place-items: center; background: var(--sunken); border: 1px solid var(--line); color: var(--ink-3); font-size: 15px; line-height: 1; }
h1 .thing { width: 34px; height: 34px; font-size: 18px; }
.named { display: inline-flex; align-items: center; gap: 12px; }
.named a { font-weight: 600; }
.card > .table + *, .card > .tabs + .table { margin-top: 0; }
.card > .table:not(:last-child) { margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.card > .tabs { margin-bottom: 0; }
/* подсказка под полем, чтобы поля в ряд стояли ровно */
label > small { order: 2; }
.stack > h2 { margin-bottom: 0; }
.stack > h2 + .hint { margin-top: -8px; }

/* поиск: иконка лупы в поле, подпись только для экранного диктора */
.toolbar label:has(> input[type=search]) { font-size: 0; gap: 0; }
input[type=search] { padding-left: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23868992' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }
.toolbar label:has(> input[type=search]) { flex: 0 1 380px; }
.editor-bar select { max-width: 170px; }

/* переключатель (права ролей и т.п.) */
.center { text-align: center; } .table .center { text-align: center; width: 130px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; padding: 0; border: 0; border-radius: 11px; background: var(--line-2); cursor: pointer; vertical-align: middle; transition: background .18s var(--ease); flex: none; }
.switch > span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .18s var(--ease); }
.switch.on { background: var(--accent); }
.switch.on > span { transform: translateX(16px); }
.switch:hover { filter: brightness(.96); }
.switch.is-locked { opacity: .45; cursor: not-allowed; }
.switch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
@media (prefers-color-scheme: dark) { .switch > span { background: #ececee; } .switch.on > span { background: #0c0d0e; } }

/* флажки в подписях .check выглядят как переключатели */
.check input[type=checkbox] { width: 36px; height: 21px; border-radius: 11px; border: 0; background: var(--line-2); position: relative; transition: background .18s var(--ease); }
.check input[type=checkbox]::before { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .18s var(--ease); }
.check input[type=checkbox]:checked { background: var(--accent); background-image: none; }
.check input[type=checkbox]:checked::before { transform: translateX(15px); }
.check input[type=checkbox]:hover { filter: brightness(.96); }
@media (prefers-color-scheme: dark) { .check input[type=checkbox]::before { background: #ececee; } .check input[type=checkbox]:checked::before { background: #0c0d0e; } }
.toggle-list { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.toggle-list .check { justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.toggle-list .check:last-child { border-bottom: 0; }
.toggle-list .check:hover { background: var(--surface-2); }
.editor textarea { min-height: 64px; }

/* страница настроек: описание слева, поля справа */
.settings { padding-top: 0; padding-bottom: 0; }
.set-row { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 28px 40px; padding: 26px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-info h2 { margin-bottom: 6px; }
.set-info .hint { font-size: 13px; }
.set-foot { display: flex; justify-content: flex-end; gap: 10px; margin: 0 -22px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
@container (max-width: 720px) { .set-row { grid-template-columns: 1fr; gap: 14px; } }
.card > .hint:not(:last-child), .card > p.muted:not(:last-child) { margin-bottom: 16px; }

/* эмодзи: строка в одну линию */
.emoji-form { display: flex; gap: 8px; align-items: center; }
.emoji-form input { width: auto; min-height: 30px; height: 30px; padding: 4px 10px; font-size: 13.5px; }
.emoji-form input[name=plain] { width: 58px; text-align: center; font-size: 16px; }
.emoji-form input[name=custom_id] { width: 200px; font-family: var(--font-mono); font-size: 12.5px; }
.emoji-now { font-size: 20px; line-height: 1.2; white-space: nowrap; }
.emoji-now .muted, .emoji-now .badge { font-size: 11.5px; }

/* таблицы на узких экранах прокручиваются внутри карточки, страница не уезжает вбок */
.card:has(> .table) { overflow-x: auto; }
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .table td, .table th { padding-top: 10px; padding-bottom: 10px; }
  .dash .table td:nth-child(3), .dash .table th:nth-child(3) { display: none; }
  .table td { min-width: 0; }
}

/* поддержка в прямом эфире */
.chat-card { position: relative; }
.chat-scroll { max-height: min(560px, 62vh); overflow-y: auto; margin: 0 -22px; padding: 4px 22px 6px; overscroll-behavior: contain; }
.msg-new { animation: msg-in .35s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.chat-jump { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 500; box-shadow: var(--shadow-pop); cursor: pointer; }
.chat-jump .icon { transform: rotate(90deg); }
.chat-notice { margin-top: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--on-ink); border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sound-btn .icon + .icon { display: none; }
.sound-btn:not(.sound-on) .icon:first-child { display: none; }
.sound-btn:not(.sound-on) .icon + .icon { display: block; }
.sound-btn.sound-on { color: var(--accent); }
.sidebar-foot form { margin-left: 0; }
.sidebar-foot .sound-btn { margin-left: auto; }

/* шаблоны ответов поддержки */
.reply-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.reply-item summary::-webkit-details-marker { display: none; }
.reply-item summary::before { content: ""; width: 0; height: 0; border-left: 5px solid var(--ink-3); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s var(--ease); flex: none; }
.reply-item[open] summary::before { transform: rotate(90deg); }
.reply-item summary b { font-weight: 500; color: var(--ink-2); }
.reply-item form.stack { margin-top: 16px; }
.reply-item form:not(.stack) { margin-top: 12px; }
.reply-thumb { max-width: 160px; max-height: 160px; }
.quick-replies-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.quick-replies-bar select { max-width: 260px; }
.quick-reply-note { display: flex; align-items: center; gap: 8px; margin-top: -6px; padding: 8px 12px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.quick-reply-note button { border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0; margin-left: auto; }
.row-actions.end { justify-content: flex-end; }
.row-actions.end select { width: auto; min-height: 30px; height: 30px; padding: 0 28px 0 10px; font-size: 13px; }

/* меню внизу чата */
.menu-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.menu-rows { display: grid; gap: 8px; }
.menu-row { display: grid; grid-template-columns: 64px minmax(0, 1.4fr) minmax(0, 1.2fr) 110px; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.menu-row .row-extra { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.menu-row input[data-menu-icon] { text-align: center; padding-inline: 4px; }
.tg-kb-btn.success { background: #2f9e57; }
.tg-kb-btn.danger { background: #d9453d; }
.tg-kb-btn .prem { font-size: 10px; opacity: .75; margin-left: 4px; }
.tg-keyboard { display: grid; gap: 5px; margin-top: 6px; }
.tg-kb-row { display: flex; gap: 5px; }
.tg-kb-btn { flex: 1; text-align: center; background: #232e3c; color: #fff; padding: 9px 8px; border-radius: 8px; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.tg-kb-btn.primary { background: #2481cc; }
.level-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .menu-grid { grid-template-columns: 1fr; } .menu-row { grid-template-columns: 64px minmax(0, 1fr); } }
