/* ============================================
   QUIZ FEATURE - MODULAR ARCHITECTURE
   ============================================
   
   This file imports modular quiz CSS files.
   The monolithic quiz.css has been split into:
   
   - quiz/quiz-base.css         - Основные контейнеры, wrapper, header, кнопки
   - quiz/quiz-screens.css      - Контейнер экранов, анимации, стартовый экран
   - quiz/quiz-game.css         - Игровой процесс (progress, rounds, options, feedback)
   - quiz/quiz-result.css       - Экран результатов и статистика
   - quiz/quiz-leaderboard.css  - Таблица лидеров и toast-уведомления
   - quiz/quiz-top.css          - Экран топов и детальной статистики
   - quiz/quiz-responsive.css   - Мобильные и адаптивные стили
   
   ============================================ */

/* ---- inlined: interactive-hub.css ---- */
/* Контейнер для квизов, мини-игр и других интерактивов. */
.interactive-hub {
    --interactive-surface: linear-gradient(
        135deg,
        rgba(120, 40, 200, 0.85) 0%,
        rgba(80, 20, 160, 0.9) 35%,
        rgba(50, 10, 120, 0.95) 65%,
        rgba(20, 5, 80, 1) 100%
    );
    --interactive-panel-min-height: 430px;
    --interactive-content-width: 650px;
    --interactive-control-width: 540px;
    --interactive-panel-padding: clamp(2rem, 5vw, 3.5rem);
    --interactive-title-size: clamp(1.55rem, 4vw, 2.55rem);
    --interactive-copy-size: 1rem;
    --interactive-header-gap: 1rem;
    --interactive-content-gap: 1.5rem;
    --interactive-action-padding: 0.85rem 1.45rem;
    --interactive-action-size: 0.78rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), filter 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-hub-sr-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.interactive-auth-session-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.7rem 0 0;
}

.interactive-auth-session-controls[hidden] {
    display: none;
}

.interactive-auth-session-controls button {
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(15, 8, 25, 0.72);
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.interactive-auth-session-controls button:hover {
    color: #fff;
    background: rgba(30, 14, 50, 0.88);
    border-color: rgba(212, 160, 255, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(120, 40, 200, 0.28);
}

.interactive-auth-session-controls button:focus-visible {
    color: #fff;
    border-color: rgba(212, 160, 255, 0.7);
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 160, 255, 0.4);
}

.interactive-auth-session-controls button:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

@media (prefers-reduced-motion: reduce) {
    .interactive-auth-session-controls button {
        transition: none;
        transform: none;
    }
    .interactive-auth-session-controls button:hover,
    .interactive-auth-session-controls button:active {
        transform: none;
    }
}

/* Единый каркас экранов Telegram-входа: кнопка под кнопкой, один размер. */
.event-auth-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
    width: min(100%, 19rem);
    margin: var(--interactive-content-gap) auto 0;
}

.event-auth-actions .event-auth-cta,
.event-auth-actions .event-auth-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    margin: 0;
    text-decoration: none;
}

.event-auth-actions .event-auth-back {
    padding: var(--interactive-action-padding);
    border-radius: 999px;
    font-family: var(--font-display), sans-serif;
    font-size: var(--interactive-action-size);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.event-auth-actions .event-auth-cta:active,
.event-auth-actions .event-auth-back:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

/* Состояния ожидания Telegram-входа: спиннер + читаемая подпись. */
.event-auth-cta.is-loading,
.event-auth-cta.is-waiting {
    cursor: progress;
}

.event-auth-cta.is-loading {
    opacity: 0.75;
    pointer-events: none;
}

.event-auth-cta.is-loading::after,
.event-auth-cta.is-waiting::after {
    content: "";
    flex: none;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: event-auth-spin 0.75s linear infinite;
}

@keyframes event-auth-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .event-auth-cta.is-loading::after,
    .event-auth-cta.is-waiting::after {
        animation-duration: 1.6s;
    }
}

.event-auth-notice {
    max-width: 34rem;
    margin: 1.1rem auto 0;
    font-family: var(--font-primary), sans-serif;
    font-size: 0.72rem;
    line-height: 1.45;
}

@media (max-width: 600px) {
    .event-auth-actions {
        width: 100%;
        gap: 0.6rem;
    }

    .event-auth-actions .event-auth-cta,
    .event-auth-actions .event-auth-back {
        min-height: 46px;
        font-size: 0.7rem;
    }
}

.interactive-hub-tabs {
    --interactive-tab-gap: 0.35rem;
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: var(--interactive-tab-gap);
    position: relative;
    z-index: 1;
}

.interactive-hub-indicator {
    position: absolute;
    bottom: -1px;
    left: 0;
    z-index: 3;
    width: calc((100% - var(--interactive-tab-gap) * 2) / 3);
    height: 4px;
    min-height: 4px;
    max-height: 4px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px 999px 0 0;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.65);
    pointer-events: none;
    will-change: transform;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.interactive-hub[data-theme="first-listen"] .interactive-hub-indicator {
    background: #15111a;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.92);
}

.interactive-hub[data-theme="constellation"] .interactive-hub-indicator {
    background: #f3d9a4;
    box-shadow: 0 0 14px rgba(243, 217, 164, 0.85);
}

.interactive-hub-tab {
    position: relative;
    min-width: 0;
    padding: 0.8rem 1rem;
    color: rgba(255, 255, 255, 0.58);
    background-image:
        linear-gradient(rgba(11, 3, 32, 0.62), rgba(11, 3, 32, 0.62)),
        var(--interactive-surface);
    border: 1px solid rgba(180, 100, 255, 0.22);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    cursor: pointer;
    font-family: var(--font-display), sans-serif;
    font-size: clamp(0.68rem, 1.8vw, 0.85rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    text-transform: uppercase;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.interactive-hub-tab__badge {
    position: absolute;
    top: -7px;
    right: 12px;
    z-index: 4;
    max-width: calc(100% - 16px);
    padding: 2px 6px;
    overflow: hidden;
    border: 1px solid rgba(5, 7, 15, 0.88);
    border-radius: 999px;
    background: rgb(204, 45, 45);
    color: #fff;
    font-family: var(--font-primary), sans-serif;
    font-size: 8px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.07em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.42);
    pointer-events: none;
}

.interactive-hub-tab:hover,
.interactive-hub-tab:focus-visible {
    color: #fff;
    background-image:
        linear-gradient(rgba(26, 7, 67, 0.36), rgba(26, 7, 67, 0.36)),
        var(--interactive-surface);
    outline: none;
}

.interactive-hub-tab:focus-visible {
    box-shadow: 0 0 0 3px rgba(212, 160, 255, 0.52);
}

.interactive-hub-tab:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

.interactive-hub-tab.is-active {
    color: #fff;
    background-image: var(--interactive-surface);
    border-color: rgba(212, 160, 255, 0.48);
    border-bottom-color: transparent;
    margin-bottom: -1px;
    position: relative;
    z-index: 2;
}

.interactive-hub-tab[data-theme="first-listen"] {
    color: #15111a;
    background-image: linear-gradient(135deg, #ffffff 0%, #e5e0ed 56%, #fbfbfd 100%);
    border-color: rgba(255, 255, 255, 0.92);
}

.interactive-hub-tab[data-theme="first-listen"]:hover,
.interactive-hub-tab[data-theme="first-listen"]:focus-visible {
    color: #15111a;
    background-image: linear-gradient(135deg, #ffffff 0%, #ece8f2 56%, #ffffff 100%);
}

.interactive-hub[data-theme="first-listen"] .interactive-hub-tab.is-active {
    color: #15111a;
    background-image: linear-gradient(135deg, #ffffff 0%, #e5e0ed 56%, #fbfbfd 100%);
    border-color: rgba(255, 255, 255, 0.92);
}

.interactive-hub-tab[data-theme="constellation"] {
    color: rgba(226, 232, 255, 0.72);
    background-image:
        radial-gradient(circle at 78% 22%, rgba(99, 102, 241, 0.14), transparent 56%),
        linear-gradient(160deg, #060811 0%, #0b0f20 55%, #04060d 100%);
    border-color: rgba(148, 163, 255, 0.2);
}

.interactive-hub-tab[data-theme="constellation"]:hover,
.interactive-hub-tab[data-theme="constellation"]:focus-visible {
    color: #ffffff;
    background-image:
        radial-gradient(circle at 78% 22%, rgba(129, 140, 248, 0.22), transparent 56%),
        linear-gradient(160deg, #090c1a 0%, #101630 55%, #060914 100%);
    border-color: rgba(165, 180, 252, 0.34);
}

.interactive-hub[data-theme="constellation"] .interactive-hub-tab[data-theme="constellation"].is-active {
    color: #ffffff;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(129, 140, 248, 0.2), transparent 68%),
        linear-gradient(180deg, #0d1226 0%, #050711 100%);
    border-color: rgba(165, 180, 252, 0.34);
    border-bottom-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .interactive-hub:hover {
        transform: translateY(-3px);
        filter:
            drop-shadow(0 0 18px rgba(120, 40, 200, 0.35))
            drop-shadow(0 22px 38px rgba(0, 0, 0, 0.42));
    }

    /* Поднимается общий контейнер, поэтому содержимое не должно двигаться отдельно. */
    .interactive-hub:hover .quiz-wrapper {
        transform: none;
        border-color: rgba(212, 160, 255, 0.45);
    }
}

.interactive-hub-panel {
    min-width: 0;
}

.interactive-hub-stage {
    position: relative;
}

.interactive-hub-panel[hidden] {
    display: none;
}

.is-transitioning {
    pointer-events: none;
}

.interactive-hub .is-transitioning .quiz-feedback-overlay.visible {
    pointer-events: none;
}


.interactive-hub .quiz-wrapper {
    box-sizing: border-box;
    max-width: none;
    min-height: var(--interactive-panel-min-height);
    margin: 0;
    padding: var(--interactive-panel-padding);
    border-radius: 0 0 28px 28px;
    background: var(--interactive-surface);
}

@media (max-width: 768px) {
    .interactive-hub-tabs {
        --interactive-tab-gap: 0.2rem;
    }

    .interactive-hub-tab {
        padding: 0.68rem 0.25rem;
        border-radius: 12px 12px 0 0;
        font-size: clamp(0.52rem, 2.35vw, 0.72rem);
        letter-spacing: 0.015em;
    }

    .interactive-hub-tab__badge {
        top: -6px;
        right: 6px;
        padding: 1.5px 5px;
        font-size: 7px;
    }

    .interactive-hub .quiz-wrapper {
        border-radius: 0 0 20px 20px;
    }

    .interactive-hub .quiz-wrapper {
        padding: 2rem 1.1rem;
    }
}

@media (max-width: 600px) {
    .interactive-hub .quiz-wrapper {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .interactive-hub-indicator,
    .interactive-hub-tab,
    .interactive-hub-tab:active,
    .event-auth-actions .event-auth-cta:active,
    .event-auth-actions .event-auth-back:active {
        transition: none;
        transform: none;
    }

    .interactive-hub:hover,
    .interactive-hub:hover .quiz-wrapper {
        transform: none;
        filter: none;
    }
}

/* ---- inlined: first-listen.css ---- */
/* «С какого трека начал слушать» — светлая перламутровая вкладка. */
.first-listen-panel {
    min-height: var(--interactive-panel-min-height);
    overflow: hidden;
    color: #121217;
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.98), transparent 30%),
        radial-gradient(circle at 86% 82%, rgba(204, 194, 235, 0.56), transparent 36%),
        linear-gradient(130deg, #f9f8fb 0%, #e8e4f0 45%, #fdfdfe 100%);
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 0 0 28px 28px;
    box-shadow: 0 20px 60px rgba(7, 4, 18, 0.28);
}

.first-listen-screen {
    box-sizing: border-box;
    max-width: var(--interactive-content-width);
    min-height: var(--interactive-panel-min-height);
    margin: 0 auto;
    padding: var(--interactive-panel-padding);
    text-align: center;
}

.first-listen-eyebrow {
    margin: 0 0 0.75rem;
    color: #635b72;
    font-family: var(--font-display), sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.first-listen-title {
    max-width: 15ch;
    margin: 0 auto;
    font-family: var(--font-display), sans-serif;
    font-size: var(--interactive-title-size);
    letter-spacing: -0.025em;
    line-height: 1.03;
}

.first-listen-screen[data-first-listen-screen="choose"] .first-listen-title {
    text-transform: uppercase;
}

.first-listen-auth-screen .first-listen-title { max-width: 22ch; }
.first-listen-auth-screen .first-listen-copy { margin-bottom: 0; }

.first-listen-copy {
    max-width: 44ch;
    margin: var(--interactive-header-gap) auto var(--interactive-content-gap);
    color: #696271;
    font-family: var(--font-primary), sans-serif;
    font-size: var(--interactive-copy-size);
    line-height: 1.45;
}

.first-listen-search {
    display: block;
    max-width: var(--interactive-control-width);
    margin: 0 auto;
    padding: 0.7rem 1.1rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(31, 24, 42, 0.13);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 25px rgba(52, 38, 74, 0.08);
}

.first-listen-search[hidden],
.first-listen-selection[hidden] {
    display: none;
}

.first-listen-search-label,
.first-listen-selection-label {
    display: block;
    color: #7d7586;
    font-family: var(--font-display), sans-serif;
    font-size: 0.57rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.first-listen-search input {
    width: 100%;
    padding: 0;
    color: #141118;
    background: transparent;
    border: 0;
    outline: none;
    font-family: var(--font-display), sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.15rem);
}

.first-listen-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1.35rem 1.35rem;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.22rem;
}

.first-listen-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.first-listen-search input::placeholder { color: #aaa4b0; }
.first-listen-search:focus-within { border-color: rgba(35, 26, 49, 0.36); box-shadow: 0 0 0 4px rgba(147, 131, 181, 0.17); }
.first-listen-input-clear,
.first-listen-search-icon {
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    color: #5f5967;
}
.first-listen-input-clear {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease;
}
.first-listen-input-clear:hover { color: #2d2635; background: rgba(64, 54, 75, 0.1); }
.first-listen-input-clear:focus-visible { outline: 2px solid rgba(95, 89, 103, 0.55); outline-offset: 2px; }
.first-listen-input-clear svg,
.first-listen-search-icon svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.15; }

.first-listen-suggestions {
    --first-listen-suggestion-height: 57px;
    display: grid;
    max-width: var(--interactive-control-width);
    /* Видны три самых похожих трека, остальные — в ленис-скролле */
    max-height: calc(var(--first-listen-suggestion-height) * 3);
    margin: 0.75rem auto 0;
    overflow-x: hidden;
    overflow-y: auto;
    text-align: left;
    border-radius: 16px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(45, 37, 56, 0.32) transparent;
}

.first-listen-suggestions::-webkit-scrollbar {
    width: 12px;
}

.first-listen-suggestions::-webkit-scrollbar-track {
    margin: 6px 0;
    background: transparent;
}

.first-listen-suggestions::-webkit-scrollbar-thumb {
    background: rgba(45, 37, 56, 0.32);
    background-clip: content-box;
    border: 3px solid transparent;
    border-radius: 999px;
}

.first-listen-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 37, 56, 0.5);
    background-clip: content-box;
}

.first-listen-suggestion {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-sizing: border-box;
    min-height: var(--first-listen-suggestion-height);
    width: 100%;
    padding: 0.6rem 0.8rem;
    color: #221c29;
    background: rgba(255, 255, 255, 0.62);
    border: 0;
    border-bottom: 1px solid rgba(39, 30, 50, 0.08);
    cursor: pointer;
    font-family: var(--font-primary), sans-serif;
    font-size: 1rem;
    text-align: left;
    transition: background 0.2s ease, transform 0.2s ease;
}
.first-listen-suggestion:hover { background: #fff; transform: translateX(3px); }
.first-listen-suggestion img, .first-listen-selection-cover, .first-listen-ranking-cover { width: 38px; height: 38px; object-fit: cover; border-radius: 10px; }
.first-listen-suggestion img { flex: none; }
.first-listen-suggestion > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.first-listen-suggestion small { display: block; margin-top: 0.12rem; overflow: hidden; color: #857d90; font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.first-listen-no-results { margin: 0.7rem 0; color: #7d7586; font-family: var(--font-primary), sans-serif; font-size: 0.9rem; }

.first-listen-selection {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: var(--interactive-control-width);
    margin: 0 auto;
    padding: 0.7rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(35, 26, 49, 0.13);
    border-radius: 16px;
}
.first-listen-selection strong { display: block; margin-top: 0.18rem; font-family: var(--font-display), sans-serif; }
.first-listen-clear { width: 30px; height: 30px; margin-left: auto; color: #625b6b; background: transparent; border: 0; cursor: pointer; font-size: 1.5rem; }

.first-listen-confirm, .first-listen-again {
    margin-top: var(--interactive-content-gap);
    padding: var(--interactive-action-padding);
    color: #fff;
    background: #18141e;
    border: 1px solid #18141e;
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--font-display), sans-serif;
    font-size: var(--interactive-action-size);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.first-listen-confirm:hover:not(:disabled), .first-listen-again:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(22, 16, 31, 0.22); }
.first-listen-confirm:disabled { opacity: 0.4; cursor: default; }
.first-listen-again { color: #2a2232; background: transparent; border-color: rgba(42, 34, 50, 0.25); }
.first-listen-confirm:active:not(:disabled), .first-listen-again:active, .first-listen-suggestion:active { transform: translateY(0) scale(0.97); transition-duration: 0.08s; }
.first-listen-clear:active, .first-listen-input-clear:active { transform: translateY(0) scale(0.97); }

.first-listen-auth-button-icon { width: 1.05em; height: 1.05em; flex: none; fill: currentColor; }
.first-listen-auth-notice { color: #7d7586; }
.first-listen-auth-notice a { color: #2a2232; text-underline-offset: 2px; }

.first-listen-leaderboard { display: grid; gap: 0.5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; text-align: left; }
.first-listen-ranking-item { display: grid; grid-template-columns: 1.4rem 38px 1fr auto; align-items: center; gap: 0.75rem; padding: 0.5rem 0.6rem; background: rgba(255, 255, 255, 0.45); border-radius: 14px; }
.first-listen-rank { color: #857c91; font-family: var(--font-display), sans-serif; font-size: 0.78rem; text-align: center; }
.first-listen-ranking-copy { min-width: 0; }
.first-listen-ranking-copy strong { display: block; font-family: var(--font-display), sans-serif; font-size: 0.74rem; }
.first-listen-ranking-details { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; min-width: 0; }
.first-listen-ranking-artist { min-width: 0; overflow: hidden; color: #746c7e; font-family: var(--font-primary), sans-serif; font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.first-listen-ranking-votes { flex: 0 0 auto; margin-left: auto; color: #746c7e; font-family: var(--font-primary), sans-serif; font-size: 0.8rem; white-space: nowrap; }
.first-listen-ranking-copy i { display: block; width: 100%; height: 4px; margin-top: 0.3rem; overflow: hidden; background: rgba(45, 37, 56, 0.12); border-radius: 999px; }
.first-listen-ranking-copy b { display: block; height: 100%; background: linear-gradient(90deg, #17121d, #8f839d); border-radius: inherit; transition: width 0.6s ease; }
.first-listen-ranking-item em { color: #4c4355; font-family: var(--font-display), sans-serif; font-size: 0.68rem; font-style: normal; white-space: nowrap; }
.first-listen-empty { padding: 1rem; color: #716979; background: rgba(255, 255, 255, 0.42); border-radius: 14px; font-family: var(--font-primary), sans-serif; text-align: center; }

@media (max-width: 600px) {
    .first-listen-panel { min-height: 0; border-radius: 0 0 20px 20px; }
    .first-listen-screen { min-height: 0; padding: 2rem 1.1rem; }
    .first-listen-ranking-item { box-sizing: border-box; grid-template-columns: 1.2rem 34px minmax(0, 1fr) auto; gap: 0.5rem; height: 66px; overflow: hidden; }
    .first-listen-ranking-copy { overflow: hidden; }
    .first-listen-ranking-copy strong { overflow: hidden; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
    .first-listen-ranking-details { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 0.5rem; line-height: 1.2; }
    .first-listen-ranking-artist { display: block; }
    .first-listen-ranking-votes { display: block; }
    .first-listen-suggestion img, .first-listen-selection-cover, .first-listen-ranking-cover { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    .first-listen-confirm:active:not(:disabled), .first-listen-again:active, .first-listen-suggestion:active, .first-listen-clear:active, .first-listen-input-clear:active { transform: none; }
}

/* ---- inlined: quiz/quiz-base.css ---- */
/* ============================================
   QUIZ BASE STYLES
   Основные контейнеры, wrapper, header
   Отступы секции — в section-spacing.css (единый источник).
   ============================================ */

.quiz-wrapper {
    max-width: 700px;
    margin: 0 auto;
    border-radius: 28px;
    padding: 1.75rem 1.75rem 2.5rem;
    position: relative;
    overflow: visible;
    /* Фиолетовый градиент */
    background: linear-gradient(135deg,
        rgba(120, 40, 200, 0.85) 0%,
        rgba(80, 20, 160, 0.9) 35%,
        rgba(50, 10, 120, 0.95) 65%,
        rgba(20, 5, 80, 1) 100%
    );
    border: 1px solid rgba(180, 100, 255, 0.25);
    box-shadow:
        0 0 60px rgba(120, 40, 200, 0.35),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 40px rgba(120, 40, 200, 0.1);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.quiz-wrapper:hover {
    transform: translateY(-3px);
    border-color: rgba(212, 160, 255, 0.45);
    box-shadow:
        0 0 68px rgba(120, 40, 200, 0.42),
        0 28px 72px rgba(0, 0, 0, 0.56),
        inset 0 0 44px rgba(120, 40, 200, 0.14);
}

/* Декоративные блики — внутри отдельного слоя чтобы не обрезать свечение дочерних элементов */
.quiz-wrapper-inner-bg {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.quiz-wrapper-inner-bg::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180, 80, 255, 0.3) 0%, transparent 70%);
}

.quiz-wrapper-inner-bg::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100, 20, 200, 0.4) 0%, transparent 70%);
}

/* Убираем старые псевдоэлементы с враппера */
.quiz-wrapper::before,
.quiz-wrapper::after {
    display: none;
}

/* Header */
.quiz-header {
    max-width: var(--interactive-content-width);
    text-align: center;
    margin: 0 auto var(--interactive-content-gap);
    position: relative;
    z-index: 1;
}

.quiz-title {
    font-family: var(--font-display), sans-serif;
    font-size: var(--interactive-title-size);
    color: #fff;
    max-width: 15ch;
    margin: 0 auto;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 20px rgba(180, 80, 255, 0.5);
    line-height: 1.03;
    text-transform: uppercase;
}

.quiz-subtitle {
    max-width: 44ch;
    font-family: var(--font-primary), sans-serif;
    font-size: var(--interactive-copy-size);
    color: rgba(255, 255, 255, 0.5);
    margin: var(--interactive-header-gap) auto 0;
    letter-spacing: 0.02em;
    line-height: 1.45;
}

/* На экране авторизации заголовок ивента подменяется заголовком входа */
.quiz-header--auth {
    display: none;
}

.quiz-wrapper.is-auth-view .quiz-header--event {
    display: none;
}

.quiz-wrapper.is-auth-view .quiz-header--auth {
    display: block;
}

.quiz-header--auth .quiz-title {
    max-width: 22ch;
}


/* Action Button */
.quiz-action-btn {
    font-family: var(--font-display), sans-serif;
    font-size: var(--interactive-action-size);
    letter-spacing: 0.05em;
    color: #0a0a0a;
    background: linear-gradient(135deg, #d4a0ff, #a855f7);
    border: none;
    border-radius: 50px;
    padding: var(--interactive-action-padding);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.4);
    margin-top: 0.25rem;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
}

.quiz-action-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e0b0ff, #c084fc);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.55);
}

.quiz-action-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

.quiz-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Quiz Top Button */
.quiz-top-btn {
    font-family: var(--font-display), sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    color: rgba(212, 160, 255, 0.9);
    background: rgba(168, 85, 247, 0.12);
    border: 2px solid rgba(168, 85, 247, 0.35);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    text-transform: uppercase;
}

.quiz-top-btn:hover {
    background: rgba(168, 85, 247, 0.22);
    border-color: rgba(168, 85, 247, 0.7);
    color: #d4a0ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.3);
}

.quiz-top-btn:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

@media (prefers-reduced-motion: reduce) {
    .quiz-action-btn:active:not(:disabled),
    .quiz-top-btn:active {
        transform: none;
    }
}

/* ---- inlined: quiz/quiz-screens.css ---- */
/* ============================================
   QUIZ SCREENS
   Контейнер экранов, анимации переходов, стартовый экран
   ============================================ */

.quiz-screens {
    position: relative;
    z-index: 1;
}

/* Все экраны имеют отступ снизу для свечения */
.quiz-start-screen,
.quiz-auth-screen,
.quiz-game-screen,
.quiz-result-screen {
    padding-bottom: 20px;
}

.quiz-screen {
    width: 100%;
}

/* ============================================
   START SCREEN
   ============================================ */

.quiz-start-screen {
    max-width: var(--interactive-control-width);
    margin: 0 auto;
    text-align: center;
}

.quiz-start-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: var(--interactive-content-gap);
}

/* Rounds Selection */
.quiz-rounds-select {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.quiz-rounds-label {
    display: block;
    font-family: var(--font-primary), sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.quiz-rounds-btns {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
}

.quiz-round-btn {
    font-family: var(--font-display), sans-serif;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 70px;
}

/* 5 раундов — зелёный */
.quiz-round-btn[data-rounds="5"] {
    border-color: rgba(80, 220, 120, 0.25);
    color: rgba(127, 255, 170, 0.7);
}
.quiz-round-btn[data-rounds="5"]:hover {
    background: rgba(80, 220, 120, 0.15);
    border-color: rgba(80, 220, 120, 0.6);
    color: #7fffaa;
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(80, 220, 120, 0.25);
}
.quiz-round-btn[data-rounds="5"].selected {
    background: rgba(80, 220, 120, 0.2);
    border-color: rgba(80, 220, 120, 0.8);
    color: #7fffaa;
    box-shadow: 0 0 20px rgba(80, 220, 120, 0.4);
}

/* 10 раундов — жёлтый */
.quiz-round-btn[data-rounds="10"] {
    border-color: rgba(255, 200, 50, 0.25);
    color: rgba(255, 217, 125, 0.7);
}
.quiz-round-btn[data-rounds="10"]:hover {
    background: rgba(255, 200, 50, 0.15);
    border-color: rgba(255, 200, 50, 0.6);
    color: #ffd97d;
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(255, 200, 50, 0.25);
}
.quiz-round-btn[data-rounds="10"].selected {
    background: rgba(255, 200, 50, 0.2);
    border-color: rgba(255, 200, 50, 0.8);
    color: #ffd97d;
    box-shadow: 0 0 20px rgba(255, 200, 50, 0.4);
}

/* 15 раундов — красный */
.quiz-round-btn[data-rounds="15"] {
    border-color: rgba(255, 80, 80, 0.25);
    color: rgba(255, 150, 150, 0.7);
}
.quiz-round-btn[data-rounds="15"]:hover {
    background: rgba(255, 80, 80, 0.15);
    border-color: rgba(255, 80, 80, 0.6);
    color: #ff9696;
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(255, 80, 80, 0.25);
}
.quiz-round-btn[data-rounds="15"].selected {
    background: rgba(255, 80, 80, 0.2);
    border-color: rgba(255, 80, 80, 0.8);
    color: #ff9696;
    box-shadow: 0 0 20px rgba(255, 80, 80, 0.4);
    position: relative;
    z-index: 1;
}

.quiz-round-btn[data-rounds]:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

/* Кнопки на стартовом экране — в ряд по центру */
.quiz-start-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0;
}

.quiz-start-actions .quiz-action-btn,
.quiz-start-actions .quiz-top-btn {
    margin-top: 0;
}

/* ============================================
   AUTH SCREEN
   ============================================ */

.quiz-auth-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: var(--interactive-control-width);
    margin: 0 auto;
    padding-top: 0.25rem;
    text-align: center;
}

.quiz-auth-screen .event-auth-actions {
    margin-top: 0.25rem;
}

.quiz-auth-screen[hidden] {
    display: none;
}

.quiz-auth-button[aria-disabled="true"] {
    opacity: 0.88;
}

.quiz-auth-button-icon {
    width: 1.05em;
    height: 1.05em;
    flex: none;
    fill: currentColor;
}

.quiz-auth-back {
    color: rgba(255, 255, 255, 0.62);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.quiz-auth-back:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.quiz-auth-back:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

.quiz-auth-notice {
    color: rgba(255, 255, 255, 0.55);
}

.quiz-auth-notice a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .quiz-round-btn[data-rounds]:active,
    .quiz-auth-back:active {
        transform: none;
    }

    .quiz-auth-back {
        transition: none;
    }
}

@media (max-width: 600px) {
    .quiz-auth-screen {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* ---- inlined: quiz/quiz-game.css ---- */
/* ============================================
   QUIZ GAME SCREEN
   Progress bar, round info, punch block, attempts, options, feedback
   ============================================ */

/* Progress Bar */
.quiz-progress-bar-wrap {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #d4a0ff);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

/* Round Info */
.quiz-round-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.quiz-round-info span {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.05em;
}

#quiz-score-label {
    font-family: var(--font-display), sans-serif;
    font-size: 1rem;
    color: rgba(212, 160, 255, 0.9);
}

/* Punch Block */
.quiz-punch-block {
    position: relative;
    text-align: center;
    padding: 0.75rem 1rem 0.5rem;
    margin-bottom: 0.75rem;
}

.quiz-punch-quotes {
    font-family: var(--font-display), sans-serif;
    font-size: 2.5rem;
    color: rgba(180, 80, 255, 0.35);
    line-height: 0.5;
    display: block;
    user-select: none;
    text-align: left;
}

.quiz-punch-quotes--close {
    text-align: right;
    margin-top: 0.15rem;
}

.quiz-punch-line {
    font-family: var(--font-display), sans-serif;
    font-size: clamp(1.1rem, 3.5vw, 1.6rem);
    color: #fff;
    line-height: 1.25;
    margin: 0.15rem 0;
    text-shadow: 0 2px 20px rgba(180, 80, 255, 0.4);
    letter-spacing: 0.02em;
}

/* Attempts */
.quiz-attempts-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.quiz-attempt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: inline-block;
}

.quiz-attempt-dot--active {
    background: rgba(212, 160, 255, 0.8);
    border-color: rgba(212, 160, 255, 0.8);
    box-shadow: 0 0 8px rgba(212, 160, 255, 0.5);
}

.quiz-attempt-dot--used {
    background: rgba(255, 100, 100, 0.5);
    border-color: rgba(255, 100, 100, 0.5);
}

/* Options */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.quiz-option:hover:not(:disabled) {
    background: rgba(180, 80, 255, 0.15);
    border-color: rgba(180, 80, 255, 0.4);
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.2);
}

.quiz-option:active:not(:disabled) {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

.quiz-option:disabled {
    cursor: default;
}

.quiz-option-cover {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
}

.quiz-option-info {
    flex: 1;
    min-width: 0;
}

.quiz-option-title {
    font-family: var(--font-display), sans-serif;
    font-size: 1rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.quiz-option-artist {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Option states */
.quiz-option--correct {
    background: rgba(80, 220, 120, 0.2) !important;
    border-color: rgba(80, 220, 120, 0.6) !important;
    transform: none !important;
}

.quiz-option--correct .quiz-option-title {
    color: #7fffaa;
}

.quiz-option--wrong {
    background: rgba(255, 80, 80, 0.15) !important;
    border-color: rgba(255, 80, 80, 0.4) !important;
    transform: none !important;
}

.quiz-option--wrong .quiz-option-title {
    color: rgba(255, 150, 150, 0.9);
}

.quiz-option--dimmed {
    opacity: 0.35;
}

/* Feedback overlay — поверх всего quiz-wrapper */
.quiz-feedback-overlay {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 20;
    background: rgba(8, 3, 22, 0.96);
}

.quiz-feedback-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.quiz-feedback-text {
    font-family: var(--font-display), sans-serif;
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    color: #fff;
    text-align: center;
    letter-spacing: 0.03em;
    line-height: 1.2;
    padding: 0 2rem;
    text-shadow: 0 2px 20px rgba(180, 80, 255, 0.5);
}

.quiz-feedback-overlay.feedback-correct .quiz-feedback-text {
    color: #7fffaa;
    text-shadow: 0 2px 30px rgba(80, 220, 120, 0.6);
}

.quiz-feedback-overlay.feedback-second .quiz-feedback-text {
    color: #ffd97d;
    text-shadow: 0 2px 30px rgba(255, 200, 50, 0.5);
}

.quiz-feedback-overlay.feedback-wrong .quiz-feedback-text {
    color: #ff9696;
    text-shadow: 0 2px 30px rgba(255, 80, 80, 0.5);
}

@media (prefers-reduced-motion: reduce) {
    .quiz-option:active:not(:disabled) {
        transform: none;
    }
}

/* ---- inlined: quiz/quiz-result.css ---- */
/* ============================================
   QUIZ RESULT SCREEN
   Результаты, статистика, кнопки
   ============================================ */

.quiz-result-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.quiz-result-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    padding-bottom: 0.5rem;
}

.quiz-result-score-wrap {
    text-align: left;
    min-width: 0;
}

.quiz-result-score-label {
    display: block;
    font-family: var(--font-primary), sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.quiz-result-score-row {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
}

.quiz-result-score {
    font-family: var(--font-display), sans-serif;
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    line-height: 1;
    background: linear-gradient(135deg, #fff 0%, #d4a0ff 60%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 0;
}

.quiz-result-score-max {
    font-family: var(--font-display), sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.35);
    align-self: flex-end;
    padding-bottom: 0.2rem;
    white-space: nowrap;
}

.quiz-result-phrase {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin: 0;
    padding: 0.6rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.quiz-result-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quiz-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.15rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.5rem 0.5rem;
    flex: 1;
    min-width: 60px;
}

.quiz-stat-item--correct {
    background: rgba(80, 220, 120, 0.1);
    border-color: rgba(80, 220, 120, 0.3);
}

.quiz-stat-item--correct .quiz-stat-num {
    color: #7fffaa;
}

.quiz-stat-item--second {
    background: rgba(255, 200, 50, 0.1);
    border-color: rgba(255, 200, 50, 0.3);
}

.quiz-stat-item--second .quiz-stat-num {
    color: #ffd97d;
}

.quiz-stat-item--wrong {
    background: rgba(255, 80, 80, 0.1);
    border-color: rgba(255, 80, 80, 0.3);
}

.quiz-stat-item--wrong .quiz-stat-num {
    color: #ff9696;
}

.quiz-stat-num {
    font-family: var(--font-display), sans-serif;
    font-size: 1.4rem;
    color: #d4a0ff;
    line-height: 1;
    display: block;
    width: 100%;
    text-align: center;
}

.quiz-stat-lbl {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    line-height: 1.3;
    display: block;
    width: 100%;
}

.quiz-restart-btn {
    width: 100%;
    text-align: center;
    margin-top: 0.25rem;
}

.quiz-result-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Кнопки на экране результата — в ряд */
.quiz-result-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.quiz-result-actions .quiz-action-btn,
.quiz-result-actions .quiz-top-btn {
    margin-top: 0;
}

/* Mobile result */
@media (max-width: 600px) {
    .quiz-result-layout {
        grid-template-columns: 1fr;
    }
}

/* ---- inlined: quiz/quiz-leaderboard.css ---- */
/* ============================================
   QUIZ LEADERBOARD
   Таблица лидеров, табы, строки, toast-уведомления
   ============================================ */

.quiz-leaderboard {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 0.85rem;
    opacity: 0;
    animation: quiz-lb-fadein 0.4s ease 0.2s both;
    overflow: hidden;
    min-width: 0;
}

.quiz-leaderboard--ready {
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-leaderboard-title {
    font-family: var(--font-display), sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 0.6rem;
}

/* Tabs */
.quiz-lb-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.quiz-lb-tabs::-webkit-scrollbar {
    display: none;
}

.quiz-lb-tab {
    font-family: var(--font-display), sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    white-space: nowrap;
    min-width: fit-content;
}

.quiz-lb-tab:hover {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

.quiz-lb-tab.active {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
    color: #d4a0ff;
}

.quiz-lb-tab:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

.quiz-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    overflow: hidden;
}

/* Анимации */
@keyframes quiz-lb-fadein {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes quiz-lb-fadeout {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

@keyframes quiz-lb-row-in {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.quiz-leaderboard-list--animating {
    animation: quiz-lb-fadein 0.28s ease both;
    will-change: opacity, transform;
}

.quiz-leaderboard-list--leaving {
    animation: quiz-lb-fadeout 0.18s ease both;
    pointer-events: none;
    will-change: opacity, transform;
}

.quiz-lb-row {
    opacity: 0;
    animation: quiz-lb-row-in 0.35s ease both;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
    min-width: 0;
    overflow: hidden;
}

.quiz-lb-row--me {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
    position: relative;
    z-index: 1;
}

.quiz-lb-row--separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.2rem 0;
    border: none;
    padding: 0;
    animation: quiz-lb-fadein 0.3s ease both;
    transform: none;
}

.quiz-lb-rank {
    font-family: var(--font-display), sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.3);
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.quiz-lb-row--me .quiz-lb-rank {
    color: #d4a0ff;
}

.quiz-lb-score {
    font-family: var(--font-display), sans-serif;
    font-size: 1rem;
    color: #fff;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quiz-lb-row--me .quiz-lb-score {
    color: #d4a0ff;
}

.quiz-lb-meta {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
}

.quiz-lb-row--me .quiz-lb-meta {
    color: rgba(212, 160, 255, 0.7);
}

/* Кнопка удаления записи (только для админа) */
.quiz-lb-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255, 80, 80, 0.3);
    background: rgba(255, 80, 80, 0.08);
    color: rgba(255, 100, 100, 0.6);
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: 0.25rem;
}

.quiz-lb-delete-btn:hover {
    background: rgba(255, 80, 80, 0.25);
    border-color: rgba(255, 80, 80, 0.7);
    color: #ff6464;
    transform: scale(1.15);
}

/* Toast-уведомления об удалении (стек) */
.quiz-lb-toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10100;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.6rem;
    align-items: center;
    pointer-events: none;
}

.quiz-lb-toast {
    background: rgba(18, 10, 30, 0.96);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 16px;
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 280px;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(168, 85, 247, 0.15);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    position: relative;
}

.quiz-lb-toast--visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.quiz-lb-toast--hiding {
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.quiz-lb-toast-body {
    flex: 1;
    min-width: 0;
}

.quiz-lb-toast-title {
    font-family: var(--font-display), sans-serif;
    font-size: 0.85rem;
    color: #fff;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
}

.quiz-lb-toast-sub {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
}

.quiz-lb-toast-restore {
    font-family: var(--font-display), sans-serif;
    font-size: 0.78rem;
    color: #d4a0ff;
    background: rgba(168, 85, 247, 0.18);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.quiz-lb-toast-restore:hover {
    background: rgba(168, 85, 247, 0.35);
    border-color: rgba(168, 85, 247, 0.7);
    color: #fff;
}

/* Прогресс-бар таймера внутри toast */
.quiz-lb-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 16px 16px;
    background: linear-gradient(90deg, #a855f7, #d4a0ff);
    width: 100%;
    transform-origin: left;
    animation: quiz-toast-progress 30s linear forwards;
}

@keyframes quiz-toast-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .quiz-lb-tab:active {
        transform: none;
    }

    .quiz-leaderboard,
    .quiz-leaderboard-list--animating,
    .quiz-leaderboard-list--leaving,
    .quiz-lb-row,
    .quiz-lb-row--separator {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .quiz-leaderboard--ready {
        transition: none;
    }

    .quiz-lb-toast-progress {
        animation: none;
    }
}

/* ---- inlined: quiz/quiz-top.css ---- */
/* ============================================
   QUIZ TOP SCREEN - NEW TWO COLUMN LAYOUT
   Экран топов с двухколоночным дизайном
   ============================================ */

.quiz-top-screen {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 0.5rem;
}

/* Кнопка назад */
.quiz-top-back-btn {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    align-self: flex-start;
    transition: color 0.2s ease;
}

.quiz-top-back-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Two column layout */
.quiz-top-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Left column - User stats */
.quiz-top-left {
    display: flex;
    flex-direction: column;
}

.quiz-top-user-stats {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    cursor: default;
}

.quiz-top-user-stats:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.15);
}

/* Right column - Leaderboards */
.quiz-top-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    overflow: hidden;
}

/* Section titles */
.quiz-top-section-title {
    font-family: var(--font-display), sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 1rem 0;
}

/* Tabs for leaderboard categories */
.quiz-top-tabs {
    display: grid;
    grid-template-columns: 0.6fr 0.6fr 0.6fr 1.2fr;
    gap: 0.5rem;
    min-width: 0;
}

.quiz-top-tab {
    font-family: var(--font-display), sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.6rem 0.4rem;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.quiz-top-tab:hover {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.quiz-top-tab.active {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
    color: #d4a0ff;
}

/* Leaderboard wrapper with smooth height transitions */
.quiz-top-leaderboard-wrap {
    position: relative;
    overflow: hidden;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

/* Leaderboard list */
.quiz-top-lb-list {
    min-width: 0;
    overflow-x: hidden;
}

.quiz-top-lb-list.fading .quiz-lb-row,
.quiz-top-lb-list.fading .quiz-top-track-row,
.quiz-top-lb-list.fading .quiz-top-empty {
    animation: quiz-lb-row-out 0.3s ease forwards !important;
}

@keyframes quiz-lb-row-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}
.quiz-top-records-block,
.quiz-top-totals-block,
.quiz-top-tracks-block {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.quiz-top-records-title,
.quiz-top-totals-title,
.quiz-top-tracks-title {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

/* Мои рекорды */
.quiz-top-records {
    display: flex;
    gap: 0.6rem;
}

.quiz-top-record-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.6rem 0.4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.quiz-top-record-rounds {
    font-family: var(--font-display), sans-serif;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1;
}

.quiz-top-record-score {
    font-family: var(--font-display), sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.25);
    line-height: 1;
}

.quiz-top-record-score--set {
    color: #d4a0ff;
    text-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.quiz-top-record-label {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
}

/* Суммарная статистика */
.quiz-top-totals {
    display: flex;
    gap: 0.6rem;
}

.quiz-top-total-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.55rem 0.4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.quiz-top-total--correct { border-color: rgba(80, 220, 120, 0.2); }
.quiz-top-total--second  { border-color: rgba(255, 200, 50, 0.2); }
.quiz-top-total--wrong   { border-color: rgba(255, 80, 80, 0.2); }

.quiz-top-total-num {
    font-family: var(--font-display), sans-serif;
    font-size: 1.3rem;
    line-height: 1;
}

.quiz-top-total--correct .quiz-top-total-num { color: #7fffaa; }
.quiz-top-total--second  .quiz-top-total-num { color: #ffd97d; }
.quiz-top-total--wrong   .quiz-top-total-num { color: #ff9696; }

.quiz-top-total-lbl {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

/* Leaderboard list */
.quiz-top-lb-list {
    transition: opacity 0.25s ease;
    min-width: 0;
    overflow-x: hidden;
}

.quiz-top-lb-list.fading {
    opacity: 0.3;
    pointer-events: none;
}

/* User stats blocks */
.quiz-top-track-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.quiz-top-track-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
    animation: quiz-track-row-in 0.35s ease both;
}

@keyframes quiz-track-row-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.quiz-top-track-rank {
    font-family: var(--font-display), sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    min-width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.quiz-top-track-cover {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.quiz-top-track-info {
    flex: 1;
    min-width: 0;
}

.quiz-top-track-title {
    font-family: var(--font-display), sans-serif;
    font-size: 0.78rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.quiz-top-track-artist {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.quiz-top-track-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
    flex-shrink: 0;
}

.quiz-top-track-ms {
    font-family: var(--font-display), sans-serif;
    font-size: 0.8rem;
    color: #d4a0ff;
    letter-spacing: 0.02em;
    line-height: 1;
}

.quiz-top-track-attempts {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}

.quiz-top-loading,
.quiz-top-empty {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    padding: 1.25rem 0;
    letter-spacing: 0.05em;
    opacity: 0;
    animation: quiz-lb-row-in 0.35s ease 0.1s both;
}

/* Responsive */
@media (max-width: 1024px) {
    .quiz-top-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .quiz-top-left {
        order: 2;
    }

    .quiz-top-right {
        order: 1;
    }
}

@media (max-width: 768px) {
    .quiz-top-records,
    .quiz-top-totals {
        flex-direction: column;
    }

    .quiz-top-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quiz-top-tab {
        font-size: 0.65rem;
        padding: 0.5rem 0.3rem;
    }
}

/* ---- inlined: quiz/quiz-responsive.css ---- */
/* ============================================
   QUIZ RESPONSIVE STYLES
   Мобильные и адаптивные стили
   ============================================ */

/* Mobile */
@media (max-width: 768px) {
    .quiz-wrapper {
        padding: 2rem 1.1rem;
        border-radius: 20px;
    }

    .quiz-rounds-select {
        text-align: center;
    }

    .quiz-rounds-btns {
        gap: 0.5rem;
        justify-content: center;
    }

    .quiz-round-btn {
        font-size: 1.2rem;
        padding: 0.5rem 1.1rem;
        min-width: 60px;
    }

    .quiz-option {
        padding: 0.75rem 0.85rem;
        gap: 0.75rem;
    }

    .quiz-option-cover {
        width: 44px;
        height: 44px;
    }

    .quiz-result-stats {
        gap: 0.6rem;
    }

    .quiz-stat-item {
        padding: 0.6rem 0.9rem;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .quiz-punch-line {
        font-size: clamp(1.1rem, 5vw, 1.5rem);
    }

    .quiz-result-stats {
        flex-direction: row;
        justify-content: center;
    }

    .quiz-top-records,
    .quiz-top-totals {
        gap: 0.5rem;
    }
    
    .quiz-top-record-item,
    .quiz-top-total-item {
        padding: 0.6rem 0.35rem;
    }
    
    .quiz-top-total-num {
        font-size: 1.25rem;
    }
    
    .quiz-top-record-rounds {
        font-size: 1.3rem;
    }
}

/* На узких экранах — табы 2×2 */
@media (max-width: 420px) {
    .quiz-top-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .quiz-top-tab {
        font-size: 0.78rem;
        padding: 0.45rem 0.5rem;
        white-space: normal;
        text-overflow: unset;
        overflow: visible;
        line-height: 1.2;
    }
}

/* ---- inlined: ai-widget.css ---- */
/* ============================================
   LIVE CHAT WIDGET: LOVER & AI ASSISTANT
   ============================================ */

.ai-widget {
    position: fixed;
    inset: 0;
    /* Выше точек навигации (1000), ниже модалок (9000). */
    z-index: 1100;
    pointer-events: none;
}

.ai-widget[hidden],
.ai-widget__panel[hidden],
.ai-widget__toast[hidden],
.ai-widget__lightbox[hidden],
.ai-widget__fab-unread[hidden] {
    display: none;
}

/* ---------- scroll lock (mobile fullscreen) ---------- */

html.ai-widget-lock,
html.ai-widget-lock body {
    overflow: hidden;
}

/* ---------- keyframe animations ---------- */

@keyframes ai-online-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
    }
}

@keyframes ai-badge-pop {
    0% {
        transform: scale(0.4);
        opacity: 0;
    }
    65% {
        transform: scale(1.14);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes ai-msg-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ai-typing-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ---------- floating circle launcher ---------- */

.ai-widget__fab {
    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.16), transparent 60%),
        rgba(14, 14, 18, 0.88);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    color: #ffffff;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
    transition:
        opacity 0.26s ease,
        visibility 0.26s linear,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.ai-widget.is-visible .ai-widget__fab {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ai-widget.is-visible .ai-widget__fab:hover {
    transform: scale(1.06);
    border-color: rgba(255, 255, 255, 0.48);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.65),
        0 0 22px rgba(255, 255, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.ai-widget.is-visible .ai-widget__fab:active {
    transform: scale(0.95);
}

.ai-widget__fab:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 3px;
}

.ai-widget.is-open .ai-widget__fab {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.65);
    pointer-events: none;
}

.ai-widget__fab-label {
    font-family: var(--font-primary);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    color: #ffffff;
    user-select: none;
    -webkit-user-select: none;
}

.ai-widget__fab-online {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid #0e0e12;
    background: #4ade80;
    animation: ai-online-pulse 2.4s ease-out infinite;
    pointer-events: none;
}

.ai-widget__fab-unread {
    position: absolute;
    top: -3px;
    right: -3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border: 2px solid #0e0e12;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff4757, #ff2e4d);
    color: #ffffff;
    font-family: var(--font-primary);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(255, 46, 77, 0.5);
    animation: ai-badge-pop 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

/* ---------- notification toast ---------- */

.ai-widget__toast {
    position: fixed;
    right: max(54px, calc(env(safe-area-inset-right) + 30px));
    bottom: max(92px, calc(env(safe-area-inset-bottom) + 68px));
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(352px, calc(100vw - 74px));
    padding: 6px 10px 6px 6px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px 18px 6px 18px;
    background: rgba(16, 16, 20, 0.94);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.58);
    pointer-events: none;
    transform-origin: bottom right;
    opacity: 0;
    transform: translateY(8px) scale(0.92);
    transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-widget__toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ai-widget.is-open .ai-widget__toast {
    opacity: 0;
    pointer-events: none;
}

.ai-widget__toast-body {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 5px 4px 5px 6px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.ai-widget__toast-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.1);
}

.ai-widget__toast-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ai-widget__toast-copy {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ai-widget__toast-sender {
    font-family: var(--font-primary);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.94);
}

.ai-widget__toast-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: pretty;
    font-family: var(--font-body);
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.8);
}

.ai-widget__toast-close {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.ai-widget__toast-close svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.ai-widget__toast-close:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

/* ---------- panel ---------- */

.ai-widget__panel {
    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: min(430px, calc(100vw - 32px));
    max-height: min(76vh, 660px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    background:
        radial-gradient(circle at 85% 0%, rgba(255, 255, 255, 0.06), transparent 46%),
        rgba(12, 12, 15, 0.94);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transform-origin: bottom right;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.92);
    pointer-events: none;
    transition:
        opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.32s linear;
}

.ai-widget.is-open .ai-widget__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ai-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex: 0 0 auto;
    padding: 0.82rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.ai-widget__heading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.ai-widget__header-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.ai-widget__header-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ai-widget__header-online {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #101014;
    background: #4ade80;
}

.ai-widget__header-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ai-widget__title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.ai-widget__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.92rem;
    letter-spacing: 0.03em;
    color: var(--text-primary);
    line-height: 1.1;
}

.ai-widget__beta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 15px;
    padding: 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-family: var(--font-primary);
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    color: rgba(255, 255, 255, 0.68);
    text-transform: uppercase;
    user-select: none;
}

.ai-widget__subtitle {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.72rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.56);
}

.ai-widget__panel.is-typing .ai-widget__subtitle-text {
    color: #86efac;
}

.ai-widget__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ai-widget__close svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.ai-widget__close:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.34);
    color: var(--text-primary);
}

.ai-widget__close:focus-visible,
.ai-widget__link:focus-visible,
.ai-widget__linkcard:focus-visible,
.ai-widget__suggestion:focus-visible,
.ai-widget__handoff-btn:focus-visible,
.ai-widget__copy:focus-visible,
.ai-widget__media-open:focus-visible,
.ai-widget__media-download:focus-visible,
.ai-widget__video-preview:focus-visible,
.ai-widget__send:focus-visible,
.ai-widget__toast-body:focus-visible,
.ai-widget__toast-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

/* ---------- dialog log ---------- */

.ai-widget__log {
    flex: 1 1 auto;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.78rem;
    padding: 1rem 0.95rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    user-select: text;
    -webkit-user-select: text;
}

.ai-widget__log::-webkit-scrollbar {
    display: none;
}

.ai-widget__message {
    display: flex;
    flex-direction: column;
    gap: 0.48rem;
    max-width: 100%;
    animation: ai-msg-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ai-widget__message--user {
    align-items: flex-end;
}

.ai-widget__message--assistant {
    align-items: flex-start;
}

.ai-widget__incoming-row {
    display: flex;
    align-items: flex-end;
    gap: 0.52rem;
    max-width: 100%;
}

.ai-widget__msg-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    margin-bottom: 2px;
}

.ai-widget__msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ai-widget__bubble {
    position: relative;
    max-width: min(326px, calc(100% - 36px));
    padding: 0.68rem 0.85rem 0.56rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 18px 18px 18px 5px;
    background: rgba(255, 255, 255, 0.055);
}

.ai-widget__bubble--lover {
    border-color: rgba(255, 255, 255, 0.18);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
}

.ai-widget__bubble--user {
    max-width: 84%;
    padding: 0.62rem 0.82rem 0.5rem;
    border-color: rgba(255, 255, 255, 0.22);
    border-radius: 18px 18px 5px 18px;
    background: rgba(255, 255, 255, 0.14);
}

.ai-widget__bubble-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0.28rem;
}

.ai-widget__sender-name {
    font-family: var(--font-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.78);
}

.ai-widget__message--lover .ai-widget__sender-name {
    color: #ffffff;
}

.ai-widget__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.ai-widget__bubble:hover .ai-widget__copy,
.ai-widget__copy:focus-visible,
.ai-widget__copy.is-copied {
    opacity: 1;
}

.ai-widget__copy:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.ai-widget__copy.is-copied {
    color: #86efac;
}

.ai-widget__copy-icon {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ai-widget__text {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: var(--font-body);
    font-size: 0.87rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.94);
}

.ai-widget__text + .ai-widget__text,
.ai-widget__text + .ai-widget__list,
.ai-widget__list + .ai-widget__text {
    margin-top: 0.5rem;
}

.ai-widget__text--error {
    color: #ff9c9c;
}

.ai-widget__list {
    margin: 0;
    padding-left: 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.34rem;
    font-family: var(--font-body);
    font-size: 0.86rem;
    line-height: 1.46;
    color: rgba(255, 255, 255, 0.93);
}

.ai-widget__list-item::marker {
    color: rgba(255, 255, 255, 0.55);
}

.ai-widget__meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 0.34rem;
}

.ai-widget__time {
    font-size: 0.65rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.4);
}

.ai-widget__sent-icon {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: rgba(255, 255, 255, 0.62);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- thinking ---------- */

.ai-widget__thinking {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.68rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 18px 18px 18px 5px;
    background: rgba(255, 255, 255, 0.055);
}

.ai-widget__thinking-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    animation: ai-typing-bounce 1.2s ease-in-out infinite;
}

.ai-widget__thinking-dot:nth-child(3) {
    animation-delay: 0.15s;
}

.ai-widget__thinking-dot:nth-child(4) {
    animation-delay: 0.3s;
}

/* ---------- rich cards, links, images, video ---------- */

.ai-widget__linkcard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 0.58rem;
    padding: 0.65rem 0.78rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ai-widget__linkcard:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

.ai-widget__linkcard-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ai-widget__linkcard-title {
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.25;
}

.ai-widget__linkcard-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.66);
    line-height: 1.3;
}

.ai-widget__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
    margin-top: 0.62rem;
}

.ai-widget__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 0.5rem 0.72rem;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        color 0.18s ease,
        transform 0.16s ease;
}

.ai-widget__link--full {
    grid-column: 1 / -1;
}

.ai-widget__link--half {
    grid-column: span 1;
}

.ai-widget__link-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-widget__link:active {
    transform: scale(0.98);
}

.ai-widget__link--primary,
.ai-widget__link--tone-primary {
    background: #ffffff;
    color: #0d0d10;
    border: 1px solid #ffffff;
}

.ai-widget__link--primary:hover,
.ai-widget__link--tone-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.ai-widget__link--secondary,
.ai-widget__link--tone-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.ai-widget__link--secondary:hover,
.ai-widget__link--tone-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.34);
    transform: translateY(-1px);
}

.ai-widget__link--tone-soft {
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.ai-widget__link--tone-soft:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-widget__link--tone-accent {
    background: rgba(168, 85, 247, 0.17);
    color: #f3e8ff;
    border: 1px solid rgba(192, 132, 252, 0.42);
}

.ai-widget__link--tone-accent:hover {
    background: rgba(168, 85, 247, 0.28);
    border-color: rgba(216, 180, 254, 0.65);
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.22);
    transform: translateY(-1px);
}

/* Брендовые glass-тоны для соцсетей и музыкальных площадок */
.ai-widget__link--tone-telegram {
    background: rgba(34, 158, 217, 0.16);
    color: #bae6fd;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.ai-widget__link--tone-telegram:hover {
    background: rgba(34, 158, 217, 0.28);
    border-color: rgba(125, 211, 252, 0.68);
    box-shadow: 0 6px 18px rgba(34, 158, 217, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-widget__link--tone-vk {
    background: rgba(0, 119, 255, 0.17);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.44);
}

.ai-widget__link--tone-vk:hover {
    background: rgba(0, 119, 255, 0.28);
    border-color: rgba(96, 165, 250, 0.72);
    box-shadow: 0 6px 18px rgba(0, 119, 255, 0.24);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-widget__link--tone-youtube {
    background: rgba(255, 45, 45, 0.16);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.42);
}

.ai-widget__link--tone-youtube:hover {
    background: rgba(255, 45, 45, 0.27);
    border-color: rgba(252, 165, 165, 0.7);
    box-shadow: 0 6px 18px rgba(255, 45, 45, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-widget__link--tone-spotify {
    background: rgba(29, 185, 84, 0.16);
    color: #bbf7d0;
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.ai-widget__link--tone-spotify:hover {
    background: rgba(29, 185, 84, 0.27);
    border-color: rgba(134, 239, 172, 0.68);
    box-shadow: 0 6px 18px rgba(29, 185, 84, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-widget__link--tone-yandex {
    background: rgba(255, 204, 0, 0.14);
    color: #fef08a;
    border: 1px solid rgba(250, 204, 21, 0.4);
}

.ai-widget__link--tone-yandex:hover {
    background: rgba(255, 204, 0, 0.24);
    border-color: rgba(253, 224, 71, 0.68);
    box-shadow: 0 6px 18px rgba(250, 204, 21, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-widget__link--tone-apple {
    background: rgba(250, 36, 60, 0.16);
    color: #fecdd3;
    border: 1px solid rgba(251, 113, 133, 0.42);
}

.ai-widget__link--tone-apple:hover {
    background: rgba(250, 36, 60, 0.27);
    border-color: rgba(253, 164, 175, 0.7);
    box-shadow: 0 6px 18px rgba(250, 36, 60, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-widget__link--tone-tiktok {
    background: linear-gradient(135deg, rgba(37, 244, 238, 0.14), rgba(254, 44, 85, 0.16));
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.ai-widget__link--tone-tiktok:hover {
    background: linear-gradient(135deg, rgba(37, 244, 238, 0.24), rgba(254, 44, 85, 0.26));
    border-color: rgba(255, 255, 255, 0.48);
    box-shadow: 0 6px 18px rgba(254, 44, 85, 0.18);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-widget__link--tone-instagram {
    background: linear-gradient(135deg, rgba(245, 133, 41, 0.16), rgba(221, 42, 123, 0.17), rgba(129, 52, 175, 0.16));
    color: #fce7f3;
    border: 1px solid rgba(244, 114, 182, 0.4);
}

.ai-widget__link--tone-instagram:hover {
    background: linear-gradient(135deg, rgba(245, 133, 41, 0.26), rgba(221, 42, 123, 0.28), rgba(129, 52, 175, 0.26));
    border-color: rgba(249, 168, 212, 0.68);
    box-shadow: 0 6px 18px rgba(221, 42, 123, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-widget__link--tone-soundcloud {
    background: rgba(255, 85, 0, 0.16);
    color: #fed7aa;
    border: 1px solid rgba(251, 146, 60, 0.42);
}

.ai-widget__link--tone-soundcloud:hover {
    background: rgba(255, 85, 0, 0.27);
    border-color: rgba(253, 186, 116, 0.7);
    box-shadow: 0 6px 18px rgba(255, 85, 0, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-widget__brand-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ai-widget__btn-arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Компактная мини-карточка обложки трека (для поиска текста и релизов) */
.ai-widget__cover-card {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.6rem;
    padding: 0.44rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.ai-widget__cover-card:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.24);
}

.ai-widget__cover-card-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: zoom-in;
}

.ai-widget__cover-thumb {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.3);
}

.ai-widget__cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.24s ease;
}

.ai-widget__cover-card:hover .ai-widget__cover-thumb img {
    transform: scale(1.05);
}

.ai-widget__cover-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ai-widget__cover-title {
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-widget__cover-sub {
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-widget__cover-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.ai-widget__cover-download:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.36);
    color: #ffffff;
}

.ai-widget__images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 0.6rem;
}

.ai-widget__images--single {
    grid-template-columns: minmax(0, 1fr);
}

.ai-widget__figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ai-widget__media {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
}

.ai-widget__media-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.ai-widget__image {
    display: block;
    width: 100%;
    max-height: 210px;
    object-fit: cover;
    transition: transform 0.28s ease;
}

.ai-widget__media:hover .ai-widget__image {
    transform: scale(1.03);
}

.ai-widget__media-download {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(12, 12, 15, 0.78);
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.18s ease, background-color 0.18s ease;
}

.ai-widget__media:hover .ai-widget__media-download,
.ai-widget__media-download:focus-visible {
    opacity: 1;
}

.ai-widget__media-download:hover {
    background: rgba(12, 12, 15, 0.95);
}

.ai-widget__download-icon {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ai-widget__caption {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.56);
    line-height: 1.3;
}

.ai-widget__video-card {
    margin: 0.6rem 0 0;
}

.ai-widget__video-frame {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 16 / 9;
    background: #000;
}

.ai-widget__video-preview {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.ai-widget__video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.ai-widget__video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 15, 18, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.ai-widget__video-play svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.ai-widget__video-embed {
    width: 100%;
    height: 100%;
    border: 0;
}

.ai-widget__video-title {
    margin-top: 0.3rem;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.68);
}

.ai-widget__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    padding-left: 36px;
}

.ai-widget__suggestion {
    padding: 0.4rem 0.68rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-body);
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.ai-widget__suggestion:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-widget__suggestion--lover {
    position: relative;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.32);
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.13) 0%,
        rgba(203, 165, 223, 0.22) 50%,
        rgba(255, 255, 255, 0.13) 100%
    );
    background-size: 200% 100%;
    color: #ffffff;
    font-weight: 500;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 4px 14px rgba(0, 0, 0, 0.22);
    animation: ai-lover-pill-flow 5.5s ease-in-out infinite;
}

.ai-widget__suggestion--lover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 22%,
        rgba(255, 255, 255, 0.24) 50%,
        transparent 78%
    );
    transform: translateX(-120%);
    animation: ai-lover-pill-sheen 4.8s ease-in-out infinite;
    pointer-events: none;
}

.ai-widget__suggestion--lover:hover {
    border-color: rgba(255, 255, 255, 0.52);
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(203, 165, 223, 0.3) 50%,
        rgba(255, 255, 255, 0.2) 100%
    );
    background-size: 200% 100%;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        0 6px 18px rgba(203, 165, 223, 0.22);
}

@keyframes ai-lover-pill-flow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes ai-lover-pill-sheen {
    0%, 58% {
        transform: translateX(-120%);
    }
    82%, 100% {
        transform: translateX(120%);
    }
}

.ai-widget__handoff {
    display: flex;
    flex-wrap: wrap;
    padding-left: 36px;
}

.ai-widget__handoff-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.38rem 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-body);
    font-size: 0.74rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.16s ease;
}

.ai-widget__handoff-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.34);
    color: #ffffff;
}

.ai-widget__handoff-btn:active {
    transform: scale(0.97);
}

.ai-widget__handoff-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ai-widget__suggestions.is-dismissing,
.ai-widget__handoff.is-dismissing {
    overflow: hidden;
    pointer-events: none;
    will-change: opacity, max-height, transform;
    transition:
        opacity 0.2s ease,
        max-height 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.2s ease,
        margin 0.24s ease;
}

.ai-widget__suggestions.is-collapsed,
.ai-widget__handoff.is-collapsed {
    opacity: 0;
    max-height: 0 !important;
    margin-top: -0.48rem;
    transform: translateY(-4px);
}

.ai-widget__note {
    margin: 0.2rem auto;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.5);
}

.ai-widget__status {
    margin: 0;
    padding: 0 1rem;
    min-height: 0;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ---------- composer ---------- */

.ai-widget__form {
    flex: 0 0 auto;
    padding: 0.62rem 0.85rem 0.72rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.ai-widget__composer {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.42rem 0.45rem 0.42rem 0.82rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.ai-widget__composer:focus-within {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.07);
}

.ai-widget__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 28px;
    max-height: 124px;
    padding: 0.28rem 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    line-height: 1.4;
    resize: none;
    overflow-y: hidden;
    outline: none;
    transition: height 0.18s cubic-bezier(0.22, 1, 0.36, 1);
    user-select: text;
    -webkit-user-select: text;
    -webkit-user-modify: read-write;
}

.ai-widget__input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

/* iOS Safari zoom prevention */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    .ai-widget__input {
        font-size: 16px;
    }
}

.ai-widget__send {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.ai-widget__send svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ai-widget__send .ai-widget__stop-icon {
    display: none;
}

.ai-widget__send.is-busy .ai-widget__send-icon {
    display: none;
}

.ai-widget__send.is-busy .ai-widget__stop-icon {
    display: block;
}

.ai-widget__send:hover:not(.is-cooldown) {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.22);
}

.ai-widget__send.is-busy {
    border-color: rgba(255, 120, 120, 0.6);
    background: rgba(255, 90, 90, 0.18);
}

.ai-widget__send.is-cooldown {
    cursor: default;
    opacity: 0.85;
}

.ai-widget__send.is-cooldown::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    pointer-events: none;
    background: conic-gradient(
        rgba(255, 255, 255, 0.75) calc(var(--cooldown-progress, 0) * 360deg),
        rgba(255, 255, 255, 0.1) 0
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
}

.ai-widget__disclaimer {
    margin: 0.42rem 0 0;
    text-align: center;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.36);
}

.ai-widget__visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- lightbox ---------- */

.ai-widget__lightbox {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ai-widget__lightbox.is-open {
    opacity: 1;
}

.ai-widget__lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.ai-widget__lightbox-frame {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 760px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-widget__lightbox-img {
    max-width: 100%;
    max-height: calc(90vh - 56px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    object-fit: contain;
    background: #0d0d10;
}

.ai-widget__lightbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #ffffff;
    font-size: 0.84rem;
}

.ai-widget__lightbox-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.ai-widget__lightbox-download,
.ai-widget__lightbox-close {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
}

/* ---------- mobile: fullscreen modal ---------- */

@media (max-width: 768px) {
    .ai-widget__fab {
        right: max(18px, env(safe-area-inset-right));
        bottom: max(18px, env(safe-area-inset-bottom));
        width: 54px;
        height: 54px;
    }

    .ai-widget__toast {
        right: max(46px, calc(env(safe-area-inset-right) + 28px));
        bottom: max(84px, calc(env(safe-area-inset-bottom) + 66px));
        max-width: calc(100vw - 64px);
    }

    .ai-widget__panel {
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
        opacity: 1;
        transform: translateY(100%);
    }

    .ai-widget.is-open .ai-widget__panel {
        opacity: 1;
        transform: translateY(0);
    }

    .ai-widget__form {
        padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
    }

    .ai-widget__copy,
    .ai-widget__media-download {
        opacity: 1;
    }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .ai-widget,
    .ai-widget__fab,
    .ai-widget__toast,
    .ai-widget__panel,
    .ai-widget__close,
    .ai-widget__link,
    .ai-widget__linkcard,
    .ai-widget__suggestion,
    .ai-widget__suggestion--lover,
    .ai-widget__suggestion--lover::after,
    .ai-widget__handoff-btn,
    .ai-widget__suggestions.is-dismissing,
    .ai-widget__handoff.is-dismissing,
    .ai-widget__copy,
    .ai-widget__composer,
    .ai-widget__input,
    .ai-widget__media-download,
    .ai-widget__image,
    .ai-widget__video-thumb,
    .ai-widget__video-play,
    .ai-widget__send,
    .ai-widget__lightbox {
        transition: none;
        animation: none;
    }

    .ai-widget__fab-online,
    .ai-widget__fab-unread,
    .ai-widget__message,
    .ai-widget__thinking-dot {
        animation: none;
    }

    .ai-widget__thinking-dot {
        opacity: 1;
    }

    .ai-widget__media:hover .ai-widget__image,
    .ai-widget__video-preview:hover .ai-widget__video-thumb {
        transform: none;
    }
}

/* ---------- Голосовое сообщение (синхронизировано с static/styles/ai-widget.css) ---------- */

.ai-widget__message--grouped {
    margin-top: -0.24rem;
}

.ai-widget__msg-avatar-spacer {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.ai-widget__bubble--voice {
    min-width: 248px;
    max-width: min(304px, calc(100% - 36px));
    padding: 10px 14px 9px 11px;
    border-color: rgba(255, 255, 255, 0.14);
    border-radius: 20px 20px 20px 6px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.038));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.22);
}

.ai-widget__bubble--voice .ai-widget__bubble-head {
    margin-bottom: 6px;
}

.ai-widget__voice {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    margin-top: 0;
}

.ai-widget__bubble:not(.ai-widget__bubble--voice) .ai-widget__voice {
    margin-top: 8px;
}

.ai-widget__voice-play {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #0d0d11;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        background-color 0.18s ease,
        transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.18s ease,
        opacity 0.16s ease;
}

.ai-widget__voice-play:hover {
    background: #ffffff;
    transform: scale(1.04);
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.ai-widget__voice-play:active {
    transform: scale(0.95);
}

.ai-widget__voice-play:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.78);
    outline-offset: 2px;
}

.ai-widget__voice.is-loading .ai-widget__voice-play {
    opacity: 0.65;
}

.ai-widget__voice-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.ai-widget__voice-icon--pause {
    display: none;
}

.ai-widget__voice.is-playing .ai-widget__voice-icon--play {
    display: none;
}

.ai-widget__voice.is-playing .ai-widget__voice-icon--pause {
    display: block;
}

.ai-widget__voice-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.ai-widget__voice-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    width: 100%;
    height: 28px;
    padding: 0;
    cursor: pointer;
    touch-action: none;
    user-select: none;
}

.ai-widget__voice-wave:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.55);
    outline-offset: 3px;
    border-radius: 6px;
}

.ai-widget__voice-wave i {
    flex: 1 1 0;
    min-width: 2.5px;
    max-width: 4px;
    min-height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    transition: background-color 0.14s ease;
}

.ai-widget__voice-wave:hover i:not(.is-played) {
    background: rgba(255, 255, 255, 0.34);
}

.ai-widget__voice-wave i.is-played {
    background: #ffffff;
}

.ai-widget__voice-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    line-height: 1;
}

.ai-widget__voice-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ai-widget__voice-dot {
    flex: 0 0 auto;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.65);
    transition: opacity 0.2s ease, transform 0.2s ease, width 0.2s ease, margin 0.2s ease;
}

.ai-widget__voice[data-played="1"] .ai-widget__voice-dot {
    opacity: 0;
    transform: scale(0.4);
    width: 0;
    margin-right: -5px;
}

.ai-widget__voice-time {
    flex: 0 0 auto;
    font-family: var(--font-primary);
    font-size: 0.69rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.56);
}

@media (hover: none) and (pointer: coarse) {
    .ai-widget__voice-play {
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-widget__voice-play,
    .ai-widget__voice-dot,
    .ai-widget__voice-wave i {
        transition: none;
    }
}

/* ---- constellation teaser (главная, «Ивенты») ---- */
/* Вкладка «Созвездие»: глубокое тёмное ночное небо, звёздная карта и живая статистика. */
.constellation-panel {
    position: relative;
    box-sizing: border-box;
    min-height: var(--interactive-panel-min-height);
    overflow: hidden;
    color: #f4f6ff;
    background:
        radial-gradient(circle at 78% 46%, rgba(99, 102, 241, 0.14), transparent 46%),
        radial-gradient(circle at 84% 14%, rgba(129, 140, 248, 0.11), transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(30, 64, 175, 0.13), transparent 48%),
        linear-gradient(160deg, #04050c 0%, #080b18 48%, #03040a 100%);
    border: 1px solid rgba(148, 163, 255, 0.2);
    border-radius: 0 0 28px 28px;
    box-shadow: 0 24px 70px rgba(2, 3, 10, 0.65);
}

.constellation-panel::before {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 11% 22%, rgba(255, 255, 255, 0.65), transparent 100%),
        radial-gradient(1.2px 1.2px at 36% 74%, rgba(199, 210, 254, 0.55), transparent 100%),
        radial-gradient(1.4px 1.4px at 62% 16%, rgba(255, 255, 255, 0.45), transparent 100%),
        radial-gradient(1.1px 1.1px at 87% 58%, rgba(186, 230, 253, 0.5), transparent 100%),
        radial-gradient(1.3px 1.3px at 22% 88%, rgba(255, 255, 255, 0.4), transparent 100%),
        radial-gradient(1px 1px at 51% 44%, rgba(224, 231, 255, 0.45), transparent 100%),
        radial-gradient(1.1px 1.1px at 44% 12%, rgba(254, 243, 199, 0.48), transparent 100%),
        radial-gradient(1px 1px at 73% 84%, rgba(199, 210, 254, 0.38), transparent 100%),
        radial-gradient(1.2px 1.2px at 8% 58%, rgba(255, 255, 255, 0.35), transparent 100%);
    content: "";
    opacity: 0.82;
    pointer-events: none;
}

.constellation-teaser {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: clamp(1.25rem, 3.6vw, 2.75rem);
    width: 100%;
    max-width: calc(var(--interactive-content-width) + 260px);
    min-height: var(--interactive-panel-min-height);
    margin: 0 auto;
    padding: var(--interactive-panel-padding);
}

.constellation-copy {
    min-width: 0;
    text-align: left;
}

.constellation-eyebrow {
    margin: 0 0 0.7rem;
    color: rgba(199, 182, 255, 0.72);
    font-family: var(--font-display), sans-serif;
    font-size: clamp(0.62rem, 1.3vw, 0.7rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.constellation-title {
    margin: 0;
    color: #ffffff;
    font-family: var(--font-display), sans-serif;
    font-size: clamp(1.35rem, 3.1vw, 2.25rem);
    letter-spacing: 0.015em;
    line-height: 1.08;
    text-shadow: 0 0 28px rgba(167, 139, 250, 0.32);
}

.constellation-lead {
    max-width: 46ch;
    margin: 0.9rem 0 0;
    color: rgba(240, 236, 255, 0.74);
    font-family: var(--font-primary), sans-serif;
    font-size: clamp(0.92rem, 1.55vw, 1.02rem);
    line-height: 1.55;
}

.constellation-stats {
    display: block;
    width: fit-content;
    margin: 1.35rem 0 0;
    padding: 0.5rem 0.95rem;
    color: #ece5ff;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.28);
    border-radius: 999px;
    font-family: var(--font-primary), sans-serif;
    font-size: clamp(0.78rem, 1.3vw, 0.86rem);
    letter-spacing: 0.03em;
    line-height: 1.35;
}

.constellation-top-track {
    margin: 0.7rem 0 0;
    color: rgba(214, 204, 255, 0.72);
    font-family: var(--font-primary), sans-serif;
    font-size: clamp(0.78rem, 1.25vw, 0.86rem);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.constellation-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: clamp(1.1rem, 2.4vw, 1.6rem);
    padding: var(--interactive-action-padding);
    color: #0b0716;
    background: linear-gradient(135deg, #e6ecff 0%, #c2b2ff 56%, #a480ff 100%);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(124, 84, 224, 0.34);
    font-family: var(--font-display), sans-serif;
    font-size: var(--interactive-action-size);
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.constellation-cta:hover,
.constellation-cta:focus-visible {
    background: linear-gradient(135deg, #f1f5ff 0%, #cdbcff 56%, #b08cff 100%);
    box-shadow: 0 14px 36px rgba(139, 92, 246, 0.46);
    transform: translateY(-2px);
}

.constellation-cta:focus-visible {
    outline: 2px solid rgba(212, 160, 255, 0.72);
    outline-offset: 3px;
}

.constellation-cta:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.08s;
}

.constellation-note {
    margin: 1rem 0 0;
    color: rgba(200, 190, 230, 0.52);
    font-family: var(--font-primary), sans-serif;
    font-size: clamp(0.68rem, 1.1vw, 0.74rem);
    line-height: 1.45;
}

.constellation-orbit {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.constellation-orbit-art {
    width: min(100%, 360px);
    height: auto;
    overflow: visible;
}

@keyframes constellation-orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes constellation-core-pulse {
    0%, 100% {
        opacity: 0.86;
        transform: scale(0.96);
    }
    50% {
        opacity: 1;
        transform: scale(1.06);
    }
}

@keyframes constellation-star-twinkle {
    0%, 100% { opacity: 0.48; }
    50% { opacity: 1; }
}

.constellation-chart-ring {
    transform-box: fill-box;
    transform-origin: center;
    animation: constellation-orbit-spin 140s linear infinite reverse;
    will-change: transform;
}

.constellation-orbit-rings {
    transform-box: fill-box;
    transform-origin: center;
    animation: constellation-orbit-spin 88s linear infinite;
    will-change: transform;
}

.constellation-core {
    transform-box: fill-box;
    transform-origin: center;
    animation: constellation-core-pulse 4.8s ease-in-out infinite;
    will-change: transform, opacity;
}

.constellation-star {
    transform-box: fill-box;
    transform-origin: center;
    animation: constellation-star-twinkle var(--star-dur, 5.4s) ease-in-out infinite;
    animation-delay: var(--star-delay, 0s);
}

@media (max-width: 900px) {
    .constellation-teaser {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
        text-align: center;
    }

    .constellation-copy {
        text-align: center;
    }

    .constellation-orbit {
        order: -1;
    }

    .constellation-orbit-art {
        width: min(72%, 280px);
    }

    .constellation-lead {
        margin-inline: auto;
    }

    .constellation-stats {
        margin-inline: auto;
    }
}

@media (max-width: 600px) {
    .constellation-panel {
        min-height: 0;
        border-radius: 0 0 20px 20px;
    }

    .constellation-teaser {
        gap: 0.85rem;
        min-height: 0;
        padding: 1.5rem 1.1rem 1.9rem;
    }

    .constellation-orbit-art {
        width: min(64%, 210px);
    }

    .constellation-note {
        margin-top: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .constellation-chart-ring,
    .constellation-orbit-rings,
    .constellation-core,
    .constellation-star {
        animation: none;
    }

    .constellation-cta,
    .constellation-cta:hover,
    .constellation-cta:focus-visible,
    .constellation-cta:active {
        transform: none;
        transition: none;
    }
}
