/* ============================================================
   2P_BOT — страница чат-бота (панель стримера)
   Спокойная типографическая сетка в духе лендинга:
   один акцент, тонкие линии, минимум рамок и цвета.
   Все классы с префиксом bot- .
   ============================================================ */

.bot {
    --b-surface:   #14141f;
    --b-surface-2: #1b1b29;
    --b-surface-3: #232333;

    --b-line:   rgba(255, 255, 255, 0.07);
    --b-line-2: rgba(255, 255, 255, 0.13);

    --b-fg:   #ffffff;
    --b-fg-2: #a3a3b8;
    --b-fg-3: #6e6e85;

    --b-accent:      #9146ff;
    --b-accent-hi:   #a76bff;
    --b-accent-dim:  rgba(145, 70, 255, 0.12);
    --b-accent-line: rgba(145, 70, 255, 0.32);
    --b-ok:   #34d399;
    --b-warn: #f0b429;
    --b-err:  #f87171;

    --b-r:    12px;
    --b-r-lg: 16px;
    --b-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
    --b-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    max-width: 1448px;
    padding-bottom: 108px; /* место для панели сохранения */
    color: var(--b-fg);
}

.bot h1, .bot h2, .bot h3 { margin: 0; letter-spacing: -0.02em; color: var(--b-fg); }
.bot p { margin: 0; }
.bot code { font-family: var(--b-mono); }

/* ---------- Служебные состояния ---------- */
.bot-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 96px 24px; color: var(--b-fg-3); font-size: 0.875rem; }
.bot-spinner { width: 26px; height: 26px; border: 2px solid var(--b-line-2); border-top-color: var(--b-accent); border-radius: 50%; animation: bot-spin 0.8s linear infinite; }
.bot-spinner-sm { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: bot-spin .8s linear infinite; display: inline-block; }
@keyframes bot-spin { to { transform: rotate(360deg); } }

/* ============================================================
   Шапка страницы
   ============================================================ */
.bot-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
    padding-bottom: 22px;
}
.bot-head h1 { font-size: 1.625rem; font-weight: 700; line-height: 1.15; }
.bot-head-sub { margin-top: 7px; font-size: 0.875rem; color: var(--b-fg-2); }

/* Один переключатель вместо «плашка статуса + тумблер» */
.bot-power {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 9px 16px;
    border: 1px solid var(--b-line);
    border-radius: 100px;
    background: var(--b-surface);
    cursor: pointer;
    transition: border-color 0.18s var(--b-ease);
}
.bot-power:hover { border-color: var(--b-line-2); }
.bot-power.on { border-color: rgba(52, 211, 153, 0.28); }
.bot-power input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.bot-power-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--b-fg-3); flex-shrink: 0; }
.bot-power.on .bot-power-dot { background: var(--b-ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14); }
.bot-power-label { font-size: 0.8125rem; font-weight: 600; color: var(--b-fg); white-space: nowrap; }

/* ============================================================
   Основная колонка + правая колонка-помощник
   ============================================================ */
.bot-body {
    display: grid;
    grid-template-columns: minmax(0, 1120px) 300px;
    gap: 28px;
    align-items: start;
}
.bot-main { min-width: 0; }

.bot-rail {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bot-rail-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 14px 16px;
    border: 1px solid var(--b-line);
    border-radius: var(--b-r);
    background: var(--b-surface);
}
.bot-rail-title { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--b-fg-3); }
.bot-rail-line { display: flex; align-items: center; gap: 9px; font-size: 0.8125rem; color: var(--b-fg); }
.bot-rail-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--b-fg-3); flex-shrink: 0; }
.bot-rail-dot.on { background: var(--b-ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }
.bot-rail-sub { margin: -3px 0 0 16px; font-size: 0.75rem; line-height: 1.55; color: var(--b-fg-3); }
.bot-rail-sub code { color: var(--b-fg-2); }
.bot-rail-stats { margin-top: 3px; padding-top: 4px; border-top: 1px solid var(--b-line); }
.bot-rail-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.8125rem; color: var(--b-fg-3); }
.bot-rail-stat b { color: var(--b-fg); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bot-rail-cmds { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bot-rail-cmd { font-family: var(--b-mono); font-size: 0.75rem; padding: 3px 8px; border-radius: 6px; background: var(--b-surface-2); color: var(--b-accent-hi); }
.bot-rail-more { font-size: 0.75rem; color: var(--b-fg-3); }
.bot-rail-note {
    padding: 13px 15px;
    border: 1px solid var(--b-line);
    border-radius: var(--b-r);
    background: var(--b-surface-2);
    font-size: 0.78125rem;
    line-height: 1.6;
    color: var(--b-fg-3);
}
.bot-rail-note b { display: block; margin-bottom: 4px; color: var(--b-fg-2); font-weight: 600; }

/* Узкий экран — помощник уходит под контент и перестаёт липнуть */
@media (max-width: 1420px) {
    .bot-body { grid-template-columns: minmax(0, 1fr); }
    .bot-rail { position: static; flex-direction: row; flex-wrap: wrap; }
    .bot-rail > * { flex: 1 1 260px; }
}
@media (max-width: 720px) {
    .bot-rail { flex-direction: column; }
}

/* ============================================================
   Вкладки — подчёркивание вместо коробки с пилюлями
   ============================================================ */
.bot-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--b-line);
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 34px;
}
.bot-tabs::-webkit-scrollbar { height: 0; }
.bot-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 14px 13px;
    background: none;
    border: none;
    border-radius: 8px 8px 0 0;
    color: var(--b-fg-3);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.16s var(--b-ease), background 0.16s var(--b-ease);
}
.bot-tab:hover { color: var(--b-fg-2); background: rgba(255, 255, 255, 0.03); }
.bot-tab.active { color: var(--b-fg); font-weight: 600; }
.bot-tab.active::after {
    content: '';
    position: absolute;
    left: 10px; right: 10px; bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--b-accent);
}
.bot-tab-count {
    min-width: 18px;
    padding: 0 5px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--b-fg-3);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.bot-tab.active .bot-tab-count { background: var(--b-accent-dim); color: var(--b-accent-hi); }
.bot-tab-pro {
    padding: 0 6px;
    border-radius: 100px;
    background: var(--b-accent-dim);
    color: var(--b-accent-hi);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 16px;
}

/* Заглушка Premium-функции */
.bot-gate {
    padding: 36px 24px;
    border: 1px dashed var(--b-line-2);
    border-radius: var(--b-r-lg);
    text-align: center;
}
.bot-gate-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--b-accent-dim);
    color: var(--b-accent-hi);
}
.bot-gate h3 { margin-top: 14px; font-size: 1rem; font-weight: 600; }
.bot-gate p { max-width: 440px; margin: 6px auto 0; font-size: 0.8125rem; color: var(--b-fg-3); }
.bot-gate .bot-btn-primary { margin-top: 18px; text-decoration: none; }

/* ============================================================
   Секции
   ============================================================ */
.bot-panes { display: flex; flex-direction: column; gap: 44px; }
.bot-sec { display: flex; flex-direction: column; gap: 14px; }
.bot-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.bot-sec-title { font-size: 1.0625rem; font-weight: 700; }
.bot-sec-desc { margin-top: 5px; font-size: 0.8125rem; color: var(--b-fg-2); max-width: 44rem; }

/* Две секции рядом на широком экране */
.bot-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }

/* ============================================================
   Панель со списком настроек (основной примитив)
   ============================================================ */
.bot-panel {
    border: 1px solid var(--b-line);
    border-radius: var(--b-r-lg);
    background: var(--b-surface);
    overflow: hidden;
}
.bot-panel-pad { padding: 18px 20px; }

.bot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 15px 20px;
}
.bot-row + .bot-row { border-top: 1px solid var(--b-line); }
.bot-row-text { min-width: 0; }
.bot-row-title { display: block; font-size: 0.875rem; font-weight: 600; color: var(--b-fg); }
.bot-row-title code { color: var(--b-accent-hi); font-weight: 600; }
.bot-row-hint { display: block; margin-top: 4px; font-size: 0.78125rem; line-height: 1.5; color: var(--b-fg-3); max-width: 42rem; }
.bot-row-hint code { color: var(--b-fg-2); }
.bot-row-ctl { flex-shrink: 0; display: flex; align-items: center; gap: 10px; }
.bot-row-ctl .bot-input { width: 110px; }
.bot-row-ctl .bot-input-with-suffix { width: 138px; }
.bot-row-mono { font-family: var(--b-mono); font-size: 0.875rem; font-weight: 600; color: var(--b-accent-hi); }

/* Строки в две колонки — чтобы короткие строки не растягивались на всю ширину */
.bot-rows-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bot-rows-2 > .bot-row + .bot-row { border-top: none; }
.bot-rows-2 > .bot-row:nth-child(n+3) { border-top: 1px solid var(--b-line); }
.bot-rows-2 > .bot-row:nth-child(even) { border-left: 1px solid var(--b-line); }
.bot-row-note { font-size: 0.75rem; color: var(--b-fg-3); white-space: nowrap; }

/* Вариант строки-опции с радио-точкой */
.bot-opt {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.16s var(--b-ease);
}
.bot-opt + .bot-opt { border-top: 1px solid var(--b-line); }
.bot-opt:hover { background: rgba(255, 255, 255, 0.02); }
.bot-opt.selected { background: rgba(145, 70, 255, 0.06); }
.bot-opt-dot {
    width: 16px; height: 16px;
    margin-top: 2px;
    border-radius: 50%;
    border: 1.5px solid var(--b-line-2);
    flex-shrink: 0;
    transition: border-color 0.18s var(--b-ease), box-shadow 0.18s var(--b-ease);
}
.bot-opt.selected .bot-opt-dot { border-color: var(--b-accent); box-shadow: inset 0 0 0 3.5px var(--b-accent); }
.bot-opt-text strong { display: block; font-size: 0.875rem; font-weight: 600; }
.bot-opt-text strong code { color: var(--b-accent-hi); font-weight: 600; }
.bot-opt-text span { display: block; margin-top: 4px; font-size: 0.78125rem; line-height: 1.55; color: var(--b-fg-3); }
.bot-opt-text code { font-size: 0.78125rem; }

/* ============================================================
   Карточка функции (с тумблером)
   ============================================================ */
.bot-card {
    border: 1px solid var(--b-line);
    border-radius: var(--b-r-lg);
    background: var(--b-surface);
    transition: opacity 0.2s var(--b-ease);
}
.bot-card.off { opacity: 0.72; }
.bot-card-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }

/* Иконка игры — тонкая линейная графика в плитке, без картинок и эмодзи */
.bot-game-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid var(--b-line);
    border-radius: 10px;
    background: var(--b-surface-2);
    color: var(--b-accent-hi);
    flex-shrink: 0;
    transition: color 0.2s var(--b-ease), border-color 0.2s var(--b-ease);
}
.bot-game-icon svg { width: 19px; height: 19px; }
.bot-card.off .bot-game-icon { color: var(--b-fg-3); }
.bot-card-titles { flex: 1; min-width: 0; }
.bot-card-title { font-size: 0.9375rem; font-weight: 600; }
.bot-card-desc { margin-top: 4px; font-size: 0.78125rem; line-height: 1.5; color: var(--b-fg-3); }
.bot-card-desc code { color: var(--b-fg-2); }
.bot-card-body {
    padding: 18px 20px 20px;
    border-top: 1px solid var(--b-line);
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.bot-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.bot-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.bot-col { display: flex; flex-direction: column; gap: 14px; }

/* Вложенная панель внутри карточки не должна выглядеть вторым слоем поверх того же фона */
.bot-card-body .bot-panel { background: rgba(255, 255, 255, 0.02); }

/* Подзаголовок внутри тела карточки */
.bot-sub {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--b-fg-3);
}

/* ============================================================
   Поля
   ============================================================ */
.bot-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.bot-fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bot-fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bot-span2 { grid-column: span 2; }

.bot-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bot-field-label { font-size: 0.78125rem; font-weight: 500; color: var(--b-fg-2); display: flex; align-items: center; gap: 6px; }
.bot-field-hint { font-size: 0.75rem; line-height: 1.5; color: var(--b-fg-3); }
.bot-field-hint code { color: var(--b-fg-2); }

.bot-input {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    padding: 0 12px;
    background: var(--b-surface-2);
    border: 1px solid var(--b-line);
    border-radius: 9px;
    color: var(--b-fg);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.16s var(--b-ease), background 0.16s var(--b-ease);
}
.bot-input::placeholder { color: var(--b-fg-3); }
.bot-input:hover { border-color: var(--b-line-2); }
.bot-input:focus { border-color: var(--b-accent-line); background: var(--b-surface-3); }
textarea.bot-input { height: auto; min-height: 72px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
select.bot-input {
    cursor: pointer;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    padding-right: 32px;
    background-image: 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='%236e6e85' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
select.bot-input option, select.bot-input optgroup { background: #1b1b29; color: #e8e8f0; }
.bot-input-mono { font-family: var(--b-mono); font-weight: 600; text-align: center; }

.bot-input-with-suffix { display: flex; align-items: center; gap: 8px; }
.bot-input-with-suffix > .bot-input { flex: 1; min-width: 0; }
.bot-suffix { font-size: 0.75rem; color: var(--b-fg-3); white-space: nowrap; flex-shrink: 0; }
.bot-input-prefix { font-family: var(--b-mono); font-size: 0.875rem; font-weight: 600; color: var(--b-accent-hi); flex-shrink: 0; }

/* Подсказка-переменные под полем */
.bot-tokens-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--b-fg-3); }
.bot-token {
    font-family: var(--b-mono);
    font-size: 0.71875rem;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--b-fg-2);
}

/* ============================================================
   Тумблер
   ============================================================ */
.bot-toggle { position: relative; display: inline-flex; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.bot-toggle input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.bot-toggle-track {
    position: absolute; inset: 0;
    background: var(--b-surface-3);
    border: 1px solid var(--b-line-2);
    border-radius: 100px;
    transition: background 0.2s var(--b-ease), border-color 0.2s var(--b-ease);
}
.bot-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--b-fg-3);
    transition: transform 0.2s var(--b-ease), background 0.2s var(--b-ease);
}
.bot-toggle input:checked + .bot-toggle-track { background: var(--b-accent); border-color: var(--b-accent); }
.bot-toggle input:checked + .bot-toggle-track::after { transform: translateX(18px); background: #fff; }
.bot-toggle input:focus-visible + .bot-toggle-track { box-shadow: 0 0 0 3px var(--b-accent-dim); }

/* ============================================================
   Кнопки
   ============================================================ */
.bot-btn-primary, .bot-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.16s var(--b-ease), border-color 0.16s var(--b-ease), color 0.16s var(--b-ease);
}
.bot-btn-primary svg, .bot-btn-ghost svg { width: 15px; height: 15px; flex-shrink: 0; }

.bot-btn-primary { background: var(--b-accent); color: #fff; }
.bot-btn-primary:hover:not(:disabled) { background: var(--b-accent-hi); }

.bot-btn-ghost { background: transparent; border-color: var(--b-line-2); color: var(--b-fg); }
.bot-btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.22); }

.bot-btn-primary:disabled, .bot-btn-ghost:disabled { background: var(--b-surface-2); border-color: var(--b-line); color: var(--b-fg-3); cursor: not-allowed; }

.bot-btn-sm { height: 32px; padding: 0 12px; font-size: 0.8125rem; }

.bot-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--b-fg-3);
    cursor: pointer;
    transition: color 0.16s, background 0.16s, border-color 0.16s;
}
.bot-icon-btn:hover { color: var(--b-fg); background: rgba(255, 255, 255, 0.06); }
.bot-icon-btn-danger:hover { color: var(--b-err); background: rgba(248, 113, 113, 0.1); }

/* ============================================================
   Карточки-элементы (команды, таймеры)
   ============================================================ */
.bot-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bot-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--b-line);
    border-radius: var(--b-r);
    background: var(--b-surface);
    transition: border-color 0.16s var(--b-ease);
}
.bot-item:hover { border-color: var(--b-line-2); }
.bot-item.off { opacity: 0.6; }
.bot-item-head { display: flex; align-items: center; gap: 8px; }
.bot-item-actions { margin-left: auto; display: flex; gap: 2px; flex-shrink: 0; }
.bot-cmd-badge {
    font-family: var(--b-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--b-accent-hi);
    background: var(--b-accent-dim);
    padding: 3px 9px;
    border-radius: 6px;
}
.bot-item-text {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--b-fg-2);
    word-break: break-word;
}
.bot-item-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.75rem; color: var(--b-fg-3); }
.bot-item-meta strong { color: var(--b-fg-2); font-weight: 600; }

/* Метки */
.bot-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--b-fg-2);
    font-size: 0.71875rem;
    font-weight: 500;
    white-space: nowrap;
}
.bot-tag-accent { background: var(--b-accent-dim); color: var(--b-accent-hi); }
.bot-tag-off { background: rgba(248, 113, 113, 0.1); color: var(--b-err); }
.bot-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================
   Пример / превью сообщения
   ============================================================ */
.bot-preview {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 13px 15px;
    border: 1px solid var(--b-line);
    border-radius: var(--b-r);
    background: var(--b-surface-2);
}
.bot-preview-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--b-fg-3); }
.bot-preview-text { font-size: 0.8125rem; line-height: 1.6; color: var(--b-fg-2); }
.bot-preview-text strong { color: var(--b-fg); font-weight: 600; }
.bot-preview-text code { font-size: 0.78125rem; color: var(--b-fg); }

/* Заметка / предупреждение */
.bot-note {
    padding: 11px 14px;
    border: 1px solid var(--b-line);
    border-radius: 10px;
    background: var(--b-surface-2);
    font-size: 0.78125rem;
    line-height: 1.6;
    color: var(--b-fg-3);
}
.bot-note strong { color: var(--b-fg-2); font-weight: 600; }
.bot-note code { color: var(--b-fg-2); }
.bot-note-warn { border-color: rgba(240, 180, 41, 0.24); background: rgba(240, 180, 41, 0.06); color: var(--b-warn); }
.bot-note-warn strong { color: var(--b-warn); }

/* ============================================================
   Пустые состояния
   ============================================================ */
.bot-empty {
    padding: 40px 24px;
    border: 1px dashed var(--b-line-2);
    border-radius: var(--b-r-lg);
    text-align: center;
}
.bot-empty h3 { font-size: 0.9375rem; font-weight: 600; }
.bot-empty p { margin-top: 6px; font-size: 0.8125rem; color: var(--b-fg-3); }
.bot-empty .bot-btn-ghost { margin-top: 16px; }

/* ============================================================
   Блок подключения OBS-виджета
   ============================================================ */
.bot-obs-main { display: flex; align-items: center; gap: 20px; padding: 16px 20px; flex-wrap: wrap; }
.bot-obs-titles { flex: 1; min-width: 220px; }
.bot-obs-title { font-size: 0.875rem; font-weight: 600; }
.bot-obs-desc { margin-top: 4px; font-size: 0.78125rem; line-height: 1.5; color: var(--b-fg-3); }
.bot-obs-copied { color: var(--b-ok); border-color: rgba(52, 211, 153, 0.35); }

.bot-obs-steps { border-top: 1px solid var(--b-line); }
.bot-obs-steps > summary {
    list-style: none;
    padding: 12px 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--b-fg-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: color 0.16s;
}
.bot-obs-steps > summary::-webkit-details-marker { display: none; }
.bot-obs-steps > summary:hover { color: var(--b-fg); }
.bot-obs-steps > summary::before {
    content: '';
    width: 6px; height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.18s var(--b-ease);
}
.bot-obs-steps[open] > summary::before { transform: rotate(45deg); }
.bot-obs-list { margin: 0; padding: 0 20px 18px 42px; display: flex; flex-direction: column; gap: 8px; }
.bot-obs-list li { font-size: 0.78125rem; line-height: 1.55; color: var(--b-fg-3); }
.bot-obs-list li strong { color: var(--b-fg-2); font-weight: 600; }

/* ============================================================
   TTS: роли, слова, загрузка
   ============================================================ */
.bot-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 10px; }
.bot-role {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 14px;
    border: 1px solid var(--b-line);
    border-radius: var(--b-r);
    background: var(--b-surface-2);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.16s var(--b-ease), background 0.16s var(--b-ease);
}
.bot-role:hover { border-color: var(--b-line-2); }
.bot-role.active { border-color: var(--b-accent-line); background: rgba(145, 70, 255, 0.08); }
.bot-role-name { padding-right: 18px; font-size: 0.8125rem; font-weight: 600; color: var(--b-fg); }
.bot-role-desc { font-size: 0.71875rem; color: var(--b-fg-3); }
.bot-role-check { position: absolute; top: 12px; right: 12px; width: 13px; height: 13px; color: var(--b-accent-hi); }

.bot-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    min-height: 42px;
    border: 1px solid var(--b-line);
    border-radius: 9px;
    background: var(--b-surface-2);
    transition: border-color 0.16s var(--b-ease);
}
.bot-chips:focus-within { border-color: var(--b-accent-line); }
.bot-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 5px 3px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--b-fg-2);
    font-size: 0.78125rem;
    white-space: nowrap;
}
.bot-chip-x { background: none; border: none; padding: 0 2px; color: var(--b-fg-3); font-size: 0.9375rem; line-height: 1; cursor: pointer; transition: color 0.14s; }
.bot-chip-x:hover { color: var(--b-err); }
.bot-chip-input { flex: 1; min-width: 180px; height: 24px; border: none; outline: none; background: none; color: var(--b-fg); font-family: inherit; font-size: 0.8125rem; }
.bot-chip-input::placeholder { color: var(--b-fg-3); }

.bot-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--b-line-2);
    border-radius: 9px;
    color: var(--b-fg-2);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.bot-upload:hover { color: var(--b-fg); background: rgba(255, 255, 255, 0.05); }

/* Подсказка-«i» */
.bot-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px; height: 14px;
    border: 1px solid var(--b-line-2);
    border-radius: 50%;
    color: var(--b-fg-3);
    font-size: 0.625rem;
    font-weight: 600;
    font-style: normal;
    cursor: help;
    user-select: none;
}
.bot-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 230px;
    padding: 9px 11px;
    border: 1px solid var(--b-line-2);
    border-radius: 9px;
    background: #1b1b29;
    color: var(--b-fg-2);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 40;
    box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.9);
}
.bot-tip:hover::after { opacity: 1; }

/* ============================================================
   Выбор награды (Boss Fight и диалог кастомной команды)
   ============================================================ */
.bot-reward-tabs { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--b-line); border-radius: 10px; background: var(--b-surface-2); }
.bot-reward-tab {
    padding: 6px 14px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--b-fg-3);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.16s, color 0.16s;
}
.bot-reward-tab:hover { color: var(--b-fg-2); }
.bot-reward-tab.active { background: rgba(255, 255, 255, 0.08); color: var(--b-fg); font-weight: 600; }

.bot-skin-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--b-line);
    border-radius: 10px;
    background: var(--b-surface-2);
}
.bot-skin-preview-img { width: 54px; height: 40px; object-fit: contain; flex-shrink: 0; }
.bot-skin-preview-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bot-skin-preview-name { font-size: 0.8125rem; font-weight: 600; color: var(--b-fg); }
.bot-skin-preview-game { font-size: 0.71875rem; color: var(--b-fg-3); }
.bot-skin-preview-price { font-size: 0.71875rem; color: var(--b-fg-2); }
.bot-skin-empty { padding: 11px 14px; border: 1px solid rgba(240, 180, 41, 0.24); border-radius: 10px; background: rgba(240, 180, 41, 0.06); color: var(--b-warn); font-size: 0.78125rem; }

/* ============================================================
   Сообщения статуса
   ============================================================ */
.bot-msg { padding: 11px 15px; border-radius: 10px; font-size: 0.8125rem; border: 1px solid transparent; }
.bot-msg.ok { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.22); color: var(--b-ok); }
.bot-msg.err { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.22); color: var(--b-err); }

/* ============================================================
   Панель сохранения
   ============================================================ */
.bot-save {
    position: sticky;
    bottom: 20px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 32px;
    padding: 12px 14px 12px 20px;
    border: 1px solid var(--b-line-2);
    border-radius: 14px;
    background: rgba(27, 27, 41, 0.94);
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.95);
    animation: bot-save-in 0.22s var(--b-ease);
}
@keyframes bot-save-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bot-save-text { font-size: 0.8125rem; color: var(--b-fg-2); }
.bot-save-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ============================================================
   Модальные окна (диалоги команд и таймеров)
   ============================================================ */
.bot-modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(6, 6, 12, 0.72);
    backdrop-filter: blur(6px);
    animation: bot-fade 0.18s ease;
}
@keyframes bot-fade { from { opacity: 0; } to { opacity: 1; } }
.bot-modal-dialog {
    --b-surface:   #14141f;
    --b-surface-2: #1b1b29;
    --b-surface-3: #232333;
    --b-line:   rgba(255, 255, 255, 0.07);
    --b-line-2: rgba(255, 255, 255, 0.13);
    --b-fg:   #ffffff;
    --b-fg-2: #a3a3b8;
    --b-fg-3: #6e6e85;
    --b-accent:      #9146ff;
    --b-accent-hi:   #a76bff;
    --b-accent-dim:  rgba(145, 70, 255, 0.12);
    --b-accent-line: rgba(145, 70, 255, 0.32);
    --b-ok:   #34d399;
    --b-warn: #f0b429;
    --b-err:  #f87171;
    --b-r:    12px;
    --b-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
    --b-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    border: 1px solid var(--b-line-2);
    border-radius: 18px;
    background: var(--b-surface);
    box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.95);
    animation: bot-rise 0.22s var(--b-ease);
    color: var(--b-fg);
}
@keyframes bot-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.bot-modal-dialog code { font-family: var(--b-mono); }
.bot-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--b-line); }
.bot-modal-head-left { min-width: 0; }
.bot-modal-title { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.bot-modal-subtitle { display: block; margin-top: 4px; font-size: 0.78125rem; color: var(--b-fg-3); }
.bot-modal-close { background: none; border: none; padding: 2px 8px; border-radius: 8px; color: var(--b-fg-3); font-size: 1.375rem; line-height: 1; cursor: pointer; transition: color 0.16s, background 0.16s; }
.bot-modal-close:hover { color: var(--b-fg); background: rgba(255, 255, 255, 0.06); }
.bot-modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.bot-modal-section { display: flex; flex-direction: column; gap: 7px; }
.bot-modal-label { font-size: 0.78125rem; font-weight: 500; color: var(--b-fg-2); }
.bot-modal-help { font-size: 0.75rem; line-height: 1.5; color: var(--b-fg-3); }
.bot-modal-help code { color: var(--b-fg-2); }
.bot-modal-input {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    padding: 0 13px;
    background: var(--b-surface-2);
    border: 1px solid var(--b-line);
    border-radius: 9px;
    color: var(--b-fg);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.16s var(--b-ease);
}
.bot-modal-input::placeholder { color: var(--b-fg-3); }
.bot-modal-input:focus { border-color: var(--b-accent-line); }
textarea.bot-modal-input { height: auto; min-height: 84px; padding: 11px 13px; line-height: 1.55; resize: vertical; }
select.bot-modal-input {
    cursor: pointer;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    padding-right: 32px;
    background-image: 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='%236e6e85' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
select.bot-modal-input option { background: #1b1b29; color: #e8e8f0; }
.bot-modal-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bot-modal-toggle-row .bot-modal-label, .bot-modal-toggle-row .bot-modal-help { display: block; }
.bot-modal-toggle-row .bot-modal-label { color: var(--b-fg); font-weight: 600; }
.bot-modal-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--b-line); border-radius: 10px; background: var(--b-surface-2); font-size: 0.875rem; }
.bot-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--b-line); }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 1100px) {
    .bot-two { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
    .bot-list, .bot-grid-2, .bot-cols-2 { grid-template-columns: 1fr; }
    .bot-fields-3, .bot-fields-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .bot-head { align-items: flex-start; }
    .bot-power { width: 100%; justify-content: space-between; }
    .bot-row { flex-direction: column; align-items: stretch; gap: 12px; }
    .bot-row-ctl .bot-input, .bot-row-ctl .bot-input-with-suffix { width: 100%; }
    .bot-row-ctl { justify-content: space-between; }
    .bot-fields, .bot-fields-3, .bot-fields-4 { grid-template-columns: 1fr; }
    .bot-span2 { grid-column: span 1; }
    .bot-rows-2 { grid-template-columns: 1fr; }
    .bot-rows-2 > .bot-row + .bot-row { border-top: 1px solid var(--b-line); }
    .bot-rows-2 > .bot-row:nth-child(even) { border-left: none; }
    .bot-modal-row { grid-template-columns: 1fr; }
    .bot-save { flex-direction: column; align-items: stretch; gap: 12px; }
    .bot-save-actions { justify-content: flex-end; }
}

/* Переключатель питания: состояние задаётся классом .on на обёртке */
.bot-power.on .bot-toggle-track { background: var(--b-accent); border-color: var(--b-accent); }
.bot-power.on .bot-toggle-track::after { transform: translateX(18px); background: #fff; }
