/* STRELA — ИИ-ассистент: плавающая кнопка и панель чата */

/* ── Плавающая кнопка ──
   Приглушённая: тёмное стекло с тонкой акцентной обводкой, чтобы не перетягивать
   внимание с контента главной. Акцент только на иконке. */
.sai-fab {
    position: fixed;
    right: 14px;
    bottom: calc(var(--strela-bottom-stack, 80px) + 18px);
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 42px;
    padding: 0 14px 0 11px;
    border: 1px solid rgba(255, 199, 44, 0.22);
    border-radius: 21px;
    background: rgba(20, 28, 44, 0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: rgba(248, 250, 252, 0.82);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.86;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    transition: transform 0.18s ease, opacity 0.22s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.sai-fab:hover {
    opacity: 1;
    border-color: rgba(255, 199, 44, 0.42);
}
.sai-fab:active {
    transform: scale(0.94);
}
.sai-fab-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--accent, #ffc72c);
    opacity: 0.9;
}
.sai-fab-ico svg {
    width: 19px;
    height: 19px;
}
.sai-fab-label {
    display: block;
    max-width: 80px;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: 0.01em;
    opacity: 1;
    transform: translateX(0);
    transition:
        max-width 0.28s cubic-bezier(0.22, 0.8, 0.32, 1),
        opacity 0.18s ease,
        transform 0.24s ease;
}
.sai-fab-hint {
    display: none;
}
.sai-fab-copy {
    display: block;
    min-width: 0;
    overflow: hidden;
    transition:
        max-width 0.28s cubic-bezier(0.22, 0.8, 0.32, 1),
        opacity 0.18s ease,
        transform 0.24s ease;
}
.sai-fab.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    pointer-events: none;
}

/* Клавиатура открыта — кнопка мешает вводу */
html.strela-keyboard-open .sai-fab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* На смартфоне подпись видна несколько секунд, затем JS добавляет
   .is-collapsed и кнопка плавно превращается в круглую иконку. */
@media (max-width: 639px) {
    .sai-fab {
        width: 108px;
        min-width: 42px;
        justify-content: center;
        transition:
            width 0.3s cubic-bezier(0.22, 0.8, 0.32, 1),
            padding 0.3s cubic-bezier(0.22, 0.8, 0.32, 1),
            gap 0.25s ease,
            transform 0.18s ease,
            opacity 0.22s ease,
            border-color 0.2s ease;
    }
    .sai-fab.is-collapsed {
        width: 42px;
        padding-left: 0;
        padding-right: 0;
        gap: 0;
    }
    .sai-fab.is-collapsed .sai-fab-copy {
        max-width: 0;
        opacity: 0;
        transform: translateX(5px);
        pointer-events: none;
    }
}

/* ПК (главная): крупнее, у правого края колонки 1260px */
@media (min-width: 1024px) {
    .sai-fab {
        right: max(24px, calc((100vw - 1260px) / 2 + 24px));
        bottom: calc(var(--strela-bottom-stack, 80px) + 36px);
        height: 56px;
        padding: 0 20px 0 16px;
        gap: 12px;
        border-radius: 28px;
        font-size: 14px;
        opacity: 1;
        border-width: 1.5px;
        border-color: rgba(255, 199, 44, 0.38);
        box-shadow:
            0 10px 32px rgba(0, 0, 0, 0.28),
            0 0 0 1px rgba(255, 199, 44, 0.12);
        transition:
            transform 0.2s ease,
            opacity 0.22s ease,
            border-color 0.2s ease,
            box-shadow 0.22s ease;
    }
    .sai-fab:hover {
        transform: translateY(-2px);
        border-color: rgba(255, 199, 44, 0.55);
        box-shadow:
            0 14px 40px rgba(0, 0, 0, 0.32),
            0 0 0 1px rgba(255, 199, 44, 0.2);
    }
    .sai-fab:active {
        transform: translateY(0) scale(0.98);
    }
    .sai-fab-ico {
        width: 30px;
        height: 30px;
    }
    .sai-fab-ico svg {
        width: 24px;
        height: 24px;
    }
    .sai-fab-copy {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
        max-width: none;
        opacity: 1;
        transform: none;
    }
    .sai-fab-label {
        max-width: none;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.15;
        letter-spacing: -0.01em;
    }
    .sai-fab-hint {
        display: block;
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
        opacity: 0.72;
        white-space: nowrap;
    }
}

[data-theme="light"] .sai-fab {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(245, 158, 11, 0.35);
    color: #334155;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}
@media (min-width: 1024px) {
    [data-theme="light"] .sai-fab {
        border-color: rgba(245, 158, 11, 0.42);
        box-shadow:
            0 10px 32px rgba(15, 23, 42, 0.16),
            0 0 0 1px rgba(245, 158, 11, 0.14);
    }
    [data-theme="light"] .sai-fab:hover {
        border-color: rgba(245, 158, 11, 0.58);
        box-shadow:
            0 14px 40px rgba(15, 23, 42, 0.2),
            0 0 0 1px rgba(245, 158, 11, 0.22);
    }
    [data-theme="light"] .sai-fab-hint {
        color: #64748b;
        opacity: 1;
    }
}
[data-theme="light"] .sai-fab-ico {
    color: #b45309;
}

/* ── Оверлей и панель ──
   Мобилка: полноэкранный выезд снизу.
   ПК: центрированная колонка как у ChatGPT/Claude — без растягивания на всю ширину. */
.sai-overlay {
    position: fixed;
    inset: 0;
    z-index: 100400;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--bg2, #1e293b);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0.24s;
}
.sai-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
/* После закрытия ещё мгновение ловим «сквозной» click (крестик совпадает с бургером). */
.sai-overlay.is-closing {
    opacity: 0;
    visibility: visible;
    pointer-events: auto;
}
body.sai-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}
body.sai-modal-open #menuButton,
body.sai-modal-open .hv2-burger,
body.sai-modal-open .hh-menu-btn,
body.sai-closing-guard #menuButton,
body.sai-closing-guard .hv2-burger,
body.sai-closing-guard .hh-menu-btn {
    pointer-events: none !important;
}
.sai-click-shield {
    position: fixed;
    inset: 0;
    z-index: 100500;
    display: none;
    background: transparent;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
}
.sai-click-shield.is-on {
    display: block;
    pointer-events: auto;
}
.sai-panel {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--bg2, #1e293b);
    border: none;
    border-radius: 0;
    box-shadow: none;
    transform: translate3d(0, 100%, 0);
    transition:
        transform 0.34s cubic-bezier(0.32, 0.72, 0, 1),
        opacity 0.28s ease,
        box-shadow 0.28s ease;
    overflow: hidden;
    will-change: transform;
}
.sai-overlay.is-open .sai-panel {
    transform: translate3d(0, 0, 0);
}
@supports (height: 100dvh) {
    .sai-panel {
        height: 100dvh;
    }
}
@media (prefers-reduced-motion: reduce) {
    .sai-panel {
        transition: none;
    }
}
.sai-handle {
    width: 36px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 4px;
    background: var(--txt3, rgba(255, 255, 255, 0.25));
    flex-shrink: 0;
}
@media (min-width: 640px) {
    .sai-handle {
        display: none;
    }
}

/* ПК / широкий планшет: спокойная колонка по центру */
@media (min-width: 860px) {
    .sai-overlay {
        align-items: center;
        padding: 28px 24px;
        background: rgba(2, 6, 23, 0.58);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
    .sai-panel {
        width: min(760px, calc(100vw - 48px));
        height: min(900px, calc(100dvh - 56px));
        max-height: calc(100dvh - 56px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 22px;
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.03),
            0 28px 80px rgba(0, 0, 0, 0.45);
        transform: translate3d(0, 18px, 0) scale(0.985);
        opacity: 0.92;
    }
    .sai-overlay.is-open .sai-panel {
        transform: none;
        opacity: 1;
    }
}
@media (min-width: 1200px) {
    .sai-panel {
        width: min(820px, calc(100vw - 64px));
    }
}

/* ── Шапка ── */
.sai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 12px;
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    background: transparent;
}
.sai-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 11px;
    background: rgba(255, 199, 44, 0.12);
    color: var(--accent, #ffc72c);
}
.sai-header-icon svg {
    width: 20px;
    height: 20px;
}
.sai-header-text {
    flex: 1;
    min-width: 0;
}
.sai-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--txt, #f8fafc);
    line-height: 1.2;
}
.sai-title-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sai-beta {
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 199, 44, 0.12);
    color: var(--accent, #ffc72c);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.sai-subtitle {
    margin: 2px 0 0;
    font-size: 11.5px;
    color: var(--txt2, #94a3b8);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sai-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1.5px solid rgba(255, 199, 44, 0.42);
    border-radius: 10px;
    background: rgba(255, 199, 44, 0.08);
    color: var(--txt2, #94a3b8);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 2;
    box-shadow: inset 0 0 0 1px rgba(255, 199, 44, 0.08);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.sai-icon-btn:hover,
.sai-icon-btn:focus-visible {
    color: var(--txt, #f8fafc);
    background: rgba(255, 199, 44, 0.14);
    border-color: rgba(255, 199, 44, 0.62);
    outline: none;
}
.sai-icon-btn:active {
    background: rgba(255, 255, 255, 0.08);
}
.sai-icon-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* ── Тело: колонка контента, без растягивания ── */
.sai-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px 16px 20px;
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.sai-body > * {
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.sai-history-toggle {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    color: var(--text, #f1f5f9);
    background: rgba(255, 255, 255, 0.03);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.sai-history-toggle:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
}
.sai-history-toggle[hidden] {
    display: none;
}
.sai-history-toggle-ico {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--accent, #ffc72c);
    background: rgba(255, 199, 44, 0.11);
}
.sai-history-toggle-ico svg {
    width: 19px;
    height: 19px;
}
.sai-history-toggle-copy {
    flex: 1;
    min-width: 0;
}
.sai-history-toggle-copy strong,
.sai-history-toggle-copy small {
    display: block;
}
.sai-history-toggle-copy strong {
    font-size: 13px;
    line-height: 1.3;
}
.sai-history-toggle-copy small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted, #94a3b8);
    font-size: 10.5px;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.sai-history-toggle-arrow {
    display: grid;
    place-items: center;
    color: var(--muted, #94a3b8);
    transition: transform 0.2s ease;
}
.sai-history-toggle-arrow svg {
    width: 18px;
    height: 18px;
}
.sai-history-toggle[aria-expanded="true"] .sai-history-toggle-arrow {
    transform: rotate(180deg);
}
.sai-history-toggle.is-loading {
    opacity: 0.65;
    pointer-events: none;
}
.sai-history-day {
    align-self: center;
    margin: 3px 0 -2px;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--muted, #94a3b8);
    background: rgba(255, 255, 255, 0.055);
    font-size: 10px;
    line-height: 1.3;
}
.sai-history-empty {
    padding: 28px 15px;
    color: var(--muted, #94a3b8);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}
.sai-history-panel {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin: -4px 0 12px;
    padding: 10px 0 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.sai-history-panel.is-open {
    display: flex;
}
.sai-history-panel .sai-msg,
.sai-history-panel .sai-cards,
.sai-history-panel .sai-actions,
.sai-history-panel .sai-phone-wrap {
    opacity: 0.92;
}
.sai-history-panel .sai-msg--history {
    animation: none;
}
.sai-suggest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.sai-suggest-label {
    margin: 0 0 0 2px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--txt2, #94a3b8);
    opacity: 0.75;
}
.sai-suggest-hide {
    flex-shrink: 0;
    padding: 4px 10px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 999px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    font-family: inherit;
    font-size: 11.5px;
    cursor: pointer;
}
.sai-suggest-hide[hidden] {
    display: none;
}
.sai-suggest-hide:hover {
    color: var(--txt, #f8fafc);
    border-color: rgba(255, 199, 44, 0.4);
}
/* Список вернули по кнопке «Назад к вопросам» */
.sai-intro.is-returned {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

/* Стартовые подсказки — строки-действия, а не мелкие чипсы */
.sai-suggest {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sai-suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid rgba(255, 199, 44, 0.38);
    border-radius: 14px;
    background: var(--bg3, rgba(255, 255, 255, 0.045));
    color: var(--txt, #f8fafc);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 199, 44, 0.06);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}
.sai-suggest-item:hover {
    border-color: rgba(255, 199, 44, 0.42);
    background: rgba(255, 199, 44, 0.07);
}
.sai-suggest-item:active {
    transform: scale(0.985);
}
.sai-suggest-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 199, 44, 0.13);
    color: var(--accent, #ffc72c);
}
.sai-suggest-ico svg {
    width: 18px;
    height: 18px;
}
.sai-suggest-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sai-suggest-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.25;
}
.sai-suggest-hint {
    font-size: 11.5px;
    line-height: 1.3;
    color: var(--txt2, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sai-suggest-arrow {
    display: flex;
    flex-shrink: 0;
    color: var(--txt2, #94a3b8);
    opacity: 0.6;
}
.sai-suggest-arrow svg {
    width: 16px;
    height: 16px;
}

/* ── Стартовый визард ── */
.sai-wizard {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sai-wizard-top {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}
.sai-wizard-top:has(.sai-wizard-back[hidden]:only-child),
.sai-wizard-top:empty {
    display: none;
}
.sai-wizard-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 4px 10px 4px 7px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 999px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}
.sai-wizard-back[hidden] {
    display: none;
}
.sai-wizard-back svg {
    width: 14px;
    height: 14px;
}
.sai-wizard-progress {
    flex: 0 0 auto;
    margin: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 199, 44, 0.08);
    color: var(--accent, #ffc72c);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
    white-space: nowrap;
}
.sai-wizard-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 2px 0 2px;
}
.sai-wizard-context[hidden] {
    display: none;
}
.sai-wizard-context-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--txt2, #94a3b8);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sai-wizard-context-sep {
    color: var(--txt2, #64748b);
    font-size: 10px;
    opacity: 0.65;
    user-select: none;
}
.sai-wizard-option.is-pin {
    margin-top: 4px;
    border-style: dashed;
}
.sai-wizard-heading {
    position: relative;
    margin-bottom: 2px;
    /* Место справа под бейдж шага — заголовок и 1/3 всегда на одном уровне */
    padding-right: 46px;
}
.sai-wizard-title-row {
    display: block;
}
.sai-wizard-title {
    margin: 0;
    color: var(--txt, #f8fafc);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}
.sai-wizard-heading > .sai-wizard-title-row > .sai-wizard-progress,
.sai-wizard-title-row .sai-wizard-progress {
    position: absolute;
    top: 2px;
    right: 0;
    z-index: 1;
    margin: 0;
}
.sai-wizard-note {
    margin: 6px 0 0;
    color: var(--txt2, #94a3b8);
    font-size: 13px;
    line-height: 1.45;
}
.sai-wizard-search-wrap[hidden] {
    display: none;
}
.sai-wizard-search {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--txt, #f8fafc);
    font-family: inherit;
    font-size: 14px;
}
.sai-wizard-search:focus {
    outline: none;
    border-color: rgba(255, 199, 44, 0.45);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.08);
}
.sai-wizard-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sai-wizard-option {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1.5px solid var(--border, rgba(255, 255, 255, 0.14));
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--txt, #f8fafc);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    transition: transform 0.13s ease, border-color 0.16s ease, background 0.16s ease;
    -webkit-tap-highlight-color: transparent;
}
.sai-wizard-option:hover {
    border-color: rgba(255, 199, 44, 0.35);
    background: rgba(255, 199, 44, 0.06);
}
.sai-wizard-option:active {
    transform: scale(0.985);
}
.sai-wizard-option[hidden] {
    display: none;
}
.sai-wizard-option.is-compact {
    min-height: 50px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.sai-wizard-option-ico {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 199, 44, 0.1);
    color: var(--accent, #ffc72c);
}
.sai-wizard-option-ico svg {
    width: 17px;
    height: 17px;
}
.sai-wizard-option-ico.has-img {
    position: relative;
    overflow: hidden;
    padding: 5px;
    border: 1px solid rgba(255, 199, 44, 0.14);
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 199, 44, 0.1), transparent 68%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}
.sai-wizard-option-ico .sai-wizard-type-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* SVG-файлы типов чёрные: окрашиваем их в фирменный жёлтый на тёмной теме. */
    filter: brightness(0) saturate(100%) invert(83%) sepia(83%) saturate(1127%) hue-rotate(336deg) brightness(104%) contrast(103%);
}
.sai-wizard-option-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sai-wizard-option-text strong {
    font-size: 14px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.sai-wizard-option-text small {
    overflow: hidden;
    color: var(--txt2, #94a3b8);
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sai-wizard-option-arrow {
    display: flex;
    flex-shrink: 0;
    color: var(--txt2, #94a3b8);
    opacity: 0.45;
}
.sai-wizard-option-arrow svg {
    width: 15px;
    height: 15px;
}
.sai-wizard-manual {
    min-height: 42px;
    margin-top: 4px;
    padding: 10px 14px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.sai-wizard-manual:hover {
    color: var(--txt, #f8fafc);
    border-color: rgba(255, 199, 44, 0.4);
    background: rgba(255, 199, 44, 0.04);
}
.sai-wizard-empty {
    margin: 8px 0;
    color: var(--txt2, #94a3b8);
    font-size: 12.5px;
    text-align: center;
}

.sai-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.sai-messages:not(:empty) {
    margin-top: 16px;
}
.sai-msg {
    max-width: 85%;
    padding: 11px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: -0.005em;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Новый ответ мягко появляется из индикатора набора. Карточки и кнопки
   продолжают движение с небольшой задержкой — без эффекта «прыжка». */
.sai-enter {
    animation: sai-answer-in 0.38s cubic-bezier(0.22, 0.8, 0.32, 1) both;
    transform-origin: left bottom;
}
.sai-msg-user.sai-enter {
    animation-name: sai-user-message-in;
    transform-origin: right bottom;
}
.sai-cards.sai-enter {
    animation-delay: 70ms;
}
.sai-actions.sai-enter {
    animation-delay: 110ms;
}
.sai-cards.sai-enter .sai-card {
    animation: sai-card-in 0.38s cubic-bezier(0.22, 0.8, 0.32, 1) both;
    animation-delay: calc(90ms + var(--sai-enter-delay, 0ms));
}
@keyframes sai-answer-in {
    0% {
        opacity: 0;
        transform: translate3d(0, 10px, 0) scale(0.975);
        filter: blur(2px);
    }
    55% {
        opacity: 1;
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}
@keyframes sai-user-message-in {
    0% {
        opacity: 0;
        transform: translate3d(10px, 6px, 0) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}
@keyframes sai-card-in {
    0% {
        opacity: 0;
        transform: translate3d(0, 8px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}
.sai-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #ffc72c 0%, #f0a500 100%);
    color: #1a1200;
    border-bottom-right-radius: 6px;
    font-weight: 500;
}
.sai-msg-ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.045);
    color: var(--txt, #f8fafc);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
}
.sai-msg-text {
    white-space: pre-wrap;
    word-break: break-word;
}
.sai-msg-error {
    align-self: flex-start;
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}
.sai-speak-btn {
    align-self: flex-start;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    opacity: 0.72;
    transition: color 0.18s ease, background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.sai-speak-btn svg {
    width: 15px;
    height: 15px;
    display: block;
    pointer-events: none;
}
.sai-speak-btn .sai-speak-stop {
    display: none;
}
.sai-speak-btn:hover,
.sai-speak-btn:focus-visible {
    color: #ffc72c;
    background: rgba(255, 199, 44, 0.12);
    opacity: 1;
    outline: none;
}
.sai-speak-btn:active {
    transform: scale(0.94);
}
.sai-speak-btn.is-speaking {
    color: #ffc72c;
    background: rgba(255, 199, 44, 0.14);
    opacity: 1;
    animation: sai-speak-pulse 1.4s ease-in-out infinite;
}
.sai-speak-btn.is-speaking .sai-speak-ico {
    display: none;
}
.sai-speak-btn.is-speaking .sai-speak-stop {
    display: block;
}
.sai-speak-btn.is-loading {
    color: #ffc72c;
    opacity: 1;
    pointer-events: none;
}
.sai-speak-btn.is-loading .sai-speak-ico {
    animation: sai-speak-wait 0.9s linear infinite;
}
@keyframes sai-speak-wait {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}
@keyframes sai-speak-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 199, 44, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(255, 199, 44, 0); }
}

/* Индикатор набора */
.sai-typing {
    align-self: flex-start;
    display: flex;
    gap: 5px;
    padding: 13px 15px;
    border-radius: 16px;
    border-bottom-left-radius: 6px;
    background: var(--bg3, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.sai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--txt2, #94a3b8);
    animation: sai-bounce 1.3s infinite ease-in-out;
}
.sai-typing span:nth-child(2) { animation-delay: 0.16s; }
.sai-typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes sai-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30%           { transform: translateY(-5px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .sai-enter,
    .sai-cards.sai-enter .sai-card,
    .sai-typing span {
        animation: none !important;
    }
}

/* ── Карточки техники ── */
.sai-cards {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sai-card {
    display: flex;
    gap: 13px;
    padding: 11px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    border-radius: 16px;
    background: var(--bg3, rgba(255, 255, 255, 0.04));
}
.sai-card-media {
    width: 92px;
    height: 92px;
    flex-shrink: 0;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sai-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sai-card-media.is-icon img {
    position: relative;
    z-index: 1;
    width: 91%;
    height: 91%;
    object-fit: contain;
    filter:
        drop-shadow(0 9px 9px rgba(0, 0, 0, 0.38))
        saturate(1.08)
        contrast(1.04);
}
.sai-card-media.is-icon {
    border-color: rgba(255, 199, 44, 0.16);
    background:
        radial-gradient(circle at 48% 42%, rgba(255, 199, 44, 0.17), transparent 57%),
        linear-gradient(145deg, rgba(255, 199, 44, 0.10), rgba(255, 255, 255, 0.025) 55%, rgba(0, 0, 0, 0.08));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 8px 20px rgba(0, 0, 0, 0.12);
}
.sai-card-media.is-icon::after {
    content: '';
    position: absolute;
    right: 7px;
    bottom: 7px;
    left: 7px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.23);
    filter: blur(6px);
}
.sai-card-media.is-empty {
    color: rgba(255, 199, 44, 0.72);
    background: linear-gradient(145deg, rgba(255, 199, 44, 0.11), rgba(255, 255, 255, 0.025));
}
.sai-card-media.is-empty svg {
    width: 35px;
    height: 35px;
}
.sai-card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sai-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--txt, #f8fafc);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sai-card-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent, #ffc72c);
}
.sai-card-meta {
    font-size: 11.5px;
    color: var(--txt2, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sai-card-top {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 199, 44, 0.16);
    color: var(--accent, #ffc72c);
    font-size: 10px;
    font-weight: 700;
}
.sai-card-top.sai-card-bl {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
}
.sai-card-actions {
    display: flex;
    gap: 7px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.sai-card-actions .sai-btn {
    flex: 1 1 auto;
    min-width: 88px;
}

/* ── Проверка номера: заголовок снаружи, карточки — только авторизованным ── */
.sai-phone-wrap {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sai-phone-heading {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--txt, #f8fafc);
    padding: 0 2px;
}
.sai-phone-heading.is-blacklist {
    color: #f87171;
}
.sai-phone-heading.is-profile {
    color: #34d399;
}
.sai-phone-heading.is-empty {
    color: var(--txt, #f8fafc);
}
.sai-phone-meta {
    padding: 0 2px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--txt2, #94a3b8);
}
.sai-phone-meta-sep {
    opacity: 0.55;
}
.sai-phone-block {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.10));
    background: var(--bg3, rgba(255, 255, 255, 0.04));
    overflow: hidden;
}
.sai-phone-list {
    display: flex;
    flex-direction: column;
}
.sai-phone-empty {
    padding: 14px;
    font-size: 12.5px;
    color: var(--txt2, #94a3b8);
    line-height: 1.45;
}
.sai-phone-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    animation: sai-chip-in 0.38s cubic-bezier(0.22, 0.8, 0.32, 1) both;
    animation-delay: var(--sai-enter-delay, 0ms);
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.sai-phone-item:first-child {
    border-top: none;
}
.sai-phone-item:hover,
.sai-phone-item:active {
    background: rgba(255, 255, 255, 0.04);
}
.sai-phone-item.is-blacklist {
    background: rgba(239, 68, 68, 0.05);
}
.sai-phone-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}
.sai-phone-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #ffc72c;
    background: rgba(255, 199, 44, 0.12);
}
.sai-phone-item.is-blacklist .sai-phone-avatar-fallback {
    color: #f87171;
    background: rgba(239, 68, 68, 0.14);
}
.sai-phone-info {
    min-width: 0;
    flex: 1;
}
.sai-phone-item-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 650;
    color: var(--txt, #f8fafc);
    line-height: 1.3;
}
.sai-phone-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.sai-phone-badge.tone-danger {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
}
.sai-phone-badge.tone-ok {
    background: rgba(52, 211, 153, 0.14);
    color: #34d399;
}
.sai-phone-item-sub,
.sai-phone-item-phone,
.sai-phone-lock {
    margin-top: 3px;
    font-size: 12px;
    color: var(--txt2, #94a3b8);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.sai-phone-item-phone {
    font-variant-numeric: tabular-nums;
    -webkit-line-clamp: 1;
}
.sai-phone-lock {
    color: #fbbf24;
    font-weight: 600;
}
.sai-phone-chevron {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--txt2, #94a3b8);
    opacity: 0.7;
}
.sai-phone-chevron svg {
    width: 18px;
    height: 18px;
    display: block;
}
.sai-phone-item.is-locked {
    opacity: 0.92;
}
.sai-phone-item.is-locked .sai-phone-info {
    filter: none;
}
@media (min-width: 480px) {
    .sai-phone-item {
        padding: 13px 16px;
    }
}

/* ── Кнопки ── */
.sai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 10px 16px;
    border: 1.5px solid rgba(255, 199, 44, 0.45);
    border-radius: 12px;
    background: rgba(255, 199, 44, 0.10);
    color: var(--txt, #f8fafc);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 199, 44, 0.08);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.sai-btn:hover {
    border-color: rgba(255, 199, 44, 0.55);
    background: rgba(255, 199, 44, 0.16);
}
.sai-btn:active {
    transform: scale(0.975);
}
.sai-btn-primary {
    border: 1.5px solid rgba(180, 83, 9, 0.35);
    background: linear-gradient(135deg, #ffc72c 0%, #f0a500 100%);
    color: #1a1200;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(240, 165, 0, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.sai-btn-primary:hover {
    opacity: 0.93;
    background: linear-gradient(135deg, #ffc72c 0%, #f0a500 100%);
}
.sai-btn-whatsapp,
.sai-btn-whatsapp:hover {
    border-color: #25d366;
    background: #25d366;
    color: #062b15;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(37, 211, 102, 0.22);
}
.sai-btn-whatsapp:hover {
    background: #20bd5a;
}
.sai-btn-block {
    width: 100%;
    min-height: 48px;
    font-size: 14.5px;
}
.sai-btn[disabled] {
    opacity: 0.55;
    cursor: default;
}

/* Кнопки под ответом — во всю ширину, их трудно промахнуть */
.sai-actions {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sai-actions .sai-btn {
    width: 100%;
    min-height: 46px;
    font-size: 14px;
}
.sai-actions-chips {
    flex-direction: row;
    flex-wrap: wrap;
}
.sai-actions-chips .sai-chip-btn {
    width: auto;
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    min-height: 42px;
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.96);
    animation: sai-chip-in 0.42s cubic-bezier(0.22, 0.8, 0.32, 1) both;
    animation-delay: var(--sai-enter-delay, 0ms);
}
@keyframes sai-chip-in {
    0% {
        opacity: 0;
        transform: translate3d(0, 12px, 0) scale(0.94);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}
@media (min-width: 480px) {
    .sai-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sai-actions .sai-btn {
        flex: 1 1 46%;
        width: auto;
    }
    .sai-actions-chips .sai-chip-btn {
        flex: 1 1 calc(33% - 8px);
    }
}

/* ── Форма обратного звонка ── */
.sai-lead {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    background: linear-gradient(180deg, rgba(255, 199, 44, 0.06) 0%, rgba(255, 199, 44, 0.015) 100%);
}
.sai-lead > * {
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.sai-lead[hidden] {
    display: none;
}
.sai-lead-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.sai-lead-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}
.sai-lead-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 11px;
    background: rgba(255, 199, 44, 0.14);
    color: var(--accent, #ffc72c);
}
.sai-lead-ico svg {
    width: 18px;
    height: 18px;
}
.sai-lead-title {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--txt, #f8fafc);
    line-height: 1.25;
}
.sai-lead-note {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--txt2, #94a3b8);
}
.sai-lead-cancel {
    flex-shrink: 0;
    margin-top: 2px;
    padding: 5px 10px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 999px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.sai-lead-cancel:hover {
    color: var(--txt, #f8fafc);
    border-color: rgba(255, 199, 44, 0.4);
}
.sai-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.sai-field-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--txt2, #94a3b8);
    letter-spacing: 0.01em;
}
.sai-field-label em {
    color: var(--accent, #ffc72c);
    font-style: normal;
}
.sai-field-hint {
    font-size: 11px;
    color: var(--txt2, #94a3b8);
    opacity: 0.8;
}
.sai-field-hint.is-error {
    color: #fca5a5;
    opacity: 1;
}
.sai-lead input,
.sai-lead textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 12px;
    background: var(--bg, #0f172a);
    color: var(--txt, #f8fafc);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
    resize: none;
}
.sai-lead input:focus,
.sai-lead textarea:focus {
    outline: none;
    border-color: rgba(255, 199, 44, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.10);
}
.sai-lead input.is-invalid,
.sai-lead textarea.is-invalid {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.sai-lead input::placeholder,
.sai-lead textarea::placeholder {
    color: var(--txt2, #94a3b8);
}
.sai-lead #saiLeadSubmit {
    margin-top: 2px;
}

/* ── Подвал с вводом ── */
.sai-footer {
    flex-shrink: 0;
    padding: 12px 16px 14px;
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    background: var(--bg2, #1e293b);
}
.sai-footer > * {
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
/* Возврат к списку быстрых вопросов после первого ответа */
.sai-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 10px 2px;
    padding: 6px 12px 6px 9px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 999px;
    background: transparent;
    color: var(--txt2, #94a3b8);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.sai-back-btn[hidden] {
    display: none;
}
.sai-back-btn:hover {
    color: var(--txt, #f8fafc);
    border-color: rgba(255, 199, 44, 0.35);
    background: rgba(255, 199, 44, 0.05);
}
.sai-back-btn svg {
    width: 14px;
    height: 14px;
}

/* Ввод — единая «капсула»: рамка подсвечивается целиком при фокусе,
   кнопка отправки живёт внутри поля и включается только при наборе текста. */
.sai-compose {
    display: block;
}
.sai-compose-field {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 7px 7px 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.22);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.sai-compose-field:focus-within {
    border-color: rgba(255, 199, 44, 0.45);
    box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.08);
}
.sai-compose textarea {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    max-height: 140px;
    padding: 9px 4px 9px 2px;
    border: none;
    background: transparent;
    color: var(--txt, #f8fafc);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    resize: none;
}
.sai-compose textarea:focus {
    outline: none;
}
.sai-compose textarea::placeholder {
    color: var(--txt2, #94a3b8);
    opacity: 0.72;
}
.sai-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc72c 0%, #f0a500 100%);
    color: #1a1200;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.15s ease, background 0.18s ease;
}
.sai-send:active {
    transform: scale(0.92);
}
.sai-send[disabled] {
    background: rgba(255, 255, 255, 0.08);
    color: var(--txt2, #94a3b8);
    cursor: default;
}
.sai-send svg {
    width: 17px;
    height: 17px;
    margin-left: -1px;
}
.sai-disclaimer {
    margin: 8px 4px 0;
    font-size: 10px;
    line-height: 1.35;
    color: var(--txt2, #94a3b8);
    opacity: 0.65;
    text-align: center;
}

/* ── Светлая тема ── */
[data-theme="light"] .sai-overlay {
    background: #f7f8fa;
}
[data-theme="light"] .sai-panel {
    background: #f7f8fa;
    border-color: transparent;
    box-shadow: none;
}
@media (min-width: 860px) {
    [data-theme="light"] .sai-overlay {
        background: rgba(15, 23, 42, 0.28);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
    [data-theme="light"] .sai-panel {
        background: #ffffff;
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.7) inset,
            0 28px 80px rgba(15, 23, 42, 0.18);
    }
}
[data-theme="light"] .sai-handle {
    background: #cbd5e1;
}
[data-theme="light"] .sai-header {
    background: transparent;
    border-color: rgba(15, 23, 42, 0.06);
    box-shadow: none;
}
[data-theme="light"] .sai-footer {
    background: #f7f8fa;
    border-color: rgba(15, 23, 42, 0.06);
    box-shadow: none;
}
@media (min-width: 860px) {
    [data-theme="light"] .sai-footer {
        background: #ffffff;
    }
}
[data-theme="light"] .sai-body {
    background: transparent;
    scrollbar-color: #cbd5e1 transparent;
}
[data-theme="light"] .sai-title,
[data-theme="light"] .sai-card-title,
[data-theme="light"] .sai-msg-ai,
[data-theme="light"] .sai-suggest-item,
[data-theme="light"] .sai-btn {
    color: #1e293b;
}
[data-theme="light"] .sai-title {
    color: #0f172a;
}
[data-theme="light"] .sai-subtitle {
    color: #64748b;
}
[data-theme="light"] .sai-header-icon {
    background: #fff7df;
    border: 1px solid #fde7a7;
}
[data-theme="light"] .sai-beta {
    background: #fff4d1;
    border: 1px solid #fde5a0;
}
[data-theme="light"] .sai-icon-btn {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #334155;
}
[data-theme="light"] .sai-icon-btn:hover {
    color: #92400e;
    background: rgba(245, 158, 11, 0.08);
    border-color: #f59e0b;
}
[data-theme="light"] .sai-msg-ai {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.055);
}
[data-theme="light"] .sai-btn.is-copied {
    color: #15803d !important;
    border-color: rgba(34, 197, 94, 0.45) !important;
}
[data-theme="light"] .sai-speak-btn {
    background: transparent;
    border: none;
    color: #64748b;
}
[data-theme="light"] .sai-speak-btn:hover,
[data-theme="light"] .sai-speak-btn:focus-visible,
[data-theme="light"] .sai-speak-btn.is-speaking {
    color: #b45309;
    background: rgba(245, 158, 11, 0.10);
}
[data-theme="light"] .sai-msg-user {
    color: #3b2600;
    background: linear-gradient(135deg, #ffd55b 0%, #fbbf24 100%);
    box-shadow: 0 3px 10px rgba(180, 83, 9, 0.13);
}
[data-theme="light"] .sai-phone-block {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.055);
}
[data-theme="light"] .sai-phone-heading {
    color: #0f172a;
}
[data-theme="light"] .sai-phone-heading.is-profile {
    color: #059669;
}
[data-theme="light"] .sai-phone-heading.is-blacklist {
    color: #dc2626;
}
[data-theme="light"] .sai-phone-meta {
    color: #64748b;
}
[data-theme="light"] .sai-phone-item-title {
    color: #0f172a;
}
[data-theme="light"] .sai-phone-item:hover,
[data-theme="light"] .sai-phone-item:active {
    background: #f8fafc;
}
[data-theme="light"] .sai-phone-item.is-blacklist {
    background: rgba(239, 68, 68, 0.04);
}
[data-theme="light"] .sai-phone-avatar-fallback {
    background: #fff7df;
}
[data-theme="light"] .sai-msg-error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}
[data-theme="light"] .sai-typing {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.045);
}
[data-theme="light"] .sai-typing span {
    background: #94a3b8;
}
[data-theme="light"] .sai-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.055);
}
[data-theme="light"] .sai-card-media {
    background: #fff8e7;
    border: 1px solid #fef0c7;
}
[data-theme="light"] .sai-card-top {
    background: #fff4d1;
    color: #92400e;
}
[data-theme="light"] .sai-suggest-item {
    background: #ffffff;
    border: 1.5px solid #f3cc74;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.035), inset 0 0 0 1px rgba(245, 158, 11, 0.06);
}
[data-theme="light"] .sai-suggest-item:hover {
    background: #fffbeb;
    border-color: #eab308;
}
[data-theme="light"] .sai-suggest-ico {
    background: #fff7df;
    border: 1px solid #fde9b3;
}
[data-theme="light"] .sai-suggest-arrow {
    color: #94a3b8;
}
[data-theme="light"] .sai-suggest-hide {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .sai-wizard-title,
[data-theme="light"] .sai-wizard-option-text strong {
    color: #0f172a;
}
[data-theme="light"] .sai-wizard-note,
[data-theme="light"] .sai-wizard-option-text small,
[data-theme="light"] .sai-wizard-option-arrow,
[data-theme="light"] .sai-wizard-manual,
[data-theme="light"] .sai-wizard-empty {
    color: #64748b;
}
[data-theme="light"] .sai-wizard-option {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .sai-wizard-option:hover {
    background: #fffbeb;
    border-color: #eab308;
}
[data-theme="light"] .sai-wizard-option-ico {
    color: #b45309;
    background: #fff7df;
    border: 1px solid #fde9b3;
}
[data-theme="light"] .sai-wizard-option-ico.has-img {
    background: #fff;
    border-color: #e8edf4;
}
[data-theme="light"] .sai-wizard-option-ico .sai-wizard-type-img {
    filter: brightness(0) saturate(100%) invert(37%) sepia(93%) saturate(1117%) hue-rotate(4deg) brightness(93%) contrast(96%);
}
[data-theme="light"] .sai-wizard-search {
    color: #1e293b;
    background: #ffffff;
    border-color: #dbe3ed;
}
[data-theme="light"] .sai-wizard-search:focus {
    border-color: #e2a91f;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.10);
}
[data-theme="light"] .sai-wizard-back {
    color: #64748b;
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .sai-wizard-progress {
    color: #92400e;
    background: #fff4d1;
}
[data-theme="light"] .sai-wizard-context-chip {
    color: #475569;
    background: #f1f5f9;
    border-color: #e2e8f0;
}
[data-theme="light"] .sai-wizard-context-sep {
    color: #94a3b8;
}
[data-theme="light"] .sai-wizard-manual {
    border-color: #cbd5e1;
}
[data-theme="light"] .sai-compose-field,
[data-theme="light"] .sai-lead input,
[data-theme="light"] .sai-lead textarea {
    background: #ffffff;
    border-color: #dbe3ed;
}
[data-theme="light"] .sai-compose-field {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
}
[data-theme="light"] .sai-compose-field:focus-within,
[data-theme="light"] .sai-lead input:focus,
[data-theme="light"] .sai-lead textarea:focus {
    border-color: #e2a91f;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.10);
}
[data-theme="light"] .sai-compose textarea,
[data-theme="light"] .sai-lead input,
[data-theme="light"] .sai-lead textarea {
    color: #1e293b;
}
[data-theme="light"] .sai-lead-title {
    color: #1e293b;
}
[data-theme="light"] .sai-lead {
    background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
    border-color: #f1e2bd;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.045);
}
[data-theme="light"] .sai-lead-ico {
    background: #fff1c2;
    border: 1px solid #f9db7b;
}
[data-theme="light"] .sai-lead-cancel {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .sai-send[disabled] {
    background: #eef2f7;
    color: #94a3b8;
}
[data-theme="light"] .sai-btn:not(.sai-btn-primary) {
    color: #78350f;
    background: #fff8e7;
    border: 1.5px solid #eab308;
    box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.12);
}
[data-theme="light"] .sai-btn:not(.sai-btn-primary):hover {
    background: #ffefbd;
    border-color: #ca8a04;
}
[data-theme="light"] .sai-btn-primary {
    color: #3b2600;
    background: linear-gradient(135deg, #ffd55b 0%, #fbbf24 100%);
    border: 1.5px solid #d97706;
    box-shadow: 0 3px 10px rgba(180, 83, 9, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
[data-theme="light"] .sai-btn.sai-btn-whatsapp,
[data-theme="light"] .sai-btn.sai-btn-whatsapp:hover {
    color: #063d1d;
    background: #25d366;
    border: 1.5px solid #15803d;
    box-shadow: 0 3px 12px rgba(22, 163, 74, 0.18);
}
[data-theme="light"] .sai-subtitle,
[data-theme="light"] .sai-card-meta,
[data-theme="light"] .sai-suggest-hint,
[data-theme="light"] .sai-suggest-label,
[data-theme="light"] .sai-suggest-hide,
[data-theme="light"] .sai-back-btn,
[data-theme="light"] .sai-lead-note,
[data-theme="light"] .sai-field-label,
[data-theme="light"] .sai-field-hint,
[data-theme="light"] .sai-disclaimer,
[data-theme="light"] .sai-icon-btn {
    color: #64748b;
}
[data-theme="light"] .sai-back-btn {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .sai-intro.is-returned {
    border-color: #e2e8f0;
}
[data-theme="light"] .sai-card-price,
[data-theme="light"] .sai-beta,
[data-theme="light"] .sai-suggest-ico,
[data-theme="light"] .sai-header-icon {
    color: #b45309;
}

/* История — светлая тема, лаконичнее */
[data-theme="light"] .sai-history-toggle {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
[data-theme="light"] .sai-history-toggle:hover {
    border-color: rgba(245, 158, 11, 0.35);
    background: #fffbeb;
}
[data-theme="light"] .sai-history-toggle-copy small,
[data-theme="light"] .sai-history-toggle-arrow {
    color: #64748b;
}
[data-theme="light"] .sai-history-toggle-ico {
    background: #fff7df;
    color: #b45309;
}
[data-theme="light"] .sai-history-panel {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .sai-history-day {
    background: rgba(15, 23, 42, 0.05);
    color: #64748b;
}
[data-theme="light"] .sai-compose-field {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .sai-send[disabled] {
    background: #e2e8f0;
    color: #94a3b8;
}

/* ПК: чуть больше воздуха в колонке */
@media (min-width: 860px) {
    .sai-header {
        padding: 14px 22px 14px;
    }
    .sai-body {
        padding: 18px 22px 24px;
    }
    .sai-footer {
        padding: 14px 22px 16px;
    }
    .sai-lead {
        padding-left: 22px;
        padding-right: 22px;
    }
    .sai-body > *,
    .sai-footer > *,
    .sai-lead > * {
        max-width: 680px;
    }
    .sai-msg {
        max-width: 78%;
        font-size: 14.5px;
    }
    .sai-wizard-title {
        font-size: 20px;
    }
    .sai-wizard-heading {
        padding-right: 52px;
    }
    .sai-wizard-option {
        min-height: 58px;
        padding: 12px 14px;
    }
}



