/* Админка: пользователи, настройки, рассылка, голоса (статистика — в admin-stats.css).
   Подключается после admin.css, поэтому здесь можно переопределять общие правила админки.
   Префиксы: .tls- общее, .aus- пользователи, .ats- настройки, .abc- рассылка, .avl- голоса */

/* ============================================================
   Общее: шторка подтверждения, цифра с подписью, шторки по центру на широком экране
   ============================================================ */
.tls-confirm__body { display: flex; flex-direction: column; gap: 16px; }
.tls-confirm__text { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.tls-confirm__actions { display: flex; gap: 10px; }
.tls-confirm__actions .btn { min-height: 48px; }
.tls-stat { min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.tls-stat__value { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tls-stat__label { margin-top: 1px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tls-stat--accent { background: var(--grad-soft), var(--card); border-color: rgba(139, 92, 246, 0.3); }

/* Подтверждение уже обычной шторки: на широком экране — компактное окно */
@media (min-width: 600px) {
  .sheet.tls-confirm { max-width: 460px; }
}

/* ============================================================
   Пользователи: поиск, карточки (телефон) / таблица (от 900px), шторка пользователя
   ============================================================ */
.aus { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 1240px; margin: 12px auto 0; }
.aus-head { display: flex; flex-direction: column; gap: 12px; }
.aus-search { position: relative; display: flex; align-items: center; }
.aus-search__icon { position: absolute; left: 16px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.aus-search__input { min-height: 44px; padding-left: 46px; padding-right: 48px; border-radius: 999px; }
.aus-search__input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.aus-search__clear {
  position: absolute;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--muted);
}
.aus-search__clear .icon { width: 18px; height: 18px; }
.aus-meta { min-height: 16px; font-size: 12px; font-weight: 600; color: var(--muted); }
.aus-meta__hint { font-weight: 500; color: var(--muted-2); }

.aus-list { display: flex; flex-direction: column; gap: 8px; }
.aus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "who actions" "cells cells";
  gap: 10px;
  padding: 12px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  animation: rise-in 260ms var(--ease) both;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease);
}
.aus-row:active { transform: scale(0.99); }
.aus-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.aus-row.is-blocked { border-color: rgba(255, 77, 94, 0.4); background: linear-gradient(135deg, rgba(255, 77, 94, 0.08), var(--card) 60%); }
.aus-row--head { display: none; }
.aus-row--sk { height: 112px; border: 0; animation: shimmer 1.4s linear infinite; }
.aus-row__who { grid-area: who; display: flex; align-items: center; gap: 12px; min-width: 0; }
.aus-row__ava.avatar { width: 44px; height: 44px; font-size: 17px; }
.aus-row.is-blocked .aus-row__ava { filter: grayscale(1); opacity: 0.6; }
.aus-row__names { min-width: 0; }
.aus-row__name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.aus-row__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; }
.aus-row__handle { margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.aus-row__cells {
  grid-area: cells;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.aus-row__cell::before { content: attr(data-prefix) " "; font-weight: 500; color: var(--muted-2); }
.aus-row__actions { grid-area: actions; display: flex; align-items: center; gap: 6px; }
.aus-row__btn .icon { width: 18px; height: 18px; }
.aus-row__btn.is-on { color: var(--red); border-color: rgba(255, 77, 94, 0.45); }
.aus-badge {
  flex: 0 0 auto;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  white-space: nowrap;
  color: var(--muted);
  border: 1px solid var(--line-2);
}
.aus-badge--danger { color: var(--red); border-color: rgba(255, 77, 94, 0.45); background: rgba(255, 77, 94, 0.1); }
.aus-badge--admin { color: var(--violet); border-color: rgba(139, 92, 246, 0.45); background: rgba(139, 92, 246, 0.1); }
.aus-more { margin-top: 10px; min-height: 48px; }
.aus-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; text-align: center; color: var(--muted); } /* как .empty--compact (К10) */
.aus-empty__icon .icon { width: 28px; height: 28px; color: var(--muted-2); }
.aus-empty__title { font-size: 16px; font-weight: 700; color: var(--text); }
.aus-empty__hint { max-width: 320px; font-size: 13px; }

/* Карточки (телефон, планшет): дата регистрации — в шторке пользователя, в строку не помещается */
@media (max-width: 899px) {
  .aus-row__cell--since { display: none; }
}

@media (min-width: 640px) and (max-width: 899px) {
  .aus-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .aus-head { flex-direction: row; align-items: center; justify-content: space-between; }
  .aus-search { flex: 0 1 420px; }
  .aus-list { gap: 0; overflow: hidden; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
  .aus-row {
    grid-template-columns: minmax(220px, 2.3fr) minmax(0, 5fr) 100px;
    grid-template-areas: "who cells actions";
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    animation: none;
  }
  .aus-row:active { transform: none; }
  .aus-row:hover { background: rgba(255, 255, 255, 0.03); }
  .aus-row.is-blocked { background: rgba(255, 77, 94, 0.06); }
  .aus-row--head {
    display: grid;
    padding-top: 12px;
    padding-bottom: 12px;
    border-top: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-2);
    background: var(--bg-2);
    cursor: default;
  }
  .aus-row--head:hover { background: var(--bg-2); }
  .aus-row--sk { height: 64px; border-radius: 0; }
  .aus-row__cells { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 0; border: 0; font-size: 13px; font-weight: 600; }
  .aus-row__cell { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .aus-row__cell::before { content: none; }
  .aus-row__cell--energy { font-weight: 800; }
  .aus-row__actions { justify-content: flex-end; }
  .aus-row__ava.avatar { width: 40px; height: 40px; font-size: 15px; }
}

/* Шторка пользователя */
.aus-sheet__body { display: flex; flex-direction: column; gap: 16px; }
.aus-sheet__top { display: flex; flex-direction: column; gap: 12px; }
.aus-card { display: flex; align-items: center; gap: 14px; }
.aus-card__ava.avatar { width: 64px; height: 64px; font-size: 24px; }
.aus-card__body { min-width: 0; }
.aus-card__name { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; } /* как .text-name (К8) */
.aus-card__handle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.aus-card__id {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px; /* выглядит пилюлей, цель касания — полная */
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line-2);
}
.aus-card__id .icon { width: 14px; height: 14px; color: var(--muted); }
.aus-card__badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.aus-card__badges:empty { display: none; }
.aus-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.aus-info { display: flex; flex-direction: column; margin: 0; padding: 2px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.aus-info__row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.aus-info__row:first-child { border-top: 0; }
.aus-info dt { color: var(--muted); }
.aus-info dd { margin: 0; font-weight: 600; text-align: right; }
.aus-section__title { font-size: 15px; font-weight: 800; }
.aus-energy { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); scroll-margin-top: 12px; }
.aus-energy__amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(84px, 1.4fr); gap: 6px; }
.aus-energy__quick { justify-content: center; min-height: 44px; padding: 0; }
.aus-energy__input { min-height: 44px; text-align: center; font-weight: 700; }
.aus-energy .btn--block { min-height: 48px; }
.aus-block { min-height: 48px; }
.aus-block.is-danger { color: var(--red); border-color: rgba(255, 77, 94, 0.45); }
.aus-sheet__hint { margin-top: -8px; font-size: 12px; color: var(--muted-2); text-align: center; }

/* Подтверждение «было → станет» */
.aus-change { padding: 16px; border-radius: var(--r); text-align: center; background: var(--card); border: 1px solid var(--line); }
.aus-change__who { font-size: 13px; color: var(--muted); }
.aus-change__row { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 6px; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.aus-change__old { color: var(--muted); }
.aus-change__arrow { width: 18px; height: 18px; color: var(--muted-2); transform: rotate(180deg); }
.aus-change__new { color: var(--green); }
.aus-change__new.is-down { color: var(--red); }
.aus-change__note { margin-top: 8px; font-size: 12px; color: var(--muted-2); }

/* ============================================================
   Настройки: группы-карточки, изменённые поля, липкая панель «Сохранить»
   ============================================================ */
.ats { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 1100px; margin: 12px auto 0; }
.ats-head__sub { margin: 0; font-size: 12px; color: var(--muted); }
.ats-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ats-group {
  min-width: 0;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color var(--t);
}
.ats-group:has(.is-changed), .ats-group.is-changed { border-color: rgba(255, 181, 71, 0.4); }
.ats-group__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ats-group__icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--pink);
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.ats-group__icon .icon { width: 20px; height: 20px; }
.ats-group__text { min-width: 0; }
.ats-group__title { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.ats-group__hint { margin: 2px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.ats-group__body { display: flex; flex-direction: column; gap: 12px; }
.ats-group__body .field { margin-bottom: 0; }
.ats-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.ats-input { position: relative; display: block; }
.ats-input .input { padding-right: 40px; }
.ats-input__unit { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); font-size: 13px; font-weight: 700; color: var(--muted-2); pointer-events: none; }
.field.is-changed .input, .field.is-changed .textarea { border-color: rgba(255, 181, 71, 0.6); }
.field.is-changed > .field__label::after { content: " · изменено"; font-weight: 600; color: var(--amber); }
.field.is-error .input, .field.is-error .textarea { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 77, 94, 0.15); }
.pack-table__row.is-error { border-color: var(--red); }
.ats-toggles { display: flex; flex-direction: column; }
.ats-toggle { min-height: 56px; padding: 10px 0; border-top: 1px solid var(--line); }
.ats-toggle:first-child { padding-top: 0; border-top: 0; }
.ats-toggle .grow { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 700; }
.ats-toggle__hint { font-size: 12px; font-weight: 500; color: var(--muted); }
.ats-toggle.is-changed .toggle__track { box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.35); }
.ats-seg .seg__item { padding: 0 6px; font-size: 13px; }
.ats-packs { display: flex; flex-direction: column; gap: 10px; }
.ats-packs .pack-table__row:not(.pack-table__head) { background: var(--bg-2); }
.ats-add { align-self: flex-start; }
.ats-sk { min-height: 180px; border: 0; }

/* Панель «Сохранить» (.dock, К4): только при правках — липнет к низу экрана, фон сплошной.
   С клавиатурой — обычный блок в конце формы (html.kb-open, К2): поле, в котором печатают, не закрывает.
   Узкий экран (< 400 px): «1 правка» и «Отменить» иконкой — строка не переносится */
.ats-savebar { display: none; position: relative; z-index: 6; }
.ats-savebar.is-dirty {
  display: block;
  position: sticky;
  bottom: 0;
  margin: 0 calc(var(--gutter) * -1);
  padding: 10px var(--gutter) calc(var(--sab) + 12px);
  background: var(--bg);
  box-shadow: 0 -1px 0 var(--line);
  animation: rise-in 220ms var(--ease) both;
}
html.kb-open .ats-savebar.is-dirty { position: relative; bottom: auto; box-shadow: none; animation: none; }
@media (min-width: 1024px) { .adm-main .ats-savebar.dock.is-dirty { margin-inline: 0; padding-inline: 0; } }
.ats-savebar__inner { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ats-savebar__status { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--text); }
.ats-savebar__long, .ats-savebar__short { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ats-savebar__short { display: none; }
.ats-savebar__dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: blink 1.6s ease-in-out infinite; }
.ats-savebar__reset { flex: 0 0 auto; gap: 6px; padding: 0 14px; }
.ats-savebar__reset .icon { width: 16px; height: 16px; }
.ats-savebar__save { flex: 0 0 auto; padding: 0 20px; }
@media (max-width: 399px) {
  .ats-savebar__long { display: none; }
  .ats-savebar__short { display: block; }
  .ats-savebar__reset { width: 44px; padding: 0; }
  .ats-savebar__reset-label { display: none; }
}

/* От 640px пакеты — таблица (admin.css), фон карточки строке не нужен */
@media (min-width: 640px) {
  .ats-cols--prices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ats-packs .pack-table__row:not(.pack-table__head) { background: none; }
}

@media (min-width: 720px) {
  .ats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .ats-group--wide { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .ats-group { padding: 20px; }
}

/* ============================================================
   Рассылка: редактор с панелью разметки, превью «как в Telegram», подтверждение, ход рассылки
   ============================================================ */
.abc { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 1100px; margin: 12px auto 0; }
.abc-head__sub { margin: 0; font-size: 12px; color: var(--muted); }
/* Телефон: «Текст | Превью» над полем; показан один из двух блоков. От 900px превью — колонкой справа */
.abc-panes { display: grid; grid-template-columns: 1fr 1fr; }
.abc:not(.is-preview) .abc-preview { display: none; }
.abc.is-preview .abc-main { display: none; }
.abc.is-preview .abc-preview__label { display: none; }
.abc-layout { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "preview" "actions"; gap: 14px; }
.abc-main { grid-area: main; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.abc-actions { grid-area: actions; }
.abc-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.abc-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.abc-card__head--sub { margin-top: 8px; }
.abc-card__title { margin: 0; font-size: 15px; font-weight: 800; }
.abc-card__aside, .abc-counter { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.abc-counter.is-warn { color: var(--amber); }
.abc-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.abc-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
.abc-tool:active { transform: scale(0.94); background: var(--card-3); }
.abc-tool.is-b { font-weight: 900; }
.abc-tool.is-i { font-style: italic; }
.abc-tool.is-u { text-decoration: underline; }
.abc-tool.is-s { text-decoration: line-through; }
.abc-tool .icon { width: 18px; height: 18px; }
.abc-compose .textarea { font-size: 15px; line-height: 1.45; resize: none; }
.abc-button-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.abc-button-fields .field { margin: 0; }
.abc-problems { padding: 12px 14px; border-radius: 14px; font-size: 12px; line-height: 1.45; color: var(--amber); background: rgba(255, 181, 71, 0.08); border: 1px solid rgba(255, 181, 71, 0.3); }
.abc-problems.is-error { color: var(--red); background: rgba(255, 77, 94, 0.08); border-color: rgba(255, 77, 94, 0.35); }
.abc-problems__title { margin-bottom: 4px; font-size: 13px; font-weight: 800; }
.abc-problems ul { margin: 0; padding-left: 18px; list-style: disc; }
.abc-send .icon { width: 20px; height: 20px; }

.abc-preview { grid-area: preview; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.abc-preview__label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.abc-chat {
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(90% 70% at 0% 100%, rgba(255, 45, 120, 0.12), transparent 60%),
    var(--bg-2);
}
.abc-chat__head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(23, 21, 38, 0.8); border-bottom: 1px solid var(--line); }
.abc-chat__ava { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: var(--grad-diag); }
.abc-chat__ava .icon { width: 18px; height: 18px; }
.abc-chat__name { font-size: 14px; font-weight: 800; }
.abc-chat__sub { font-size: 11px; color: var(--muted); }
.abc-chat__body { display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px; padding: 18px 14px 20px; }
.abc-bubble-wrap { display: flex; flex-direction: column; gap: 4px; align-self: flex-start; max-width: 90%; min-width: 0; }
.abc-bubble {
  position: relative;
  min-width: 120px;
  padding: 9px 12px 20px;
  border-radius: 16px 16px 16px 6px;
  font-size: 14px;
  line-height: 1.45;
  background: var(--card-2);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.abc-bubble__text { white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.abc-bubble__text.is-empty { font-style: italic; color: var(--muted-2); }
.abc-bubble__time { position: absolute; right: 10px; bottom: 5px; font-size: 10px; color: var(--muted-2); }
.abc-bubble__button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 12px; font-size: 13px; font-weight: 700; background: rgba(139, 92, 246, 0.18); border: 1px solid rgba(139, 92, 246, 0.35); }
.abc-bubble__button-icon { width: 14px; height: 14px; opacity: 0.8; }
/* Цвет кнопки рассылки (Bot API style): синяя, зелёная, красная; «Обычная» — как было */
.abc-bubble__button.is-primary { background: rgba(51, 144, 236, 0.24); border-color: rgba(51, 144, 236, 0.55); }
.abc-bubble__button.is-success { background: rgba(45, 212, 160, 0.2); border-color: rgba(45, 212, 160, 0.5); }
.abc-bubble__button.is-danger { background: rgba(255, 77, 94, 0.2); border-color: rgba(255, 77, 94, 0.5); }
.abc-style-field { margin: 0; }
.abc-style.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; border-radius: 18px; }
.abc-style .seg__item { min-height: 44px; border-radius: 14px; }
@media (min-width: 520px) { .abc-style.seg { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.abc-style__item { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.abc-style__dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.abc-style__dot.is-primary { background: #3390ec; }
.abc-style__dot.is-success { background: var(--green); }
.abc-style__dot.is-danger { background: var(--red); }
.abc-bubble .abc-code { padding: 1px 4px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: rgba(255, 255, 255, 0.08); }
.abc-bubble .abc-pre { display: block; margin: 4px 0; padding: 8px 10px; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; background: rgba(0, 0, 0, 0.3); }
.abc-bubble .abc-blockquote { display: block; margin: 4px 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--violet); }
.abc-link { color: var(--violet); text-decoration: underline; text-underline-offset: 2px; }
.abc-spoiler {
  border-radius: 4px;
  color: transparent;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0 2px, rgba(255, 255, 255, 0.12) 2px 4px);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.abc-spoiler.is-open { color: inherit; background: rgba(255, 255, 255, 0.06); }
.abc-confirm-preview { max-height: 40vh; overflow: auto; padding: 14px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.abc-confirm-preview .abc-bubble-wrap { max-width: 100%; }

.abc-run { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--grad-soft), var(--card); border: 1px solid rgba(139, 92, 246, 0.35); animation: rise-in 260ms var(--ease) both; }
.abc-run-box:empty { display: none; }
.abc-run__head { display: flex; align-items: center; gap: 12px; }
.abc-run__icon { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: var(--grad); }
.abc-run__icon .icon { width: 18px; height: 18px; }
.abc-run__text { min-width: 0; }
.abc-run__title { font-size: 15px; font-weight: 800; }
.abc-run__sub { font-size: 12px; color: var(--muted); }
.abc-run__bar { height: 8px; overflow: hidden; border-radius: 4px; background: rgba(255, 255, 255, 0.08); }
.abc-run__fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--pink), var(--violet-2), var(--pink));
  background-size: 200% 100%;
  animation: shimmer 2.4s linear infinite;
  transition: width 1s linear;
}
.abc-run.is-done .abc-run__fill { background: var(--green); animation: none; }
.abc-run.is-done .abc-run__icon { background: var(--green); }
.abc-run__note { font-size: 12px; line-height: 1.4; color: var(--muted); }

@media (min-width: 520px) {
  .abc-tools { display: flex; flex-wrap: wrap; }
  .abc-button-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
}

@media (min-width: 900px) {
  .abc-panes { display: none; }
  .abc:not(.is-preview) .abc-preview, .abc.is-preview .abc-main { display: flex; }
  .abc.is-preview .abc-preview__label { display: block; }
  .abc-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "main preview" "actions preview"; align-items: start; }
  .abc-preview { position: sticky; top: 12px; }
  .abc-chat__body { min-height: 340px; }
}

/* ============================================================
   Голоса: лаборатория (клон / по описанию), прослушивание, фильтры, карточки голосов
   ============================================================ */
.avl { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 1240px; margin: 0 auto; }
.avl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.avl-head__text { min-width: 0; }
.avl-head__title { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.avl-head__count { font-size: 15px; font-weight: 700; color: var(--muted); }
.avl-head__status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.avl-head__status .adm-badge { backdrop-filter: none; -webkit-backdrop-filter: none; }

.avl-lab { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.avl-lab__action {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 80px;
  padding: 14px 14px 14px 16px;
  text-align: left;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line-2);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast);
}
.avl-lab__action:active { transform: scale(0.98); }
.avl-lab__action.is-primary { background: var(--grad-soft), var(--card); border-color: rgba(255, 45, 120, 0.4); box-shadow: 0 10px 30px rgba(255, 45, 120, 0.12); }
.avl-lab__icon { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 16px; color: #fff; background: var(--card-3); }
.avl-lab__action.is-primary .avl-lab__icon { background: var(--grad); box-shadow: var(--glow); }
.avl-lab__icon .icon { width: 24px; height: 24px; }
.avl-lab__text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.avl-lab__title { font-size: 16px; font-weight: 800; }
.avl-lab__sub { font-size: 12px; line-height: 1.35; color: var(--muted); }
.avl-lab__chev { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted-2); transform: rotate(180deg); }

.avl-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.avl-tools__side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.avl-listen { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.avl-listen__speed { display: flex; flex-direction: column; gap: 6px; }
.avl-defaults { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.avl-default { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-weight: 700; color: var(--text); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.avl-default__who { font-weight: 500; color: var(--muted); }
/* Узкий телефон: подпись отдельной строкой, оба голоса — рядом под ней */
@media (max-width: 419px) { .avl-defaults__label { flex-basis: 100%; } }
.avl-filters { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.avl-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -4px calc(-1 * var(--gutter)) -8px;
  padding: 4px var(--gutter) 8px; /* запас под свечение активного чипа */
  overflow-x: auto;
  scrollbar-width: none;
}
.avl-filter::-webkit-scrollbar { display: none; }
.avl-filter__label { flex: 0 0 auto; min-width: 54px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); }
.avl-filter .chip { flex: 0 0 auto; min-height: 40px; padding: 0 13px; }
.avl-filter__count { margin-left: 2px; font-size: 11px; font-weight: 800; opacity: 0.7; }

.avl-list { display: flex; flex-direction: column; gap: 18px; }
.avl-group { display: flex; flex-direction: column; gap: 10px; }
.avl-group__title { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 17px; font-weight: 800; }
.avl-group__count { font-size: 13px; font-weight: 700; color: var(--muted); }
.avl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.avl-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  animation: rise-in 260ms var(--ease) both;
}
.avl-card.is-custom { border-color: rgba(139, 92, 246, 0.35); background: linear-gradient(160deg, rgba(139, 92, 246, 0.1), var(--card) 55%); }
.avl-card.is-failed { border-color: rgba(255, 77, 94, 0.45); }
.avl-card__top { display: flex; align-items: center; gap: 12px; }
.avl-card__play.vplay { width: 48px; height: 48px; }
.avl-card__head { flex: 1; min-width: 0; }
.avl-card__name { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 800; }
.avl-card__meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.avl-card__id { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; color: var(--muted-2); }
.avl-card__id::before { content: "· "; font-family: var(--font); }
.avl-card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.avl-card__tags:empty { display: none; }
.avl-card__tags .vcard__tag { margin-left: 0; line-height: 16px; }
.vcard__tag--default { color: var(--green); border-color: rgba(45, 212, 160, 0.4); }
.avl-card__desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.avl-card__error { margin: 0; font-size: 12px; line-height: 1.4; color: var(--red); }
.avl-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.avl-card__usage { font-size: 12px; font-weight: 700; }
.avl-card__usage.is-zero { font-weight: 500; color: var(--muted-2); }
.avl-card__access { min-height: 44px; display: inline-flex; align-items: center; font-size: 12px; color: var(--muted-2); }
.avl-card__access.is-on { color: var(--muted); }
.avl-card__foot .vlist__access { flex: 0 0 auto; width: auto; min-height: 44px; margin: 0; gap: 10px; font-size: 12px; }

/* Мини-чипы проверок качества (карточка голоса, варианты по описанию) */
.vq { display: flex; flex-wrap: wrap; gap: 4px; }
.vq__chip {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}
.vq__chip.is-good { color: var(--green); background: rgba(45, 212, 160, 0.08); border-color: rgba(45, 212, 160, 0.35); }
.vq__chip.is-ok { color: var(--amber); background: rgba(255, 181, 71, 0.08); border-color: rgba(255, 181, 71, 0.35); }
.vq__chip.is-bad { color: var(--red); background: rgba(255, 77, 94, 0.08); border-color: rgba(255, 77, 94, 0.4); }

.avl-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 16px; font-size: 13px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.avl-pending { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.avl-pending__row { display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); }
.avl-pending__body { flex: 1; min-width: 0; }
.avl-pending__name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text); }
.avl-pending__name .vcard__tag { margin-left: 0; }
.avl-pending__sub { font-size: 12px; color: var(--muted); }
.avl-sk { border: 0; }
.avl-sk--head { width: 60%; height: 56px; border-radius: 14px; }
.avl-sk--lab { height: 80px; border-radius: var(--r-lg); }
.avl-sk--card { height: 180px; border-radius: var(--r-lg); }

@media (min-width: 640px) {
  .avl-lab { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .avl-tools { grid-template-columns: minmax(260px, 1fr) minmax(0, 1.5fr); align-items: start; }
  .avl-filter { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
}

@media (min-width: 1180px) {
  .avl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Шторки клона и дизайна: шаги, этапы проверки, вывод по качеству ---------- */
.vsteps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.vsteps__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
}
.vsteps__item::before { content: ""; grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--line-2); }
.vsteps__item.is-done::before, .vsteps__item.is-active::before { background: var(--grad); }
.vsteps__item.is-done { color: var(--muted); }
.vsteps__item.is-active { color: var(--text); }
.vsteps__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  background: var(--card-2);
  border: 1px solid var(--line-2);
}
.vsteps__dot .icon { width: 11px; height: 11px; }
.vsteps__item.is-active .vsteps__dot { color: #fff; background: var(--grad); border-color: transparent; }
.vsteps__item.is-done .vsteps__dot { color: var(--green); background: rgba(45, 212, 160, 0.15); border-color: rgba(45, 212, 160, 0.5); }
.vsteps__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsheet__step { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 15px; font-weight: 800; }
.vsheet__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.4);
}
.vsheet__step-text { flex: 1; min-width: 0; }
.vsheet__step-aside { font-size: 12px; font-weight: 500; color: var(--muted-2); }
details.vsheet__tips > summary { display: flex; align-items: center; justify-content: space-between; min-height: 28px; margin-bottom: 0; list-style: none; cursor: pointer; }
details.vsheet__tips > summary::-webkit-details-marker { display: none; }
details.vsheet__tips > summary::after { content: "›"; font-size: 18px; line-height: 1; transform: rotate(90deg); transition: transform var(--t-fast); }
details.vsheet__tips[open] > summary { margin-bottom: 6px; }
details.vsheet__tips[open] > summary::after { transform: rotate(-90deg); }
.vsheet__submit { display: flex; flex-direction: column; gap: 8px; }
.vsheet__missing { font-size: 12px; color: var(--muted-2); text-align: center; }
.vsheet__missing:empty { display: none; }
.vsheet__progress { align-items: stretch; gap: 16px; padding: 20px 4px 8px; text-align: left; }
.vsheet__progress-title { font-size: 17px; font-weight: 800; text-align: center; }
.vsheet__progress-foot { font-size: 12px; color: var(--muted-2); text-align: center; }
.vstage { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.vstage__item { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted-2); }
.vstage__item.is-done { color: var(--muted); }
.vstage__item.is-active { font-weight: 700; color: var(--text); }
.vstage__mark { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--card); border: 1px solid var(--line-2); }
.vstage__mark .icon { width: 14px; height: 14px; }
.vstage__item.is-done .vstage__mark { color: var(--green); background: rgba(45, 212, 160, 0.12); border-color: rgba(45, 212, 160, 0.5); }
.vstage__item.is-active .vstage__mark { border-color: rgba(255, 45, 120, 0.5); }
.vcheck__verdict { padding: 12px 14px; border-radius: 12px; font-size: 13px; font-weight: 700; line-height: 1.4; border: 1px solid; }
.vcheck__verdict.is-good { color: var(--green); background: rgba(45, 212, 160, 0.08); border-color: rgba(45, 212, 160, 0.35); }
.vcheck__verdict.is-ok { color: var(--amber); background: rgba(255, 181, 71, 0.08); border-color: rgba(255, 181, 71, 0.35); }
.vcheck__verdict.is-bad { color: var(--red); background: rgba(255, 77, 94, 0.08); border-color: rgba(255, 77, 94, 0.4); }
.vcheck__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vcheck__grade { margin-top: 3px; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.vcheck__item.is-good .vcheck__grade { color: var(--green); }
.vcheck__item.is-ok .vcheck__grade { color: var(--amber); }
.vcheck__item.is-bad .vcheck__grade { color: var(--red); }
.vdesign__card.is-best { background: var(--grad-soft), var(--card); border-color: rgba(255, 45, 120, 0.5); }
.vdesign__best { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 17px; vertical-align: 2px; color: #fff; background: var(--grad); }
.vdesign__card .vq { margin-top: 4px; }

@media (min-width: 520px) {
  .vcheck__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
