/* Main Layout CSS */



/* --- БАЗОВЫЕ ПЕРЕМЕННЫЕ --- */

:root {

    --bg-grad-start: #d7c29e;

    --bg-grad-end: #b9a178;

    --accent-color: #5d4037;

    --accent-hover: #4e342e;

    --muted: #795548;

    --success-color: #4CAF50;

    --error-color: #c62828;

    --danger-color: #c62828;

    /* Added for Stage 2 */

    --bg-color: #fdf5e6;

    --paper-color: #faf3e0;

    --glass-bg: rgba(253, 245, 230, 0.65);

    --glass-border: rgba(255, 255, 255, 0.4);

    --btn-base-bg: rgba(255, 255, 255, 0.6);

    --pedestal-bg: rgba(255, 255, 255, 0.4);

    --pedestal-border: rgba(255, 255, 255, 0.6);

    --selected-category-bg: color-mix(in srgb, var(--success-color) 15%, transparent);

    --partial-category-bg: color-mix(in srgb, #87CEEB 40%, transparent);

    --selected-theme-bg: color-mix(in srgb, #90EE90 50%, transparent);

    --partial-theme-bg: color-mix(in srgb, #ADD8E6 50%, transparent);

}



/* [NEW] Стили для Этапа 2: Поля ввода для целого слова */

.letter-inputs {

    gap: 10px;

}



.letter-input.full-word-input {

    width: 80%;

    max-width: 350px;

    height: 45px;

    font-size: 1.2rem;

    text-align: left;

    padding: 5px 10px;

    color: var(--text-color);

    background-color: #fff;

    border: 1px solid #ccc;

}



.letter-input.full-word-input:focus {

    border-color: var(--accent-color);

    background-color: #fff;

}



.letter-input.full-word-input.correct {

    background: #d4edda;

    border-color: var(--success-color);

    color: #155724;

    font-weight: bold;

}



.letter-input.full-word-input.incorrect {

    background: #f8d7da;

    border-color: var(--danger-color);

    color: #721c24;

}



/* [NEW] Стили специфичные для Stage 3 Hybrid */

.hybrid-phrase-container {

    display: flex;

    flex-wrap: wrap; /* [ИЗМЕНЕНО] Переносим на новую строку длинные слова */

    align-items: center;

    justify-content: center;

    gap: 10px;

    margin: 30px 0;

    line-height: 2;

    width: 100%;

}



.hybrid-static {

    font-size: 1.5rem;

    font-weight: bold;

    color: #444;

    user-select: none;

}



.hybrid-input {

    text-align: center;

    border: 2px solid #ddd;

    border-radius: 8px;

    font-size: 1.3rem;

    transition: all 0.2s ease;

    outline: none;

    background: #f9f9f9;

    font-family: inherit;

    color: #333;

}



.hybrid-input:focus {

    border-color: #007bff;

    background-color: #fff;

    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.15);

    transform: translateY(-2px);

}



.hybrid-input.correct {

    background-color: #d4edda;

    border-color: #28a745;

    color: #155724;

    font-weight: bold;

}



.hybrid-input.incorrect {

    background-color: #f8d7da;

    border-color: #dc3545;

    color: #721c24;

}



.hybrid-input:disabled {

    opacity: 0.8;

    cursor: default;

}



.hybrid-input.full-word-input {

    width: auto;

    min-width: 80px;

    padding: 8px 12px;

}



.hybrid-word-group {

    display: flex;

    gap: 2px;

    white-space: nowrap;

    flex-shrink: 1;

    /* [ИЗМЕНЕНО] Разрешаем сжатие группы */

}



.hybrid-input.letter-input {

    width: 40px;

    min-width: 15px;

    /* [ИЗМЕНЕНО] Позволяем сжиматься */

    height: 50px;

    padding: 0;

    text-transform: none;

    flex-shrink: 1;

    /* [ИЗМЕНЕНО] Разрешаем сжатие */

}



@media (max-width: 600px) {

    .hybrid-input.letter-input {

        width: 32px;

        height: 42px;

        font-size: 1.1rem;

    }



    .hybrid-input.full-word-input {

        font-size: 1.1rem;

        padding: 6px 10px;

    }



    .hybrid-phrase-container {

        gap: 6px;

        margin: 5px 0;

    }

}



.field-error-pulse {

    animation: pulse-red 0.4s ease;

}



@keyframes pulse-red {

    0% {

        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);

    }



    70% {

        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);

    }



    100% {

        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);

    }

}



/* SKELETON LOADING */

.skeleton-text {

    background: #e2e8f0;

    border-radius: 4px;

    position: relative;

    overflow: hidden;

}



.skeleton-text::after {

    content: "";

    position: absolute;

    top: 0;

    right: 0;

    bottom: 0;

    left: 0;

    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);

    animation: skeleton-loading 1.5s infinite;

}



.skeleton-progress {

    width: 150px;

    height: 20px;

    background: #e2e8f0;

    border-radius: 10px;

    margin: 10px auto;

    position: relative;

    overflow: hidden;

}



.skeleton-progress::after {

    content: "";

    position: absolute;

    top: 0;

    right: 0;

    bottom: 0;

    left: 0;

    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);

    animation: skeleton-loading 1.5s infinite;

}



.skeleton-stats {

    width: 100px;

    height: 20px;

    background: #e2e8f0;

    border-radius: 4px;

    position: relative;

    overflow: hidden;

}



.skeleton-stats::after {

    content: "";

    position: absolute;

    top: 0;

    right: 0;

    bottom: 0;

    left: 0;

    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);

    animation: skeleton-loading 1.5s infinite;

}



.skeleton-input-block {

    background: #e2e8f0;

    border-radius: 4px;

    position: relative;

    overflow: hidden;

}



.skeleton-input-block::after {

    content: "";

    position: absolute;

    top: 0;

    right: 0;

    bottom: 0;

    left: 0;

    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);

    animation: skeleton-loading 1.5s infinite;

}



@keyframes skeleton-loading {

    0% {

        transform: translateX(-100%);

    }



    100% {

        transform: translateX(100%);

    }

}



body {

    margin: 0;

    padding: 0 !important;

    /* Force 0 padding to prevent jump from stage_selection.css */

    font-family: 'Inter', system-ui, sans-serif;

    color: var(--text-color);

    background: linear-gradient(135deg, var(--bg-grad-start), var(--bg-grad-end));

    background-attachment: fixed;

    min-height: 100vh;

    overflow-x: hidden;

}



.wrap {

    width: 100%;

    min-height: 100vh;

    padding: 40px 20px;

    box-sizing: border-box;

    display: flex;

    flex-direction: column;

    align-items: center;

}



.empty-list-msg {

    text-align: center;

    color: var(--muted);

    padding: 40px;

    font-style: italic;

}



/* Карточки статистики внутри панели */

.stat-card-mini {

    background: white;

    padding: 15px;

    border-radius: 15px;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);

    border: 1px solid rgba(0, 0, 0, 0.03);

}



body:has(#view-trainer.active) .container {
    width: 100%;
    max-width: 1000px;
    background: var(--glass-bg);

    backdrop-filter: blur(15px);

    border: 1px solid var(--glass-border);

    border-radius: 30px;

    padding: 30px;

    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);

    position: relative;

    z-index: 1;

}



.flicker-shield {

    visibility: hidden;

}



.levels-grid {

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 15px;

    width: 100%;

    margin-bottom: 15px;

    margin-top: 5px;

}



@media (max-width: 992px) {

    .levels-grid {

        grid-template-columns: repeat(2, 1fr);

    }

}



@media (max-width: 600px) {

    .levels-grid {

        grid-template-columns: 1fr;

    }

}



.profile-card {

    background: var(--paper-color);

    border-radius: 20px;

    padding: 15px 20px;

    text-align: left;

    border: 1px solid rgba(0, 0, 0, 0.05);

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    transition: transform 0.2s, box-shadow 0.2s;

    height: 100%;

    min-height: 180px;

}



.profile-card:hover {

    transform: translateY(-5px);

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);

    border-color: rgba(93, 64, 55, 0.2);

}



.profile-card-header {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 12px;

}



.profile-card-icon {

    font-size: 2.2em;

    line-height: 1;

    flex-shrink: 0;

}



.profile-card h2 {

    font-size: 1.15em;

    margin: 0;

    color: var(--accent-hover);

    font-weight: 700;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}



.stats-box {

    background: var(--pedestal-bg);

    border: 1px solid var(--pedestal-border);

    border-radius: 12px;

    padding: 10px;

    margin-bottom: 15px;

    font-size: 0.85em;

    color: var(--text-color);

    flex-grow: 1;

    display: flex;

    flex-direction: column;

    justify-content: center;

    text-align: center;

    min-height: 55px;

}



.stats-box b {

    font-size: 1.05em;

    color: var(--accent-color);

}



.stats-box .base-info {

    display: block;

    margin-top: 4px;

    font-size: 0.85em;

    opacity: 0.85;

}



.stats-box .details {

    font-size: 0.8em;

    opacity: 0.7;

    display: block;

    margin-top: 2px;

}



.updating-glow {

    box-shadow: 0 0 12px 2px rgba(255, 215, 0, 0.6) !important;

    transition: box-shadow 0.3s ease-in-out;

    border-color: rgba(255, 215, 0, 0.8) !important;

}



.card-btn {

    background: var(--accent-color);

    color: white;

    border: none;

    padding: 12px 0;

    border-radius: 12px;

    font-size: 1em;

    cursor: pointer;

    text-decoration: none;

    font-weight: 600;

    transition: all 0.2s;

    display: flex;

    justify-content: center;

    align-items: center;

    width: 100%;

    text-align: center;

    font-family: inherit;

    line-height: 1.2;

    box-sizing: border-box;

    min-height: 45px;

}



.card-btn:hover {

    background: var(--accent-hover);

    transform: translateY(-2px);

    box-shadow: 0 4px 12px rgba(93, 64, 55, 0.3);

}



.card-btn.empty-state {

    background: #fff;

    color: #8d6e63;

    border: 2px dashed #8d6e63;

}



.card-btn.disabled-state {

    background: #e0e0e0;

    color: #9e9e9e;

    cursor: not-allowed;

    pointer-events: none;

}



.profile-card.srs-profile {

    background: linear-gradient(135deg, #f3e5f5, #fff);

    border: 1px solid #e1bee7;

}



.profile-card.srs-profile h2 {

    color: #673ab7;

}



.profile-card.srs-profile .card-btn {

    background-color: #673ab7;

}



.profile-card.srs-profile .card-btn:hover {

    background-color: #512da8;

}



.top-bar {

    display: flex;

    justify-content: space-between;

    align-items: center;

    background: var(--glass-bg);

    backdrop-filter: blur(10px);

    padding: 8px 15px;

    border-radius: 16px;

    border: 1px solid var(--glass-border);

    margin-bottom: 6px;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

    gap: 15px;

    position: relative;

    z-index: 2000;

    min-height: 50px;

    /* Use min-height for stability without forced expansion */

    box-sizing: border-box;

}



.top-bar-center {

    flex-grow: 1;

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 15px;

}



.header-btn {

    background: var(--btn-base-bg);

    color: var(--accent-color) !important;

    border: 1px solid rgba(93, 64, 55, 0.3);

    padding: 0 16px;

    border-radius: 12px;

    font-size: 0.9em;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    height: 38px;

    white-space: nowrap;

    text-decoration: none;

}



.header-btn:hover {

    background: var(--accent-color);

    color: white !important;

    border-color: var(--accent-color);

    transform: translateY(-2px);

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

}



.header-btn:active {

    transform: translateY(0) scale(0.96);

}



.exit-btn-power {

    background: #ff5252 !important;

    color: white !important;

    border-radius: 10px !important;

    width: 28px !important;

    height: 28px !important;

    display: flex !important;

    align-items: center !important;

    justify-content: center !important;

    border: 2px solid white !important;

    cursor: pointer !important;

    box-shadow: 0 2px 8px rgba(255, 82, 82, 0.3) !important;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;

    padding: 0 !important;

    flex-shrink: 0;

    margin-left: 10px;

}



.exit-btn-power:hover {

    background: #ff1744 !important;

    transform: translateY(-2px);

    box-shadow: 0 4px 12px rgba(255, 82, 82, 0.5) !important;

}



.exit-btn-power:active {

    transform: scale(0.92);

}



.exit-btn-power svg {

    width: 16px;

    height: 16px;

    stroke: white;

    stroke-width: 2.5;

}



.user-pedestal {

    display: flex;

    align-items: center;

    background: rgba(255, 255, 255, 0.4);

    padding: 4px 12px;

    border-radius: 14px;

    border: 1px solid rgba(0, 0, 0, 0.05);

    min-width: 150px;

}



.level-header-row {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 6px;

    margin-top: 8px;

    min-height: 40px;

    /* Force stable height to prevent jumps */

}



.level-header-row h1 {

    font-size: 1.6em;

    margin: 0 !important;

    /* Prevent h1 margin from causing jumps */

    color: var(--accent-color);

    line-height: 1.2;

}



.progress-report-trigger {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    min-width: 210px;

    min-height: 42px;

    padding: 8px 18px;

    border: 1px solid rgba(93, 64, 55, 0.18);

    border-radius: 14px;

    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(245, 235, 220, 0.8));

    color: var(--accent-hover);

    font-weight: 800;

    font-size: 0.95rem;

    cursor: pointer;

    box-shadow: 0 8px 20px rgba(93, 64, 55, 0.08);

    transition: transform 0.2s ease, box-shadow 0.2s ease;

}



.progress-report-trigger:hover {

    transform: translateY(-2px);

    box-shadow: 0 12px 26px rgba(93, 64, 55, 0.14);

}



.progress-report-modal {

    position: fixed;

    inset: 0;

    z-index: 10050;

    display: none;

    align-items: center;

    justify-content: center;

    padding: 22px;

    background: rgba(34, 24, 18, 0.58);

    backdrop-filter: blur(8px);

}



.progress-report-modal.visible {

    display: flex;

}



.progress-report-shell {

    width: min(1180px, 96vw);

    height: min(860px, 92vh);

    display: flex;

    flex-direction: column;

    overflow: hidden;

    border-radius: 28px;

    background: linear-gradient(145deg, #fffaf1, #f1e1c8);

    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);

    border: 1px solid rgba(255, 255, 255, 0.7);

}



.progress-report-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 24px 28px 18px;

    border-bottom: 1px solid rgba(93, 64, 55, 0.12);

}



.progress-report-kicker {

    color: #8a6d55;

    font-size: 0.82rem;

    font-weight: 900;

    letter-spacing: 0.08em;

    text-transform: uppercase;

}



.progress-report-header h2 {

    margin: 4px 0 0;

    color: var(--accent-hover);

    font-size: 1.6rem;

}



.progress-report-close {

    width: 44px;

    height: 44px;

    border: none;

    border-radius: 14px;

    background: rgba(255, 255, 255, 0.75);

    color: var(--accent-hover);

    font-size: 2rem;

    line-height: 1;

    cursor: pointer;

}



.progress-report-body {

    overflow: auto;

    padding: 22px 28px 30px;

}



.progress-report-summary {

    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 18px;

}



.progress-summary-card,

.progress-level-card,

.progress-mode-card {

    background: rgba(255, 255, 255, 0.68);

    border: 1px solid rgba(93, 64, 55, 0.1);

    border-radius: 20px;

    box-shadow: 0 10px 24px rgba(93, 64, 55, 0.08);

}



.progress-summary-card {

    display: flex;

    gap: 12px;

    padding: 12px;

}



.progress-summary-icon {

    font-size: 2rem;

}



.progress-summary-label {

    color: #8a6d55;

    font-size: 0.82rem;

    font-weight: 800;

}



.progress-summary-value {

    color: var(--accent-hover);

    font-size: 1.65rem;

    font-weight: 900;

}



.progress-summary-sub {

    color: #7d6b61;

    font-size: 0.78rem;

}



.progress-report-levels {

    display: grid;

    gap: 16px;

}



.progress-level-card {

    padding: 18px;

}



.progress-level-top,

.progress-level-stats,

.progress-stage-row,

.progress-word-row {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

}



.progress-level-title {

    display: flex;

    align-items: center;

    gap: 10px;

    color: var(--accent-hover);

    font-size: 1.1rem;

}



.progress-level-percent {

    color: #2f7d58;

    font-size: 1.35rem;

    font-weight: 900;

}



.progress-bar {

    height: 10px;

    overflow: hidden;

    margin: 12px 0;

    border-radius: 999px;

    background: rgba(93, 64, 55, 0.12);

}



.progress-bar span {

    display: block;

    height: 100%;

    border-radius: inherit;

    background: linear-gradient(90deg, #60c58b, #3b82f6);

}



.progress-level-stats {

    flex-wrap: wrap;

    color: #6a5548;

    font-size: 0.9rem;

    margin-bottom: 14px;

}



.progress-mode-grid {

    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 12px;

}



.progress-mode-card {

    padding: 12px;

}



.progress-mode-title {

    margin-bottom: 8px;

    color: var(--accent-hover);

    font-weight: 900;

}



.progress-stage-row {

    padding: 7px 0;

    border-top: 1px solid rgba(93, 64, 55, 0.1);

    color: #6a5548;

    font-size: 0.86rem;

}



.progress-stage-row em {

    min-width: 42px;

    color: #2f7d58;

    font-style: normal;

    font-weight: 900;

    text-align: right;

}



.progress-words-details {

    margin-top: 14px;

}



.progress-words-details summary {

    cursor: pointer;

    color: var(--accent-hover);

    font-weight: 900;

}



.progress-words-list {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 8px;

    margin-top: 10px;

}



.progress-word-row {

    padding: 8px 10px;

    border-radius: 12px;

    background: rgba(255, 255, 255, 0.55);

    color: #4f3f36;

}



.progress-word-main {

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

}



.progress-word-status {

    flex-shrink: 0;

    padding: 3px 8px;

    border-radius: 999px;

    font-size: 0.74rem;

    font-weight: 900;

}



.progress-word-status.in-progress {

    background: #fff3cd;

    color: #9a6700;

}



.progress-word-status.completed {

    background: #d9f7e7;

    color: #167249;

}



.progress-word-status.remaining {

    background: #e7efff;

    color: #2454a6;

}



.progress-empty-note,

.progress-hidden-note {

    margin-top: 12px;

    color: #8a6d55;

    font-size: 0.86rem;

}



.global-score-container {

    background: rgba(255, 255, 255, 0.5);

    padding: 5px 15px;

    border-radius: 12px;

    border: 1px solid rgba(255, 255, 255, 0.6);

    display: flex;

    flex-direction: row;

    align-items: center;

    gap: 10px;

    line-height: 1;

}



.score-label {

    font-size: 0.9em;

    opacity: 0.8;

    font-weight: 600;

}



.score-value {

    font-size: 1.3em;

    font-weight: 800;

    color: var(--accent-color);

}



/* SPA VIEWS */

.spa-view {

    display: none;

    opacity: 0;

    transform: translateY(10px);

    transition: all 0.3s ease;

}



.spa-view.active {

    display: block;

    opacity: 1;

    transform: translateY(0);

}



/* [HYDRATION FIX] Force visibility of the main view */

html[data-initial-view="levels"] #view-levels {

    display: block !important;

    opacity: 1 !important;

}



html[data-initial-view="stages"] #view-stages {

    display: block !important;

    opacity: 1 !important;

}



/* [HYDRATION FIX] Prevent initial shift by hiding other views immediately */

html[data-initial-view] .spa-view:not(.active) {

    display: none !important;

}



html.spa-routing-pending .spa-view {

    display: none !important;

    opacity: 0 !important;

    transform: translateY(10px) !important;

}



/* [HYDRATION FIX] Immediate visibility for pre-rendered views */

html[data-initial-view="levels"] #view-levels,

html[data-initial-view="stages"] #view-stages,

html[data-initial-view="selection"] #view-selection,

html[data-initial-view="game"] #view-game {

    display: block !important;

    opacity: 1 !important;

    transform: none !important;

    transition: none !important;

}



/* [HYDRATION FIX] Hide Top Bar only during Game */

html[data-initial-view="game"] .top-bar {

    display: none !important;

}



/* [HYDRATION FIX] Prevent game collapse */

html[data-initial-view="game"] #app {

    min-height: 60vh;

}



/* [HYDRATION FIX] Force grid stability for cards */

.stage-cards {

    display: grid !important;

    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;

    gap: 20px !important;

    width: 100% !important;

    box-sizing: border-box !important;

}



.stage-card {

    min-width: 0 !important;

    overflow: hidden !important;

}



.stage-card h2 {

    white-space: nowrap !important;

    overflow: hidden !important;

    text-overflow: ellipsis !important;

    margin: 10px 0 !important;

}



/* [SPINNER FIX] Hydration mask */

.game-hydration-placeholder {

    display: flex;

    justify-content: center;

    align-items: center;

    min-height: 60vh;

    width: 100%;

}



.game-hydration-placeholder::after {

    content: "";

    width: 60px;

    height: 60px;

    border: 6px solid rgba(93, 64, 55, 0.1);

    border-left-color: var(--accent-color);

    border-radius: 50%;

    animation: hydration-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;

}



@keyframes hydration-spin {

    0% {

        transform: rotate(0deg);

    }



    100% {

        transform: rotate(360deg);

    }

}



/* [LAYOUT FIX] Stabilize header area during SPA transition */

html[data-initial-view="game"] .main-header-bar {

    min-height: 50px;

}



html[data-initial-view="game"] .progress-indicator {

    min-height: 40px;

}



/* MODALS */

.modal-overlay {

    display: none;

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    background: rgba(46, 34, 27, 0.6);

    backdrop-filter: blur(5px);

    z-index: 10000;

    justify-content: center;

    align-items: center;

    opacity: 0;

    transition: opacity 0.3s ease;

}



.modal-overlay.visible {

    display: flex;

    opacity: 1;

}



.modal-content {

    background: #fff8f0;

    width: 100%;

    height: 100%;

    position: relative;

    display: flex;

    flex-direction: column;

    overflow: hidden;

    transform: scale(1.02);

    transition: transform 0.3s ease;

}



.modal-overlay.visible .modal-content {

    transform: scale(1);

}



.modal-close-btn {

    position: absolute;

    top: 15px;

    left: 15px;

    width: 40px;

    height: 40px;

    background: white;

    border-radius: 50%;

    color: #5d4037;

    font-size: 24px;

    font-weight: bold;

    border: 1px solid rgba(0, 0, 0, 0.1);

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    transition: all 0.2s;

    z-index: 10;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);

}



.modal-iframe {

    width: 100%;

    height: 100%;

    border: none;

    background: transparent;

}



/* STAGES SPA UI */

.stage-tabs {

    display: flex;

    background: rgba(0, 0, 0, 0.05);

    padding: 6px;

    border-radius: 16px;

    margin-bottom: 25px;

    gap: 6px;

}



.stage-tab {

    flex: 1;

    padding: 12px;

    text-align: center;

    font-size: 0.85rem;

    font-weight: 700;

    cursor: pointer;

    border-radius: 12px;

    transition: all 0.2s;

    color: var(--muted);

}



.stage-tab.active {

    background: #fff;

    color: var(--accent-color);

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

}



.mode-grid {

    display: flex;

    flex-direction: column;

    gap: 12px;

}



.mode-card {

    background: #fff;

    border-radius: 22px;

    padding: 18px 24px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);

    border: 1px solid rgba(0, 0, 0, 0.01);

    transition: all 0.2s;

    cursor: pointer;

}



.mode-card:hover {

    transform: scale(1.02);

    border-color: var(--accent-color);

}



/* Word Selection Styles (Original Parity) */

#view-selection {

    height: calc(100vh - 170px);

    min-height: 550px;

}



#view-selection.active {

    display: flex;

    flex-direction: column;

}



#word-selection-app-container {

    display: flex;

    flex-direction: column;

    flex-grow: 1;

    min-height: 0;

    height: 100%;

}



.selection-prepaint {

    display: flex;

    flex-direction: column;

    height: 100%;

    box-sizing: border-box;

}



.dictionary-view-container {

    display: block;

    flex-grow: 1;

    min-height: 0;

    overflow-y: auto;

    border: 1px solid #ddd;

    border-radius: 8px;

    padding: 10px;

    background-color: #fff;

    margin-top: 5px;

}



.selection-prepaint .app-header {

    display: grid;

    grid-template-columns: 54px 1fr 54px;

    align-items: center;

    gap: 16px;

    margin-bottom: 26px;

}



.selection-prepaint .app-header-title {

    margin: 0;

    text-align: center;

    color: var(--accent-color);

    font-size: 28px;

    line-height: 1.2;

    font-weight: 800;

    letter-spacing: -0.02em;

}



.selection-prepaint .nav-icon-btn {

    width: 40px;

    height: 40px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: #fff;

    color: var(--accent-color);

    text-decoration: none;

    font-size: 18px;

    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);

}



.selection-prepaint .nav-icon-btn svg {

    width: 22px;

    height: 22px;

    stroke: currentColor;

    stroke-width: 2;

    fill: none;

}



.selection-prepaint .header-right-group {

    display: flex;

    justify-content: flex-end;

}



.selection-prepaint #word-search-input {

    width: 100%;

    height: 42px;

    padding: 12px 15px 12px 40px;

    border-radius: 12px;

    border: 1px solid #ddd;

    box-sizing: border-box;

    background: #fff;

    color: #5d4037;

    font-size: 14px;

}



.selection-prepaint .button:disabled {

    opacity: 0.85;

    cursor: default;

}



details.category-details,

details.theme-details {

    border-radius: 8px;

    margin-top: 10px;

    border: 1px solid #e0e0e0;

    background-color: #f5f5ff;

    transition: background-color 0.2s;

    list-style: none;

}



details.category-details.selected-group,

details.theme-details.selected-group {

    background-color: var(--selected-category-bg);

}



details.category-details.partial-group,

details.theme-details.partial-group {

    background-color: var(--partial-category-bg);

}



summary {

    cursor: pointer;

    padding: 10px 15px 10px 35px;

    font-weight: bold;

    color: var(--accent-color);

    position: relative;

    list-style: none;

    display: flex;

    align-items: center;

    gap: 8px;

}



summary::-webkit-details-marker {

    display: none;

}



details>summary::before {

    content: '►';

    position: absolute;

    left: 12px;

    font-size: 0.9em;

    transition: transform 0.2s;

    transform-origin: center;

}



details[open]>summary::before {

    transform: rotate(90deg);

}



details[open] {

    padding-bottom: 10px;

}



.category-content {

    padding-left: 15px;

}



details.theme-details {

    margin: 5px 0;

    border: 1px solid #e0e0e0;

    background-color: #eaf2f8;

}



details.theme-details>summary {

    font-weight: normal;

    color: #333;

    font-size: 1em;

    padding: 8px 10px 8px 30px;

}



details.theme-details>summary::before {

    left: 10px;

}



.theme-content {

    padding: 0 10px 5px 10px;

    border-top: 1px solid #f0f0f0;

    margin-top: 5px;

}



.dictionary-item {

    display: flex;

    flex-direction: column;

    padding: 10px 5px;

    border-bottom: 1px dashed #eee;

    cursor: pointer;

    transition: background-color 0.2s;

}



.dictionary-item:last-child {

    border-bottom: none;

}



.dictionary-item:hover {

    background-color: color-mix(in srgb, var(--accent-color) 8%, transparent);

}



.dictionary-item.selected {

    background-color: color-mix(in srgb, var(--success-color) 15%, transparent);

}



.dictionary-item input[type="checkbox"] {

    transform: scale(1.1);

    margin-right: 8px;

    cursor: pointer;

}



.locked-group>summary input[type="checkbox"]:checked {

    accent-color: #9e9e9e;

}



.incomplete-categories-section {

    margin-top: 28px;

    border-top: 2px dashed #ccc;

    padding-top: 16px;

}



.incomplete-section-title {

    font-size: 1em;

    font-weight: 700;

    color: #999;

    margin: 0 0 4px 4px;

}



.incomplete-section-hint {

    font-size: 0.82em;

    color: #bbb;

    margin: 0 0 12px 4px;

    font-style: italic;

}



.incomplete-section-body .category-details>summary,

.incomplete-section-body .theme-details>summary {

    cursor: default;

    color: #aaa;

    opacity: 0.8;

}



.incomplete-section-body input[type="checkbox"] {

    opacity: 0.3;

    pointer-events: none !important;

}



.incomplete-section-body .dictionary-item {

    opacity: 0.45;

}



.incomplete-section-body .dictionary-item:hover {

    background: none !important;

}



.word-detail-section {

    border-top: 1px solid #000;

    padding-top: 8px;

    margin-top: 8px;

}



.word-detail-section:first-child {

    border-top: none;

    padding-top: 0;

    margin-top: 0;

}



.word-detail-section p {

    margin: 5px 0;

}



.item-ru {

    font-weight: 500;

}



.item-translations span {

    font-size: 0.9em;

    color: #555;

    margin-left: 8px;

    white-space: nowrap;

}



.word-context-inline {

    font-size: 0.9em;

    color: #555;

    margin-left: 10px;

    white-space: nowrap;

}



.synonym-indicator {

    color: #ff8c00;

    font-weight: bold;

    cursor: help;

    display: inline-block;

    margin-left: 2px;

    vertical-align: super;

    font-size: 1.3em;

}



.word-description-container {

    margin-top: 8px;

    padding-left: 30px;

}



.word-description {

    font-size: 0.8em;

    color: #888;

    background-color: #f9f9f9;

    padding: 8px;

    border-radius: 4px;

    margin-top: 4px;

    border-left: 3px solid var(--accent-color);

}



.description-toggle {

    font-size: 0.7em;

    color: #666;

    cursor: pointer;

    padding: 2px 6px;

    border: 1px solid #ddd;

    border-radius: 3px;

    margin-left: 8px;

    transition: background-color 0.2s;

}



.description-toggle:hover {

    background-color: #f0f0f0;

}



/* Modal Overrides */

.modal-content-card h2 {

    color: var(--accent-color);

    text-align: center;

    margin-bottom: 15px;

}



.confirmation-list {

    flex: 1;

    overflow-y: auto;

    border: 1px solid rgba(0, 0, 0, 0.1);

    border-radius: 8px;

    background: rgba(255, 255, 255, 0.5);

    margin-bottom: 6px;

    padding: 10px;

    min-height: 150px;

}



.conf-item {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 8px 10px;

    border-bottom: 1px solid rgba(0, 0, 0, 0.05);

    transition: background 0.2s;

}



.conf-item:last-child {

    border-bottom: none;

}



.conf-item:hover {

    background: rgba(0, 0, 0, 0.03);

}



.delete-btn {

    background: rgba(231, 76, 60, 0.1);

    border: 1px solid rgba(231, 76, 60, 0.3);

    border-radius: 50%;

    cursor: pointer;

    color: #e74c3c;

    width: 32px;

    height: 32px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 14px;

    transition: all 0.2s;

    margin-left: 10px;

}



.delete-btn:hover {

    background: #e74c3c;

    color: white;

    transform: scale(1.1);

}



.dictionary-item-main {

    display: flex;

    align-items: center;

    gap: 5px;

    flex-wrap: wrap;

}



.dictionary-item-main input[type="checkbox"] {

    margin-right: 5px;

}



.tabs-and-controls {

    display: flex;

    justify-content: space-between;

    align-items: center;

    border-bottom: 2px solid var(--accent-color);

    margin-bottom: 6px;

    padding-bottom: 8px;

    flex-wrap: wrap;

    gap: 10px;

}



.search-bar-container {

    position: relative;

    margin-bottom: 6px;

    width: 100%;

}



#word-search-input {

    width: 100%;

    padding: 12px 15px 12px 40px;

    border-radius: 12px;

    border: 1px solid #ddd;

    box-sizing: border-box;

}



.search-bar-container::before {

    content: '🔍';

    position: absolute;

    left: 15px;

    top: 50%;

    transform: translateY(-50%);

    opacity: 0.5;

    font-size: 1.2em;

}



.tab-button.tab-selected {

    background: var(--success-color) !important;

    color: white !important;

    border-color: var(--success-color) !important;

}



.locked-group>summary {

    background-color: #eee !important;

    color: #999 !important;

    cursor: not-allowed;

}



/* --- MemoryManager & Admin Styles Statically Injected --- */

/* Зеленая интерактивная точка */

#admin-cache-trigger {

    position: fixed;

    left: 18px;

    bottom: 18px;

    width: 14px;

    height: 14px;

    background: #10B981;

    border-radius: 50%;

    z-index: 99999;

    cursor: pointer;

    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);

    animation: admin-dot-pulse 2s infinite;

    transition: transform 0.2s ease, background-color 0.2s ease;

}



#admin-cache-trigger:hover {

    transform: scale(1.3);

    background: #34D399;

    box-shadow: 0 0 12px #34D399;

}



@keyframes admin-dot-pulse {

    0% {

        transform: scale(0.95);

        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);

    }



    70% {

        transform: scale(1);

        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);

    }



    100% {

        transform: scale(0.95);

        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);

    }

}



/* Кастомное контекстное меню */

.admin-context-menu {

    position: fixed;

    z-index: 100000;

    background: rgba(15, 23, 42, 0.95);

    backdrop-filter: blur(10px);

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 8px;

    padding: 5px 0;

    width: 160px;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);

    display: none;

    font-family: 'Inter', system-ui, sans-serif;

}



.admin-context-menu-item {

    padding: 10px 15px;

    color: #e2e8f0;

    font-size: 13px;

    cursor: pointer;

    transition: all 0.2s ease;

    display: flex;

    align-items: center;

    gap: 8px;

}



.admin-context-menu-item:hover {

    background: rgba(59, 130, 246, 0.15);

    color: #3b82f6;

}



/* Дашборд Оверлей */

.cache-dashboard-overlay {

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    background: rgba(8, 10, 15, 0.85);

    backdrop-filter: blur(20px);

    z-index: 100001;

    display: none;

    justify-content: center;

    align-items: center;

    font-family: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif;

    color: #f1f5f9;

}



.cache-dashboard-overlay.visible {

    display: flex;

    animation: fadeInDashboard 0.3s ease forwards;

}



@keyframes fadeInDashboard {

    from {

        opacity: 0;

    }



    to {

        opacity: 1;

    }

}



.cache-dashboard-window {

    width: 92%;

    max-width: 1200px;

    height: 88vh;

    background: rgba(17, 24, 39, 0.9);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 20px;

    padding: 24px;

    position: relative;

    display: flex;

    flex-direction: column;

    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    overflow: hidden;

}



.cache-dashboard-close {

    position: absolute;

    top: 15px;

    right: 20px;

    background: none;

    border: none;

    color: #94a3b8;

    font-size: 32px;

    cursor: pointer;

    transition: color 0.2s;

}



.cache-dashboard-close:hover {

    color: #ef4444;

}



.cache-dashboard-header {

    margin-bottom: 20px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.06);

    padding-bottom: 15px;

}



.cache-dashboard-header h2 {

    margin: 0 0 5px 0;

    font-size: 22px;

    color: #60a5fa;

    font-weight: 700;

}



.cache-dashboard-header p {

    margin: 0;

    font-size: 13px;

    color: #94a3b8;

}



.cache-dashboard-grid {

    display: grid;

    grid-template-columns: 1fr 1.1fr;

    gap: 10px;

    flex: 1;

    overflow: hidden;

}



.cache-dashboard-col {

    display: flex;

    flex-direction: column;

    gap: 10px;

    overflow-y: auto;

    padding-right: 5px;

}



.cache-dashboard-col::-webkit-scrollbar {

    width: 6px;

}



.cache-dashboard-col::-webkit-scrollbar-thumb {

    background: rgba(255, 255, 255, 0.1);

    border-radius: 4px;

}



.dashboard-card {

    background: rgba(30, 41, 59, 0.4);

    border: 1px solid rgba(255, 255, 255, 0.05);

    border-radius: 12px;

    padding: 12px;

}



.dashboard-card h3 {

    margin: 0 0 15px 0;

    font-size: 15px;

    color: #93c5fd;

    border-left: 3px solid #3b82f6;

    padding-left: 8px;

}



/* Gauge-кольцо для памяти */

.gauge-container {

    display: flex;

    align-items: center;

    justify-content: space-around;

    gap: 15px;

}



.gauge-ring {

    position: relative;

    width: 120px;

    height: 120px;

}



.gauge-bg {

    fill: none;

    stroke: rgba(255, 255, 255, 0.05);

    stroke-width: 8;

}



.gauge-fill {

    fill: none;

    stroke: #3b82f6;

    stroke-width: 8;

    stroke-linecap: round;

    transform: rotate(-90deg);

    transform-origin: 50% 50%;

    stroke-dasharray: 314;

    stroke-dashoffset: 314;

    transition: stroke-dashoffset 0.8s ease;

}



.gauge-text {

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

}



.gauge-text .value {

    font-size: 20px;

    font-weight: bold;

    color: #f8fafc;

}



.gauge-text .label {

    font-size: 9px;

    color: #64748b;

    margin-top: 2px;

}



.gauge-legend {

    display: flex;

    flex-direction: column;

    gap: 6px;

    font-size: 12px;

}



.legend-item {

    display: flex;

    align-items: center;

    gap: 8px;

    color: #cbd5e1;

}



.legend-dot {

    width: 8px;

    height: 8px;

    border-radius: 50%;

    display: inline-block;

}



.legend-dot.dict {

    background: #3b82f6;

}



.legend-dot.session {

    background: #f59e0b;

}



.legend-dot.other {

    background: #64748b;

}



.legend-dot.free {

    background: #10b981;

}



/* Схема движения данных */

.pipeline-container {

    padding: 10px 0;

}



.pipeline-flow {

    display: flex;

    align-items: center;

    justify-content: space-between;

    position: relative;

}



.pipeline-node {

    background: rgba(30, 41, 59, 0.8);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 8px;

    padding: 8px 12px;

    display: flex;

    flex-direction: column;

    align-items: center;

    min-width: 90px;

    z-index: 2;

    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);

}



.node-icon {

    font-size: 18px;

    margin-bottom: 4px;

}



.node-name {

    font-size: 10px;

    color: #94a3b8;

    font-weight: 600;

}



.pipeline-branch-container {

    display: flex;

    flex-direction: column;

    gap: 10px;

}



.pipeline-branch-row {

    display: flex;

    align-items: center;

}



.pipeline-arrow {

    position: relative;

    height: 2px;

    background: rgba(255, 255, 255, 0.15);

    width: 90px;

    margin: 0 6px;

}



.pipeline-arrow.active-arrow {

    background: #60a5fa;

    box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);

}



.arrow-label {

    position: absolute;

    top: -12px;

    left: 50%;

    transform: translateX(-50%);

    font-size: 8px;

    color: #64748b;

    white-space: nowrap;

}



.pulse-particle {

    position: absolute;

    width: 6px;

    height: 6px;

    background: #fff;

    border-radius: 50%;

    top: -2px;

    animation: flowParticle 2s infinite linear;

}



@keyframes flowParticle {

    0% {

        left: 0%;

        opacity: 0;

    }



    10% {

        opacity: 1;

    }



    90% {

        opacity: 1;

    }



    100% {

        left: 100%;

        opacity: 0;

    }

}



/* Песочница Симуляции */

.sandbox-desc {

    font-size: 12px;

    color: #94a3b8;

    margin: 0 0 12px 0;

    line-height: 1.4;

}



.sandbox-actions {

    display: flex;

    gap: 10px;

    margin-bottom: 12px;

}



.sandbox-btn {

    flex: 1;

    border: none;

    padding: 10px 14px;

    border-radius: 8px;

    font-size: 12px;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.2s;

    color: #fff;

}



.sandbox-btn.danger {

    background: #ef4444;

    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);

}



.sandbox-btn.danger:hover:not(:disabled) {

    background: #dc2626;

    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);

}



@keyframes spin {

    to {

        transform: rotate(360deg);

    }

}



.spinner-icon {

    display: inline-block;

    margin-left: 6px;

    width: 14px;

    height: 14px;

    border: 2px solid currentColor;

    border-bottom-color: transparent;

    border-radius: 50%;

    animation: spin 1s linear infinite;

    vertical-align: middle;

}



.sandbox-btn.success {

    background: #10b981;

    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);

}



.sandbox-btn.success:hover:not(:disabled) {

    background: #059669;

    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);

}



.sandbox-btn:disabled {

    opacity: 0.4;

    cursor: not-allowed;

    box-shadow: none !important;

}



.sandbox-console {

    background: #090d16;

    border: 1px solid rgba(255, 255, 255, 0.06);

    border-radius: 8px;

    font-family: 'Courier New', monospace;

    overflow: hidden;

}



.console-header {

    background: rgba(255, 255, 255, 0.03);

    padding: 6px 10px;

    font-size: 10px;

    color: #64748b;

    border-bottom: 1px solid rgba(255, 255, 255, 0.05);

}



.console-body {

    padding: 10px;

    height: 95px;

    overflow-y: auto;

    font-size: 11px;

    color: #a7f3d0;

    line-height: 1.5;

}



.console-body::-webkit-scrollbar {

    width: 4px;

}



.console-body::-webkit-scrollbar-thumb {

    background: rgba(255, 255, 255, 0.1);

}



/* Карта Связей (Дерево) */

.tree-desc {

    font-size: 12px;

    color: #94a3b8;

    margin: 0 0 12px 0;

}



.tree-container {

    display: flex;

    flex-direction: column;

    gap: 8px;

}



.tree-loading {

    text-align: center;

    color: #64748b;

    padding: 40px;

    font-size: 13px;

}



.tree-category {

    border: 1px solid rgba(255, 255, 255, 0.04);

    border-radius: 8px;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.01);

}



.tree-category-header {

    padding: 10px 14px;

    background: rgba(255, 255, 255, 0.03);

    display: flex;

    justify-content: space-between;

    align-items: center;

    cursor: pointer;

    font-size: 13px;

    font-weight: 700;

    transition: background 0.2s;

}



.tree-category-header:hover {

    background: rgba(255, 255, 255, 0.06);

}



.tree-category-content {

    display: none;

    padding: 10px 10px 10px 20px;

    border-top: 1px solid rgba(255, 255, 255, 0.04);

    flex-direction: column;

    gap: 8px;

}



.tree-category.expanded .tree-category-content {

    display: flex;

}



.tree-theme {

    border-left: 2px solid rgba(255, 255, 255, 0.1);

    padding-left: 10px;

}



.tree-theme-header {

    padding: 6px 0;

    display: flex;

    justify-content: space-between;

    cursor: pointer;

    font-size: 12px;

    font-weight: 600;

    color: #cbd5e1;

}



.tree-theme-header:hover {

    color: #60a5fa;

}



.tree-theme-content {

    display: none;

    padding: 5px 0 5px 15px;

    flex-wrap: wrap;

    gap: 6px;

}



.tree-theme.expanded .tree-theme-content {

    display: flex;

}



/* Бейджи статуса */

.word-badge {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 4px 8px;

    border-radius: 6px;

    font-size: 11px;

    background: rgba(255, 255, 255, 0.03);

    border: 1px solid rgba(255, 255, 255, 0.06);

    color: #cbd5e1;

}



.word-status-indicator {

    width: 6px;

    height: 6px;

    border-radius: 50%;

    display: inline-block;

}



.word-status-indicator.active {

    background: #10b981;

    box-shadow: 0 0 6px #10b981;

}



.word-status-indicator.session {

    background: #f59e0b;

    box-shadow: 0 0 6px #f59e0b;

}



.word-status-indicator.details {

    background: #3b82f6;

    box-shadow: 0 0 6px #3b82f6;

}



.tree-arrow {

    font-size: 10px;

    color: #64748b;

    transition: transform 0.2s;

}



.tree-category.expanded .tree-category-header .tree-arrow,

.tree-theme.expanded .tree-theme-header .tree-arrow {

    transform: rotate(90deg);

}



/* Патч-карточка */

.sandbox-btn.patch {

    background: linear-gradient(135deg, #6366f1, #8b5cf6);

    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);

}



.sandbox-btn.patch:hover:not(:disabled) {

    background: linear-gradient(135deg, #4f46e5, #7c3aed);

    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);

    transform: translateY(-1px);

}



.sandbox-btn.patch:disabled {

    opacity: 0.4;

    cursor: not-allowed;

    box-shadow: none !important;

    transform: none;

}



.patch-status-row {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 10px;

}



.patch-badge {

    display: inline-flex;

    align-items: center;

    gap: 5px;

    padding: 4px 10px;

    border-radius: 20px;

    font-size: 11px;

    font-weight: 600;

    border: 1px solid transparent;

}



.patch-badge.neutral {

    background: rgba(255, 255, 255, 0.04);

    border-color: rgba(255, 255, 255, 0.08);

    color: #94a3b8;

}



.patch-badge.success {

    background: rgba(16, 185, 129, 0.12);

    border-color: rgba(16, 185, 129, 0.3);

    color: #34d399;

}



.patch-badge.error {

    background: rgba(239, 68, 68, 0.12);

    border-color: rgba(239, 68, 68, 0.3);

    color: #fca5a5;

}



.patch-badge.info {

    background: rgba(99, 102, 241, 0.12);

    border-color: rgba(99, 102, 241, 0.3);

    color: #a5b4fc;

}



.patch-card code {

    background: rgba(255, 255, 255, 0.07);

    padding: 1px 5px;

    border-radius: 4px;

    font-family: 'Courier New', monospace;

    font-size: 11px;

    color: #93c5fd;

}



.diagnostic-toolbar {

    display: grid;

    grid-template-columns: 1fr 1fr auto;

    gap: 8px;

    margin-bottom: 12px;

}



.diagnostic-select,

.diagnostic-btn {

    background: rgba(15, 23, 42, 0.9);

    color: #e2e8f0;

    border: 1px solid rgba(148, 163, 184, 0.2);

    border-radius: 8px;

    padding: 8px 10px;

    font-size: 12px;

}



.diagnostic-btn {

    cursor: pointer;

    font-weight: 800;

    color: #93c5fd;

}



.diagnostic-btn:hover {

    border-color: rgba(96, 165, 250, 0.6);

    background: rgba(59, 130, 246, 0.14);

}



.diagnostic-list {

    display: flex;

    flex-direction: column;

    gap: 8px;

    max-height: 360px;

    overflow-y: auto;

    padding-right: 4px;

}



.diagnostic-card {

    border: 1px solid rgba(255, 255, 255, 0.07);

    border-radius: 10px;

    background: rgba(15, 23, 42, 0.45);

    padding: 10px;

}



.diagnostic-card-head {

    display: flex;

    justify-content: space-between;

    gap: 10px;

    align-items: flex-start;

    font-size: 12px;

    color: #cbd5e1;

    margin-bottom: 8px;

}



.diagnostic-title {

    font-weight: 800;

    color: #f8fafc;

}



.diagnostic-meta {

    color: #94a3b8;

    font-size: 11px;

    line-height: 1.45;

}



.diagnostic-badges {

    display: flex;

    flex-wrap: wrap;

    gap: 5px;

    margin: 8px 0;

}



.diagnostic-word {

    border: 1px solid rgba(255, 255, 255, 0.08);

    background: rgba(255, 255, 255, 0.04);

    color: #dbeafe;

    border-radius: 999px;

    padding: 4px 8px;

    font-size: 11px;

    cursor: pointer;

}



.diagnostic-word:hover {

    background: rgba(96, 165, 250, 0.2);

    border-color: rgba(96, 165, 250, 0.5);

}



.diagnostic-word.bad {

    color: #fecaca;

    border-color: rgba(239, 68, 68, 0.35);

}



.diagnostic-word.partial {

    color: #fde68a;

    border-color: rgba(245, 158, 11, 0.35);

}



.diagnostic-word.full {

    color: #bbf7d0;

    border-color: rgba(16, 185, 129, 0.35);

}



.inspector-panel {

    margin-top: 12px;

    border: 1px solid rgba(96, 165, 250, 0.18);

    border-radius: 10px;

    background: rgba(2, 6, 23, 0.45);

    padding: 12px;

    font-size: 12px;

    color: #cbd5e1;

}



.inspector-panel pre {

    white-space: pre-wrap;

    word-break: break-word;

    max-height: 240px;

    overflow-y: auto;

    background: #090d16;

    border-radius: 8px;

    padding: 10px;

    color: #a7f3d0;

}



.storage-breakdown {

    margin-top: 12px;

    max-height: 180px;

    overflow-y: auto;

    display: flex;

    flex-direction: column;

    gap: 5px;

}



.storage-row {

    display: grid;

    grid-template-columns: 1fr auto auto;

    gap: 8px;

    font-size: 11px;

    color: #cbd5e1;

    border-bottom: 1px solid rgba(255, 255, 255, 0.04);

    padding: 4px 0;

}



.storage-row code {

    color: #93c5fd;

    background: rgba(255, 255, 255, 0.05);

    border-radius: 4px;

    padding: 1px 4px;

}



/* Combined Settings Dropdown Panel styling */

.settings-dropdown-container {

    position: relative;

    display: inline-block;

}



.settings-dropdown-menu {

    display: none;

    position: absolute;

    top: calc(100% + 8px);

    right: 0;

    background: rgba(43, 30, 24, 0.95);

    backdrop-filter: blur(12px);

    -webkit-backdrop-filter: blur(12px);

    border: 2px solid var(--accent-color);

    border-radius: 12px;

    padding: 12px;

    min-width: 320px;

    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    z-index: 1000;

    flex-direction: column;

    gap: 14px;

}



.settings-dropdown-menu.active {

    display: flex;

}



.settings-dropdown-row {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

}



.settings-dropdown-row .row-label {

    font-weight: 700;

    color: #f5f5f5;

    font-size: 0.95rem;

    min-width: 60px;

    text-align: left;

}



/* Adjustments inside the dropdown row */

.settings-dropdown-row .audio-integrated-wrapper {

    background: rgba(255, 255, 255, 0.05);

    padding: 4px 8px;

    border-radius: 8px;

    border: 1px solid rgba(255, 255, 255, 0.1);

    display: flex;

    align-items: center;

    gap: 6px;

    flex-grow: 1;

    justify-content: flex-end;

}



.settings-dropdown-row .lang-switcher-bar {

    margin: 0;

    display: flex;

    gap: 6px;

    flex-grow: 1;

    justify-content: flex-end;

}



.settings-dropdown-row .lang-switch-btn {

    background: rgba(255, 255, 255, 0.12);

    border: 1px solid rgba(255, 255, 255, 0.25);

    color: #ffffff;

    padding: 6px 16px;

    font-size: 0.85rem;

    font-weight: 700;

    border-radius: 8px;

    cursor: pointer;

    transition: all 0.25s ease;

}



.settings-dropdown-row .lang-switch-btn:hover {

    background: rgba(255, 255, 255, 0.25);

    border-color: var(--accent-color, #df8f55);

    color: #ffffff;

    transform: translateY(-1px);

}



.settings-dropdown-row .lang-switch-btn.active {

    background: linear-gradient(135deg, var(--accent-color, #df8f55), #f2a772);

    border-color: var(--accent-color, #df8f55);

    color: #ffffff;

    box-shadow: 0 4px 15px rgba(223, 143, 85, 0.5);

    font-weight: 800;

    transform: translateY(0);

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);

}



.settings-dropdown-row .volume-slider-container {

    display: flex;

    align-items: center;

    width: 80px;

}



.settings-dropdown-row .volume-range {

    width: 100%;

    cursor: pointer;

}



.settings-dropdown-row .track-popup {

    max-width: 150px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 11px;

    color: #ccc;

}



@media (max-width: 992px) {

    .settings-dropdown-menu {

        position: fixed !important;

        top: 70px !important;

        left: 15px !important;

        right: 15px !important;

        width: calc(100% - 30px) !important;

        min-width: 0 !important;

        z-index: 1000000 !important;

    }

}



.swal-small-popup {

    width: 320px !important;

    font-size: 0.9rem !important;

    padding: 1em !important;

    border-radius: 12px !important;

}

[data-theme="dark"] .unified-hint-container,
body.theme-dark .unified-hint-container {
    background: linear-gradient(180deg, rgba(120, 136, 164, 0.86), rgba(96, 110, 138, 0.92)) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 28px rgba(0, 0, 0, 0.22) !important;
    animation: none !important;
}

[data-theme="dark"] .hint-separator,
body.theme-dark .hint-separator {
    background-color: rgba(255, 255, 255, 0.16) !important;
}

[data-theme="dark"] .hearts-simple-btn,
body.theme-dark .hearts-simple-btn {
    color: #ff667f !important;
}

[data-theme="dark"] .hint-cost-text,
body.theme-dark .hint-cost-text {
    color: #334155 !important;
    font-weight: 800 !important;
}

[data-theme="dark"] .favorite-toggle,
body.theme-dark .favorite-toggle {
    background: rgba(50, 65, 90, 0.42) !important;
    color: #d8d9cf !important;
    border-radius: 999px !important;
}

[data-theme="dark"] .favorite-toggle.is-favorite,
body.theme-dark .favorite-toggle.is-favorite {
    background: rgba(251, 191, 36, 0.18) !important;
    color: #facc15 !important;
}

/* Trainer levels dark theme polish. */
[data-theme="dark"],
body.theme-dark {
    --bg-grad-start: #020617;
    --bg-grad-end: #0f172a;
    --bg-color: #0f172a;
    --paper-color: #363d4a;
    --glass-bg: rgba(54, 61, 74, 0.88);
    --glass-border: rgba(148, 163, 184, 0.38);
    --btn-base-bg: rgba(68, 76, 92, 0.92);
    --pedestal-bg: rgba(54, 61, 74, 0.72);
    --pedestal-border: rgba(148, 163, 184, 0.38);
    --accent-color: #c4b5fd;
    --accent-hover: #f8fafc;
    --muted: #cbd5e1;
    --text-color: #f8fafc;
    --border-color: rgba(148, 163, 184, 0.38);
}

[data-theme="dark"] body,
body.theme-dark {
    background:
        radial-gradient(circle at top, rgba(124, 58, 237, 0.16), transparent 38%),
        linear-gradient(135deg, #020617 0%, #111827 100%) !important;
    color: #f8fafc;
}

[data-theme="dark"] body.view-levels-active,
[data-theme="dark"] body.view-stages-active,
[data-theme="dark"] body:has(#view-levels.spa-view.active),
[data-theme="dark"] body:has(#view-stages.spa-view.active),
body.theme-dark.view-levels-active,
body.theme-dark.view-stages-active,
body.theme-dark:has(#view-levels.spa-view.active),
body.theme-dark:has(#view-stages.spa-view.active) {
    background: linear-gradient(135deg, #020617 0%, #111827 100%) !important;
}

[data-theme="dark"] .wrap,
body.theme-dark .wrap {
    background: transparent !important;
}

[data-theme="dark"] .wrap>.container,
body.theme-dark .wrap>.container {
    background: rgba(54, 61, 74, 0.94) !important;
    border: 1px solid rgba(148, 163, 184, 0.32) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38) !important;
    color: #f8fafc;
}

[data-theme="dark"] #view-levels.spa-view.active,
[data-theme="dark"] #levels-grid-container,
[data-theme="dark"] #view-stages.spa-view.active,
[data-theme="dark"] #view-stages .level-header-row,
[data-theme="dark"] #view-stages .tabs,
[data-theme="dark"] #view-stages .stage-cards-container,
[data-theme="dark"] #view-stages .stage-panel,
[data-theme="dark"] #view-stages .tactical-menu-bar,
body.theme-dark #view-levels.spa-view.active,
body.theme-dark #levels-grid-container,
body.theme-dark #view-stages.spa-view.active,
body.theme-dark #view-stages .level-header-row,
body.theme-dark #view-stages .tabs,
body.theme-dark #view-stages .stage-cards-container,
body.theme-dark #view-stages .stage-panel,
body.theme-dark #view-stages .tactical-menu-bar {
    background: transparent !important;
}

[data-theme="dark"] .top-bar,
body.theme-dark .top-bar {
    background: rgba(45, 52, 64, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32) !important;
}

[data-theme="dark"] .header-btn,
[data-theme="dark"] .audio-btn,
body.theme-dark .header-btn,
body.theme-dark .audio-btn {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #e5e7eb !important;
    border-color: rgba(196, 181, 253, 0.36) !important;
}

[data-theme="dark"] .header-btn:hover,
[data-theme="dark"] .audio-btn:hover,
body.theme-dark .header-btn:hover,
body.theme-dark .audio-btn:hover {
    background: #4c1d95 !important;
    color: #ffffff !important;
    border-color: rgba(196, 181, 253, 0.7) !important;
    box-shadow: 0 8px 18px rgba(76, 29, 149, 0.34) !important;
}

[data-theme="dark"] .level-header-row,
body.theme-dark .level-header-row {
    border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}

[data-theme="dark"] .level-header-row h1,
body.theme-dark .level-header-row h1 {
    color: #f8fafc !important;
}

[data-theme="dark"] .progress-report-trigger,
body.theme-dark .progress-report-trigger {
    background: rgba(30, 41, 59, 0.94) !important;
    color: #f8fafc !important;
    border-color: rgba(196, 181, 253, 0.34) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24) !important;
}

[data-theme="dark"] .progress-report-modal,
body.theme-dark .progress-report-modal {
    background: rgba(54, 61, 74, 0.98) !important;
}

[data-theme="dark"] .progress-report-shell,
body.theme-dark .progress-report-shell {
    background: linear-gradient(180deg, #444c5c 0%, #363d4a 100%) !important;
    border-color: rgba(196, 181, 253, 0.22) !important;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46) !important;
}

[data-theme="dark"] .progress-report-header,
body.theme-dark .progress-report-header {
    border-bottom-color: rgba(148, 163, 184, 0.16) !important;
}

[data-theme="dark"] .progress-report-kicker,
body.theme-dark .progress-report-kicker {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .progress-report-header h2,
body.theme-dark .progress-report-header h2 {
    color: #f8fafc !important;
}

[data-theme="dark"] .progress-report-close,
body.theme-dark .progress-report-close {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(196, 181, 253, 0.28) !important;
}

[data-theme="dark"] .progress-summary-card,
[data-theme="dark"] .progress-level-card,
[data-theme="dark"] .progress-mode-card,
body.theme-dark .progress-summary-card,
body.theme-dark .progress-level-card,
body.theme-dark .progress-mode-card {
    background: rgba(30, 41, 59, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.16) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24) !important;
}

[data-theme="dark"] .progress-summary-label,
[data-theme="dark"] .progress-summary-sub,
[data-theme="dark"] .progress-level-stats,
[data-theme="dark"] .progress-stage-row,
[data-theme="dark"] .progress-empty-note,
[data-theme="dark"] .progress-hidden-note,
body.theme-dark .progress-summary-label,
body.theme-dark .progress-summary-sub,
body.theme-dark .progress-level-stats,
body.theme-dark .progress-stage-row,
body.theme-dark .progress-empty-note,
body.theme-dark .progress-hidden-note {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .progress-summary-value,
[data-theme="dark"] .progress-level-title,
[data-theme="dark"] .progress-mode-title,
[data-theme="dark"] .progress-words-details summary,
body.theme-dark .progress-summary-value,
body.theme-dark .progress-level-title,
body.theme-dark .progress-mode-title,
body.theme-dark .progress-words-details summary {
    color: #f8fafc !important;
}

[data-theme="dark"] .progress-level-percent,
[data-theme="dark"] .progress-stage-row em,
body.theme-dark .progress-level-percent,
body.theme-dark .progress-stage-row em {
    color: #4ade80 !important;
}

[data-theme="dark"] .progress-bar,
body.theme-dark .progress-bar {
    background: rgba(148, 163, 184, 0.16) !important;
}

[data-theme="dark"] .progress-bar span,
body.theme-dark .progress-bar span {
    background: linear-gradient(90deg, #22c55e, #60a5fa) !important;
}

[data-theme="dark"] .progress-stage-row,
body.theme-dark .progress-stage-row {
    border-top-color: rgba(148, 163, 184, 0.12) !important;
}

[data-theme="dark"] .progress-word-row,
body.theme-dark .progress-word-row {
    background: rgba(15, 23, 42, 0.76) !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(148, 163, 184, 0.12) !important;
}

[data-theme="dark"] .progress-word-main,
[data-theme="dark"] .progress-word-modes,
body.theme-dark .progress-word-main,
body.theme-dark .progress-word-modes {
    color: #e5e7eb !important;
}

[data-theme="dark"] .progress-word-status.in-progress,
body.theme-dark .progress-word-status.in-progress {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .progress-word-status.completed,
body.theme-dark .progress-word-status.completed {
    background: rgba(34, 197, 94, 0.18) !important;
    color: #86efac !important;
}

[data-theme="dark"] .progress-word-status.remaining,
body.theme-dark .progress-word-status.remaining {
    background: rgba(96, 165, 250, 0.18) !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .global-score-container,
body.theme-dark .global-score-container {
    background: rgba(15, 23, 42, 0.72) !important;
    border-color: rgba(148, 163, 184, 0.26) !important;
}

[data-theme="dark"] .score-label,
body.theme-dark .score-label {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

[data-theme="dark"] .score-value,
body.theme-dark .score-value {
    color: #ffffff !important;
}

[data-theme="dark"] .profile-card,
body.theme-dark .profile-card {
    background: #202d44 !important;
    color: #f8fafc !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
}

[data-theme="dark"] .profile-card:hover,
body.theme-dark .profile-card:hover {
    border-color: rgba(196, 181, 253, 0.48) !important;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34) !important;
}

[data-theme="dark"] .profile-card h2,
body.theme-dark .profile-card h2 {
    color: #f8fafc !important;
}

[data-theme="dark"] .stats-box,
body.theme-dark .stats-box {
    background: rgba(15, 23, 42, 0.62) !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .stats-box b,
body.theme-dark .stats-box b {
    color: #ffffff !important;
}

[data-theme="dark"] .stats-box .base-info,
[data-theme="dark"] .stats-box .details,
body.theme-dark .stats-box .base-info,
body.theme-dark .stats-box .details {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

[data-theme="dark"] .card-btn,
body.theme-dark .card-btn {
    background: #6d28d9 !important;
    color: #ffffff !important;
    border: 1px solid rgba(196, 181, 253, 0.34) !important;
    box-shadow: 0 8px 18px rgba(76, 29, 149, 0.28) !important;
}

[data-theme="dark"] .card-btn:hover,
body.theme-dark .card-btn:hover {
    background: #5b21b6 !important;
    border-color: rgba(251, 191, 36, 0.72) !important;
}

[data-theme="dark"] .card-btn.disabled-state,
body.theme-dark .card-btn.disabled-state {
    background: rgba(51, 65, 85, 0.82) !important;
    color: #cbd5e1 !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .profile-card.srs-profile,
body.theme-dark .profile-card.srs-profile {
    background: #241f3f !important;
    border-color: rgba(196, 181, 253, 0.38) !important;
}

[data-theme="dark"] .profile-card.srs-profile h2,
body.theme-dark .profile-card.srs-profile h2 {
    color: #d8b4fe !important;
}

[data-theme="dark"] .user-pedestal,
body.theme-dark .user-pedestal {
    background: rgba(15, 23, 42, 0.74) !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
}

[data-theme="dark"] .user-name-main,
body.theme-dark .user-name-main {
    color: #f8fafc !important;
}

[data-theme="dark"] .user-email-full,
[data-theme="dark"] .user-score-val,
body.theme-dark .user-email-full,
body.theme-dark .user-score-val {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

[data-theme="dark"] .stage-tab-btn,
body.theme-dark .stage-tab-btn {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .stage-tab-btn:hover:not(.active):not(:disabled),
body.theme-dark .stage-tab-btn:hover:not(.active):not(:disabled) {
    background: rgba(30, 41, 59, 0.9) !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .stage-tab-btn.active,
[data-theme="dark"] .container.layer-tabs .stage-tab-btn.active,
[data-theme="dark"] .container:not(.layer-tabs) .stage-tab-btn.active,
body.theme-dark .stage-tab-btn.active,
body.theme-dark .container.layer-tabs .stage-tab-btn.active,
body.theme-dark .container:not(.layer-tabs) .stage-tab-btn.active {
    background: #334155 !important;
    color: #ffffff !important;
    box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.24) !important;
}

[data-theme="dark"] .tabs,
body.theme-dark .tabs {
    border-bottom-color: rgba(196, 181, 253, 0.46) !important;
}

[data-theme="dark"] .tab-indicator,
body.theme-dark .tab-indicator {
    background: #fbbf24 !important;
}

[data-theme="dark"] .stage-card,
body.theme-dark .stage-card {
    background: #202d44 !important;
    color: #f8fafc !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24) !important;
}

[data-theme="dark"] .stage-card h2,
body.theme-dark .stage-card h2 {
    color: #f8fafc !important;
}

[data-theme="dark"] .stage-card-stats,
body.theme-dark .stage-card-stats {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .language-card.active-mode,
body.theme-dark .language-card.active-mode {
    border-color: #fbbf24 !important;
    box-shadow: 0 16px 42px rgba(251, 191, 36, 0.14), 0 12px 28px rgba(0, 0, 0, 0.28) !important;
}

[data-theme="dark"] .menu-btn,
body.theme-dark .menu-btn {
    background: rgba(30, 41, 59, 0.94) !important;
    color: #e5e7eb !important;
    border-color: rgba(196, 181, 253, 0.36) !important;
}

[data-theme="dark"] .menu-btn:hover,
body.theme-dark .menu-btn:hover {
    background: #4c1d95 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .session-info-compact,
body.theme-dark .session-info-compact {
    background: rgba(15, 23, 42, 0.62) !important;
    border-color: rgba(148, 163, 184, 0.26) !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .session-info-compact:hover,
body.theme-dark .session-info-compact:hover {
    background: rgba(30, 41, 59, 0.96) !important;
    border-color: rgba(196, 181, 253, 0.52) !important;
}

[data-theme="dark"] .session-meta-row,
[data-theme="dark"] .session-words-preview,
body.theme-dark .session-meta-row,
body.theme-dark .session-words-preview {
    color: #f8fafc !important;
}

[data-theme="dark"] .player-status-container,
body.theme-dark .player-status-container {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(51, 65, 85, 0.92)) !important;
    border-color: rgba(196, 181, 253, 0.52) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28) !important;
}

[data-theme="dark"] .player-status-container .status-divider,
body.theme-dark .player-status-container .status-divider {
    background-color: rgba(226, 232, 240, 0.16) !important;
}

[data-theme="dark"] .player-status-container .status-value,
body.theme-dark .player-status-container .status-value {
    color: #ddd6fe !important;
    text-shadow: none !important;
}

[data-theme="dark"] .player-status-container .star-item .status-value,
body.theme-dark .player-status-container .star-item .status-value {
    color: #f8fafc !important;
}

[data-theme="dark"] #view-selection,
[data-theme="dark"] #word-selection-app-container,
body.theme-dark #view-selection,
body.theme-dark #word-selection-app-container {
    background: transparent !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .app-header-title,
[data-theme="dark"] .selection-prepaint .app-header-title,
body.theme-dark .app-header-title,
body.theme-dark .selection-prepaint .app-header-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .nav-icon-btn,
[data-theme="dark"] .selection-prepaint .nav-icon-btn,
body.theme-dark .nav-icon-btn,
body.theme-dark .selection-prepaint .nav-icon-btn {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(196, 181, 253, 0.28) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24) !important;
}

[data-theme="dark"] .nav-icon-btn:hover,
body.theme-dark .nav-icon-btn:hover {
    background: rgba(51, 65, 85, 0.98) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .tabs-and-controls,
body.theme-dark .tabs-and-controls {
    border-bottom-color: rgba(196, 181, 253, 0.42) !important;
}

[data-theme="dark"] #word-search-input,
body.theme-dark #word-search-input {
    background: rgba(15, 23, 42, 0.94) !important;
    border-color: rgba(196, 181, 253, 0.26) !important;
    color: #f8fafc !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .search-bar-container::before,
body.theme-dark .search-bar-container::before {
    opacity: 0.72 !important;
}

[data-theme="dark"] .dictionary-view-container,
body.theme-dark .dictionary-view-container {
    background: rgba(15, 23, 42, 0.88) !important;
    border-color: rgba(196, 181, 253, 0.26) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] details.category-details,
body.theme-dark details.category-details {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.18) !important;
}

[data-theme="dark"] details.theme-details,
body.theme-dark details.theme-details {
    background: rgba(56, 189, 248, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.16) !important;
}

[data-theme="dark"] .dictionary-item,
body.theme-dark .dictionary-item {
    background: rgba(56, 189, 248, 0.16) !important;
    color: #f8fafc !important;
    border-bottom-color: rgba(71, 85, 105, 0.14) !important;
}

[data-theme="dark"] .dictionary-item:hover,
body.theme-dark .dictionary-item:hover {
    background: rgba(56, 189, 248, 0.32) !important;
    color: #ffffff !important;
}

[data-theme="dark"] summary,
[data-theme="dark"] details.theme-details>summary,
[data-theme="dark"] details.category-details>summary,
body.theme-dark summary,
body.theme-dark details.theme-details>summary,
body.theme-dark details.category-details>summary {
    color: #ddd6fe !important;
}

[data-theme="dark"] details>summary::before,
body.theme-dark details>summary::before {
    color: #a78bfa !important;
}

[data-theme="dark"] .item-ru,
[data-theme="dark"] .item-translations span,
[data-theme="dark"] .word-context-inline,
body.theme-dark .item-ru,
body.theme-dark .item-translations span,
body.theme-dark .word-context-inline {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .word-description,
body.theme-dark .word-description {
    color: #cbd5e1 !important;
    background-color: rgba(15, 23, 42, 0.9) !important;
    border-left-color: #8b5cf6 !important;
}

[data-theme="dark"] .description-toggle,
body.theme-dark .description-toggle {
    color: #cbd5e1 !important;
    border-color: rgba(196, 181, 253, 0.28) !important;
    background: rgba(30, 41, 59, 0.96) !important;
}

[data-theme="dark"] .description-toggle:hover,
body.theme-dark .description-toggle:hover {
    background: rgba(51, 65, 85, 0.98) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .incomplete-categories-section,
body.theme-dark .incomplete-categories-section {
    border-top-color: rgba(148, 163, 184, 0.36) !important;
}

[data-theme="dark"] .bottom-controls-bar,
body.theme-dark .bottom-controls-bar {
    background: rgba(15, 23, 42, 0.94) !important;
    border-top-color: rgba(196, 181, 253, 0.24) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28) !important;
}

[data-theme="dark"] #selection-counter,
[data-theme="dark"] .bottom-controls-bar label,
[data-theme="dark"] .bottom-controls-bar p,
body.theme-dark #selection-counter,
body.theme-dark .bottom-controls-bar label,
body.theme-dark .bottom-controls-bar p {
    color: #f8fafc !important;
}

[data-theme="dark"] .tabs-and-controls .button.secondary,
[data-theme="dark"] .tabs-and-controls .tab-button.secondary,
[data-theme="dark"] #expand-toggle-btn,
[data-theme="dark"] #start-training-btn,
body.theme-dark .tabs-and-controls .button.secondary,
body.theme-dark .tabs-and-controls .tab-button.secondary,
body.theme-dark #expand-toggle-btn,
body.theme-dark #start-training-btn {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #ddd6fe !important;
    border-color: rgba(196, 181, 253, 0.4) !important;
}

[data-theme="dark"] .tabs-and-controls .button.secondary:hover,
[data-theme="dark"] .tabs-and-controls .tab-button.secondary:hover,
[data-theme="dark"] #expand-toggle-btn:hover,
[data-theme="dark"] #start-training-btn:hover,
body.theme-dark .tabs-and-controls .button.secondary:hover,
body.theme-dark .tabs-and-controls .tab-button.secondary:hover,
body.theme-dark #expand-toggle-btn:hover,


[data-theme="dark"] .tabs-and-controls .tab-button:not(.secondary),
body.theme-dark .tabs-and-controls .tab-button:not(.secondary) {
    background: #6d28d9 !important;
    color: #ffffff !important;
    border-color: #5b21b6 !important;
}

[data-theme="dark"] .tabs-and-controls .tab-button:not(.secondary):hover,
body.theme-dark .tabs-and-controls .tab-button:not(.secondary):hover {
    background: #4c1d95 !important;
    color: #ffffff !important;
    border-color: #4c1d95 !important;
}

[data-theme="dark"] #continue-training-btn,
body.theme-dark #continue-training-btn {
    background: linear-gradient(135deg, #3ba54c, #2f8d40) !important;
    color: #ffffff !important;
    border-color: rgba(74, 222, 128, 0.2) !important;
}

[data-theme="dark"] .trainer-session-popup,
body.theme-dark .trainer-session-popup {
    background: #363d4a !important;
    color: #f8fafc !important;
    border: 1px solid rgba(196, 181, 253, 0.22) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.44) !important;
}

[data-theme="dark"] .trainer-session-popup .swal2-title,
[data-theme="dark"] .trainer-session-popup .swal2-html-container,
body.theme-dark .trainer-session-popup .swal2-title,
body.theme-dark .trainer-session-popup .swal2-html-container {
    color: #f8fafc !important;
}

[data-theme="dark"] .trainer-session-popup .swal2-close,
body.theme-dark .trainer-session-popup .swal2-close {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .trainer-session-popup .swal2-confirm,
body.theme-dark .trainer-session-popup .swal2-confirm {
    background: #6d28d9 !important;
    box-shadow: none !important;
}

[data-theme="dark"] .tactical-content,
body.theme-dark .tactical-content {
    background: #111827 !important;
    border-color: rgba(196, 181, 253, 0.22) !important;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.42) !important;
}

[data-theme="dark"] .tactical-header,
[data-theme="dark"] .tactical-lang-tabs,
[data-theme="dark"] .tactical-tabs,
body.theme-dark .tactical-header,
body.theme-dark .tactical-lang-tabs,
body.theme-dark .tactical-tabs {
    background: #1e293b !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

[data-theme="dark"] .tactical-header h2,
[data-theme="dark"] .tactical-close,
body.theme-dark .tactical-header h2,
body.theme-dark .tactical-close {
    color: #f8fafc !important;
}

[data-theme="dark"] .lang-tab-btn,
[data-theme="dark"] .t-tab,
[data-theme="dark"] .global-collapse-btn,
body.theme-dark .lang-tab-btn,
body.theme-dark .t-tab,
body.theme-dark .global-collapse-btn {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #e5e7eb !important;
    border-color: rgba(196, 181, 253, 0.26) !important;
}

[data-theme="dark"] .lang-tab-btn:hover,
[data-theme="dark"] .t-tab:hover,
[data-theme="dark"] .global-collapse-btn:hover,
body.theme-dark .lang-tab-btn:hover,
body.theme-dark .t-tab:hover,
body.theme-dark .global-collapse-btn:hover {
    background: rgba(51, 65, 85, 0.98) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .lang-tab-btn.active,
[data-theme="dark"] .t-tab.active,
body.theme-dark .lang-tab-btn.active,
body.theme-dark .t-tab.active {
    background: #4c1d95 !important;
    color: #ffffff !important;
    border-color: rgba(221, 214, 254, 0.7) !important;
}

[data-theme="dark"] .tactical-body,
body.theme-dark .tactical-body {
    background: #111827 !important;
}

[data-theme="dark"] .queue-global-header,
body.theme-dark .queue-global-header {
    background: rgba(30, 41, 59, 0.94) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

[data-theme="dark"] .batch-container,
[data-theme="dark"] .batch-items-list,
[data-theme="dark"] .batch-header,
[data-theme="dark"] .create-pkg-btn,
[data-theme="dark"] .btn-to-top,
body.theme-dark .batch-container,
body.theme-dark .batch-items-list,
body.theme-dark .batch-header,
body.theme-dark .create-pkg-btn,
body.theme-dark .btn-to-top {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #f8fafc !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

[data-theme="dark"] .create-pkg-btn:hover,
[data-theme="dark"] .btn-to-top:hover,
[data-theme="dark"] .batch-header:hover,
body.theme-dark .create-pkg-btn:hover,
body.theme-dark .btn-to-top:hover,
body.theme-dark .batch-header:hover {
    background: rgba(51, 65, 85, 0.98) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .batch-date,
[data-theme="dark"] .batch-arrow,
[data-theme="dark"] .row-main-text,
[data-theme="dark"] .row-details,
body.theme-dark .batch-date,
body.theme-dark .batch-arrow,
body.theme-dark .row-main-text,
body.theme-dark .row-details {
    color: #f8fafc !important;
}

[data-theme="dark"] .batch-count,
[data-theme="dark"] .row-meta,
body.theme-dark .batch-count,
body.theme-dark .row-meta {
    color: #cbd5e1 !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .tactical-stats-table,
body.theme-dark .tactical-stats-table {
    background: rgba(15, 23, 42, 0.96) !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .tactical-stats-table thead tr,
body.theme-dark .tactical-stats-table thead tr {
    background: rgba(30, 41, 59, 0.96) !important;
    border-bottom-color: rgba(148, 163, 184, 0.2) !important;
}

[data-theme="dark"] .tactical-stats-table th,
[data-theme="dark"] .tactical-stats-table td,
body.theme-dark .tactical-stats-table th,
body.theme-dark .tactical-stats-table td {
    border-color: rgba(148, 163, 184, 0.2) !important;
}

[data-theme="dark"] .tactical-stats-table th:first-child,
body.theme-dark .tactical-stats-table th:first-child {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .tactical-stats-table th:nth-child(2),
body.theme-dark .tactical-stats-table th:nth-child(2) {
    color: #4ade80 !important;
}

[data-theme="dark"] .tactical-stats-table th:nth-child(3),
body.theme-dark .tactical-stats-table th:nth-child(3) {
    color: #60a5fa !important;
}

[data-theme="dark"] .tactical-stats-table th:nth-child(4),
body.theme-dark .tactical-stats-table th:nth-child(4) {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .tactical-stats-table td,
body.theme-dark .tactical-stats-table td {
    color: #f8fafc !important;
}

[data-theme="dark"] .tactical-stats-table tbody td:first-child,
body.theme-dark .tactical-stats-table tbody td:first-child {
    background: rgba(30, 41, 59, 0.88) !important;
}

[data-theme="dark"] #tactical-footer,
body.theme-dark #tactical-footer {
    background: rgba(15, 23, 42, 0.98) !important;
    border-top: 1px solid rgba(196, 181, 253, 0.2) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.34) !important;
}

[data-theme="dark"] #confirmation-modal .modal-content,
body.theme-dark #confirmation-modal .modal-content {
    background: rgba(54, 61, 74, 0.98) !important;
    border-color: rgba(196, 181, 253, 0.22) !important;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.46) !important;
}

[data-theme="dark"] #confirmation-modal .modal-title,
[data-theme="dark"] #modal-counter-text,
body.theme-dark #confirmation-modal .modal-title,
body.theme-dark #modal-counter-text {
    color: #f8fafc !important;
    text-shadow: none !important;
}

[data-theme="dark"] #confirmation-modal .modal-search-bar input,
body.theme-dark #confirmation-modal .modal-search-bar input {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #f8fafc !important;
    border-color: rgba(196, 181, 253, 0.28) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] #confirmation-modal .modal-search-bar input::placeholder,
body.theme-dark #confirmation-modal .modal-search-bar input::placeholder {
    color: #94a3b8 !important;
}

[data-theme="dark"] #confirmation-modal .confirmation-list,
body.theme-dark #confirmation-modal .confirmation-list {
    background: transparent !important;
}

[data-theme="dark"] #confirmation-modal .conf-item,
body.theme-dark #confirmation-modal .conf-item {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #f8fafc !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] #confirmation-modal .conf-item:hover,
body.theme-dark #confirmation-modal .conf-item:hover {
    background: rgba(51, 65, 85, 0.98) !important;
}

[data-theme="dark"] #confirmation-modal .conf-item-ru,
body.theme-dark #confirmation-modal .conf-item-ru {
    color: #f8fafc !important;
}

[data-theme="dark"] #confirmation-modal .conf-item-translations,
body.theme-dark #confirmation-modal .conf-item-translations {
    color: #cbd5e1 !important;
}

[data-theme="dark"] #confirmation-modal .btn-back,
body.theme-dark #confirmation-modal .btn-back {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(196, 181, 253, 0.24) !important;
}

[data-theme="dark"] #confirmation-modal .btn-back:hover,
body.theme-dark #confirmation-modal .btn-back:hover {
    background: rgba(51, 65, 85, 0.98) !important;
}

[data-theme="dark"] .swal-small-popup,
body.theme-dark .swal-small-popup {
    background: #111827 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(196, 181, 253, 0.22) !important;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.46) !important;
}

[data-theme="dark"] .swal-small-popup .swal2-title,
[data-theme="dark"] .swal-small-popup .swal2-html-container,
[data-theme="dark"] .swal-small-popup .swal2-icon-content,
body.theme-dark .swal-small-popup .swal2-title,
body.theme-dark .swal-small-popup .swal2-html-container,
body.theme-dark .swal-small-popup .swal2-icon-content {
    color: #f8fafc !important;
}

[data-theme="dark"] .swal-small-popup .swal2-close,
body.theme-dark .swal-small-popup .swal2-close {
    color: #cbd5e1 !important;
}





/* Additional Components CSS */



.limit-toast {

    position: fixed;

    bottom: 30px;

    left: 50%;

    transform: translateX(-50%) translateY(100px);

    background: #333;

    color: white;

    padding: 12px 25px;

    border-radius: 50px;

    transition: transform 0.3s ease, opacity 0.3s ease;

    z-index: 20000;

    opacity: 0;

    pointer-events: none;

}



.limit-toast.show {

    transform: translateX(-50%) translateY(0);

    opacity: 1;

}



/* [ORIGINAL] Word Selection Modal Styles */

#confirmation-modal .modal-content {

    background: rgba(255, 255, 255, 0.95);

    width: 95%;

    max-width: 480px;

    max-height: 85vh;

    border-radius: 20px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);

    border: 2px solid #fff;

    padding: 18px;

    display: flex;

    flex-direction: column;

    gap: 10px;

    backdrop-filter: blur(10px);

}



#confirmation-modal .modal-title {

    color: #8d6e63;

    font-size: 1.5rem;

    font-weight: 800;

    margin-bottom: 0;

    text-shadow: 1px 1px 0px #fff;

    text-align: center;

}



.modal-search-bar input {

    width: 100%;

    padding: 8px 14px;

    border: 2px solid #eee;

    border-radius: 12px;

    font-size: 1.1rem;

    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);

    outline: none;

    box-sizing: border-box;

}



#modal-counter-text {

    color: #8d6e63;

    font-weight: bold;

    font-size: 1.1rem;

    text-align: center;

    display: block;

}



.confirmation-list {

    flex: 1;

    overflow-y: auto;

    background: transparent;

    padding: 5px;

    margin: 0 -5px;

}



.confirmation-list .conf-item {

    display: flex;

    align-items: center;

    padding: 8px 12px;

    background: #f1f8e9;

    border-radius: 15px;

    margin-bottom: 6px;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);

    border: 1px solid #fff;

    position: relative;

}



.conf-item-checkbox {

    width: 18px;

    height: 18px;

    margin-right: 15px;

    cursor: pointer;

}



.conf-item-content {

    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 2px;

}



.conf-item-ru {

    font-size: 1.05rem;

    font-weight: 800;

    color: #333;

}



.conf-item-translations {

    font-size: 0.85rem;

    color: #666;

    display: flex;

    align-items: center;

    gap: 8px;

}



.conf-remove-btn {

    width: 32px;

    height: 32px;

    background: #ffcdd2;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    border: 2px solid #fff;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);

    transition: all 0.2s;

    color: #d32f2f;

    font-weight: bold;

    font-size: 1.2rem;

    flex-shrink: 0;

}



.conf-remove-btn:hover {

    background: #d32f2f;

    color: #fff;

    transform: scale(1.1);

}



.modal-buttons-row {

    display: flex;

    gap: 15px;

    margin-top: 10px;

}



.modal-buttons-row button {
    flex: 1;
    padding: 10px;
    font-weight: 800;
    font-size: 1rem;
    white-space: nowrap;
    border-radius: 15px;

    border: none;

    cursor: pointer;

    transition: all 0.2s;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);

}



.btn-back {

    background: #efebe9;

    color: #5d4037;

}



.btn-back:hover {

    background: #d7ccc8;

}



.btn-start-training {

    background: #4caf50;

    color: #fff;

}



.btn-start-training:hover {

    background: #388e3c;

    transform: translateY(-2px);

    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);

}



/* Batch Move Buttons */

.btn-to-top {

    width: 34px;

    height: 34px;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #ddd;

    background: #fff;

    cursor: pointer;

    transition: all 0.2s;

    padding: 0;

    flex-shrink: 0;

}



.btn-move-down,

.btn-move-up {

    background: #4285f4;

    color: #fff;

    border: none;

    box-shadow: 0 2px 5px rgba(66, 133, 244, 0.3);

}



.btn-move-down:hover,

.btn-move-up:hover {

    background: #3367d6;

    transform: scale(1.1);

}



/* --- Скрытая клавиатура (Технический элемент) --- */

#hidden-keyboard-input {

    opacity: 0 !important;

    position: fixed !important;

    top: -1000px !important;

    left: -1000px !important;

    pointer-events: none !important;

    font-size: 16px !important;

    height: 0 !important;

    width: 0 !important;

}



/* [HYDRATION FIX] Force keyboard hidden state */

#virtual-keyboard.hidden {

    display: none !important;

}



/* --- LOADING STATE FOR BUTTONS --- */

@keyframes btnLoadingFill {

    0% {

        clip-path: inset(0 100% 0 0);

    }



    100% {

        clip-path: inset(0 0 0 0);

    }

}



.card-btn.loading-state,

.btn.loading-state {

    position: relative;

    background: rgba(0, 0, 0, 0.05);

    color: var(--text-color);

    pointer-events: none;

    overflow: hidden;

    border: 1px solid var(--border-color);

    transition: none;

}



[data-theme="dark"] .card-btn.loading-state,

[data-theme="dark"] .btn.loading-state {

    background: rgba(255, 255, 255, 0.05);

}



.card-btn.loading-state::after,

.btn.loading-state::after {

    content: attr(data-loading-text);

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    background: #2e7d32;

    /* dark green loading bar */

    color: white;

    display: flex;

    justify-content: center;

    align-items: center;

    clip-path: inset(0 100% 0 0);

    animation: btnLoadingFill 1.5s infinite ease-in-out;

    z-index: 1;

}



.swal-small-popup {

    width: 320px !important;

    font-size: 0.9rem !important;

    padding: 1em !important;

    border-radius: 12px !important;

}

