/* ============================================================
   Kling AI Avatar — scoped стили страницы (скелет как у Omni/Fish:
   hero → форма слева / заказы справа). Загружается только на
   kling-avatar.php. JS-хуки (av-zone, av-qcard, id av*) сохранены,
   layout-классы — ka-*.
   ============================================================ */

:root {
    --ka-grad: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    --ka-grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(217, 70, 239, 0.18));
    --ka-card-bg: linear-gradient(180deg, rgba(28, 19, 52, 0.55), rgba(17, 11, 34, 0.6));
    --ka-card-border: rgba(139, 92, 246, 0.16);
    --ka-input-bg: rgba(17, 11, 34, 0.55);
    --ka-text: #fff8ec;
    --ka-muted: rgba(255, 255, 255, 0.55);
    --ka-faint: rgba(255, 255, 255, 0.38);
}

.ka-shell { max-width: 1440px; }

/* ================= Hero ================= */
.ka-hero {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 26px 28px;
    margin-bottom: 20px;
    background:
        radial-gradient(circle at 88% 15%, rgba(139, 92, 246, 0.42), transparent 42%),
        radial-gradient(circle at 65% 90%, rgba(217, 70, 239, 0.30), transparent 45%),
        linear-gradient(120deg, #4c1d95 0%, #6d28d9 45%, #86198f 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 22px 60px rgba(109, 40, 217, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.ka-hero h1 { margin: 0 0 8px; font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1.15; }
.ka-hero-sub { margin: 0 0 14px; color: rgba(255, 255, 255, 0.88); font-size: 0.92rem; max-width: 560px; }
.ka-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ka-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 13px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(30, 20, 60, 0.30);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.78rem; font-weight: 500;
}
.ka-pill svg { width: 13px; height: 13px; }
.ka-hero-deco {
    position: absolute; right: 26px; top: 50%;
    transform: translateY(-50%);
    width: 108px; height: 108px;
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
    filter: drop-shadow(0 10px 26px rgba(139, 92, 246, 0.55));
}
.ka-hero-deco svg { width: 100%; height: 100%; }
@media (max-width: 640px) { .ka-hero-deco { display: none; } }

/* ================= Layout: форма + панель заказов ================= */
.ka-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 348px;
    gap: 18px;
    align-items: start;
}
.ka-layout--single { grid-template-columns: 1fr; }
.ka-main { min-width: 0; }

.ka-card {
    background: var(--ka-card-bg);
    border: 1px solid var(--ka-card-border);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ka-card > :last-child { margin-bottom: 0; }
.ka-label {
    display: flex; align-items: center; gap: 10px;
    color: var(--ka-text); font-weight: 700; font-size: 0.95rem;
    margin-bottom: 12px;
}
.ka-step {
    width: 24px; height: 24px; border-radius: 8px;
    background: var(--ka-grad); color: #fff;
    font-size: 0.75rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ================= CTA ================= */
.ka-cta-wrap { margin-top: 4px; }

/* ================= Правая панель «Мои заказы» ================= */
.ka-panel {
    background: var(--ka-card-bg);
    border: 1px solid var(--ka-card-border);
    border-radius: 18px;
    padding: 16px;
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ka-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ka-panel-title {
    display: inline-flex; align-items: center; gap: 8px; margin: 0;
    color: #fff; font-weight: 700; font-size: 0.98rem;
}
.ka-panel-title svg { width: 17px; height: 17px; color: #c4b5fd; }
.ka-panel-count {
    min-width: 24px; height: 24px; padding: 0 8px;
    border-radius: 999px; background: var(--ka-grad); color: #fff;
    font-size: 0.72rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.ka-refresh {
    width: 30px; height: 30px; border-radius: 9px; margin-left: auto;
    border: 1px solid var(--ka-card-border); background: var(--ka-input-bg);
    color: var(--ka-muted); cursor: pointer; display: grid; place-items: center;
    transition: color 0.18s, border-color 0.18s;
}
.ka-refresh:hover { color: #fff; border-color: rgba(139, 92, 246, 0.5); }
.ka-refresh svg { width: 15px; height: 15px; }

.ka-latest {
    background: var(--ka-grad-soft);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 14px;
}
.ka-latest-title { color: #fff; font-weight: 600; font-size: 0.85rem; line-height: 1.3; margin-bottom: 8px; }
.ka-video {
    width: 100%; aspect-ratio: 16 / 9;
    border-radius: 11px; background: #151030;
    display: block;
}
.ka-latest-sub { color: var(--ka-muted); font-size: 0.72rem; margin: 8px 0 10px; }
.ka-open-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: #c4b5fd; font-size: 0.8rem; font-weight: 600; text-decoration: none;
}
.ka-open-link:hover { color: #fff; }

.ka-orders-head { color: var(--ka-muted); font-size: 0.8rem; font-weight: 600; margin-bottom: 8px; }
.ka-orders { display: flex; flex-direction: column; gap: 8px; }

.ka-order {
    display: block; text-decoration: none;
    background: rgba(30, 20, 8, 0.5);
    border: 1px solid rgba(167, 139, 250, 0.13);
    border-radius: 13px;
    padding: 10px;
    transition: border-color 0.18s;
}
.ka-order:hover { border-color: rgba(139, 92, 246, 0.4); }
.ka-order-main { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; }
.ka-order-prev {
    width: 96px; height: 62px; border-radius: 10px;
    object-fit: cover; background: #151030; display: block;
}
.ka-order-prev-ph {
    width: 96px; height: 62px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--ka-grad-soft);
    color: rgba(255, 255, 255, 0.7);
}
.ka-order-prev-ph svg { width: 20px; height: 20px; }
.ka-order-info { min-width: 0; }
.ka-order-name {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem; font-weight: 600; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ka-order-sub { color: var(--ka-faint); font-size: 0.68rem; margin-top: 3px; }
.ka-order-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }

.ka-badge {
    flex-shrink: 0;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.68rem; font-weight: 600;
}
.ka-badge.ready { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.ka-badge.error { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.ka-badge.processing { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.ka-badge.render { background: rgba(217, 70, 239, 0.24); color: #a78bfa; }
.ka-badge.muted { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }

.ka-orders-empty {
    text-align: center;
    padding: 1.4rem 0.8rem;
    color: var(--ka-faint);
    font-size: 0.82rem;
    border: 1px dashed rgba(167, 139, 250, 0.2);
    border-radius: 12px;
}
.ka-orders-empty svg { width: 28px; height: 28px; margin-bottom: 8px; color: rgba(167, 139, 250, 0.55); }
.ka-all-link {
    display: block;
    margin-top: 12px;
    padding: 10px;
    text-align: center;
    border-radius: 12px;
    border: 1px solid rgba(167, 139, 250, 0.22);
    background: rgba(139, 92, 246, 0.08);
    color: #c4b5fd;
    font-size: 0.85rem; font-weight: 600;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
}
.ka-all-link:hover { background: rgba(139, 92, 246, 0.2); color: #fff; }

/* ================= Адаптив ================= */
@media (max-width: 1279.98px) {
    .ka-layout { grid-template-columns: 1fr; }
    .ka-panel { position: static; max-height: none; }
    .ka-orders { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .ka-orders-empty { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .ka-orders { grid-template-columns: 1fr; }
    .ka-hero { padding: 20px 18px; }
    .ka-hero h1 { font-size: 1.4rem; }
}

/* ================= Наследованные стили формы (бывший inline <style>) ================= */
        .av-wrap { max-width: 860px; margin: 0 auto; }
        .av-hero { background: linear-gradient(135deg, rgba(139, 92, 246,0.15) 0%, rgba(217, 70, 239,0.12) 100%); border: 1px solid rgba(139, 92, 246,0.3); border-radius: 24px; padding: 2.5rem 2rem; margin-bottom: 2rem; text-align: center; }
        .av-hero h1 { font-size: 2.2rem; font-weight: 800; background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 0.75rem; }
        .av-hero .subtitle { font-size: 1.1rem; color: rgba(255,255,255,0.8); max-width: 640px; margin: 0 auto; }
        .av-form { background: rgba(0,0,0,0.3); border: 1px solid rgba(139, 92, 246,0.25); border-radius: 20px; padding: 2rem; }
        .av-label { color: rgba(255,255,255,0.9); font-weight: 600; margin-bottom: 0.5rem; display: block; }
        .av-textarea { width: 100%; background: rgba(0,0,0,0.4); border: 1px solid rgba(139, 92, 246,0.3); color: white; border-radius: 12px; padding: 0.75rem 1rem; min-height: 110px; resize: vertical; font-size: 0.95rem; }
        .av-textarea:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246,0.2); }
        .av-counter { text-align: right; font-size: 0.8rem; color: rgba(255,255,255,0.45); margin-top: 0.25rem; }
        .av-uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.25rem 0; }
        .av-zone { border: 2px dashed rgba(139, 92, 246,0.4); border-radius: 16px; padding: 1.5rem 1rem; text-align: center; cursor: pointer; transition: all 0.25s ease; position: relative; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; }
        .av-zone:hover { border-color: #8b5cf6; background: rgba(139, 92, 246,0.05); }
        .av-zone.av-filled { border-style: solid; border-color: rgba(52,211,153,0.5); }
        .av-zone.av-uploading { pointer-events: none; opacity: 0.75; }
        .av-zone .icon { font-size: 2rem; }
        .av-zone p { color: rgba(255,255,255,0.7); margin: 0; font-size: 0.9rem; }
        .av-zone .hint { font-size: 0.78rem; color: rgba(255,255,255,0.4); }
        .av-thumb { max-width: 100%; max-height: 120px; border-radius: 10px; object-fit: cover; }
        .av-audio-player { width: 100%; margin-top: 0.5rem; }
        .av-progress { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin-top: 0.5rem; display: none; }
        .av-progress > div { height: 100%; width: 0; background: linear-gradient(90deg, #a78bfa, #8b5cf6); transition: width 0.2s; }
        .av-quality { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.25rem 0; }
        .av-qcard { border: 1px solid rgba(139, 92, 246,0.25); border-radius: 14px; padding: 1rem 1.25rem; cursor: pointer; background: rgba(0,0,0,0.25); transition: all 0.2s; }
        .av-qcard:hover { border-color: rgba(139, 92, 246,0.6); }
        .av-qcard.active { border-color: #8b5cf6; background: rgba(139, 92, 246,0.1); box-shadow: 0 0 0 3px rgba(139, 92, 246,0.15); }
        .av-qcard .qname { font-weight: 700; color: white; display: flex; justify-content: space-between; align-items: center; }
        .av-qcard .qdesc { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-top: 0.3rem; }
        .av-qcard .qprice { font-size: 0.85rem; color: #a78bfa; font-weight: 600; white-space: nowrap; }
        .av-submit { background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%); border: none; color: white; font-weight: 700; padding: 1rem 2rem; border-radius: 12px; font-size: 1.05rem; width: 100%; cursor: pointer; transition: all 0.25s; margin-top: 0.5rem; }
        .av-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246,0.35); }
        .av-submit:disabled { opacity: 0.55; cursor: not-allowed; }
        .av-submit .coin-icon { width: 18px; height: 18px; }

        /* Иконки Lucide в зонах загрузки и заголовке готового видео */
        .av-zone .icon svg { width: 28px; height: 28px; }
        .av-zone.av-dragover { border-color: #a78bfa; background: rgba(139, 92, 246, 0.14); }
        .av-done-title { color: #34d399; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 8px; }
        .av-done-title svg { width: 20px; height: 20px; }

        /* Блок готового видео: кнопки вместо текстовых ссылок */
        .av-done-actions { display: flex; gap: 10px; margin-top: 1rem; }
        .av-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0.7rem 1.2rem; border-radius: 12px; font-weight: 700; font-size: 0.92rem; text-decoration: none; transition: all 0.2s; }
        .av-btn svg { width: 16px; height: 16px; }
        .av-btn-primary { background: linear-gradient(135deg, #8b5cf6, #d946ef); color: #fff; flex: 1; }
        .av-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.35); color: #fff; }
        .av-btn-ghost { border: 1px solid rgba(167, 139, 250, 0.35); color: #c4b5fd; }
        .av-btn-ghost:hover { background: rgba(139, 92, 246, 0.12); color: #fff; }
        .av-error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.4); border-radius: 12px; padding: 0.9rem 1.1rem; color: #fca5a5; margin-bottom: 1rem; }
        .av-notice { background: rgba(139, 92, 246,0.08); border: 1px dashed rgba(139, 92, 246,0.4); border-radius: 12px; padding: 1rem; text-align: center; color: rgba(255,255,255,0.75); margin-bottom: 1rem; }
        .av-notice a { color: #a78bfa; font-weight: 600; }
        .av-status { background: rgba(0,0,0,0.3); border: 1px solid rgba(139, 92, 246,0.25); border-radius: 20px; padding: 2rem; text-align: center; margin-bottom: 2rem; }
        .av-status video { max-width: 100%; max-height: 480px; border-radius: 14px; margin-top: 1rem; }
        .av-spinner { width: 42px; height: 42px; border: 4px solid rgba(139, 92, 246,0.2); border-top-color: #8b5cf6; border-radius: 50%; margin: 0 auto 1rem; animation: avSpin 0.9s linear infinite; }
        @keyframes avSpin { to { transform: rotate(360deg); } }
        .av-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 2rem 0; }
        .av-fact { background: rgba(139, 92, 246,0.07); border: 1px solid rgba(139, 92, 246,0.2); border-radius: 14px; padding: 1.25rem; }
        .av-fact h4 { color: white; font-size: 0.98rem; margin: 0 0 0.4rem; display: flex; align-items: center; gap: 8px; }
        .av-fact h4 svg { width: 18px; height: 18px; color: #c4b5fd; flex-shrink: 0; }
        .av-fact p { color: rgba(255,255,255,0.65); font-size: 0.88rem; margin: 0; line-height: 1.55; }
        @media (max-width: 640px) {
            .av-hero h1 { font-size: 1.6rem; }
            .av-form { padding: 1.25rem; }
            .av-uploads, .av-quality { grid-template-columns: 1fr; }
        }

/* ================= Вкладки «Фото» / «Аудио» ================= */
.av-tabs { display: flex; gap: 6px; margin-bottom: 12px; background: rgba(17, 11, 34, 0.5); border: 1px solid var(--ka-card-border); border-radius: 12px; padding: 4px; }
.av-tab {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 10px; border: none; border-radius: 9px; cursor: pointer;
    background: transparent; color: var(--ka-muted);
    font-size: 0.83rem; font-weight: 600; font-family: inherit;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}
.av-tab svg { width: 14px; height: 14px; }
.av-tab:hover { color: #fff; }
.av-tab.active { background: var(--ka-grad); color: #fff; box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35); }
.av-tabpanel { min-width: 0; }

/* Генерация фото: чипы моделей */
.av-mchips { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.av-mchip {
    border: 1px solid rgba(139, 92, 246, 0.25); border-radius: 12px;
    background: rgba(0, 0, 0, 0.25); padding: 9px 11px; cursor: pointer;
    text-align: left; font-family: inherit;
    transition: border-color 0.18s, background 0.18s;
}
.av-mchip:hover { border-color: rgba(139, 92, 246, 0.6); }
.av-mchip.active { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.12); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15); }
.av-mchip-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.av-mchip-name { color: #fff; font-weight: 700; font-size: 0.82rem; }
.av-mchip-price { color: #a78bfa; font-weight: 700; font-size: 0.8rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.av-mchip-price .coin-icon { width: 12px; height: 12px; }
.av-mchip-desc { color: var(--ka-faint); font-size: 0.7rem; margin-top: 3px; display: block; }

.av-genprompt { min-height: 74px; margin-bottom: 10px; font-size: 0.88rem; }
.av-genrow { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.av-aspects { display: flex; gap: 6px; background: rgba(17, 11, 34, 0.5); border: 1px solid var(--ka-card-border); border-radius: 11px; padding: 4px; }
.av-aspect { border: none; border-radius: 8px; padding: 7px 12px; cursor: pointer; background: transparent; color: var(--ka-muted); font-size: 0.78rem; font-weight: 600; font-family: inherit; }
.av-aspect.active { background: var(--ka-grad); color: #fff; }
.av-genbtn {
    flex: 1; min-width: 200px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, #8b5cf6, #d946ef); border: none; color: #fff;
    font-weight: 700; font-size: 0.9rem; padding: 10px 16px; border-radius: 11px;
    cursor: pointer; font-family: inherit; transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}
.av-genbtn svg { width: 15px; height: 15px; }
.av-genbtn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(139, 92, 246, 0.35); }
.av-genbtn:disabled { opacity: 0.55; cursor: not-allowed; }
.av-genbtn .coin-icon { width: 14px; height: 14px; }
.av-genstatus { margin-top: 9px; color: var(--ka-muted); font-size: 0.82rem; min-height: 1em; }
.av-genstatus.err { color: #fca5a5; }

/* Мои фото: сетка референсов и истории */
.av-refgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.av-refcard {
    position: relative; aspect-ratio: 1; border-radius: 11px; overflow: hidden;
    border: 2px solid transparent; background: rgba(139, 92, 246, 0.1);
    cursor: pointer; padding: 0; font-family: inherit;
    transition: border-color 0.18s, transform 0.18s, opacity 0.18s;
}
.av-refcard:hover { border-color: rgba(139, 92, 246, 0.55); transform: scale(1.04); }
.av-refcard.busy { opacity: 0.45; pointer-events: none; }
.av-refcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-refcard-tag {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 5px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff; font-size: 0.62rem; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.av-refmanage { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: #c4b5fd; font-size: 0.78rem; font-weight: 600; text-decoration: none; }
.av-refmanage:hover { color: #fff; }
.av-refmanage svg { width: 13px; height: 13px; }

/* Озвучка текста (Fish TTS) */
.av-voicerow { display: flex; gap: 8px; margin-bottom: 10px; }
.av-select {
    flex: 1; min-width: 0;
    background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(139, 92, 246, 0.3);
    color: #fff; border-radius: 11px; padding: 9px 12px;
    font-size: 0.88rem; font-family: inherit;
}
.av-select:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2); }
.av-voiceplay {
    width: 40px; flex-shrink: 0; border-radius: 11px; cursor: pointer;
    border: 1px solid rgba(139, 92, 246, 0.3); background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd; display: grid; place-items: center;
    transition: background 0.18s, color 0.18s;
}
.av-voiceplay:hover { background: rgba(139, 92, 246, 0.28); color: #fff; }
.av-voiceplay svg { width: 15px; height: 15px; }
.av-ttsmeta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--ka-muted); font-size: 0.76rem; margin: 6px 0 10px; }
.av-ttsmeta .coin-icon { width: 11px; height: 11px; }
.av-ttsdaily { color: var(--ka-faint); }

/* Прогресс генерации: таймер + прогрессбар + отмена */
.av-prog { margin-top: 10px; }
.av-prog[hidden] { display: none; }
.av-prog-bar { height: 8px; border-radius: 6px; background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.25); overflow: hidden; }
.av-prog-fill { height: 100%; width: 0%; border-radius: 6px; background: linear-gradient(90deg, #8b5cf6, #d946ef); box-shadow: 0 0 12px rgba(217, 70, 239, 0.5); transition: width 0.4s ease; }
.av-prog-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.av-prog-timer { color: #c4b5fd; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.av-cancelbtn { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; border-radius: 8px; padding: 4px 10px; font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.18s, color 0.18s; }
.av-cancelbtn svg { width: 12px; height: 12px; }
.av-cancelbtn:hover { background: rgba(239, 68, 68, 0.15); color: #fff; }

/* Мои аудио: прошлые озвучки Fish */
.av-audiolist { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.av-audiorow { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(139, 92, 246, 0.22); border-radius: 11px; padding: 9px 12px; cursor: pointer; font-family: inherit; transition: border-color 0.18s, background 0.18s; }
.av-audiorow:hover:not(.disabled) { border-color: rgba(139, 92, 246, 0.6); background: rgba(139, 92, 246, 0.08); }
.av-audiorow.busy { opacity: 0.5; pointer-events: none; }
.av-audiorow.disabled { opacity: 0.45; cursor: not-allowed; }
.av-audiorow-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.av-audiorow-text { color: #fff; font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-audiorow-sub { color: var(--ka-faint); font-size: 0.7rem; }
.av-audiorow-badge { flex-shrink: 0; font-size: 0.66rem; font-weight: 700; color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 7px; padding: 2px 7px; }
.av-audionote { color: var(--ka-faint); font-size: 0.72rem; margin: 8px 0 0; line-height: 1.5; }

/* Пикер голоса: в fish-tts.css кнопка скрыта на десктопе (там инлайн-сетка голосов) — здесь она единственный вход */
.vp-open-btn { display: inline-flex; width: 100%; justify-content: flex-start; margin: 0 0 10px; }
.vp-open-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Иконка коина в цене карточек качества */
.av-qcard .qprice { display: inline-flex; align-items: center; gap: 4px; }
.av-qcard .qprice .coin-icon { width: 12px; height: 12px; }

/* Крестики очистки текстовых полей */
.av-field { position: relative; }
.av-field .av-textarea { padding-right: 2.4rem; }
.av-clear {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 26px; height: 26px; border-radius: 8px;
    display: none; place-items: center;
    background: rgba(139, 92, 246, 0.18); border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd; cursor: pointer; font-family: inherit;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.av-clear.visible { display: grid; }
.av-clear:hover { background: rgba(239, 68, 68, 0.25); border-color: rgba(239, 68, 68, 0.5); color: #fff; }
.av-clear svg { width: 12px; height: 12px; }

/* Крестик сброса на заполненной зоне фото/аудио (видимость управляется из JS) */
.av-zonewrap { position: relative; }
.av-zonereset {
    position: absolute; top: 8px; right: 8px; z-index: 3;
    width: 28px; height: 28px; border-radius: 9px;
    display: none; place-items: center;
    background: rgba(17, 11, 34, 0.85); border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5; cursor: pointer; font-family: inherit;
    transition: background 0.18s, color 0.18s;
}
.av-zonereset:hover { background: rgba(239, 68, 68, 0.3); color: #fff; }
.av-zonereset svg { width: 13px; height: 13px; }

/* AI-помощник промпта */
.av-aitoolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.av-aitoolbar--end { justify-content: flex-end; margin-bottom: 10px; }
.av-aibtn {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid rgba(139, 92, 246, 0.4); color: #c4b5fd;
    border-radius: 9px; padding: 5px 11px; font-size: 0.75rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.av-aibtn svg { width: 12px; height: 12px; }
.av-aibtn:hover { background: rgba(139, 92, 246, 0.15); border-color: rgba(217, 70, 239, 0.6); color: #fff; }
.av-aipanel {
    margin-top: 8px; padding: 10px;
    border: 1px dashed rgba(139, 92, 246, 0.35); border-radius: 11px;
    background: rgba(139, 92, 246, 0.05);
    display: flex; flex-wrap: wrap; gap: 8px;
}
.av-aipanel[hidden] { display: none; }
.av-input {
    flex: 1; min-width: 180px;
    background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(139, 92, 246, 0.3);
    color: #fff; border-radius: 10px; padding: 8px 12px;
    font-size: 0.85rem; font-family: inherit;
}
.av-input:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2); }
.av-aiapply { flex: 0 0 auto; min-width: 0; }
.av-aipanel .av-genstatus { flex-basis: 100%; margin-top: 2px; }

/* Готовность формы под кнопкой заказа */
.av-readiness { margin-top: 8px; text-align: center; color: var(--ka-faint); font-size: 0.78rem; }
.av-readiness.ok { color: #34d399; }
