    /* Стили для страницы аналитики */
    #pageAnalytics {
        padding: 0;
        background: #000;
        touch-action: pan-y pinch-zoom;
    }

    #pageAnalytics [data-allow-swipe-back] {
        pointer-events: auto;
    }

    #pageAnalytics * {
        user-select: none;
        -webkit-user-select: none;
    }

    .analytics-root {
        --bg: #000;
        --card-bg: #1b1919;
        --accent: #FFD700;
        --text: #fff;
        --gap: 16px;
        --panel-padding: 18px;
        margin: 0;
        font-family: 'Roboto', sans-serif;
        background: var(--bg);
        color: var(--text);
        min-height: 100vh;
        overflow-y: auto;
    }

    .analytics-root * {
        box-sizing: border-box;
    }

    /* TAB BAR */
    .tabbar {
        display: flex;
        gap: 10px;
        padding: 12px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin-top: 50px;
        touch-action: pan-x pinch-zoom;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .tabbar::-webkit-scrollbar {
        display: none;
    }

    .tab {
        flex: 0 0 auto;
        width: 200px;
        height: 200px;
        background: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
        position: relative;
        scroll-snap-align: center;
        touch-action: pan-x;
    }

    .tab svg,
    .tab img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 10px;
    }

    /* Активная вкладка */
    .tab[aria-selected="true"]::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 12px;
        box-shadow: 0 0 0 3px var(--accent);
        pointer-events: none;
    }

    /* Индикаторы точки */
    .tab-indicators {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin: 6px 0 12px 0;
    }

    .tab-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #555;
        cursor: pointer;
        transition: background 0.3s;
    }

    .tab-dot.active {
        background: var(--accent);
    }

    /* MAIN CONTAINER */
    .analytics-container {
        padding: var(--gap);
        display: grid;
        gap: var(--gap);
        max-width: 1100px;
        margin: 0 auto;
    }

    /* Панели */
    .panel {
        background: var(--card-bg);
        border-radius: 12px;
        padding: var(--panel-padding);
        display: none;
        color: var(--text);
        min-height: 160px;
    }

    .panel[aria-hidden="false"] {
        display: block;
        animation: fadeIn .16s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(6px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Заголовки */
    .analytics-card-title {
        color: var(--accent);
        margin: 0 0 8px 0;
        font-size: 1rem;
    }

    .month-title {
        font-weight: 700;
        color: var(--accent);
        margin-bottom: 6px;
    }

    .climate-info {
        color: #fff;
        margin-bottom: 8px;
    }

    /* Списки */
    .analytics-ul {
        margin: 8px 0 8px 20px;
        padding: 0;
    }

    .analytics-li {
        margin-bottom: 6px;
        line-height: 1.36;
    }

    .risk-category {
        color: #FFD700;
        font-weight: 700;
        margin-top: 8px;
    }

    .risk-title {
        color: #ff4b4b;
        font-weight: 700;
        margin-top: 12px;
    }

    .risk .analytics-li {
        color: #ff4b4b;
    }

    .rec-title {
        color: #00ff00;
        font-weight: 700;
        margin-top: 12px;
    }

    .rec .analytics-li {
        color: #00ff00;
    }

    /* Происшествия */
    .incident-event {
        color: #FFD700;
        font-weight: 700;
        font-size: 1.05rem;
        margin-top: 12px;
    }

    .incident-desc,
    .incident-causes-desc,
    .incident-preventions-desc {
        color: #fff;
        margin: 4px 0;
    }

    .incident-causes {
        color: #ff4b4b;
        font-weight: 700;
        margin-top: 6px;
    }

    .incident-preventions {
        color: #00ff00;
        font-weight: 700;
        margin-top: 6px;
    }

    /* Мобильная адаптация */
    @media (max-width:768px) {
        .analytics-container {
            padding: 12px;
        }

        .tab {
            width: 160px;
            height: 160px;
        }
    }

    @media (max-width:480px) {
        .tab {
            width: 140px;
            height: 140px;
        }
    }

    @media (max-width:380px) {
        .tab {
            width: 120px;
            height: 120px;
        }
    }

    @media (max-width:360px) {
        .tab {
            width: 110px;
            height: 110px;
        }
    }

    @media (max-width:320px) {
        .tab {
            width: 100px;
            height: 100px;
        }
    }

    .analytics-muted {
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.9rem;
        margin-top: 6px;
    }

    /* Списки для прогноза транспорта */
    .risk-list,
    .rec-list {
        margin: 8px 0 8px 20px;
        padding: 0;
    }

    .risk-list li {
        color: #ffffff;
    }

    .rec-list li {
        color: #ffffff;
    }

    /* Стили для поиска вопросов */
    .search-questions-button {
        position: absolute;
        top: 15px;
        right: 15px;
        background: #ffd200;
        color: #121212;
        border: none;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        font-weight: bold;
        cursor: pointer;
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }

    .search-questions-button:hover {
        background: #ffda40;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .search-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #121212;
        z-index: 1000;
        display: none;
        flex-direction: column;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .search-fullscreen.active {
        display: flex;
        opacity: 1;
    }

    .search-header {
        padding: calc(var(--safe-top) + 56px) 20px 20px;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid #333;
    }

    .search-input-container {
        position: relative;
        margin-bottom: 15px;
    }

    .search-input {
        width: 100%;
        padding: 15px 50px 15px 20px;
        background: #1e1e1e;
        border: 2px solid #333;
        border-radius: 15px;
        color: white;
        font-size: 16px;
        outline: none;
        transition: border-color 0.3s ease;
    }

    .search-input:focus {
        border-color: #ffd200;
    }

    .search-clear {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #888;
        font-size: 20px;
        cursor: pointer;
        padding: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-close {
        position: absolute;
        top: calc(var(--safe-top) + 10px);
        right: 16px;
        background: none;
        border: none;
        color: #ffd200;
        font-size: 28px;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1001;
    }

    .search-results {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
    }

    .search-result-item {
        background: #1e1e1e;
        border-radius: 10px;
        padding: 20px;
        margin-bottom: 15px;
        border-left: 4px solid #333;
        transition: all 0.3s ease;
    }

    .search-result-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .result-question {
        color: white;
        font-size: 16px;
        margin-bottom: 15px;
        line-height: 1.4;
    }

    .result-answers {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .result-answer {
        padding: 10px 15px;
        background: #2a2a2a;
        border-radius: 8px;
        color: #ccc;
        font-size: 14px;
        line-height: 1.3;
        border: 1px solid transparent;
        transition: all 0.2s ease;
    }

    .result-answer.correct {
        background: rgba(76, 175, 80, 0.2);
        color: #4CAF50;
        border-color: #4CAF50;
    }

    .result-correct-label {
        margin-top: 10px;
        padding: 8px 12px;
        background: rgba(76, 175, 80, 0.12);
        border: 1px dashed rgba(76, 175, 80, 0.45);
        border-radius: 8px;
        color: #8BC34A;
        font-size: 13px;
        line-height: 1.3;
    }

    .result-highlight {
        background: #ffd200;
        color: #121212;
        padding: 2px 4px;
        border-radius: 3px;
        font-weight: bold;
    }

    .no-results {
        text-align: center;
        color: #888;
        padding: 40px 20px;
        font-size: 16px;
    }

    .search-loading {
        text-align: center;
        padding: 40px 20px;
        color: #ffd200;
    }

    .search-loading-spinner {
        width: 40px;
        height: 40px;
        border: 3px solid #333;
        border-top-color: #ffd200;
        border-radius: 50%;
        margin: 0 auto 15px;
        animation: spin 1s linear infinite;
    }

    .search-stats {
        color: #888;
        font-size: 14px;
        text-align: center;
        padding: 10px 20px;
        background: rgba(0, 0, 0, 0.8);
        border-top: 1px solid #333;
    }

    .island-back-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    }

    .island-search-button {
        background: rgba(255, 210, 0, 0.9);
        color: #121212;
        border: none;
        border-radius: 15px;
        padding: 10px 12px;
        /* Увеличенный padding для единого вида */
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        display: none;
        align-items: center;
        gap: 5px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        height: 36px;
        /* Фиксированная высота кнопки */
        line-height: 1;
        /* Убираем лишний межстрочный интервал */
    }

    .island-search-button:hover {
        background: #ffd200;
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    }

    .island-search-button:active {
        transform: scale(0.95);
    }

    /* Показываем кнопку только когда нужно */
    .island-search-button.active {
        display: flex;
    }

    /* Стили для выбора раздела поиска */
    .search-section-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        z-index: 999;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .search-section-list {
        background: #1e1e1e;
        border-radius: 15px;
        padding: 30px;
        max-width: 500px;
        width: 100%;
        max-height: 80vh;
        overflow-y: auto;
    }

    .search-section-item {
        background: #2a2a2a;
        color: white;
        border: none;
        padding: 15px;
        border-radius: 10px;
        text-align: left;
        cursor: pointer;
        font-size: 16px;
        transition: all 0.3s ease;
        margin-bottom: 10px;
        width: 100%;
    }

    .search-section-item:hover {
        background: #333;
    }

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
    }

    :root {
        --safe-top: env(safe-area-inset-top, 0px);
        --safe-right: env(safe-area-inset-right, 0px);
        --safe-bottom: env(safe-area-inset-bottom, 0px);
        --safe-left: env(safe-area-inset-left, 0px);
        --bottom-bar: 90px;
        --header-pad: 16px;
        --island-height: 50px;
        --screen-header-height: 56px;

        --spacing-md: 12px;
        --spacing-lg: 16px;
        --chat-input-height: 70px;
    }

    @media (min-width: 480px) {
        :root {
            --header-pad: 18px;
            --bottom-bar: 95px;
        }
    }

    @media (min-width: 768px) {
        :root {
            --header-pad: 22px;
            --bottom-bar: 100px;

            --spacing-md: 12px;
            --spacing-lg: 16px;
            --chat-input-height: 70px;
        }
    }

    @media (min-width: 1024px) {
        :root {
            --header-pad: 26px;
            --bottom-bar: 110px;
        }
    }

    html,
    body {
        background: #000000;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        touch-action: pan-y;
    }

    body {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        background: #000000;
        color: white;
        min-height: 100vh;
        line-height: 1.4;
        overflow-x: hidden;
        width: 100%;
        position: relative;
        padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
        padding-bottom: calc(var(--bottom-bar) + var(--safe-bottom));
    }



    /* Стили для навигации */
    .page {
        display: none;
        flex: 0;
        width: 100%;
        max-width: 100%;
        background: #000000;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .page.active {
        display: flex;
        flex-direction: column;
        position: relative;
        transform: translateX(0);
    }

    .page.slide-out-left {
        transform: translateX(-100%);
    }

    .page.slide-out-right {
        transform: translateX(100%);
    }

    .page.slide-in-left {
        transform: translateX(-100%);
        animation: slideInFromLeft 0.3s ease forwards;
    }

    .page.slide-in-right {
        transform: translateX(100%);
        animation: slideInFromRight 0.3s ease forwards;
    }

    .page.has-screen-header {
        padding-top: calc(var(--screen-header-height) + var(--safe-top)) !important;
    }

    #pageMain.has-screen-header,
    #pageAnalytics.has-screen-header {
        padding-top: calc(var(--screen-header-height) + var(--safe-top) - 12px) !important;
    }

    #pageMain .main-content {
        padding-top: 20px !important;
    }

    #pageAnalytics .tabbar {
        margin-top: 10px !important;
    }

    #pageAnalytics .analytics-container {
        padding-top: 8px;
    }

    .screen-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: calc(var(--screen-header-height) + var(--safe-top));
        display: flex;
        align-items: center;
        gap: 12px;
        padding: calc(var(--safe-top) + 10px) 16px 10px 16px;
        background: rgba(0, 0, 0, 0.92);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
        z-index: 200;
    }

    .screen-header-back {
        width: 32px;
        height: 32px;
        border: none;
        background: transparent;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #ffd200;
        transition: transform 0.15s ease;
    }

    .screen-header-back:active {
        transform: scale(0.96);
    }

    .screen-header-back svg {
        width: 20px;
        height: 20px;
    }

    .screen-header-title {
        flex: 1;
        text-align: center;
        font-size: clamp(1rem, 2.5vw, 1.15rem);
        font-weight: 600;
        color: #ffd200;
        letter-spacing: 0.2px;
        transform: translateX(-23px);
    }

    .screen-header.is-root .screen-header-back {
        opacity: 0;
        pointer-events: none;
    }

    .screen-header.is-root .screen-header-title {
        opacity: 0;
    }

    .page.has-screen-header .header,
    .page.has-screen-header .main-header {
        padding-top: 12px;
        margin-top: 0;
    }

    #pageMessages.has-screen-header .header {
        padding-top: 12px;
        margin-top: 0;
    }

    @keyframes slideInFromLeft {
        from {
            transform: translateX(-100%);
        }

        to {
            transform: translateX(0);
        }
    }

    @keyframes slideInFromRight {
        from {
            transform: translateX(100%);
        }

        to {
            transform: translateX(0);
        }
    }

    /* ГАРАНТИРУЕМ ПРАВИЛЬНОЕ ОТОБРАЖЕНИЕ СПЛЭШ-ЭКРАНА */
    #splashScreen {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #000000;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        transition: opacity 0.5s ease, transform 0.5s ease;
        opacity: 1;
    }

    /* УБЕДИТЕСЬ ЧТО ГЛАВНАЯ СТРАНИЦА МОЖЕТ ПОКАЗЫВАТЬСЯ */
    #pageMain {
        display: none;
    }

    #pageMain.active {
        display: flex !important;
    }

    .splash-logo {
        width: 150px;
        height: 150px;
        position: relative;
        margin-bottom: 30px;
    }

    .splash-logo-inner {
        width: 100%;
        height: 100%;
        background: #ffd200;
        border-radius: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        animation: logoPulse 2s ease-in-out infinite;
        box-shadow: 0 0 50px rgba(255, 210, 0, 0.3);
    }

    .splash-logo-inner img {
        width: 80%;
        height: 80%;
        object-fit: contain;
    }

    .splash-text {
        text-align: center;
        margin-top: 20px;
    }

    .splash-title {
        font-size: 2rem;
        font-weight: bold;
        color: #ffd200;
        margin-bottom: 10px;
        letter-spacing: 2px;
    }

    .splash-subtitle {
        font-size: 1rem;
        color: #ccc;
        opacity: 0;
        animation: fadeInUp 1s ease 0.5s forwards;
    }

    .splash-loading {
        width: 100px;
        height: 3px;
        background: #333;
        border-radius: 2px;
        margin-top: 30px;
        overflow: hidden;
        position: relative;
    }

    .splash-progress {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: linear-gradient(90deg, #ffd200, #ffed4e);
        width: 0%;
        animation: loadingProgress 2s ease-in-out;
    }

    @keyframes logoPulse {
        0% {
            transform: scale(1) rotate(0deg);
            box-shadow: 0 0 30px rgba(255, 210, 0, 0.3);
        }

        25% {
            transform: scale(1.05) rotate(5deg);
            box-shadow: 0 0 40px rgba(255, 210, 0, 0.4);
        }

        50% {
            transform: scale(1.1) rotate(0deg);
            box-shadow: 0 0 50px rgba(255, 210, 0, 0.5);
        }

        75% {
            transform: scale(1.05) rotate(-5deg);
            box-shadow: 0 0 40px rgba(255, 210, 0, 0.4);
        }

        100% {
            transform: scale(1) rotate(0deg);
            box-shadow: 0 0 30px rgba(255, 210, 0, 0.3);
        }
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes loadingProgress {
        0% {
            width: 0%;
        }

        50% {
            width: 70%;
        }

        100% {
            width: 100%;
        }
    }

    @keyframes fadeHeader {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .container {
        max-width: 100%;
        margin: 0 auto;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        background: #000000;
        padding-top: 0;
    }

    .selection-page {
        justify-content: space-between;
    }

    .selection-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 100%;
    }

    /* Отступы для header для PWA */
    .main-header {
        width: 100%;
        height: auto;
        min-height: 200px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000000;
        padding: 20px 20px 0 20px;
        padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        position: relative;
        overflow: visible;
        z-index: 10;
        transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        animation: fadeHeader 0.6s ease-out;
        margin-top: var(--safe-top);
    }

    .main-logo {
        width: 100%;
        max-width: 490px;
        height: auto;
        aspect-ratio: 490/283;
        object-fit: contain;
        display: block;
    }


    /* СТИЛИ ДЛЯ ИЗОБРАЖЕНИЙ КНОПОК 380 на 130, кроме кнопок тестов */
    .button-image img {
        width: 100%;
        height: auto;
        object-fit: contain;
        display: block;
        border-radius: 0;
    }

    /* Стили для кнопок сообщений и организации */
    .icon-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3vw;
        margin-bottom: 5vw;
        padding: 0 5vw;
        width: 100%;
        max-width: 100%;
    }

    /* Грид-сетка для страницы сообщений (1 столбец, 4 строки) */
    #pageMessages .icon-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: 3vw;
        margin-bottom: 5vw;
        padding: 0 5vw;
        width: 100%;
        max-width: 100%;
    }

    /* Грид-сетка для страницы выбора организаций (1 столбец, 2 строки) */
    #pageOrganization .icon-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, 1fr);
        gap: 3vw;
        margin-bottom: 5vw;
        padding: 0 5vw;
        width: 100%;
        max-width: 100%;
    }

    /* Грид-сетка для страницы выбора группы (1 столбец, 4 строки) */
    #pageGroup .icon-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: 3vw;
        margin-bottom: 5vw;
        padding: 0 5vw;
        width: 100%;
        max-width: 100%;
    }

    /* Стили для кнопок по новым параметрам */
    .icon-button {
        width: 90vw;
        max-width: 380px;
        height: 130px;
        min-height: 130px;
        max-height: 130px;
        margin: 0 auto;
        background: none;
        border: none;
        border-radius: min(25px, 4vh);
        padding: 0;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        overflow: hidden;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .icon-button .button-image {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .icon-button .button-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: min(25px, 4vh);
        display: block;
    }

    /* Адаптивные стили для КНОПОК */
    @media (max-width: 480px) {
        .icon-grid {
            gap: 2.5vw;
            padding: 0 4vw;
        }

        #pageMessages .icon-grid,
        #pageOrganization .icon-grid,
        #pageGroup .icon-grid {
            gap: 2.5vw;
            padding: 0 4vw;
        }

    }

    @media (max-width: 320px) {
        .icon-grid {
            gap: 2vw;
            padding: 0 3vw;
        }

        #pageMessages .icon-grid,
        #pageOrganization .icon-grid,
        #pageGroup .icon-grid {
            gap: 2vw;
            padding: 0 3vw;
        }

        .icon-button {
            height: 130px;
            min-height: 130px;
            max-height: 130px;
        }

        .icon-button .button-image img {
            border-radius: min(25px, 4vh);
        }
    }

    @media (min-width: 768px) {
        .icon-grid {
            gap: 20px;
            padding: 0 20px;
        }

        #pageMessages .icon-grid,
        #pageOrganization .icon-grid,
        #pageGroup .icon-grid {
            gap: 20px;
            padding: 0 20px;
        }

        .icon-button {
            height: 130px;
            max-width: 380px;
        }
    }

    /* Специфичные стили для страницы сообщений */
    #pageMessages .icon-grid {
        gap: 2.5vw;
        margin-bottom: 20px;
        padding: 0 4vw;
    }

    /* Анимации для главных кнопок сообщений */
    #pageMessages .icon-button {
        opacity: 0;
        animation: slideInButton 0.6s ease-out forwards;
        border-radius: min(25px, 4vh);
    }

    #pageMessages .icon-button:nth-child(1) {
        animation-delay: 0.1s;
    }

    #pageMessages .icon-button:nth-child(2) {
        animation-delay: 0.2s;
    }

    #pageMessages .icon-button:nth-child(3) {
        animation-delay: 0.3s;
    }

    #pageMessages .icon-button:nth-child(4) {
        animation-delay: 0.4s;
    }

    @keyframes slideInButton {
        from {
            opacity: 0;
            transform: translateY(30px) scale(0.9);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    /* СТИЛИ ДЛЯ ЭКРАНОВ 360-380px */
    @media (max-width: 380px) {

        /* Страница сообщений - 4 кнопки в столбик */
        #pageMessages .icon-grid {
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: repeat(4, 29vw);
            gap: 3vw;
            margin-bottom: 5vw;
            padding: 0 5vw;
            width: 100%;
            max-width: 100%;
        }

        /* Кнопки на странице сообщений */
        #pageMessages .icon-button {
            width: 84vw;
            max-width: 390px;
            height: 110px;
            min-height: 110px;
            max-height: 110px;
            margin: 0 auto;
        }

        /* Страница выбора организаций - 2 кнопки в столбик */
        #pageOrganization .icon-grid {
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: repeat(2, 29vw);
            gap: 3vw;
            margin-bottom: 5vw;
            padding: 0 5vw;
            width: 100%;
            max-width: 100%;
        }

        /* Кнопки на странице организаций */
        #pageOrganization .icon-button {
            width: 84vw;
            max-width: 390px;
            height: 110px;
            min-height: 110px;
            max-height: 110px;
            margin: 0 auto;
        }

        /* Страница выбора группы - 4 кнопки в столбик */
        #pageGroup .icon-grid {
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: repeat(4, 29vw);
            gap: 3vw;
            margin-bottom: 5vw;
            padding: 0 5vw;
            width: 100%;
            max-width: 100%;
        }

        /* Кнопки на странице групп */
        #pageGroup .icon-button {
            width: 84vw;
            max-width: 390px;
            height: 110px;
            min-height: 110px;
            max-height: 110px;
            margin: 0 auto;
        }
    }

    /* Для экранов больше 768px - другие размеры */
    @media (min-width: 768px) {
        .icon-button {
            height: 250px;
            max-width: 700px;
        }

        #pageMessages .icon-button,
        #pageOrganization .icon-button,
        #pageGroup .icon-button {
            width: 90vw;
            max-width: 690px;
            height: auto;
            min-height: 230px;
            max-height: 230px;
        }
    }

    /* Стили для кнопки установки */
    .install-button {
        position: fixed;
        top: calc(25px + var(--safe-top));
        right: 15px;
        background: #ffd200;
        color: #121212;
        border: none;
        border-radius: 20px;
        padding: 12px 18px;
        font-weight: 600;
        cursor: pointer;
        z-index: 10010;
        box-shadow: 0 4px 15px rgba(255, 210, 0, 0.4);
        display: none;
        align-items: center;
        gap: 6px;
        font-size: 14px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .install-button .icon {
        width: 16px;
        height: 16px;
        background: #121212;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        color: #ffd200;
    }

    /* ОДИНАКОВЫЙ ОТСТУП ДЛЯ ВСЕХ HEADER - Исправленный */
    .header {
        text-align: center;
        padding: 5vw 5vw 3vw 5vw;
        margin-bottom: 3vw;
        width: 100%;
        background: #000000;
        padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        position: relative;
        z-index: 10;
        transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        animation: fadeHeader 0.6s ease-out;
        margin-top: var(--safe-top);
    }

    .header h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
        margin-bottom: 2vw;
        color: #ffd200;
    }

    .header p {
        color: #ccc;
        font-size: clamp(0.9rem, 4vw, 1rem);
    }

    /* ОДИНАКОВЫЙ ОТСТУП ДЛЯ СТРАНИЦЫ СООБЩЕНИЙ - Исправленный */
    #pageMessages .header {
        padding: 5vw 5vw 1vw 5vw;
        margin-bottom: 1vw;
        padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        margin-top: var(--safe-top);
    }

    /* Стили для кнопок тестов - одинаковые размеры */
    #pageTests .icon-button,
    #pageTestSections .icon-button,
    #pageTestMode .icon-button {
        width: 90vw;
        max-width: 380px;
        height: 130px;
        min-height: 130px;
        max-height: 130px;
        justify-content: center;
        padding: 20px 15px;
        background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
        border: 2px solid #333;
        border-radius: min(25px, 4vh);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        position: relative;
        overflow: hidden;
        margin: 0 auto;
    }

    #pageTests .icon-button::before,
    #pageTestSections .icon-button::before,
    #pageTestMode .icon-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 210, 0, 0.1), transparent);
        transition: left 0.6s ease;
    }

    #pageTests .icon-button:hover::before,
    #pageTestSections .icon-button:hover::before,
    #pageTestMode .icon-button:hover::before {
        left: 100%;
    }

    #pageTests .icon-button:hover,
    #pageTestSections .icon-button:hover,
    #pageTestMode .icon-button:hover {
        transform: translateY(-5px);
        border-color: #ffd200;
        box-shadow: 0 10px 25px rgba(255, 210, 0, 0.2);
    }

    #pageTests .icon-button:active,
    #pageTestSections .icon-button:active,
    #pageTestMode .icon-button:active {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(255, 210, 0, 0.3);
    }

    #pageTests .button-image,
    #pageTestSections .button-image,
    #pageTestMode .button-image {
        display: none;
    }

    #pageTests .text,
    #pageTestSections .text,
    #pageTestMode .text {
        display: block !important;
        font-size: clamp(1.1rem, 4vw, 1.3rem);
        font-weight: 700;
        text-align: center;
        color: white;
        line-height: 1.4;
        position: relative;
        z-index: 2;
    }

    #pageTests .text small,
    #pageTestSections .text small,
    #pageTestMode .text small {
        font-size: 0.9rem;
        font-weight: 400;
        color: #ccc;
        display: block;
        margin-top: 8px;
        line-height: 1.3;
        opacity: 0.9;
    }

    /* УБИРАЕМ ЦВЕТНЫЕ ПОЛОСКИ */
    #pageTests .icon-button:nth-child(1),
    #pageTests .icon-button:nth-child(2),
    #pageTestMode .icon-button:nth-child(1),
    #pageTestMode .icon-button:nth-child(2) {
        border-left: 2px solid #333;
    }

    #pageTests .icon-button:nth-child(1):hover,
    #pageTests .icon-button:nth-child(2):hover,
    #pageTestMode .icon-button:nth-child(1):hover,
    #pageTestMode .icon-button:nth-child(2):hover {
        border-color: #ffd200;
        box-shadow: 0 10px 25px rgba(255, 210, 0, 0.2);
    }

    /* === Адаптация для РАЗДЕЛА ТЕСТОВ === */
    #pageTests,
    #pageTestSections,
    #pageTestMode,
    #pageTestQuestions,
    #pageTestResults {
        padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
    }

    /* Адаптация для экранов 768px */
    @media (max-width: 768px) {

        /* Главная страница тестов */
        #pageTests .icon-grid {
            gap: 15px;
            padding: 0 15px;
        }

        #pageTests .icon-button,
        #pageTestSections .icon-button,
        #pageTestMode .icon-button {
            width: 85vw;
            max-width: 470px;
            height: 110px;
            min-height: 150px;
            max-height: 150px;
            padding: 15px 12px;
        }

        #pageTests .text,
        #pageTestSections .text,
        #pageTestMode .text {
            font-size: clamp(1.8rem, 3.5vw, 1.1rem);
        }

        #pageTests .text small,
        #pageTestSections .text small,
        #pageTestMode .text small {
            font-size: 1.3rem;
            margin-top: 6px;
        }

        /* Страница с вопросами теста */
        .test-content {
            padding: 15px;
        }

        .question-container {
            padding: 15px;
            margin-bottom: 15px;
        }

        .question-text {
            font-size: 1rem;
            margin-bottom: 15px;
        }

        .answer-option {
            padding: 12px;
            font-size: 0.95rem;
        }

        .test-timer {
            font-size: 1rem;
        }

        /* Страница результатов */
        .score-circle {
            width: 100px;
            height: 100px;
        }

        .score-circle span {
            font-size: 1.5rem;
        }

        .result-details {
            max-height: calc(100vh - 500px);
            padding: 10px;
        }

        .result-item {
            padding: 8px;
        }
    }

    /* Адаптация для экранов 480px */
    @media (max-width: 480px) {

        /* Главная страница тестов */
        #pageTests .icon-grid {
            gap: 12px;
            padding: 0 10px;
        }

        #pageTests .icon-button,
        #pageTestSections .icon-button,
        #pageTestMode .icon-button {
            width: 90vw;
            max-width: 360px;
            height: 120px;
            min-height: 140px;
            max-height: 180px;
            padding: 12px 10px;
            border-radius: min(20px, 3vh);
        }

        #pageTests .text,
        #pageTestSections .text,
        #pageTestMode .text {
            font-size: clamp(1.0rem, 3vw, 1rem);
        }

        #pageTests .text small,
        #pageTestSections .text small,
        #pageTestMode .text small {
            font-size: 1.0rem;
            margin-top: 4px;
        }

        /* Страница с вопросами теста */
        .test-content {
            padding: 12px;
        }

        .question-container {
            padding: 12px;
            margin-bottom: 12px;
            border-radius: 12px;
        }

        .question-text {
            font-size: 0.95rem;
            margin-bottom: 12px;
        }

        .answers-container {
            gap: 8px;
        }

        .answer-option {
            padding: 10px;
            font-size: 0.9rem;
            border-radius: 8px;
        }

        .test-timer {
            font-size: 0.9rem;
            margin-top: 8px;
        }

        /* Навигация теста */
        .test-navigation {
            gap: 8px;
            padding: 15px 0;
        }

        /* Страница результатов */
        .result-score {
            margin-bottom: 20px;
        }

        .score-circle {
            width: 90px;
            height: 90px;
            margin-bottom: 10px;
        }

        .score-circle span {
            font-size: 1.3rem;
        }

        .score-text {
            font-size: 1rem;
        }

        .result-details {
            max-height: calc(100vh - 480px);
            padding: 8px;
            margin-bottom: 12px;
        }

        .result-item {
            padding: 6px;
            margin-bottom: 6px;
        }

        .result-question {
            font-size: 0.9rem;
        }

        .result-answer {
            font-size: 0.8rem;
        }

        .result-actions {
            gap: 8px;
        }
    }

    /* Адаптация для экранов 380px */
    @media (max-width: 380px) {

        /* Главная страница тестов */
        #pageTests .icon-button,
        #pageTestSections .icon-button,
        #pageTestMode .icon-button {
            width: 100vw;
            max-width: 320px;
            height: 120px;
            min-height: 90px;
            max-height: 100px;
            padding: 10px 8px;
            border-radius: min(18px, 2.5vh);
        }

        #pageTests .text,
        #pageTestSections .text,
        #pageTestMode .text {
            font-size: clamp(0.8rem, 2.8vw, 1rem);
        }

        #pageTests .text small,
        #pageTestSections .text small,
        #pageTestMode .text small {
            font-size: 0.8rem;
            margin-top: 3px;
        }

        /* Страница с вопросами теста */
        .test-content {
            padding: 10px;
        }

        .question-container {
            padding: 10px;
            margin-bottom: 10px;
            border-radius: 10px;
        }

        .question-text {
            font-size: 0.9rem;
            margin-bottom: 10px;
            line-height: 1.4;
        }

        .answers-container {
            gap: 6px;
        }

        .answer-option {
            padding: 8px 10px;
            font-size: 0.85rem;
            border-radius: 7px;
            line-height: 1.3;
        }

        .test-timer {
            font-size: 0.85rem;
            margin-top: 6px;
        }

        /* Навигация теста */
        .test-navigation {
            gap: 6px;
            padding: 12px 0;
        }

        /* Страница результатов */
        .score-circle {
            width: 80px;
            height: 80px;
        }

        .score-circle span {
            font-size: 1.2rem;
        }

        .score-text {
            font-size: 0.9rem;
        }

        .result-details {
            max-height: calc(100vh - 460px);
            padding: 6px;
            margin-bottom: 10px;
            border-radius: 8px;
        }

        .result-item {
            padding: 5px;
            margin-bottom: 5px;
        }

        .result-question {
            font-size: 0.85rem;
            margin-bottom: 3px;
        }

        .result-answer {
            font-size: 0.75rem;
        }

        .result-actions {
            gap: 6px;
        }
    }

    /* Адаптация для экранов 320px */
    @media (max-width: 320px) {

        /* Главная страница тестов */
        #pageTests .icon-button,
        #pageTestSections .icon-button,
        #pageTestMode .icon-button {
            width: 94vw;
            max-width: 280px;
            height: 85px;
            min-height: 85px;
            max-height: 85px;
            padding: 8px 6px;
            border-radius: min(16px, 2vh);
        }

        #pageTests .text,
        #pageTestSections .text,
        #pageTestMode .text {
            font-size: clamp(0.7rem, 2.5vw, 0.85rem);
        }

        #pageTests .text small,
        #pageTestSections .text small,
        #pageTestMode .text small {
            font-size: 0.65rem;
            margin-top: 2px;
            line-height: 1.2;
        }

        /* Страница с вопросами теста */
        .test-content {
            padding: 8px;
        }

        .question-container {
            padding: 8px;
            margin-bottom: 8px;
            border-radius: 8px;
            border-width: 1px;
        }

        .question-text {
            font-size: 0.85rem;
            margin-bottom: 8px;
            line-height: 1.3;
        }

        .answers-container {
            gap: 5px;
        }

        .answer-option {
            padding: 7px 8px;
            font-size: 0.8rem;
            border-radius: 6px;
            line-height: 1.25;
        }

        .test-timer {
            font-size: 0.8rem;
            margin-top: 5px;
        }

        /* Навигация теста */
        .test-navigation {
            gap: 5px;
            padding: 10px 0;
        }

        /* Страница результатов */
        .result-score {
            margin-bottom: 15px;
        }

        .score-circle {
            width: 70px;
            height: 70px;
            margin-bottom: 8px;
        }

        .score-circle span {
            font-size: 1.1rem;
        }

        .score-text {
            font-size: 0.85rem;
        }

        .result-details {
            max-height: calc(100vh - 450px);
            padding: 5px;
            margin-bottom: 8px;
            border-radius: 6px;
        }

        .result-item {
            padding: 4px;
            margin-bottom: 4px;
        }

        .result-question {
            font-size: 0.8rem;
            margin-bottom: 2px;
        }

        .result-answer {
            font-size: 0.7rem;
        }

        .result-actions {
            gap: 5px;
        }

        .result-actions button {
            padding: 8px 12px;
            font-size: 0.85rem;
        }
    }

    /* Стили для горизонтального скролла управлений */
    .viewport-management {
        width: min(1200px, 100vw);
        height: calc(350px + 120px);
        padding: 40px 24px;
        overflow: hidden;
        position: relative;
        /* РАЗРЕШАЕМ ТОЛЬКО ВЕРТИКАЛЬНЫЕ СВАЙПЫ */
        touch-action: pan-y pinch-zoom;
    }

    .track-management {
        display: flex;
        align-items: center;
        height: 100%;
        gap: 24px;
        will-change: transform;
        transition: transform 400ms cubic-bezier(.22, .9, .15, 1);
        padding: 0 calc((100% - 350px) / 2);
        /* ОТКЛЮЧАЕМ СТАНДАРТНЫЕ ГОРИЗОНТАЛЬНЫЕ СВАЙПЫ БРАУЗЕРА */
        touch-action: none;
    }

    .management-card {
        width: 350px;
        height: 350px;
        flex: 0 0 350px;
        border-radius: 18px;
        background: transparent !important;
        box-shadow: none !important;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        transform-origin: center center;
        transition: transform 400ms cubic-bezier(.22, .9, .15, 1), filter 400ms cubic-bezier(.22, .9, .15, 1), opacity 400ms cubic-bezier(.22, .9, .15, 1);
        user-select: none;
        cursor: pointer;
        border: none !important;
    }

    .management-card .card-content {
        width: 100%;
        height: 100%;
        padding: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .management-card .button-image {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .management-card .button-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 12px;
    }

    .management-card .text {
        display: none;
    }

    /* Стили для кнопки выбора в карточках управления */
    .management-card .select-management-button {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(255, 210, 0, 0.9);
        color: #121212;
        border: none;
        border-radius: 12px;
        padding: 10px 20px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        display: none;
        transition: all 0.3s ease;
        z-index: 20;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow:
            0 2px 10px rgba(0, 0, 0, 0.3),
            0 0 15px rgba(255, 210, 0, 0.5),
            0 0 25px rgba(255, 210, 0, 0.3);
    }

    .management-card .select-management-button:hover {
        background: rgba(255, 210, 0, 1);
        transform: translateX(-50%) scale(1.05);
        box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.4),
            0 0 20px rgba(255, 210, 0, 0.7),
            0 0 35px rgba(255, 210, 0, 0.5);
    }

    .management-card .select-management-button:active {
        transform: translateX(-50%) scale(0.95);
        box-shadow:
            0 1px 5px rgba(0, 0, 0, 0.3),
            0 0 10px rgba(255, 210, 0, 0.4);
    }

    /* Анимация появления кнопки с эффектом свечения */
    .management-card.active .select-management-button {
        display: block;
        animation: buttonGlowAppear 0.5s ease-out;
    }

    @keyframes buttonGlowAppear {
        from {
            opacity: 0;
            transform: translateX(-50%) scale(0.8);
            box-shadow: 0 0 0 rgba(255, 210, 0, 0);
        }

        to {
            opacity: 1;
            transform: translateX(-50%) scale(1);
            box-shadow:
                0 2px 10px rgba(0, 0, 0, 0.3),
                0 0 15px rgba(255, 210, 0, 0.5),
                0 0 25px rgba(255, 210, 0, 0.3);
        }
    }

    /* Стили для неактивных карточек управления с легким размытием */
    .management-card.inactive {
        filter: blur(2px) !important;
        transform: scale(0.97);
        opacity: 0.7;
        transition: all 0.4s cubic-bezier(.22, .9, .15, 1);
    }

    /* active look */
    .management-card.active {
        transform: scale(1.06);
        filter: none !important;
        opacity: 1;
        box-shadow: none !important;
    }

    /* dots for management */
    .controls-management {
        position: absolute;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 5;
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .management-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.12);
        cursor: pointer;
    }

    .management-dot.active {
        background: #ffd200;
    }

    /* Адаптивность для управления */
    @media (max-width: 820px) {
        .viewport-management {
            height: calc(300px + 120px);
        }

        .track-management {
            padding: 0 calc((100% - 300px) / 2);
            margin-left: -46px;
        }

        .management-card {
            width: 300px;
            height: 300px;
            flex: 0 0 300px;
        }
    }

    @media (max-width: 480px) {
        .viewport-management {
            height: calc(280px + 100px);
            padding: 30px 16px;
            margin-top: 40px;

        }

        .track-management {
            padding: 0 calc((100% - 280px) / 2);
            margin-left: -36px;
            gap: 18px;
            margin-top: 8px;
        }

        .management-card {
            width: 280px;
            height: 280px;
            flex: 0 0 280px;
            border-radius: 16px;
        }

        .management-card .button-image img {
            border-radius: 10px;
        }

        .management-card .select-management-button {
            padding: 9px 18px;
            font-size: 13.5px;
            bottom: 18px;
            border-radius: 10px;
            box-shadow:
                0 2px 8px rgba(0, 0, 0, 0.25),
                0 0 12px rgba(255, 210, 0, 0.45),
                0 0 20px rgba(255, 210, 0, 0.25);
        }

        .management-card.inactive {
            filter: blur(1.8px) !important;
        }
    }

    @media (max-width: 380px) {
        .viewport-management {
            height: calc(260px + 100px);
            padding: 30px 14px;
            margin-top: 4px;
        }

        .track-management {
            padding: 0 calc((100% - 260px) / 2);
            margin-left: -38px;
            gap: 16px;
            margin-top: 10px;
        }

        .management-card {
            width: 260px;
            height: 260px;
            flex: 0 0 260px;
            border-radius: 15px;
        }

        .management-card .button-image img {
            border-radius: 9px;
        }

        .management-card .select-management-button {
            padding: 8px 16px;
            font-size: 13px;
            bottom: 17px;
            border-radius: 9px;
            box-shadow:
                0 2px 7px rgba(0, 0, 0, 0.25),
                0 0 10px rgba(255, 210, 0, 0.4),
                0 0 18px rgba(255, 210, 0, 0.25);
        }

        .management-card.inactive {
            filter: blur(1.6px) !important;
            transform: scale(0.96);
        }

        .management-card.active {
            transform: scale(1.05);
        }

        .controls-management {
            bottom: 10px;
        }

        .management-dot {
            width: 9px;
            height: 9px;
        }
    }

    @media (max-width: 360px) {
        .viewport-management {
            height: calc(240px + 90px);
            padding: 25px 12px;
        }

        .track-management {
            padding: 0 calc((100% - 240px) / 2);
            margin-left: -30px;
            gap: 16px;
        }

        .management-card {
            width: 240px;
            height: 240px;
            flex: 0 0 240px;
            border-radius: 14px;
        }

        .management-card .button-image img {
            border-radius: 9px;
        }

        .management-card .select-management-button {
            padding: 8px 16px;
            font-size: 13px;
            bottom: 16px;
            border-radius: 9px;
            box-shadow:
                0 2px 7px rgba(0, 0, 0, 0.2),
                0 0 10px rgba(255, 210, 0, 0.4),
                0 0 18px rgba(255, 210, 0, 0.2);
        }

        .management-card.inactive {
            filter: blur(1.5px) !important;
            transform: scale(0.95);
        }

        .management-card.active {
            transform: scale(1.04);
        }

        .controls-management {
            bottom: 10px;
        }

        .management-dot {
            width: 8px;
            height: 8px;
        }
    }

    @media (max-width: 320px) {
        .viewport-management {
            height: calc(220px + 80px);
            padding: 20px 10px;
        }

        .track-management {
            padding: 0 calc((100% - 220px) / 2);
            margin-left: -26px;
            gap: 14px;
        }

        .management-card {
            width: 220px;
            height: 220px;
            flex: 0 0 220px;
            border-radius: 12px;
        }

        .management-card .button-image img {
            border-radius: 8px;
        }

        .management-card .select-management-button {
            padding: 7px 14px;
            font-size: 12px;
            bottom: 15px;
            border-radius: 8px;
            min-width: 120px;
            box-shadow:
                0 2px 6px rgba(0, 0, 0, 0.18),
                0 0 9px rgba(255, 210, 0, 0.35),
                0 0 15px rgba(255, 210, 0, 0.18);
        }

        .management-card.inactive {
            filter: blur(1.2px) !important;
            transform: scale(0.93);
        }

        .management-card.active {
            transform: scale(1.03);
        }

        .controls-management {
            bottom: 8px;
            gap: 6px;
        }

        .management-dot {
            width: 7px;
            height: 7px;
        }
    }

    /* СТИЛИ ДЛЯ РАЗДЕЛА ВЫБОРА НАРУШЕНИЯ */
    .viewport-violation {
        width: min(1200px, 100vw);
        height: calc(350px + 120px);
        padding: 40px 24px;
        overflow: hidden;
        position: relative;
        touch-action: pan-y pinch-zoom;
    }

    .track-violation {
        display: flex;
        align-items: center;
        height: 100%;
        gap: 24px;
        will-change: transform;
        transition: transform 400ms cubic-bezier(.22, .9, .15, 1);
        padding: 0 calc((100% - 350px) / 2);
        touch-action: none;
    }

    .violation-card {
        width: 350px;
        height: 350px;
        flex: 0 0 350px;
        border-radius: 18px;
        background: transparent !important;
        box-shadow: none !important;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        transform-origin: center center;
        transition: transform 400ms cubic-bezier(.22, .9, .15, 1), filter 400ms cubic-bezier(.22, .9, .15, 1), opacity 400ms cubic-bezier(.22, .9, .15, 1);
        user-select: none;
        cursor: pointer;
        border: none !important;
    }

    .violation-card .card-content {
        width: 100%;
        height: 100%;
        padding: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .violation-card .button-image {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .violation-card .button-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 12px;
    }

    .violation-card .text {
        display: none;
    }

    /* Стили для кнопки выбора в карточках нарушения */
    .violation-card .select-violation-button {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(255, 210, 0, 0.9);
        color: #121212;
        border: none;
        border-radius: 12px;
        padding: 10px 20px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        display: none;
        transition: all 0.3s ease;
        z-index: 20;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow:
            0 2px 10px rgba(0, 0, 0, 0.3),
            0 0 15px rgba(255, 210, 0, 0.5),
            0 0 25px rgba(255, 210, 0, 0.3);
    }

    .violation-card .select-violation-button:hover {
        background: rgba(255, 210, 0, 1);
        transform: translateX(-50%) scale(1.05);
        box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.4),
            0 0 20px rgba(255, 210, 0, 0.7),
            0 0 35px rgba(255, 210, 0, 0.5);
    }

    .violation-card .select-violation-button:active {
        transform: translateX(-50%) scale(0.95);
        box-shadow:
            0 1px 5px rgba(0, 0, 0, 0.3),
            0 0 10px rgba(255, 210, 0, 0.4);
    }

    /* Анимация появления кнопки с эффектом свечения */
    .violation-card.active .select-violation-button {
        display: block;
        animation: buttonGlowAppear 0.5s ease-out;
    }

    /* Стили для неактивных карточек нарушения с легким размытием */
    .violation-card.inactive {
        filter: blur(2px) !important;
        transform: scale(0.97);
        opacity: 0.7;
        transition: all 0.4s cubic-bezier(.22, .9, .15, 1);
    }

    /* active look */
    .violation-card.active {
        transform: scale(1.06);
        filter: none !important;
        opacity: 1;
        box-shadow: none !important;
    }

    /* dots for violation */
    .controls-violation {
        position: absolute;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 5;
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .violation-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.12);
        cursor: pointer;
    }

    .violation-dot.active {
        background: #ffd200;
    }

    /* Адаптивность для нарушения */
    @media (max-width: 820px) {
        .viewport-violation {
            height: calc(300px + 120px);
        }

        .track-violation {
            padding: 0 calc((100% - 300px) / 2);
            margin-left: -46px;
        }

        .violation-card {
            width: 300px;
            height: 300px;
            flex: 0 0 300px;
        }
    }

    @media (max-width: 480px) {
        .viewport-violation {
            height: calc(280px + 100px);
            padding: 30px 16px;
            margin-top: 40px;
        }

        .track-violation {
            padding: 0 calc((100% - 280px) / 2);
            margin-left: -36px;
            gap: 18px;
            margin-top: 8px;
        }

        .violation-card {
            width: 280px;
            height: 280px;
            flex: 0 0 280px;
            border-radius: 16px;
        }

        .violation-card .button-image img {
            border-radius: 10px;
        }

        .violation-card .select-violation-button {
            padding: 9px 18px;
            font-size: 13.5px;
            bottom: 18px;
            border-radius: 10px;
            box-shadow:
                0 2px 8px rgba(0, 0, 0, 0.25),
                0 0 12px rgba(255, 210, 0, 0.45),
                0 0 20px rgba(255, 210, 0, 0.25);
        }

        .violation-card.inactive {
            filter: blur(1.8px) !important;
        }
    }

    @media (max-width: 380px) {
        .viewport-violation {
            height: calc(260px + 100px);
            padding: 30px 14px;
            margin-top: 4px;
        }

        .track-violation {
            padding: 0 calc((100% - 260px) / 2);
            margin-left: -38px;
            gap: 16px;
            margin-top: 10px;
        }

        .violation-card {
            width: 260px;
            height: 260px;
            flex: 0 0 260px;
            border-radius: 15px;
        }

        .violation-card .button-image img {
            border-radius: 9px;
        }

        .violation-card .select-violation-button {
            padding: 8px 16px;
            font-size: 13px;
            bottom: 17px;
            border-radius: 9px;
            box-shadow:
                0 2px 7px rgba(0, 0, 0, 0.25),
                0 0 10px rgba(255, 210, 0, 0.4),
                0 0 18px rgba(255, 210, 0, 0.25);
        }

        .violation-card.inactive {
            filter: blur(1.6px) !important;
            transform: scale(0.96);
        }

        .violation-card.active {
            transform: scale(1.05);
        }

        .controls-violation {
            bottom: 10px;
        }

        .violation-dot {
            width: 9px;
            height: 9px;
        }
    }

    @media (max-width: 360px) {
        .viewport-violation {
            height: calc(240px + 90px);
            padding: 25px 12px;
        }

        .track-violation {
            padding: 0 calc((100% - 240px) / 2);
            margin-left: -30px;
            gap: 16px;
        }

        .violation-card {
            width: 240px;
            height: 240px;
            flex: 0 0 240px;
            border-radius: 14px;
        }

        .violation-card .button-image img {
            border-radius: 9px;
        }

        .violation-card .select-violation-button {
            padding: 8px 16px;
            font-size: 13px;
            bottom: 16px;
            border-radius: 9px;
            box-shadow:
                0 2px 7px rgba(0, 0, 0, 0.2),
                0 0 10px rgba(255, 210, 0, 0.4),
                0 0 18px rgba(255, 210, 0, 0.2);
        }

        .violation-card.inactive {
            filter: blur(1.5px) !important;
            transform: scale(0.95);
        }

        .violation-card.active {
            transform: scale(1.04);
        }

        .controls-violation {
            bottom: 10px;
        }

        .violation-dot {
            width: 8px;
            height: 8px;
        }
    }

    @media (max-width: 320px) {
        .viewport-violation {
            height: calc(220px + 80px);
            padding: 20px 10px;
        }

        .track-violation {
            padding: 0 calc((100% - 220px) / 2);
            margin-left: -26px;
            gap: 14px;
        }

        .violation-card {
            width: 220px;
            height: 220px;
            flex: 0 0 220px;
            border-radius: 12px;
        }

        .violation-card .button-image img {
            border-radius: 8px;
        }

        .violation-card .select-violation-button {
            padding: 7px 14px;
            font-size: 12px;
            bottom: 15px;
            border-radius: 8px;
            min-width: 120px;
            box-shadow:
                0 2px 6px rgba(0, 0, 0, 0.18),
                0 0 9px rgba(255, 210, 0, 0.35),
                0 0 15px rgba(255, 210, 0, 0.18);
        }

        .violation-card.inactive {
            filter: blur(1.2px) !important;
            transform: scale(0.93);
        }

        .violation-card.active {
            transform: scale(1.03);
        }

        .controls-violation {
            bottom: 8px;
            gap: 6px;
        }

        .violation-dot {
            width: 7px;
            height: 7px;
        }
    }

    /* Стили для контейнеров скролла */
    .scroll-container {
        display: flex;
        gap: 15px;
        overflow-x: auto;
        padding: 10px 20px;
        margin-bottom: 10px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        position: relative;
        width: 100%;
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
        touch-action: pan-x pinch-zoom;
    }

    .scroll-container::-webkit-scrollbar {
        display: none;
    }

    .scroll-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-bottom: 20px;
        width: 100%;
        position: relative;
        z-index: 2;
    }

    .scroll-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #333;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .scroll-dot.active {
        background: #ffd200;
        transform: scale(1.2);
    }

    .scroll-item {
        background: none;
        border: none;
        border-radius: 15px;
        padding: 0;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        flex: 0 0 auto;
        width: 250px;
        height: 250px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
        scroll-snap-align: start;
    }

    .scroll-item:active {
        transform: scale(0.98);
    }

    .scroll-item .button-image {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px;
    }

    .scroll-item .button-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        margin-bottom: 5px;
    }

    .scroll-item .text {
        display: none;
    }

    .circle-scroll-container {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding: 5px 15px;
        margin-bottom: 5px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        position: relative;
        width: 100%;
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
        touch-action: pan-x pinch-zoom;
    }

    .circle-scroll-container::-webkit-scrollbar {
        display: none;
    }

    .circle-scroll-item {
        background: none;
        border: none;
        border-radius: 0;
        width: 250px;
        height: 250px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        flex: 0 0 auto;
        position: relative;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
        scroll-snap-align: start;
    }

    .circle-scroll-item:active {
        transform: scale(0.98);
    }

    .circle-scroll-item .button-image {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .circle-scroll-item .button-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .circle-scroll-item .text {
        display: none;
    }

    .circle-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-bottom: 30px;
        padding: 0 20px;
        width: 100%;
        max-width: 100%;
    }

    .circle-button {
        background: none;
        border: none;
        border-radius: 50%;
        width: 100px;
        height: 100px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        margin: 0 auto;
        padding: 0;
        position: relative;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
    }

    .circle-button:active {
        transform: scale(0.95);
    }

    .circle-button .button-image {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 15px;
    }

    .circle-button .button-image img {
        width: 31px;
        height: 31px;
        object-fit: contain;
        margin-bottom: 2px;
    }

    .circle-button .text {
        font-size: 0.7rem;
        text-align: center;
        font-weight: 500;
        color: white;
    }

    .input-group {
        margin-bottom: 25px;
        padding: 0 20px;
        width: 100%;
    }

    .input-label {
        display: block;
        margin-bottom: 10px;
        font-weight: 600;
        color: #ffd200;
        font-size: 1.1rem;
    }

    .text-input,
    .textarea-input {
        width: 100%;
        background: #2a2a2a;
        border: 2px solid #333;
        border-radius: 12px;
        padding: 15px;
        color: white;
        font-size: 1rem;
        resize: vertical;
        -webkit-appearance: none;
        -webkit-user-select: text;
        user-select: text;
    }

    .textarea-input {
        min-height: 120px;
    }

    .text-input:focus,
    .textarea-input:focus {
        outline: none;
        border-color: #ffd200;
    }

    .nav-buttons {
        display: flex;
        gap: 3vw;
        margin-top: auto;
        padding: 4vw;
        width: 100%;
        background: #000000;
        padding-bottom: max(20px, var(--safe-bottom));
    }

    .nav-button {
        flex: 1;
        padding: clamp(12px, 4vw, 16px);
        border: none;
        border-radius: 12px;
        font-size: clamp(0.9rem, 4vw, 1rem);
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-button.back {
        background: #6c757d;
        color: white;
    }

    .nav-button.next {
        background: #28a745;
        color: white;
    }

    .nav-button.send {
        background: #dc3545;
        color: white;
    }

    .nav-button.cancel {
        background: #ffc107;
        color: #212529;
    }

    .nav-button:disabled {
        background: #6c757d;
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

    .nav-button:active:not(:disabled) {
        transform: scale(0.98);
    }

    .progress-bar {
        width: 100%;
        height: 10px;
        background: linear-gradient(180deg, #1b1b1b, #111111);
        border-radius: 999px;
        margin: 20px 0;
        overflow: hidden;
        padding: 0 20px;
        position: relative;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    }

    .progress {
        height: 100%;
        width: 0%;
        border-radius: inherit;
        background: linear-gradient(90deg, #ffcc00 0%, #ffd84d 45%, #fff2a6 100%);
        box-shadow: 0 0 12px rgba(255, 214, 77, 0.55);
        position: relative;
        transition: width 0.45s ease;
    }

    .progress::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        right: 6px;
        width: 28px;
        background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.65) 100%);
        opacity: 0.6;
        filter: blur(1px);
        border-radius: 999px;
    }

    .step-info {
        text-align: center;
        color: #ccc;
        font-size: 0.9rem;
        margin-bottom: 10px;
        padding: 0 20px;
        display: none;
        width: 100%;
    }

    .extra-fields {
        margin-top: 20px;
        padding: 15px;
        background: #2a2a2a;
        border-radius: 12px;
        border: 2px solid #333;
        display: none;
        margin: 20px;
        width: calc(100% - 40px);
    }

    /* === Стили для РАЗДЕЛА ПАМЯТОК === */
    .references-container {
        position: relative;
        width: 100%;
        height: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        margin-bottom: 10px;
    }

    /* Полоса на фоне вровень с кнопками */
    .references-background-stripe {
        position: absolute;
        top: 50%;
        left: 0;
        width: 100%;
        height: 120px;
        background: #1a1a1a;
        z-index: 1;
        border-bottom: 1px solid #2a2a2a;
        transform: translateY(-50%);
    }

    .references-content {
        position: relative;
        z-index: 2;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .references-scroll-container {
        display: flex;
        gap: 20px;
        overflow-x: auto;
        padding: 20px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        position: relative;
        width: 100%;
        justify-content: flex-start;
        align-items: center;
        scroll-snap-type: x mandatory;
        touch-action: pan-x pinch-zoom;
    }

    .references-scroll-container::-webkit-scrollbar {
        display: none;
    }

    .references-wrapper {
        display: flex;
        gap: 20px;
        height: 100%;
        align-items: center;
        justify-content: flex-start;
        padding: 0 20px;
        scroll-snap-align: start;
    }

    .reference-item {
        flex: 0 0 auto;
        width: 280px;
        height: 400px;
        background: #1a1a1a;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        -webkit-tap-highlight-color: transparent;
        opacity: 0;
        scroll-snap-align: center;
        touch-action: pan-x;
    }

    .reference-item:active {
        transform: scale(0.98);
    }

    .reference-item .button-image {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .reference-item .button-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
    }

    .reference-title {
        display: none;
    }

    /* Полоса прокрутки с точками */
    .references-scroll-indicator {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin: 15px 0;
        width: 100%;
        position: relative;
        z-index: 2;
    }

    .references-scroll-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #333;
        transition: all 0.3s ease;
    }

    .references-scroll-dot.active {
        background: #ffd200;
        transform: scale(1.2);
    }

    /* ДОБАВЛЕНЫ СТИЛИ ДЛЯ ЦЕНТРИРОВАНИЯ ПЕРВОГО ЭЛЕМЕНТА */
    .references-scroll-container::before {
        content: '';
        flex: 0 0 calc(50% - 140px);
        min-width: 0;
    }

    .references-scroll-container::after {
        content: '';
        flex: 0 0 calc(50% - 140px);
        min-width: 0;
    }

    /* Центрирование контента для страниц выбора */
    .centered-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 0;
        width: 100%;
    }

    /* === Стили для PDF ПРОСМОТРА === */
    .pdf-viewer-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #000000;
        z-index: 2000;
        display: none;
        flex-direction: column;
        padding-top: var(--safe-top);
    }

    .pdf-viewer-container.active {
        display: flex;
    }

    .pdf-header {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        background: #1a1a1a;
        border-bottom: 1px solid #333;
        flex-shrink: 0;
        justify-content: space-between;
    }

    .pdf-back-button {
        background: #ffd200;
        color: #121212;
        border: none;
        border-radius: 10px;
        padding: 10px 15px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-right: 15px;
    }

    .pdf-title {
        color: white;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .pdf-close-button {
        background: transparent;
        color: #ffd200;
        border: 2px solid #ffd200;
        border-radius: 10px;
        padding: 10px 15px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .pdf-content {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .pdf-pages-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        width: 100%;
        max-width: 800px;
    }

    .pdf-page-container {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .pdf-canvas {
        max-width: 100%;
        height: auto;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        border-radius: 8px;
    }

    .pdf-loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #ccc;
        gap: 15px;
        height: 100%;
    }

    .pdf-loading-spinner {
        width: 40px;
        height: 40px;
        border: 3px solid #333;
        border-top: 3px solid #ffd200;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }

    /* === Стили для КРУГЛОГО ТУЛБАРА === */
    .bottom-toolbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(5, 5, 5, 0.7);
        border: none;
        border-radius: 0;
        padding: 15px 10px;
        display: none;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        padding-bottom: max(15px, var(--safe-bottom));
        gap: 5px;
        width: 100%;
        margin: 0;
        margin-left: -5px;
        margin-right: -5px;
        min-width: auto;
        height: 70px;
    }

    /* Убираем закругления и расширяем за края */
    .bottom-toolbar::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1.5px;
        background: linear-gradient(90deg, transparent 10%, #ffd200 50%, transparent 90%);
        z-index: 1000;
    }

    .toolbar-button {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        background: none;
        border: none;
        color: #666666;
        cursor: pointer;
        padding: 8px 5px;
        border-radius: 15px;
        transition: all 0.3s ease;
        flex: 1;
        max-width: 70px;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        overflow: hidden;
        min-height: 50px;
        border: none;
    }

    .toolbar-button.active {
        color: #ffd200;
    }

    .toolbar-button:active {
        color: #ffd200;
    }

    .toolbar-button.active .toolbar-icon {
        transform: scale(1.1);
    }

    .toolbar-icon {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease;
        position: relative;
        z-index: 1;
    }

    .toolbar-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: grayscale(1) brightness(0.5);
    }

    .toolbar-button.active .toolbar-icon img {
        filter: none;
    }

    /* Стили для ТЕКСТА ТУЛБАРА - СКРЫВАЕМ ПОДПИСИ */
    .toolbar-label {
        display: block;
        font-size: 9px;
    }

    /* Анимации для плавного перехода */
    .toolbar-button,
    .toolbar-icon,
    .toolbar-label {
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* СТИЛИ ДЛЯ СТРАНИЦЫ ТЕСТОВ */
    .test-timer {
        font-size: 1.2rem;
        font-weight: 600;
        color: #ffd200;
        margin-top: 10px;
    }

    .test-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 20px;
        overflow-y: auto;
    }

    .question-container {
        background: #1a1a1a;
        border-radius: 15px;
        padding: 20px;
        margin-bottom: 20px;
        border: 1px solid #333;
    }

    .question-text {
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 20px;
        color: white;
        font-weight: 500;
    }

    .answers-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .answer-option {
        background: #2a2a2a;
        border: 2px solid #333;
        border-radius: 10px;
        padding: 15px;
        color: white;
        text-align: left;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 1rem;
        -webkit-tap-highlight-color: transparent;
    }

    .answer-option:hover {
        background: #3a3a3a;
    }

    .answer-option:active {
        transform: scale(0.98);
    }

    /* ИСПРАВЛЕНИЕ 1: Первый вариант ответа в вопросах с двумя правильными ответами подсвечивается желтым */
    .answer-option.selected-yellow {
        border-color: #ffd200 !important;
        background: rgba(255, 210, 0, 0.1) !important;
    }

    .answer-option.correct {
        background: #2d5a27 !important;
        border-color: #4caf50 !important;
        color: white;
    }

    .answer-option.incorrect {
        background: #5a2727 !important;
        border-color: #f44336 !important;
        color: white;
    }

    .answer-option.selected {
        border-color: #ffd200;
        background: #3a3a3a;
    }

    /* Отключаем hover эффекты когда ответ уже выбран */
    .answer-option[style*="pointer-events: none"]:hover {
        background: inherit !important;
    }

    .test-navigation {
        display: flex;
        gap: 10px;
        margin-top: auto;
        padding: 20px 0;
    }

    .test-results-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px;
        padding-bottom: 100px;
        overflow-y: visible;
        overflow-x: hidden;
    }

    .result-score {
        text-align: center;
        margin-bottom: 30px;
    }

    .score-circle {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background: linear-gradient(135deg, #ffd200, #ffed4e);
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 15px;
        box-shadow: 0 4px 15px rgba(255, 210, 0, 0.3);
    }

    .score-circle span {
        font-size: 1.8rem;
        font-weight: bold;
        color: #121212;
    }

    .score-text {
        font-size: 1.1rem;
        color: #ccc;
    }

    .result-details {
        width: 100%;
        max-height: 47vh;
        min-height: 120px;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        margin-bottom: 15px;
        background: #1a1a1a;
        border-radius: 10px;
        padding: 10px;
        position: relative;
    }

    .result-item {
        padding: 10px;
        border-bottom: 1px solid #333;
        margin-bottom: 8px;
    }

    .result-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    .result-question {
        font-weight: 500;
        margin-bottom: 5px;
        color: white;
    }

    .result-answer {
        font-size: 0.9rem;
        color: #ccc;
    }

    .result-correct {
        color: #4caf50;
    }

    .result-incorrect {
        color: #f44336;
    }

    .result-actions {
        display: flex;
        gap: 10px;
        width: 100%;
        margin-top: 20px;
        margin-bottom: 50px;
        flex-shrink: 0;
    }

    /* === Стили для РАЗДЕЛА ВИДЕО === */
    .videos-container {
        width: 100%;
        padding: 0 20px;
    }

    .video-item {
        margin-bottom: 25px;
        background: #1a1a1a;
        border-radius: 15px;
        overflow: hidden;
        border: 1px solid #333;
    }

    .video-title {
        padding: 15px;
        background: rgba(42, 42, 42, 0.6);
        backdrop-filter: blur(10px);
        color: white;
        font-weight: 600;
        font-size: 1rem;
        border-bottom: 1px solid #333;
    }

    .video-player {
        width: 100%;
        height: 200px;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: relative;
    }

    .video-preview {
        width: 100%;
        height: 100%;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000;
        overflow: hidden;
    }

    .video-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .video-player:hover .video-preview img {
        transform: scale(1.05);
    }

    .video-play-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 3rem;
        transition: all 0.3s ease;
    }

    .video-player:hover .video-play-overlay {
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(0px);
    }

    .video-play-button {
        text-align: center;
        color: white;
    }

    .play-icon {
        font-size: 4rem;
        margin-bottom: 15px;
        color: #ffd200;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        transition: transform 0.3s ease;
    }

    .video-player:hover .play-icon {
        transform: scale(1.1);
    }

    .play-text {
        font-size: 1.1rem;
        font-weight: 500;
        color: #fff;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    }

    /* Стили для полноэкранного режима видео */
    .video-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #000;
        z-index: 4000;
        display: none;
        flex-direction: column;
        padding-top: var(--safe-top);
    }

    .video-fullscreen.active {
        display: flex;
    }

    .video-fullscreen-header {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        background: rgba(0, 0, 0, 0.8);
        border-bottom: 1px solid #333;
        flex-shrink: 0;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        justify-content: space-between;
    }

    .video-fullscreen-back {
        background: transparent;
        color: #ffd200;
        border: 2px solid #ffd200;
        border-radius: 10px;
        padding: 10px 15px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-right: 15px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .video-fullscreen-title {
        color: white;
        font-size: 1.1rem;
        font-weight: 600;
        flex: 1;
    }

    .video-close-button {
        background: transparent;
        color: #ffd200;
        border: 2px solid #ffd200;
        border-radius: 10px;
        padding: 10px 15px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .video-fullscreen-content {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000;
        position: relative;
    }

    .video-fullscreen-content video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    /* Стили для плейсхолдера когда видео недоступно */
    .video-placeholder {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #ccc;
        font-size: 0.9rem;
        text-align: center;
        padding: 20px;
        background: #1a1a1a;
        border: 2px dashed #333;
    }

    .video-placeholder small {
        margin-top: 10px;
        color: #666;
    }

    /* СТИЛИ ДЛЯ ПОЛНОЭКРАННЫХ ИНСТРУКЦИЙ */
    .fullscreen-instruction {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #000000;
        z-index: 3000;
        display: none;
        flex-direction: column;
        padding-top: var(--safe-top);
        overflow-y: auto;
    }

    .fullscreen-instruction.active {
        display: flex;
    }

    .instruction-header {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        background: rgba(26, 26, 26, 0.95);
        border-bottom: 1px solid #333;
        flex-shrink: 0;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        justify-content: space-between;
    }

    .instruction-back-button {
        background: transparent;
        color: #ffd200;
        border: 2px solid #ffd200;
        border-radius: 10px;
        padding: 10px 15px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-right: 15px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .instruction-title {
        color: white;
        font-size: 1.1rem;
        font-weight: 600;
        flex: 1;
    }

    .instruction-close-button {
        background: transparent;
        color: #ffd200;
        border: 2px solid #ffd200;
        border-radius: 10px;
        padding: 10px 15px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .instruction-content {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
        background: #000000;
    }

    /* Адаптивные стили для ВИДЕО */
    @media (max-width: 480px) {
        .videos-container {
            padding: 0 15px;
        }

        .video-player {
            height: 180px;
        }

        .video-title {
            padding: 12px 15px;
            font-size: 0.95rem;
        }
    }

    @media (max-width: 320px) {
        .video-player {
            height: 160px;
        }
    }

    /* Адаптивные стили для ТУЛБАРА С 5 КНОПКАМИ */
    @media (max-width: 768px) {
        .bottom-toolbar {
            padding: 12px 8px;
            gap: 3px;
            height: 100px;
        }

        .toolbar-button {
            padding: 6px 3px;
            max-width: 60px;
            min-height: 45px;
            border-radius: 12px;
        }

        .toolbar-icon {
            width: 31px;
            height: 31px;
        }
    }

    @media (max-width: 480px) {
        .bottom-toolbar {
            padding: 4px 10px;
            gap: 2px;
            height: 80px;
        }

        .toolbar-button {
            padding: 5px 2px;
            max-width: 55px;
            min-height: 55px;
        }

        .toolbar-icon {
            width: 26px;
            height: 26px;
        }
    }

    @media (max-width: 380px) {
        .bottom-toolbar {
            padding: 4px 10px;
            gap: 2px;
            height: 70px;
        }

        .toolbar-button {
            padding: 5px 2px;
            max-width: 55px;
            min-height: 40px;
        }

        .toolbar-icon {
            width: 22px;
            height: 22px;
        }

        .bottom-toolbar.collapsed {
            width: 55px;
            height: 55px;
            border-radius: 27.5px;
            left: 10px;
            bottom: 10px;
        }

        .bottom-toolbar.collapsed .toolbar-button.active {
            width: 45px;
            height: 45px;
            border-radius: 22.5px;
        }
    }

    @media (max-width: 320px) {
        .bottom-toolbar {
            padding: 8px 0px;
            gap: 1px;
            height: 60px;
        }

        .toolbar-button {
            padding: 4px 1px;
            max-width: 50px;
        }

        .toolbar-icon {
            width: 25px;
            height: 25px;
        }

        .bottom-toolbar.collapsed {
            width: 50px;
            height: 50px;
            border-radius: 25px;
            left: 8px;
            bottom: 8px;
        }

        .bottom-toolbar.collapsed .toolbar-button.active {
            width: 40px;
            height: 40px;
            border-radius: 20px;
        }
    }

    /* УЛУЧШЕННЫЕ СТИЛИ ДЛЯ PWA РЕЖИМА */
    @media (display-mode: standalone) {
        body {
            padding-top: var(--safe-top);
            padding-bottom: var(--safe-bottom);
        }

        .main-header,
        .header,
        #pageMessages .header {
            padding-top: max(70px, calc(50px + var(--safe-top)));
        }

        /* Увеличиваем отступ для кнопки установки в PWA */
        .install-button {
            top: calc(25px + var(--safe-top));
        }
    }

    /* Для iOS PWA с вырезом */
    @supports (-webkit-touch-callout: none) {

        .main-header,
        .header,
        #pageMessages .header {
            padding-top: max(70px, calc(50px + var(--safe-top)));
        }

        .island-overlay {
            display: flex;
            align-items: center;
            gap: var(--spacing-md);
            padding: calc(var(--safe-top) + var(--spacing-md)) var(--spacing-lg);
            background: #000000 !important;
            position: sticky;
            top: 0;
            z-index: 100;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .install-button {
            top: calc(25px + var(--safe-top));
            right: max(15px, var(--safe-right));
        }
    }

    /* Резервные стили если env() не работает */
    body.pwa-mode .main-header,
    body.pwa-mode .header,
    body.pwa-mode #pageMessages .header {
        padding-top: 70px !important;
    }

    /* Адаптивные стили для МОБИЛЬНЫХ УСТРОЙСТВ */
    @media (max-width: 768px) {
        body {
            padding-bottom: 95px;
        }

        .logo {
            max-width: 400px;
        }

        .scroll-container {
            padding: 10px 15px;
        }

        .circle-scroll-container {
            padding: 10px 15px;
        }

        .references-scroll-container {
            padding: 15px;
        }

        .references-wrapper {
            padding: 0 15px;
        }

        .reference-item {
            width: 250px;
            height: 357px;
        }

        .install-button {
            top: calc(15px + var(--safe-top));
            right: 15px;
            padding: 10px 16px;
            font-size: 14px;
        }
    }

    @media (max-width: 480px) {
        body {
            padding: 0 0 90px 0;
        }

        .header {
            padding: 4vw 3vw 2vw 3vw;
            margin-bottom: 2vw;
            padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        }

        .header h1 {
            font-size: clamp(1.3rem, 5vw, 1.7rem);
        }

        #pageMessages .header {
            padding: 4vw 3vw 1vw 3vw;
            padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        }

        .logo {
            max-width: 300px;
        }

        .circle-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            padding: 0 15px;
        }

        .circle-button {
            width: 90px;
            height: 90px;
        }

        .circle-button .button-image img {
            width: 35px;
            height: 35px;
        }

        .scroll-container {
            padding: 10px 15px;
        }

        .circle-scroll-container {
            padding: 10px 15px;
        }

        .scroll-item {
            width: 220px;
            height: 220px;
        }

        .circle-scroll-item {
            width: 250px;
            height: 250px;
        }

        .input-group,
        .nav-buttons,
        .progress-bar,
        .step-info {
            padding: 0 15px;
        }

        .extra-fields {
            margin: 20px 15px;
            width: calc(100% - 30px);
        }

        .references-scroll-container {
            padding: 10px;
            margin-top: 130px;
        }

        .references-wrapper {
            padding: 0 10px;
        }

        .reference-item {
            width: 220px;
            height: 314px;
        }

        .install-button {
            top: calc(10px + var(--safe-top));
            right: 10px;
            padding: 8px 14px;
            font-size: 12px;
        }

        .splash-logo {
            width: 120px;
            height: 120px;
        }

        .splash-title {
            font-size: 1.7rem;
        }

        .bottom-toolbar.collapsed {
            width: 65px;
            height: 65px;
            border-radius: 32.5px;
            left: 15px;
        }

        .bottom-toolbar.collapsed .toolbar-button.active {
            width: 55px;
            height: 55px;
            border-radius: 27.5px;
        }

        .pdf-content {
            padding: 10px;
        }

        .pdf-pages-container {
            gap: 10px;
        }

        .pdf-header {
            padding: 12px 15px;
        }

        .pdf-back-button {
            padding: 8px 12px;
            font-size: 14px;
        }

        .pdf-title {
            font-size: 1rem;
        }

        /* Адаптивные отступы для header */
        .main-header {
            min-height: 120px;
            padding: 10px 10px 0 10px;
            padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        }

        .main-logo {
            max-width: 270px;
        }
    }

    /* Адаптивные стили для ЭКРАНОВ 360-380px */
    @media (max-width: 380px) {


        .main-header {
            min-height: 120px;
            padding: 10px 10px 0px 10px;
            padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        }

        .references-scroll-container {
            padding: 10px;
            margin-top: 40px;
        }

        .main-logo {
            max-width: 230px;
        }
    }

    /* Адаптивные стили для ЭКРАНОВ 320px */
    @media (max-width: 320px) {
        body {
            padding-bottom: 85px;
        }

        .logo {
            max-width: 250px;
        }

        .circle-button {
            width: 80px;
            height: 80px;
        }

        .circle-button .button-image img {
            width: 30px;
            height: 30px;
        }

        .scroll-item {
            width: 200px;
            height: 200px;
        }

        .circle-scroll-item {
            width: 250px;
            height: 250px;
        }

        .reference-item {
            width: 200px;
            height: 286px;
        }

        .splash-logo {
            width: 100px;
            height: 100px;
        }

        .splash-title {
            font-size: 1.5rem;
        }

        .bottom-toolbar.collapsed {
            width: 60px;
            height: 60px;
            border-radius: 30px;
            left: 10px;
        }

        .bottom-toolbar.collapsed .toolbar-button.active {
            width: 50px;
            height: 50px;
            border-radius: 25px;
        }

        /* Адаптивные отступы для header */
        .header {
            padding: 3vw 2vw 1vw 2vw;
            padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        }

        #pageMessages .header {
            padding: 3vw 2vw 0.5vw 2vw;
            padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        }

        .main-header {
            padding: 10px 10px 0 10px;
            padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        }

        .references-scroll-container {
            padding: 10px;
            margin-top: 40px;
        }

        .main-logo {
            max-width: 190px;
        }

        .main-header {
            min-height: 100px;
            margin-top: 31px;
        }
    }

    /* Для устройств без выреза (notch) */
    @supports not (padding-top: var(--safe-top)) {
        .island-overlay {
            display: flex;
            align-items: center;
            gap: var(--spacing-md);
            padding: calc(var(--safe-top) + var(--spacing-md)) var(--spacing-lg);
            background: #000000 !important;
            position: sticky;
            top: 0;
            z-index: 100;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
    }

    /* Для Landscape ориентации */
    @media (max-height: 500px) and (orientation: landscape) {
        .island-overlay {
            display: flex;
            align-items: center;
            gap: var(--spacing-md);
            padding: calc(var(--safe-top) + var(--spacing-md)) var(--spacing-lg);
            background: #000000 !important;
            position: sticky;
            top: 0;
            z-index: 100;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
    }

    /* === СТИЛИ ДЛЯ РАЗДЕЛА ЧАТ-БОТА БЕЗ СКРОЛЛА === */
    #pageChat {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100dvh;
        background: #000000;
        display: none;
        flex-direction: column;
        overflow: hidden;
        z-index: 100;
        padding: 0;
        margin: 0;
    }

    #pageChat.active {
        display: flex;
    }

    /* Контейнер чата - занимает всю оставшуюся высоту */
    .chat-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        width: 100%;
        background: #000000;
        position: relative;
        overflow: hidden;
        min-height: 0;
    }

    /* Область сообщений с фиксированной высотой и скроллом */
    #chat-box {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
        background: #000000;
    }

    /* Сообщения - скролл только здесь */
    #messages {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        min-height: 0;
        scrollbar-width: thin;
        scrollbar-color: #ffd200 #1a1a1a;
        -webkit-overflow-scrolling: touch;
    }

    #messages::-webkit-scrollbar {
        width: 6px;
    }

    #messages::-webkit-scrollbar-track {
        background: #1a1a1a;
        border-radius: 3px;
    }

    #messages::-webkit-scrollbar-thumb {
        background: #ffd200;
        border-radius: 3px;
    }

    /* Панель ввода - внизу через flex */
    #input-area {
        flex-shrink: 0;
        display: flex;
        padding: 12px 15px calc(12px + var(--safe-bottom));
        background: #1a1a1a;
        border-top: 1px solid #333;
        gap: 12px;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
    }

    /* Поле ввода */
    #input {
        flex: 1;
        padding: 12px 16px;
        border: 2px solid #333;
        border-radius: 25px;
        outline: none;
        background: #2a2a2a;
        color: white;
        font-size: 16px;
        line-height: 1.4;
        min-height: 44px;
        resize: none;
    }

    #input:focus {
        border-color: #ffd200;
    }

    /* Кнопка отправки */
    #send {
        background: linear-gradient(135deg, #ffd200, #ffed4e);
        color: #121212;
        border: none;
        padding: 12px 12px;
        border-radius: 25px;
        cursor: pointer;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(255, 210, 0, 0.3);
        transition: all 0.3s ease;
        font-size: 16px;
        min-height: 44px;
        min-width: 80px;
        flex-shrink: 0;
    }

    #send:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(255, 210, 0, 0.4);
    }

    #send:active {
        transform: translateY(0);
    }

    /* Сообщения */
    .message {
        padding: 12px 16px;
        border-radius: 18px;
        max-width: 85%;
        word-wrap: break-word;
        line-height: 1.4;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        font-size: 16px;
        animation: messageAppear 0.3s ease-out;
    }

    @keyframes messageAppear {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .user {
        background: linear-gradient(135deg, #ffd200, #ffed4e);
        color: #121212;
        align-self: flex-end;
        border-bottom-right-radius: 6px;
        font-weight: 500;
    }

    .bot {
        background: #2a2a2a;
        color: white;
        align-self: flex-start;
        border-bottom-left-radius: 6px;
        border: 1px solid #333;
    }

    .typing::after {
        content: "...";
        animation: blink 1.5s infinite;
    }

    @keyframes blink {

        0%,
        50% {
            opacity: 1;
        }

        51%,
        100% {
            opacity: 0;
        }
    }



    /* АДАПТАЦИЯ ЧАТА ДЛЯ ЭКРАНОВ 320-380px */
    @media (max-width: 380px) {
        #messages {
            padding: 15px;
            padding-bottom: 15px;
            gap: 8px;
        }

        .message {
            max-width: 90%;
            padding: 10px 12px;
            font-size: 14px;
        }

        #input-area {
            padding: 12px 15px calc(12px + var(--safe-bottom));
        }

        #input {
            padding: 10px 14px;
            font-size: 14px;
            min-height: 40px;
        }

        #send {
            padding: 10px 10px;
            min-height: 40px;
            min-width: 70px;
            font-size: 14px;
        }
    }

    @media (max-width: 360px) {
        #messages {
            padding: 15px;
            padding-bottom: 15px;
            gap: 6px;
        }

        .message {
            max-width: 92%;
            padding: 8px 10px;
            font-size: 13px;
        }

        #input-area {
            padding: 12px 15px calc(12px + var(--safe-bottom));
            gap: 8px;
        }

        #input {
            padding: 8px 12px;
            font-size: 13px;
            min-height: 38px;
        }

        #send {
            padding: 8px 8px;
            min-height: 38px;
            min-width: 65px;
            font-size: 13px;
        }
    }

    @media (max-width: 320px) {
        #messages {
            padding: 15px;
            padding-bottom: 15px;
            gap: 5px;
        }

        .message {
            max-width: 95%;
            padding: 6px 8px;
            font-size: 12px;
        }

        #input-area {
            padding: 12px 15px calc(12px + var(--safe-bottom));
            gap: 10px;
        }

        #input {
            padding: 6px 10px;
            font-size: 12px;
            min-height: 35px;
        }

        #send {
            padding: 6px 6px;
            min-height: 35px;
            min-width: 60px;
            font-size: 12px;
        }
    }

    /* Стили для кнопок тестов */
    #pageTestQuestions .nav-button.back,
    #pageTestResults .nav-button.back,
    #pageTestMode .nav-button.back,
    #pageTestSections .nav-button.back {
        display: none !important;
    }

    #pageTestQuestions .nav-button.back:not([disabled]) {
        display: none !important;
    }

    /* Стили для СООБЩЕНИЙ О НАРУШЕНИИ */
    #pageDescription .nav-buttons {
        display: flex;
    }

    /* Скрываем кнопки отмена в сообщениях */
    #pageGroup .nav-button.cancel,
    #pageManagement .nav-button.cancel,
    #pageShop .nav-button.cancel,
    #pageArea .nav-button.cancel {
        display: none;
    }

    /* Скрываем кнопки назад в инструкциях, памятках, видео при открытии полного экрана */
    .fullscreen-instruction .instruction-back-button,
    .video-fullscreen .video-fullscreen-back,
    .pdf-viewer-container .pdf-back-button {
        display: none;
    }

    /* Скрываем кнопки назад в навигации */
    #pageTestResults .nav-button.back,
    #pageDescription .nav-button.back {
        display: none !important;
    }

    /* Скрываем кнопки назад в шагах */
    #pageOrganization .nav-button.back,
    #pageGroup .nav-button.back,
    #pageManagement .nav-button.back,
    #pageManualManagement .nav-button.back,
    #pageContractor .nav-button.back,
    #pageShop .nav-button.back,
    #pageArea .nav-button.back,
    #pagePlace .nav-button.back,
    #pageDescription .nav-button.back {
        display: none !important;
    }

    /* Скрываем плашку в полноэкранных режимах */
    #fullscreenInstruction.active~.island-overlay,
    #pdfViewer.active~.island-overlay,
    #videoFullscreen.active~.island-overlay,
    #fullscreenInstruction.active~.island-buttons,
    #pdfViewer.active~.island-buttons,
    #videoFullscreen.active~.island-buttons {
        display: none !important;
    }

    /* Убираем все обводки у кнопок тулбара */
    .toolbar-button {
        outline: none !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Убираем обводки при фокусе и активном состоянии */
    .toolbar-button:focus,
    .toolbar-button:active,
    .toolbar-button:hover,
    .toolbar-button.active {
        outline: none !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Убираем обводки у иконок */
    .toolbar-icon img {
        outline: none !important;
        border: none !important;
    }

    /* Убираем возможные псевдоэлементы с обводками */
    .toolbar-button::before,
    .toolbar-button::after {
        display: none !important;
    }

    /* Для свернутого состояния тулбара */
    .bottom-toolbar.collapsed .toolbar-button.active {
        outline: none !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* НОВЫЕ СТИЛИ ДЛЯ МОДАЛЬНЫХ ОКОН НАРУШЕНИЯ */
    .violation-modal {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffd200;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        z-index: 2000;
        display: none;
        flex-direction: column;
        max-height: 80vh;
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
        padding-bottom: var(--safe-bottom);
    }

    .violation-modal.active {
        display: flex;
        transform: translateY(0);
        animation: slideUp 0.3s ease-out;
    }

    .violation-modal.slide-out {
        animation: slideDown 0.3s ease-out forwards;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    @keyframes slideDown {
        from {
            transform: translateY(0);
            opacity: 1;
            display: flex;
        }

        to {
            transform: translateY(100%);
            opacity: 0;
            display: none;
        }
    }

    .violation-modal-header {
        padding: 20px;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #ffd200;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .violation-modal-title {
        font-size: 1.2rem;
        font-weight: 600;
        color: #121212;
    }

    .violation-modal-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #121212;
        cursor: pointer;
        padding: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .violation-modal-content {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
        background: #ffd200;
    }

    .violation-modal-input-group {
        margin-bottom: 20px;
    }

    .violation-modal-label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #121212;
        font-size: 1rem;
    }

    .violation-modal-input {
        width: 100%;
        background: rgba(255, 255, 255, 0.9);
        border: 2px solid rgba(0, 0, 0, 0.2);
        border-radius: 10px;
        padding: 12px 15px;
        color: #121212;
        font-size: 1rem;
        resize: vertical;
    }

    .violation-modal-input:focus {
        outline: none;
        border-color: rgba(0, 0, 0, 0.4);
        background: white;
    }

    .violation-modal-buttons {
        display: flex;
        gap: 15px;
        padding: 20px;
        border-top: 2px solid rgba(0, 0, 0, 0.1);
        background: #ffd200;
    }

    .violation-modal-button {
        flex: 1;
        padding: 12px;
        border: none;
        border-radius: 10px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .violation-modal-button.next {
        background: #121212;
        color: #ffd200;
    }

    .violation-modal-button.next:disabled {
        background: #666;
        color: #999;
        cursor: not-allowed;
    }

    .violation-modal-button.cancel {
        background: rgba(255, 255, 255, 0.9);
        color: #121212;
        border: 2px solid rgba(0, 0, 0, 0.2);
    }

    .violation-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        display: none;
        animation: fadeInOpacity 0.3s ease-out;
    }

    .violation-modal-overlay.active {
        display: block;
    }

    @keyframes fadeInOpacity {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    /* СТИЛИ ДЛЯ ШАГОВ ПРОГРЕССА В МОДАЛЬНЫХ ОКНАХ */
    .modal-progress {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-bottom: 20px;
    }

    .modal-progress-step {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }

    .modal-progress-step.active {
        background: #121212;
        transform: scale(1.2);
    }

    /* СТИЛИ ДЛЯ ТЕМНЫХ ПОЛЕЙ ВВОДА */
    .violation-modal-input.dark {
        background: #1a1a1a;
        color: white;
        border-color: #333;
    }

    .violation-modal-input.dark:focus {
        background: #2a2a2a;
        border-color: #ffd200;
    }

    .violation-modal-label.dark {
        color: #121212;
    }

    /* СТИЛИ ДЛЯ ИНДИКАТОРА ПРОГРЕССА ТЕСТА */
    .test-progress {
        width: 100%;
        padding: 0 20px;
        margin-bottom: 20px;
    }

    .progress-bar-test {
        width: 100%;
        height: 8px;
        background: #333;
        border-radius: 4px;
        overflow: hidden;
        position: relative;
    }

    .progress-fill-test {
        height: 100%;
        background: linear-gradient(90deg, #ffd200, #ffed4e);
        width: 0%;
        transition: width 0.4s ease;
        border-radius: 4px;
    }

    .test-progress-text {
        display: flex;
        justify-content: space-between;
        margin-top: 8px;
        color: #ccc;
        font-size: 0.9rem;
    }

    /* АДАПТАЦИЯ ИНДИКАТОРА ПРОГРЕССА ТЕСТА */
    @media (max-width: 768px) {
        .test-progress {
            padding: 0 15px;
            margin-bottom: 15px;
        }

        .progress-bar-test {
            height: 6px;
        }

        .test-progress-text {
            font-size: 0.85rem;
        }
    }

    @media (max-width: 480px) {
        .test-progress {
            padding: 0 12px;
            margin-bottom: 12px;
        }

        .progress-bar-test {
            height: 5px;
        }

        .test-progress-text {
            font-size: 0.8rem;
            margin-top: 6px;
        }
    }

    @media (max-width: 380px) {
        .test-progress {
            padding: 0 10px;
            margin-bottom: 10px;
        }

        .progress-bar-test {
            height: 4px;
        }

        .test-progress-text {
            font-size: 0.75rem;
            margin-top: 5px;
        }
    }

    @media (max-width: 320px) {
        .test-progress {
            padding: 0 8px;
            margin-bottom: 8px;
        }

        .progress-bar-test {
            height: 3px;
        }

        .test-progress-text {
            font-size: 0.7rem;
            margin-top: 4px;
        }
    }

    /* СТИЛИ ДЛЯ ВРЕМЕНИ ТЕСТА */
    .test-timer-container {
        text-align: center;
        margin-bottom: 20px;
        padding: 0 20px;
    }

    .timer-display {
        font-size: 1.5rem;
        font-weight: 700;
        color: #ffd200;
        margin-bottom: 5px;
        font-family: 'Courier New', monospace;
    }

    .timer-label {
        color: #ccc;
        font-size: 0.9rem;
    }

    /* АДАПТАЦИЯ ТАЙМЕРА ТЕСТА */
    @media (max-width: 768px) {
        .test-timer-container {
            margin-bottom: 15px;
            padding: 0 15px;
        }

        .timer-display {
            font-size: 1.3rem;
        }

        .timer-label {
            font-size: 0.85rem;
        }
    }

    @media (max-width: 480px) {
        .test-timer-container {
            margin-bottom: 12px;
            padding: 0 12px;
        }

        .timer-display {
            font-size: 1.1rem;
        }

        .timer-label {
            font-size: 0.8rem;
        }
    }

    @media (max-width: 380px) {
        .test-timer-container {
            margin-bottom: 10px;
            padding: 0 10px;
        }

        .timer-display {
            font-size: 1rem;
        }

        .timer-label {
            font-size: 0.75rem;
        }
    }

    @media (max-width: 320px) {
        .test-timer-container {
            margin-bottom: 8px;
            padding: 0 8px;
        }

        .timer-display {
            font-size: 0.9rem;
        }

        .timer-label {
            font-size: 0.7rem;
        }
    }

    /* СТИЛИ ДЛЯ НОМЕРА ВОПРОСА */
    .question-number {
        text-align: center;
        color: #ffd200;
        font-weight: 600;
        margin-bottom: 15px;
        font-size: 1.1rem;
        padding: 0 20px;
    }

    /* АДАПТАЦИЯ НОМЕРА ВОПРОСА */
    @media (max-width: 768px) {
        .question-number {
            margin-bottom: 12px;
            font-size: 1rem;
            padding: 0 15px;
        }
    }

    @media (max-width: 480px) {
        .question-number {
            margin-bottom: 10px;
            font-size: 0.95rem;
            padding: 0 12px;
        }
    }

    @media (max-width: 380px) {
        .question-number {
            margin-bottom: 8px;
            font-size: 0.9rem;
            padding: 0 10px;
        }
    }

    @media (max-width: 320px) {
        .question-number {
            margin-bottom: 6px;
            font-size: 0.85rem;
            padding: 0 8px;
        }
    }

    /* СТИЛИ ДЛЯ ИЗОБРАЖЕНИЙ В ВОПРОСАХ ТЕСТА */
    .question-image-container {
        margin: 15px 0;
        text-align: center;
    }

    .question-image {
        max-width: 100%;
        max-height: 200px;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    @media (max-width: 380px) {
        .question-image {
            max-height: 140px;
        }
    }

    @media (max-width: 320px) {
        .question-image {
            max-height: 120px;
            border-radius: 6px;
        }
    }

    /* СТИЛИ ДЛЯ КНОПОК навигации ТЕСТА */
    .test-nav-button {
        flex: 1;
        padding: 12px 20px;
        border: none;
        border-radius: 10px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
    }

    .test-nav-button.prev {
        background: #6c757d;
        color: white;
    }

    .test-nav-button.next {
        background: #28a745;
        color: white;
    }

    .test-nav-button.finish {
        background: #dc3545;
        color: white;
    }

    .test-nav-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    .test-nav-button:active:not(:disabled) {
        transform: scale(0.98);
    }

    /* АДАПТАЦИЯ КНОПОК навигации ТЕСТА */
    @media (max-width: 768px) {
        .test-nav-button {
            padding: 10px 16px;
            font-size: 0.95rem;
        }
    }

    @media (max-width: 480px) {
        .test-nav-button {
            padding: 8px 12px;
            font-size: 0.9rem;
            border-radius: 8px;
        }
    }

    @media (max-width: 380px) {
        .test-nav-button {
            padding: 7px 10px;
            font-size: 0.85rem;
        }
    }

    @media (max-width: 320px) {
        .test-nav-button {
            padding: 6px 8px;
            font-size: 0.8rem;
            border-radius: 6px;
        }
    }

    /* СТИЛИ ДЛЯ СПИСКА ВОПРОСОВ В РЕЗУЛЬТАТАХ */
    .question-list-results {
        width: 100%;
        margin-bottom: 20px;
    }

    .question-list-item {
        display: flex;
        align-items: center;
        padding: 10px;
        margin-bottom: 8px;
        background: #2a2a2a;
        border-radius: 8px;
        border-left: 4px solid #333;
    }

    .question-list-item.correct {
        border-left-color: #4caf50;
    }

    .question-list-item.incorrect {
        border-left-color: #f44336;
    }

    .question-number-badge {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: #333;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 12px;
        font-weight: 600;
        font-size: 0.9rem;
    }

    .question-list-item.correct .question-number-badge {
        background: #4caf50;
        color: white;
    }

    .question-list-item.incorrect .question-number-badge {
        background: #f44336;
        color: white;
    }

    .question-list-text {
        flex: 1;
        font-size: 0.9rem;
        color: white;
    }

    /* АДАПТАЦИЯ СПИСКА ВОПРОСОВ */
    @media (max-width: 768px) {
        .question-list-item {
            padding: 8px;
            margin-bottom: 6px;
        }

        .question-number-badge {
            width: 28px;
            height: 28px;
            font-size: 0.85rem;
            margin-right: 10px;
        }

        .question-list-text {
            font-size: 0.85rem;
        }
    }

    @media (max-width: 480px) {
        .question-list-item {
            padding: 6px;
            margin-bottom: 5px;
            border-left-width: 3px;
        }

        .question-number-badge {
            width: 26px;
            height: 26px;
            font-size: 0.8rem;
            margin-right: 8px;
        }

        .question-list-text {
            font-size: 0.8rem;
        }
    }

    @media (max-width: 380px) {
        .question-list-item {
            padding: 5px;
        }

        .question-number-badge {
            width: 24px;
            height: 24px;
            font-size: 0.75rem;
            margin-right: 6px;
        }

        .question-list-text {
            font-size: 0.75rem;
        }
    }

    @media (max-width: 320px) {
        .question-list-item {
            padding: 4px;
            margin-bottom: 4px;
        }

        .question-number-badge {
            width: 22px;
            height: 22px;
            font-size: 0.7rem;
            margin-right: 5px;
        }

        .question-list-text {
            font-size: 0.7rem;
        }
    }

    /* СТИЛИ ДЛЯ СТАТИСТИКИ ТЕСТА */
    .test-statistics {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 25px;
        padding: 0 20px;
    }

    .stat-item {
        background: #2a2a2a;
        border-radius: 10px;
        padding: 15px;
        text-align: center;
    }

    .stat-value {
        font-size: 1.5rem;
        font-weight: 700;
        color: #ffd200;
        margin-bottom: 5px;
    }

    .stat-label {
        font-size: 0.9rem;
        color: #ccc;
    }

    /* АДАПТАЦИЯ СТАТИСТИКИ ТЕСТА */
    @media (max-width: 768px) {
        .test-statistics {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            margin-bottom: 20px;
            padding: 0 15px;
        }

        .stat-item {
            padding: 12px;
            border-radius: 8px;
        }

        .stat-value {
            font-size: 1.3rem;
        }

        .stat-label {
            font-size: 0.85rem;
        }
    }

    @media (max-width: 480px) {
        .test-statistics {
            gap: 10px;
            margin-bottom: 15px;
            padding: 0 12px;
        }

        .stat-item {
            padding: 10px;
        }

        .stat-value {
            font-size: 1.1rem;
        }

        .stat-label {
            font-size: 0.8rem;
        }
    }

    @media (max-width: 380px) {
        .test-statistics {
            gap: 8px;
            margin-bottom: 12px;
            padding: 0 10px;
        }

        .stat-item {
            padding: 8px;
            border-radius: 6px;
        }

        .stat-value {
            font-size: 1rem;
        }

        .stat-label {
            font-size: 0.75rem;
        }
    }

    @media (max-width: 320px) {
        .test-statistics {
            gap: 6px;
            margin-bottom: 10px;
            padding: 0 8px;
        }

        .stat-item {
            padding: 6px;
        }

        .stat-value {
            font-size: 0.9rem;
        }

        .stat-label {
            font-size: 0.7rem;
        }
    }

    /* СТИЛИ ДЛЯ КНОПОК ПОВТОРА И ВЫХОДА */
    .test-result-actions {
        display: flex;
        gap: 15px;
        width: 100%;
        padding: 0 20px;
    }

    .action-button {
        flex: 1;
        padding: 12px 20px;
        border: none;
        border-radius: 10px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
    }

    .action-button.retry {
        background: #ffd200;
        color: #121212;
    }

    .action-button.exit {
        background: #6c757d;
        color: white;
    }

    .action-button:active {
        transform: scale(0.98);
    }

    /* АДАПТАЦИЯ КНОПОК ДЕЙСТВИЙ */
    @media (max-width: 768px) {
        .test-result-actions {
            gap: 12px;
            padding: 0 15px;
        }

        .action-button {
            padding: 10px 16px;
            font-size: 0.95rem;
        }
    }

    @media (max-width: 480px) {
        .test-result-actions {
            gap: 10px;
            padding: 0 12px;
        }

        .action-button {
            padding: 8px 12px;
            font-size: 0.9rem;
            border-radius: 8px;
        }
    }

    @media (max-width: 380px) {
        .test-result-actions {
            gap: 8px;
            padding: 0 10px;
        }

        .action-button {
            padding: 7px 10px;
            font-size: 0.85rem;
        }
    }

    @media (max-width: 320px) {
        .test-result-actions {
            gap: 6px;
            padding: 0 8px;
        }

        .action-button {
            padding: 6px 8px;
            font-size: 0.8rem;
            border-radius: 6px;
        }
    }

    /* СТИЛИ ДЛЯ СООБЩЕНИЯ О ЗАВЕРШЕНИИ ТЕСТА */
    .test-complete-message {
        text-align: center;
        margin-bottom: 25px;
        padding: 0 20px;
    }

    .complete-title {
        font-size: 1.3rem;
        color: #ffd200;
        margin-bottom: 10px;
        font-weight: 600;
    }

    .complete-text {
        color: #ccc;
        font-size: 1rem;
        line-height: 1.5;
    }

    /* АДАПТАЦИЯ СООБЩЕНИЯ О ЗАВЕРШЕНИИ */
    @media (max-width: 768px) {
        .test-complete-message {
            margin-bottom: 20px;
            padding: 0 15px;
        }

        .complete-title {
            font-size: 1.2rem;
        }

        .complete-text {
            font-size: 0.95rem;
        }
    }

    @media (max-width: 480px) {
        .test-complete-message {
            margin-bottom: 15px;
            padding: 0 12px;
        }

        .complete-title {
            font-size: 1.1rem;
        }

        .complete-text {
            font-size: 0.9rem;
        }
    }

    @media (max-width: 380px) {
        .test-complete-message {
            margin-bottom: 12px;
            padding: 0 10px;
        }

        .complete-title {
            font-size: 1rem;
        }

        .complete-text {
            font-size: 0.85rem;
        }
    }

    @media (max-width: 320px) {
        .test-complete-message {
            margin-bottom: 10px;
            padding: 0 8px;
        }

        .complete-title {
            font-size: 0.95rem;
        }

        .complete-text {
            font-size: 0.8rem;
        }
    }

    /* СТИЛИ ДЛЯ ЗАГРУЗКИ ТЕСТА */
    .test-loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        padding: 40px 20px;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
        border: 4px solid #333;
        border-top: 4px solid #ffd200;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-bottom: 20px;
    }

    .loading-text {
        color: #ccc;
        font-size: 1.1rem;
        text-align: center;
    }

    /* АДАПТАЦИЯ ИНДИКАТОРА ЗАГРУЗКИ */
    @media (max-width: 768px) {
        .test-loading {
            padding: 30px 15px;
        }

        .loading-spinner {
            width: 45px;
            height: 45px;
            border-width: 3px;
        }

        .loading-text {
            font-size: 1rem;
        }
    }

    @media (max-width: 480px) {
        .test-loading {
            padding: 25px 12px;
        }

        .loading-spinner {
            width: 40px;
            height: 40px;
            margin-bottom: 15px;
        }

        .loading-text {
            font-size: 0.95rem;
        }
    }

    @media (max-width: 380px) {
        .test-loading {
            padding: 20px 10px;
        }

        .loading-spinner {
            width: 35px;
            height: 35px;
            margin-bottom: 12px;
        }

        .loading-text {
            font-size: 0.9rem;
        }
    }

    @media (max-width: 320px) {
        .test-loading {
            padding: 15px 8px;
        }

        .loading-spinner {
            width: 30px;
            height: 30px;
            margin-bottom: 10px;
        }

        .loading-text {
            font-size: 0.85rem;
        }
    }

    /* СТИЛИ ДЛЯ ОШИБКИ ТЕСТА */
    .test-error {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        padding: 40px 20px;
        text-align: center;
    }

    .error-icon {
        font-size: 3rem;
        color: #f44336;
        margin-bottom: 20px;
    }

    .error-title {
        font-size: 1.3rem;
        color: #f44336;
        margin-bottom: 10px;
        font-weight: 600;
    }

    .error-text {
        color: #ccc;
        font-size: 1rem;
        margin-bottom: 20px;
        line-height: 1.5;
    }

    /* АДАПТАЦИЯ ОШИБКИ ТЕСТА */
    @media (max-width: 768px) {
        .test-error {
            padding: 30px 15px;
        }

        .error-icon {
            font-size: 2.5rem;
            margin-bottom: 15px;
        }

        .error-title {
            font-size: 1.2rem;
        }

        .error-text {
            font-size: 0.95rem;
        }
    }

    @media (max-width: 480px) {
        .test-error {
            padding: 25px 12px;
        }

        .error-icon {
            font-size: 2rem;
            margin-bottom: 12px;
        }

        .error-title {
            font-size: 1.1rem;
        }

        .error-text {
            font-size: 0.9rem;
        }
    }

    @media (max-width: 380px) {
        .test-error {
            padding: 20px 10px;
        }

        .error-icon {
            font-size: 1.8rem;
            margin-bottom: 10px;
        }

        .error-title {
            font-size: 1rem;
        }

        .error-text {
            font-size: 0.85rem;
        }
    }

    @media (max-width: 320px) {
        .test-error {
            padding: 15px 8px;
        }

        .error-icon {
            font-size: 1.5rem;
            margin-bottom: 8px;
        }

        .error-title {
            font-size: 0.95rem;
        }

        .error-text {
            font-size: 0.8rem;
        }
    }

    /* СТИЛИ ДЛЯ ПОДСКАЗОК В ТЕСТЕ */
    .test-hint {
        background: rgba(255, 210, 0, 0.1);
        border: 1px solid #ffd200;
        border-radius: 8px;
        padding: 12px;
        margin: 15px 0;
        color: #ffd200;
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* АДАПТАЦИЯ ПОДСКАЗОК */
    @media (max-width: 768px) {
        .test-hint {
            padding: 10px;
            margin: 12px 0;
            font-size: 0.85rem;
        }
    }

    @media (max-width: 480px) {
        .test-hint {
            padding: 8px;
            margin: 10px 0;
            font-size: 0.8rem;
        }
    }

    @media (max-width: 380px) {
        .test-hint {
            padding: 6px;
            margin: 8px 0;
            font-size: 0.75rem;
        }
    }

    @media (max-width: 320px) {
        .test-hint {
            padding: 5px;
            margin: 6px 0;
            font-size: 0.7rem;
        }
    }

    /* СТИЛИ ДЛЯ ВЫБОРА РЕЖИМА ТЕСТА */
    .test-mode-description {
        text-align: center;
        margin-bottom: 30px;
        padding: 0 20px;
    }

    .mode-description {
        color: #ccc;
        font-size: 1rem;
        line-height: 1.6;
    }

    /* АДАПТАЦИЯ ОПИСАНИЯ РЕЖИМА */
    @media (max-width: 768px) {
        .test-mode-description {
            margin-bottom: 25px;
            padding: 0 15px;
        }

        .mode-description {
            font-size: 0.95rem;
        }
    }

    @media (max-width: 480px) {
        .test-mode-description {
            margin-bottom: 20px;
            padding: 0 12px;
        }

        .mode-description {
            font-size: 0.9rem;
        }
    }

    @media (max-width: 380px) {
        .test-mode-description {
            margin-bottom: 15px;
            padding: 0 10px;
        }

        .mode-description {
            font-size: 0.85rem;
        }
    }

    @media (max-width: 320px) {
        .test-mode-description {
            margin-bottom: 12px;
            padding: 0 8px;
        }

        .mode-description {
            font-size: 0.8rem;
        }
    }

    /* СТИЛИ ДЛЯ ВЫБОРА РАЗДЕЛА ТЕСТА */
    .test-section-description {
        text-align: center;
        margin-bottom: 30px;
        padding: 0 20px;
    }

    .section-description {
        color: #ccc;
        font-size: 1rem;
        line-height: 1.6;
    }

    /* АДАПТАЦИЯ ОПИСАНИЯ РАЗДЕЛА */
    @media (max-width: 768px) {
        .test-section-description {
            margin-bottom: 25px;
            padding: 0 15px;
        }

        .section-description {
            font-size: 0.95rem;
        }
    }

    @media (max-width: 480px) {
        .test-section-description {
            margin-bottom: 20px;
            padding: 0 12px;
        }

        .section-description {
            font-size: 0.9rem;
        }
    }

    @media (max-width: 380px) {
        .test-section-description {
            margin-bottom: 15px;
            padding: 0 10px;
        }

        .section-description {
            font-size: 0.85rem;
        }
    }

    @media (max-width: 320px) {
        .test-section-description {
            margin-bottom: 12px;
            padding: 0 8px;
        }

        .section-description {
            font-size: 0.8rem;
        }
    }

    /* АДАПТИВНЫЕ СЕТКИ ДЛЯ РАЗДЕЛОВ ТЕСТОВ */
    #pageTests .icon-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 5vw;
        padding: 0 5vw;
    }

    #pageTestSections .icon-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 5vw;
        padding: 0 5vw;
    }

    #pageTestMode .icon-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 5vw;
        padding: 0 5vw;
    }

    /* АДАПТАЦИЯ СЕТОК ДЛЯ ТЕСТОВ */
    @media (max-width: 768px) {

        #pageTests .icon-grid,
        #pageTestSections .icon-grid,
        #pageTestMode .icon-grid {
            gap: 12px;
            padding: 0 4vw;
        }
    }

    @media (max-width: 480px) {

        #pageTests .icon-grid,
        #pageTestSections .icon-grid,
        #pageTestMode .icon-grid {
            gap: 10px;
            padding: 0 3vw;
        }
    }

    @media (max-width: 380px) {

        #pageTests .icon-grid,
        #pageTestSections .icon-grid,
        #pageTestMode .icon-grid {
            gap: 8px;
            padding: 0 2vw;
        }
    }

    @media (max-width: 320px) {

        #pageTests .icon-grid,
        #pageTestSections .icon-grid,
        #pageTestMode .icon-grid {
            gap: 6px;
            padding: 0 1vw;
        }
    }

    /* ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ТЕСТОВ */
    .test-instructions {
        background: #2a2a2a;
        border-radius: 10px;
        padding: 15px;
        margin-bottom: 20px;
        border-left: 4px solid #ffd200;
    }

    .instructions-title {
        color: #ffd200;
        font-weight: 600;
        margin-bottom: 8px;
        font-size: 1rem;
    }

    .instructions-list {
        margin: 0;
        padding-left: 20px;
    }

    .instructions-list li {
        color: #ccc;
        margin-bottom: 5px;
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* АДАПТАЦИЯ ИНСТРУКЦИЙ */
    @media (max-width: 768px) {
        .test-instructions {
            padding: 12px;
            margin-bottom: 15px;
        }

        .instructions-title {
            font-size: 0.95rem;
        }

        .instructions-list li {
            font-size: 0.85rem;
        }
    }

    @media (max-width: 480px) {
        .test-instructions {
            padding: 10px;
            margin-bottom: 12px;
            border-left-width: 3px;
        }

        .instructions-title {
            font-size: 0.9rem;
        }

        .instructions-list li {
            font-size: 0.8rem;
        }
    }

    @media (max-width: 380px) {
        .test-instructions {
            padding: 8px;
            margin-bottom: 10px;
        }

        .instructions-title {
            font-size: 0.85rem;
        }

        .instructions-list li {
            font-size: 0.75rem;
        }
    }

    @media (max-width: 320px) {
        .test-instructions {
            padding: 6px;
            margin-bottom: 8px;
        }

        .instructions-title {
            font-size: 0.8rem;
        }

        .instructions-list li {
            font-size: 0.7rem;
        }
    }

    /* СТИЛИ ДЛЯ ФИКСИРОВАННОЙ ШАПКИ В ТЕСТАХ */
    .test-header-fixed {
        position: sticky;
        top: 0;
        background: #000000;
        z-index: 100;
        padding: 15px 20px;
        border-bottom: 1px solid #333;
        margin-bottom: 15px;
    }

    /* АДАПТАЦИЯ ФИКСИРОВАННОЙ ШАПКИ */
    @media (max-width: 768px) {
        .test-header-fixed {
            padding: 12px 15px;
            margin-bottom: 12px;
        }
    }

    @media (max-width: 480px) {
        .test-header-fixed {
            padding: 10px 12px;
            margin-bottom: 10px;
        }
    }

    @media (max-width: 380px) {
        .test-header-fixed {
            padding: 8px 10px;
            margin-bottom: 8px;
        }
    }

    @media (max-width: 320px) {
        .test-header-fixed {
            padding: 6px 8px;
            margin-bottom: 6px;
        }
    }

    /* СТИЛИ ДЛЯ ПОДВАЛА В ТЕСТАХ */
    .test-footer-fixed {
        position: sticky;
        bottom: 0;
        background: #000000;
        z-index: 100;
        padding: var(--test-footer-padding);
        border-top: 1px solid #333;
        --test-footer-padding: 15px 20px;
        --test-footer-margin: 15px;
        margin-top: var(--test-footer-margin);
    }

    /* АДАПТАЦИЯ ПОДВАЛА */
    @media (max-width: 768px) {
        .test-footer-fixed {
            --test-footer-padding: 12px 15px;
            --test-footer-margin: 12px;
        }
    }

    @media (max-width: 480px) {
        .test-footer-fixed {
            --test-footer-padding: 10px 12px;
            --test-footer-margin: 10px;
        }
    }

    @media (max-width: 380px) {
        .test-footer-fixed {
            --test-footer-padding: 8px 10px;
            --test-footer-margin: 8px;
        }
    }

    @media (max-width: 320px) {
        .test-footer-fixed {
            --test-footer-padding: 6px 8px;
            --test-footer-margin: 6px;
        }
    }

    /* ФИНАЛЬНЫЕ СТИЛИ ДЛЯ ПОЛНОЙ АДАПТАЦИИ ТЕСТОВ */
    /* Обеспечиваем правильное отображение на всех экранах */
    @media (max-width: 768px) {

        #pageTests,
        #pageTestSections,
        #pageTestMode,
        #pageTestQuestions,
        #pageTestResults {
            padding-top: calc(var(--header-pad) + var(--safe-top) + var(--island-height));
        }
    }

 
    /* === СПЕЦИФИЧНЫЕ СТИЛИ ДЛЯ СТРАНИЦЫ ВОПРОСОВ ТЕСТА === */
    #pageTestQuestions {
        display: none;
        /* ИЗМЕНЕНО: скрываем по умолчанию */
        flex-direction: column;
        background: #000000;
        width: 100%;
        height: 100%;
        position: relative;
    }

    #pageTestQuestions.active {
        display: flex;
        /* ПОКАЗЫВАЕМ только когда активна */
    }

    #pageTestQuestions {
        --tq-content-padding: 20px;
        --tq-q-padding: 20px;
        --tq-q-margin: 20px;
        --tq-q-radius: 15px;
        --tq-q-font: 1.1rem;
        --tq-q-margin-bottom: 20px;
        --tq-q-line: 1.5;
        --tq-answers-gap: 12px;
        --tq-answer-padding: 15px;
        --tq-answer-font: 1rem;
        --tq-answer-radius: 10px;
        --tq-answer-line: 1.4;
        --tq-nav-padding: 20px 0;
        --tq-nav-gap: 10px;
        --tq-nav-btn-padding: 12px 20px;
        --tq-nav-btn-font: 1rem;
        --tq-nav-btn-radius: 10px;
        --tq-progress-padding: 0 20px;
        --tq-progress-margin: 20px;
        --tq-progress-height: 8px;
        --tq-timer-margin: 20px;
        --tq-timer-padding: 0 20px;
        --tq-timer-font: 1.5rem;
        --tq-number-margin: 15px;
        --tq-number-font: 1.1rem;
        --tq-number-padding: 0 20px;
        --tq-image-margin: 15px 0;
        --tq-image-max-height: 200px;
        --tq-image-radius: 10px;
        --tq-hint-padding: 12px;
        --tq-hint-margin: 15px 0;
        --tq-hint-font: 0.9rem;
    }

    /* Основной контент страницы вопросов */
    #pageTestQuestions .test-content {
        flex: 1;
        padding: var(--tq-content-padding);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Контейнер вопроса */
    #pageTestQuestions .question-container {
        background: #1a1a1a;
        border-radius: var(--tq-q-radius);
        padding: var(--tq-q-padding);
        margin-bottom: var(--tq-q-margin);
        border: 1px solid #333;
        transition: all 0.3s ease;
    }

    /* Текст вопроса */
    #pageTestQuestions .question-text {
        font-size: var(--tq-q-font);
        line-height: var(--tq-q-line);
        margin-bottom: var(--tq-q-margin-bottom);
        color: white;
        font-weight: 500;
    }

    /* Контейнер ответов */
    #pageTestQuestions .answers-container {
        display: flex;
        flex-direction: column;
        gap: var(--tq-answers-gap);
    }

    /* Варианты ответов */
    #pageTestQuestions .answer-option {
        background: #2a2a2a;
        border: 2px solid #333;
        border-radius: var(--tq-answer-radius);
        padding: var(--tq-answer-padding);
        color: white;
        text-align: left;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: var(--tq-answer-font);
        -webkit-tap-highlight-color: transparent;
    }

    #pageTestQuestions .answer-option:hover {
        background: #3a3a3a;
    }

    #pageTestQuestions .answer-option:active {
        transform: scale(0.98);
    }

    #pageTestQuestions .answer-option.selected {
        border-color: #ffd200;
        background: #3a3a3a;
    }

    #pageTestQuestions .answer-option.correct {
        background: #2d5a27 !important;
        border-color: #4caf50 !important;
        color: white;
    }

    #pageTestQuestions .answer-option.incorrect {
        background: #5a2727 !important;
        border-color: #f44336 !important;
        color: white;
    }

    #pageTestQuestions .answer-option.selected-yellow {
        border-color: #ffd200 !important;
        background: rgba(255, 210, 0, 0.1) !important;
    }

    /* Навигация в тесте */
    #pageTestQuestions .test-navigation {
        display: flex;
        gap: var(--tq-nav-gap);
        margin-top: auto;
        padding: var(--tq-nav-padding);
    }

    /* Кнопки навигации */
    #pageTestQuestions .test-nav-button {
        flex: 1;
        padding: var(--tq-nav-btn-padding);
        border: none;
        border-radius: var(--tq-nav-btn-radius);
        font-size: var(--tq-nav-btn-font);
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
    }

    #pageTestQuestions .test-nav-button.prev {
        background: #6c757d;
        color: white;
    }

    #pageTestQuestions .test-nav-button.next {
        background: #28a745;
        color: white;
    }

    #pageTestQuestions .test-nav-button.finish {
        background: #dc3545;
        color: white;
    }

    #pageTestQuestions .test-nav-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    /* Прогресс теста */
    #pageTestQuestions .test-progress {
        width: 100%;
        padding: var(--tq-progress-padding);
        margin-bottom: var(--tq-progress-margin);
    }

    #pageTestQuestions .progress-bar-test {
        width: 100%;
        height: var(--tq-progress-height);
        background: linear-gradient(180deg, #1b1b1b, #111111);
        border-radius: 999px;
        overflow: hidden;
        position: relative;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    }

    #pageTestQuestions .progress-fill-test {
        height: 100%;
        background: linear-gradient(90deg, #ffcc00 0%, #ffd84d 45%, #fff2a6 100%);
        width: 0%;
        transition: width 0.45s ease;
        border-radius: 999px;
        box-shadow: 0 0 12px rgba(255, 214, 77, 0.55);
        position: relative;
    }

    #pageTestQuestions .progress-fill-test::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        right: 4px;
        width: 22px;
        background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.65) 100%);
        opacity: 0.6;
        filter: blur(1px);
        border-radius: 999px;
    }

    /* Таймер */
    #pageTestQuestions .test-timer-container {
        text-align: center;
        margin-bottom: var(--tq-timer-margin);
        padding: var(--tq-timer-padding);
    }

    #pageTestQuestions .timer-display {
        font-size: var(--tq-timer-font);
        font-weight: 700;
        color: #ffd200;
        margin-bottom: 5px;
        font-family: 'Courier New', monospace;
    }

    /* Номер вопроса */
    #pageTestQuestions .question-number {
        text-align: center;
        color: #ffd200;
        font-weight: 600;
        margin-bottom: var(--tq-number-margin);
        font-size: var(--tq-number-font);
        padding: var(--tq-number-padding);
    }

    /* === ��������� ��� PAGE TEST QUESTIONS (����� CSS-����������) === */
    @media (max-width: 768px) {
        #pageTestQuestions {
            --tq-content-padding: 15px;
            --tq-q-padding: 15px;
            --tq-q-margin: 15px;
            --tq-q-radius: 12px;
            --tq-q-font: 1rem;
            --tq-q-margin-bottom: 15px;
            --tq-answer-padding: 12px;
            --tq-answer-font: 0.95rem;
            --tq-nav-padding: 15px 0;
            --tq-nav-btn-padding: 10px 16px;
            --tq-nav-btn-font: 0.95rem;
            --tq-progress-padding: 0 15px;
            --tq-progress-margin: 15px;
            --tq-progress-height: 6px;
            --tq-timer-margin: 15px;
            --tq-timer-padding: 0 15px;
            --tq-timer-font: 1.3rem;
            --tq-number-margin: 12px;
            --tq-number-font: 1rem;
            --tq-number-padding: 0 15px;
            --tq-image-margin: 12px 0;
            --tq-image-max-height: 180px;
            --tq-hint-padding: 10px;
            --tq-hint-margin: 12px 0;
            --tq-hint-font: 0.85rem;
        }
    }

    @media (max-width: 480px) {
        #pageTestQuestions {
            --tq-content-padding: 12px;
            --tq-q-padding: 12px;
            --tq-q-margin: 12px;
            --tq-q-radius: 10px;
            --tq-q-font: 0.95rem;
            --tq-q-margin-bottom: 12px;
            --tq-answers-gap: 8px;
            --tq-answer-padding: 10px;
            --tq-answer-font: 0.9rem;
            --tq-answer-radius: 8px;
            --tq-nav-padding: 12px 0;
            --tq-nav-gap: 8px;
            --tq-nav-btn-padding: 8px 12px;
            --tq-nav-btn-font: 0.9rem;
            --tq-nav-btn-radius: 8px;
            --tq-progress-padding: 0 12px;
            --tq-progress-margin: 12px;
            --tq-progress-height: 5px;
            --tq-timer-margin: 12px;
            --tq-timer-padding: 0 12px;
            --tq-timer-font: 1.1rem;
            --tq-number-margin: 10px;
            --tq-number-font: 0.95rem;
            --tq-number-padding: 0 12px;
            --tq-image-margin: 10px 0;
            --tq-image-max-height: 160px;
            --tq-image-radius: 8px;
            --tq-hint-padding: 8px;
            --tq-hint-margin: 10px 0;
            --tq-hint-font: 0.8rem;
        }
    }

    @media (max-width: 380px) {
        #pageTestQuestions {
            --tq-content-padding: 10px;
            --tq-q-padding: 10px;
            --tq-q-margin: 10px;
            --tq-q-radius: 8px;
            --tq-q-font: 0.9rem;
            --tq-q-margin-bottom: 10px;
            --tq-q-line: 1.4;
            --tq-answers-gap: 6px;
            --tq-answer-padding: 8px 10px;
            --tq-answer-font: 0.85rem;
            --tq-answer-radius: 7px;
            --tq-answer-line: 1.3;
            --tq-nav-padding: 10px 0;
            --tq-nav-gap: 6px;
            --tq-nav-btn-padding: 7px 10px;
            --tq-nav-btn-font: 0.85rem;
            --tq-nav-btn-radius: 7px;
            --tq-progress-padding: 0 10px;
            --tq-progress-margin: 10px;
            --tq-progress-height: 4px;
            --tq-timer-margin: 10px;
            --tq-timer-padding: 0 10px;
            --tq-timer-font: 1rem;
            --tq-number-margin: 8px;
            --tq-number-font: 0.9rem;
            --tq-number-padding: 0 10px;
            --tq-image-max-height: 140px;
            --tq-hint-padding: 6px;
            --tq-hint-margin: 8px 0;
            --tq-hint-font: 0.75rem;
        }
    }

    @media (max-width: 320px) {
        #pageTestQuestions {
            --tq-content-padding: 8px;
            --tq-q-padding: 8px;
            --tq-q-margin: 8px;
            --tq-q-radius: 6px;
            --tq-q-font: 0.85rem;
            --tq-q-margin-bottom: 8px;
            --tq-q-line: 1.25;
            --tq-answers-gap: 5px;
            --tq-answer-padding: 7px 8px;
            --tq-answer-font: 0.8rem;
            --tq-answer-radius: 6px;
            --tq-answer-line: 1.2;
            --tq-nav-padding: 8px 0;
            --tq-nav-gap: 5px;
            --tq-nav-btn-padding: 6px 8px;
            --tq-nav-btn-font: 0.8rem;
            --tq-nav-btn-radius: 6px;
            --tq-progress-padding: 0 8px;
            --tq-progress-margin: 8px;
            --tq-progress-height: 3px;
            --tq-timer-margin: 8px;
            --tq-timer-padding: 0 8px;
            --tq-timer-font: 0.9rem;
            --tq-number-margin: 6px;
            --tq-number-font: 0.85rem;
            --tq-number-padding: 0 8px;
            --tq-image-max-height: 120px;
            --tq-image-radius: 6px;
            --tq-hint-padding: 5px;
            --tq-hint-margin: 6px 0;
            --tq-hint-font: 0.7rem;
        }
    }

    #pageTestQuestions .question-image-container {
        margin: var(--tq-image-margin);
        text-align: center;
    }

    #pageTestQuestions .question-image {
        max-width: 100%;
        max-height: var(--tq-image-max-height);
        border-radius: var(--tq-image-radius);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    /* Стили для подсказок на #pageTestQuestions */
    #pageTestQuestions .test-hint {
        background: rgba(255, 210, 0, 0.1);
        border: 1px solid #ffd200;
        border-radius: 8px;
        padding: var(--tq-hint-padding);
        margin: var(--tq-hint-margin);
        color: #ffd200;
        font-size: var(--tq-hint-font);
        line-height: 1.5;
    }

    /* ============================================ */

    :root {
        --main-content-padding: 30px 20px;
        --wide-max: 464px;
        --wide-wrapper-margin: 15px;
        --wide-wrapper-3-margin: 8px;
        --wide-button-height: 345px;
        --wide-button-radius: 20px;
        --wide-button-3-height: 113px;
        --tools-header-margin: 10px 0;
        --tools-title-font: 18px;
        --tools-title-padding-left: 20px;
        --tools-title-margin: 10px 0;
        --tools-title-bar-width: 4px;
        --tools-title-bar-height: 24px;
        --main-grid-gap: 15px;
        --main-grid-margin-top: 5px;
        --main-button-height: 165px;
        --main-button-radius: 20px;
    }

    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: var(--main-content-padding);
        width: 100%;
        box-sizing: border-box;
        position: relative;
        z-index: 1;
    }

    /* ���������� ��� ������� ������ */
    .wide-wrapper {
        width: 100%;
        max-width: var(--wide-max);
        margin-bottom: var(--wide-wrapper-margin);
        box-sizing: border-box;
    }

    /* ��������� ������ ����� ������ �� ��������� */
    .wide-wrapper:nth-child(3) {
        margin-bottom: var(--wide-wrapper-3-margin);
    }

    /* ��������� "�������� � ���������" */
    .wide-button {
        width: 100%;
        height: var(--wide-button-height);
        background: transparent;
        border: none;
        border-radius: var(--wide-button-radius);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        padding: 0;
        box-sizing: border-box;
    }

    /* ��������� "�� ���������" */
    .wide-wrapper:nth-child(3) .wide-button {
        height: var(--wide-button-3-height);
        border-radius: var(--wide-button-radius);
    }

    /* ������ � ������� */
    .wide-button img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

    /* ������� ��� ��������� */
    .wide-button:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    }

    .wide-button:active {
        transform: translateY(-2px);
    }

    /* ��������� "����������� � ��������" */
    .tools-header {
        width: 100%;
        max-width: var(--wide-max);
        margin: var(--tools-header-margin);
        text-align: left;
        box-sizing: border-box;
    }

    .tools-title {
        color: #ffffff;
        font-size: var(--tools-title-font);
        font-weight: bold;
        line-height: 1.2;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        position: relative;
        padding-left: var(--tools-title-padding-left);
        margin: var(--tools-title-margin);
    }

    /* ������ ������������ �������� ����� */
    .tools-title::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: var(--tools-title-bar-width);
        height: var(--tools-title-bar-height);
        background-color: #ffd200;
        border-radius: 2px;
    }

    /* ����� 2x2 */
    .main-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: var(--main-grid-gap);
        width: 100%;
        max-width: var(--wide-max);
        margin-top: var(--main-grid-margin-top);
        box-sizing: border-box;
    }

    /* ���������� ����� */
    .main-button {
        width: 100%;
        height: var(--main-button-height);
        background: transparent;
        border: none;
        border-radius: var(--main-button-radius);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        padding: 0;
        box-sizing: border-box;
    }

    /* ������ � ������ ������� */
    .main-button img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

    /* ������� ��� ��������� ��� ������ ������ */
    .main-button:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }

    .main-button:active {
        transform: translateY(-1px);
    }

    /* ============================================
   ��������� ��� ���� �������� �������
   ============================================ */

    @media (max-width: 768px) {
        :root {
            --main-content-padding: 25px 18px;
            --wide-max: 420px;
            --wide-button-height: 310px;
            --wide-button-radius: 18px;
            --wide-button-3-height: 102px;
            --wide-wrapper-3-margin: 6px;
            --tools-title-font: 17px;
            --tools-title-padding-left: 18px;
            --tools-title-margin: 8px 0;
            --tools-title-bar-height: 22px;
            --main-button-height: 148px;
            --main-button-radius: 18px;
            --main-grid-gap: 14px;
            --main-grid-margin-top: 4px;
        }
    }

    @media (max-width: 480px) {
        :root {
            --main-content-padding: 65px 15px;
            --wide-max: 380px;
            --wide-button-height: 276px;
            --wide-button-radius: 16px;
            --wide-button-3-height: 92px;
            --wide-wrapper-3-margin: 5px;
            --tools-title-font: 16px;
            --tools-title-padding-left: 16px;
            --tools-title-margin: 6px 0;
            --tools-title-bar-width: 3px;
            --tools-title-bar-height: 20px;
            --main-button-height: 140px;
            --main-button-radius: 16px;
            --main-grid-gap: 8px;
            --main-grid-margin-top: 3px;
        }
    }

    @media (max-width: 380px) {
        :root {
            --main-content-padding: 15px 12px;
            --wide-max: 360px;
            --wide-button-height: 241px;
            --wide-button-radius: 14px;
            --wide-button-3-height: 79px;
            --wide-wrapper-3-margin: 4px;
            --tools-title-font: 15px;
            --tools-title-padding-left: 14px;
            --tools-title-margin: 5px 0;
            --tools-title-bar-height: 18px;
            --main-button-height: 125px;
            --main-button-radius: 14px;
            --main-grid-gap: 8px;
            --main-grid-margin-top: 2px;
        }
    }

    @media (max-width: 360px) {
        :root {
            --main-content-padding: 60px 10px;
            --wide-max: 340px;
            --wide-button-height: 250px;
            --wide-button-radius: 12px;
            --wide-button-3-height: 80px;
            --wide-wrapper-3-margin: -3px;
            --tools-title-font: 14px;
            --tools-title-padding-left: 12px;
            --tools-title-margin: 4px 0;
            --tools-title-bar-width: 2px;
            --tools-title-bar-height: 16px;
            --main-button-height: 122px;
            --main-button-radius: 12px;
            --main-grid-gap: 8px;
            --main-grid-margin-top: 12px;
        }
    }

    @media (max-width: 320px) {
        :root {
            --main-content-padding: 10px 8px;
            --wide-max: 280px;
            --wide-button-height: 190px;
            --wide-button-radius: 10px;
            --wide-button-3-height: 62px;
            --wide-wrapper-3-margin: 2px;
            --tools-title-font: 13px;
            --tools-title-padding-left: 10px;
            --tools-title-margin: 3px 0;
            --tools-title-bar-width: 2px;
            --tools-title-bar-height: 14px;
            --main-button-height: 91px;
            --main-button-radius: 10px;
            --main-grid-gap: 6px;
            --main-grid-margin-top: 0;
        }
    }

    /* �������������� ��������� �� ������ ������ */
    @media (max-height: 700px) {
        :root {
            --main-content-padding: 15px 20px 20px;
            --wide-button-height: calc(345px * 0.85);
            --wide-button-3-height: calc(113px * 0.85);
            --wide-wrapper-3-margin: 4px;
            --tools-header-margin: 8px 0 6px 0;
            --main-grid-margin-top: 2px;
        }
    }

    @media (max-height: 600px) {
        :root {
            --main-content-padding: 10px 20px 15px;
            --wide-button-height: calc(345px * 0.75);
            --wide-button-3-height: calc(113px * 0.75);
            --wide-wrapper-3-margin: 2px;
            --main-button-height: calc(165px * 0.75);
            --main-grid-gap: 8px;
            --main-grid-margin-top: 0;
            --tools-header-margin: 5px 0 4px 0;
        }
    }

    @media (min-width: 769px) {
        .main-content {
            padding: 40px 20px;
            max-width: 500px;
            margin: 0 auto;
        }
    }

    /* ��������� ������ ����������� ������ */
    @media (max-width: 400px) and (min-aspect-ratio: 9/18) {
        :root {
            --main-content-padding: 60px 10px;
            --wide-button-height: 260px;
            --wide-button-3-height: 87px;
            --wide-wrapper-3-margin: 4px;
            --tools-header-margin: 5px 0;
            --main-grid-margin-top: 7px;
        }
    }

    @media (max-width: 500px) and (min-aspect-ratio: 3/4) {
        :root {
            --main-content-padding: 15px 12px;
            --wide-button-height: 250px;
            --wide-button-3-height: 85px;
            --wide-wrapper-3-margin: 5px;
            --main-button-height: 120px;
            --main-grid-margin-top: 3px;
        }
    }

    /* ЖЕСТКАЯ БЛОКИРОВКА ОРИЕНТАЦИИ - ЧЕРНЫЙ ЭКРАН */
    @media (orientation: landscape) {

        /* Полностью сбрасываем все стили и убираем контент */
        html,
        body {
            all: unset !important;
        }

        html {
            display: block !important;
            width: 100vw !important;
            height: 100vh !important;
            background: #000000 !important;
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
            overflow: hidden !important;
            z-index: 2147483647 !important;
        }

        body {
            display: block !important;
            width: 100% !important;
            height: 100% !important;
            background: #000000 !important;
            margin: 0 !important;
            padding: 0 !important;
            position: relative !important;
        }

        /* Убираем ВСЕ содержимое */
        body * {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
            width: 0 !important;
            height: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
            border: none !important;
            background: none !important;
        }

        /* Убираем все псевдоэлементы */
        html::before,
        html::after,
        body::before,
        body::after {
            content: none !important;
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
        }

        /* Блокируем скроллинг и взаимодействие */
        html {
            overflow: hidden !important;
            touch-action: none !important;
            -ms-touch-action: none !important;
            -webkit-overflow-scrolling: none !important;
        }

        /* Гарантируем черный цвет на всех элементах */
        * {
            background: #000000 !important;
            background-color: #000000 !important;
            border-color: #000000 !important;
            color: #000000 !important;
            text-shadow: none !important;
            box-shadow: none !important;
        }
    }

/* ===== МОДАЛЬНЫЕ ОКНА УСТАНОВКИ ПРИЛОЖЕНИЯ ===== */

.install-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.install-modal-overlay.active {
    display: flex;
    animation: installFadeIn 0.3s ease-out;
}

@keyframes installFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.install-modal {
    background: #1a1a1a;
    border-radius: 20px;
    width: 100%;
    max-width: 340px;
    position: relative;
    overflow: hidden;
    border: 2px solid #FFD700;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: installSlideUp 0.35s ease-out;
}

@keyframes installSlideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.install-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #FFD700;
    border: none;
    color: #000;
    font-size: 1.4rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
}

.install-modal-lottie {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.install-modal-lottie svg {
    max-width: 100%;
    max-height: 100%;
}

.install-modal-content {
    padding: 20px 24px 28px;
}

.install-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 0 0 16px;
}

/* iOS: инструкция по шагам */
.install-modal-instructions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.install-modal-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    line-height: 1.4;
}

.install-modal-step strong {
    color: #FFD700;
}

.install-modal-step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #FFD700;
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Android: предупреждение и кнопка */
.install-modal-warning {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0 0 20px;
}

.install-modal-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #FFD700;
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.install-modal-btn:active {
    background: #e6c200;
}

    /* Дополнительная защита для всех браузеров */
    @supports (orientation: landscape) {
        @media (orientation: landscape) {
            :root {
                display: none !important;
            }

            html {
                background: #000000 !important;
                display: block !important;
            }

            html,
            body,
            body * {
                visibility: hidden !important;
                pointer-events: none !important;
                user-select: none !important;
                -webkit-user-select: none !important;
                -moz-user-select: none !important;
                -ms-user-select: none !important;
            }

            html::after {
                content: "" !important;
                display: block !important;
                position: fixed !important;
                top: 0 !important;
                left: 0 !important;
                width: 100vw !important;
                height: 100vh !important;
                background: #000000 !important;
                z-index: 9999999 !important;
            }
        }
    }

    /* СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА УСПЕШНОЙ ОТПРАВКИ EMAIL */
    .email-success-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 10000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .email-success-modal.active {
        opacity: 1;
    }

    .email-success-content {
        background: #1b1919;
        padding: 40px;
        border-radius: 20px;
        text-align: center;
        color: white;
        max-width: 300px;
        transform: scale(0.8);
        transition: transform 0.3s ease;
        border: 2px solid #FFD700;
    }

    .email-success-modal.active .email-success-content {
        transform: scale(1);
    }

    .email-success-icon {
        width: 80px;
        height: 80px;
        background: rgba(255, 215, 0, 0.15);
        border: 2px solid #FFD700;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto 20px;
        font-size: 40px;
        color: #FFD700;
    }

    .email-success-content h2 {
        margin: 0 0 10px;
        font-size: 1.5rem;
        color: #FFD700;
    }

    .email-success-content p {
        margin: 0;
        opacity: 0.8;
        font-size: 0.95rem;
    }
