/* === Тема Космос === */

/* 1. ПЕРЕМЕННЫЕ */
body.theme-cosmos {
    --theme-bg-primary: #0d1021;
    --theme-bg-secondary: #181c3a;
    --theme-bg-content: #23265a;
    --theme-text-primary: #e0e6ff;
    --theme-text-secondary: #a0a8ff;
    --theme-text-placeholder: #6a72cc;
    --theme-border-color: #2a2a5a;

    --theme-accent-primary: #7f5fff;
    --theme-accent-secondary: #00eaff;
    --theme-accent-alt1: #ff2d95;
    --theme-accent-alt2: #00ffb2;
    --theme-accent-alt3: #ffd600;

    --theme-button-text-on-accent: #fff;
    --theme-button-text-on-normal: var(--theme-text-primary);

    --theme-success-color: #00ffb2;
    --theme-error-color: #ff2d95;
    --theme-warning-color: #ffd600;
    --theme-focus-ring-color: rgba(127, 95, 255, 0.5);

    --font-main: 'Rajdhani', 'Segoe UI', Roboto, sans-serif;

    --theme-srs-bar-short: #ffd600;
    --theme-srs-bar-medium: var(--theme-accent-secondary);
    --theme-srs-bar-long: var(--theme-accent-primary);
    --theme-srs-bar-learned: var(--theme-success-color);
    --theme-srs-segment-inactive-bg: #2a2a5a;

    --theme-grammar-feedback-correct-bg: rgba(0, 255, 178, 0.12);
    --theme-grammar-feedback-correct-border: var(--theme-success-color);
    --theme-grammar-feedback-correct-text: var(--theme-success-color);
    --theme-grammar-feedback-incorrect-bg: rgba(255, 45, 149, 0.12);
    --theme-grammar-feedback-incorrect-border: var(--theme-error-color);
    --theme-grammar-feedback-incorrect-text: var(--theme-error-color);
    --theme-grammar-ai-explanation-bg: #181c3a;
    --theme-grammar-ai-explanation-border: #2a2a5a;
    --theme-grammar-ai-explanation-text: var(--theme-text-primary);
    --theme-grammar-chat-bg: #181c3a;
    --theme-grammar-chat-user-msg-bg: var(--theme-accent-primary);
    --theme-grammar-chat-user-msg-text: var(--theme-button-text-on-accent);
    --theme-grammar-chat-ai-msg-bg: #23265a;
    --theme-grammar-chat-ai-msg-text: var(--theme-text-primary);

    --theme-gold: #ffd600;

    background: radial-gradient(ellipse at 60% 20%, rgba(127,95,255,0.15) 0%, transparent 70%),
                radial-gradient(ellipse at 20% 80%, rgba(0,234,255,0.10) 0%, transparent 70%),
                linear-gradient(120deg, #0d1021 0%, #181c3a 100%);
    color: var(--theme-text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    scrollbar-color: var(--theme-accent-primary) var(--theme-bg-secondary);
    scrollbar-width: thin;
}

/* 2. АНИМИРОВАННЫЕ ЗВЁЗДЫ */
body.theme-cosmos::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 80px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 120px 90px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 200px 60px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 300px 200px, var(--theme-accent-secondary), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 250px 150px, var(--theme-accent-alt1), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 400px 300px, var(--theme-accent-primary), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 500px 500px;
    animation: starsMove 120s linear infinite;
    opacity: 0.6;
}
@keyframes starsMove {
    from { background-position: 0 0; }
    to { background-position: 1000px 1000px; }
}

/* 3. ОБЩИЕ ЭЛЕМЕНТЫ */
body.theme-cosmos { background-color: var(--theme-bg-primary); color: var(--theme-text-primary); }
body.theme-cosmos h1, body.theme-cosmos h2, body.theme-cosmos h3 {
    color: var(--theme-text-primary);
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(127, 95, 255, 0.6);
}
body.theme-cosmos .secondary-text { color: var(--theme-text-secondary); }

/* Шапка */
body.theme-cosmos #header-title-logo { display: flex; align-items: center; justify-content: center; z-index: 2; }
body.theme-cosmos #header-title-logo h1 {
    color: var(--theme-text-primary);
    text-shadow: 0 0 18px var(--theme-accent-primary), 0 0 8px rgba(0,0,0,0.8);
    font-size: 2.2rem;
    letter-spacing: 2px;
}
body.theme-cosmos #header-title-logo .header-logo-en-accent {
    color: var(--theme-accent-primary);
    text-shadow: 0 0 20px var(--theme-accent-secondary);
}
body.theme-cosmos #header-title-logo .app-logo-icon {
    fill: var(--theme-accent-primary);
    color: var(--theme-accent-primary);
    filter: drop-shadow(0 0 8px var(--theme-accent-secondary));
}

/* Навигация */
body.theme-cosmos #bottom-nav {
    background-color: rgba(13, 16, 33, 0.95);
    border-top: 1px solid var(--theme-border-color);
    backdrop-filter: blur(10px);
}
body.theme-cosmos .nav-item { color: var(--theme-text-secondary); }
body.theme-cosmos .nav-item:hover, body.theme-cosmos .nav-item.active {
    color: var(--theme-accent-primary);
    text-shadow: 0 0 8px var(--theme-accent-primary);
}

/* Карточки и секции */
body.theme-cosmos .content-section {
    background: rgba(24, 28, 58, 0.85);
    border: 1px solid rgba(127, 95, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 10px rgba(127, 95, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: transform 0.3s, box-shadow 0.3s;
}
body.theme-cosmos .content-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(127, 95, 255, 0.15);
}
body.theme-cosmos .content-card-bg {
    background: rgba(35, 38, 90, 0.8);
    border: 1px solid rgba(127, 95, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(6px);
}
body.theme-cosmos .modal-bg { background-color: var(--theme-bg-secondary); border: 1px solid var(--theme-border-color); }

/* Оступы контента */
body.theme-cosmos #app-content { padding-top: 0 !important; margin-top: 0 !important; }
body.theme-cosmos #header-title-logo { margin-top: 0 !important; }
body.theme-cosmos #app-container { margin-top: 0 !important; padding-top: 0 !important; }

/* 4. ПЛАВАЮЩИЕ КНОПКИ */
body.theme-cosmos #floating-action-buttons #theme-toggle-button {
    background-color: var(--theme-accent-primary);
    color: var(--theme-button-text-on-accent);
    box-shadow: 0 0 12px rgba(127, 95, 255, 0.5);
}
body.theme-cosmos #floating-action-buttons #theme-toggle-button:hover {
    background-color: #6a4ee0;
    box-shadow: 0 0 20px rgba(127, 95, 255, 0.7);
}
body.theme-cosmos #floating-action-buttons #floating-settings-button {
    background-color: var(--theme-bg-content);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border-color);
}
body.theme-cosmos #floating-action-buttons #floating-settings-button:hover {
    border-color: var(--theme-accent-primary);
    box-shadow: 0 0 12px rgba(127, 95, 255, 0.3);
}
body.theme-cosmos .floating-action-button:hover, body.theme-cosmos .floating-action-button:focus-visible {
    border-color: var(--theme-accent-primary);
}

/* 5. ФОРМЫ И ИНПУТЫ */
body.theme-cosmos .input-field, body.theme-cosmos select.input-field {
    background-color: rgba(35, 38, 90, 0.8);
    border: 1px solid var(--theme-border-color);
    color: var(--theme-text-primary);
}
body.theme-cosmos .input-field::placeholder { color: var(--theme-text-placeholder); }
body.theme-cosmos .input-field:focus, body.theme-cosmos select.input-field:focus {
    border-color: var(--theme-accent-primary);
    box-shadow: 0 0 0 2px var(--theme-focus-ring-color), 0 0 8px rgba(127, 95, 255, 0.3);
}
body.theme-cosmos .input-field[readonly] { background-color: rgba(13, 16, 33, 0.6); }
body.theme-cosmos select.input-field {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23a0a8ff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
}
body.theme-cosmos .clear-input-btn { color: var(--theme-text-secondary); }
body.theme-cosmos .clear-input-btn:hover { color: var(--theme-accent-secondary); }
body.theme-cosmos .custom-checkbox { background-color: var(--theme-bg-primary); border: 1px solid var(--theme-border-color); }
body.theme-cosmos .custom-checkbox:checked { background-color: var(--theme-accent-primary); border-color: var(--theme-accent-primary); }
body.theme-cosmos .custom-checkbox:checked::after { color: var(--theme-button-text-on-accent); }
body.theme-cosmos .custom-checkbox:focus { box-shadow: 0 0 0 2px var(--theme-focus-ring-color); }

/* 6. КНОПКИ */
body.theme-cosmos .button {
    border-radius: 10px;
    border: none;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
body.theme-cosmos .button:focus, body.theme-cosmos .button:focus-visible {
    box-shadow: 0 0 0 2px var(--theme-bg-primary), 0 0 0 4px var(--theme-focus-ring-color);
}
body.theme-cosmos .button:disabled, body.theme-cosmos .button.disabled {
    background-color: var(--theme-bg-content);
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border-color);
    box-shadow: none;
}
body.theme-cosmos .button-primary {
    background: linear-gradient(90deg, var(--theme-accent-primary) 0%, var(--theme-accent-secondary) 100%);
    color: var(--theme-button-text-on-accent);
    box-shadow: 0 0 16px rgba(127, 95, 255, 0.4);
}
body.theme-cosmos .button-primary:hover:not(:disabled) {
    box-shadow: 0 0 24px rgba(127, 95, 255, 0.7), 0 0 8px rgba(0, 234, 255, 0.3);
    filter: brightness(1.1);
}
body.theme-cosmos .button-success {
    background: linear-gradient(90deg, var(--theme-success-color) 0%, var(--theme-accent-secondary) 100%);
    color: #0d1021;
    box-shadow: 0 0 16px rgba(0, 255, 178, 0.35);
}
body.theme-cosmos .button-success:hover:not(:disabled) {
    box-shadow: 0 0 24px rgba(0, 255, 178, 0.6);
    filter: brightness(1.1);
}
body.theme-cosmos .button-secondary {
    background: rgba(35, 38, 90, 0.8);
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border-color);
    box-shadow: none;
}
body.theme-cosmos .button-secondary:hover:not(:disabled) {
    border-color: var(--theme-accent-primary);
    color: var(--theme-text-primary);
    box-shadow: 0 0 10px rgba(127, 95, 255, 0.2);
}
body.theme-cosmos .button-secondary:focus, body.theme-cosmos .button-secondary:focus-visible {
    border-color: var(--theme-accent-primary);
    box-shadow: none;
}
body.theme-cosmos .button-danger {
    background: linear-gradient(90deg, var(--theme-error-color) 0%, #c01870 100%);
    color: var(--theme-button-text-on-accent);
    box-shadow: 0 0 16px rgba(255, 45, 149, 0.35);
}
body.theme-cosmos .button-danger:hover:not(:disabled) {
    box-shadow: 0 0 24px rgba(255, 45, 149, 0.6);
    filter: brightness(1.1);
}
body.theme-cosmos .button-warning {
    background: linear-gradient(90deg, var(--theme-warning-color) 0%, var(--theme-accent-alt3) 100%);
    color: #0d1021;
    box-shadow: 0 0 16px rgba(255, 214, 0, 0.3);
}
body.theme-cosmos .button-accent-alt1 {
    background: linear-gradient(90deg, var(--theme-accent-alt1) 0%, var(--theme-accent-primary) 100%);
    color: var(--theme-button-text-on-accent);
    box-shadow: 0 0 16px rgba(255, 45, 149, 0.35);
}
body.theme-cosmos .button-accent-alt1:hover:not(:disabled) {
    box-shadow: 0 0 24px rgba(255, 45, 149, 0.6);
    filter: brightness(1.1);
}
body.theme-cosmos .button-accent-alt2 {
    background: linear-gradient(90deg, var(--theme-accent-secondary) 0%, var(--theme-success-color) 100%);
    color: #0d1021;
    box-shadow: 0 0 16px rgba(0, 234, 255, 0.35);
}
body.theme-cosmos .button-accent-alt2:hover:not(:disabled) {
    box-shadow: 0 0 24px rgba(0, 234, 255, 0.6);
    filter: brightness(1.1);
}
body.theme-cosmos .button-icon-study {
    background-color: var(--theme-accent-primary);
    color: var(--theme-button-text-on-accent);
    box-shadow: 0 0 10px rgba(127, 95, 255, 0.4);
}
body.theme-cosmos .button-icon-study:hover:not(:disabled) {
    background-color: #6a4ee0;
    box-shadow: 0 0 18px rgba(127, 95, 255, 0.6);
}
body.theme-cosmos .toggle-button { background-color: var(--theme-bg-content); border: 1px solid var(--theme-border-color); }
body.theme-cosmos .toggle-button-slider { background-color: var(--theme-text-secondary); }
body.theme-cosmos .toggle-button.active {
    background-color: var(--theme-accent-primary);
    box-shadow: 0 0 8px rgba(127, 95, 255, 0.5);
}
body.theme-cosmos .toggle-button.active .toggle-button-slider { background-color: var(--theme-button-text-on-accent); }

/* 7. СТРАНИЦА "УЧИТЬ" */
body.theme-cosmos .card-word-srs-info { color: var(--theme-text-secondary); }
body.theme-cosmos .srs-status-pill-new { background-color: var(--theme-srs-bar-short); color: var(--theme-bg-primary); }
body.theme-cosmos .srs-status-pill-studying { background-color: var(--theme-srs-bar-medium); color: var(--theme-bg-primary); }
body.theme-cosmos .srs-status-pill-consolidating { background-color: var(--theme-srs-bar-long); }
body.theme-cosmos .srs-status-pill-confident { background-color: color-mix(in srgb, var(--theme-srs-bar-learned) 70%, var(--theme-srs-bar-long) 30%); color: var(--theme-bg-primary); }
body.theme-cosmos .srs-status-pill-learned { background-color: var(--theme-srs-bar-learned); color: var(--theme-bg-primary); }
body.theme-cosmos .study-card-next-review-pill { color: var(--theme-button-text-on-accent); }
body.theme-cosmos .srs-progress-bar-container { background-color: var(--theme-bg-primary); }
body.theme-cosmos .srs-progress-segment { background-color: var(--theme-srs-segment-inactive-bg); }
body.theme-cosmos .srs-segment-short::before { background-color: var(--theme-srs-bar-short); }
body.theme-cosmos .srs-segment-medium::before { background-color: var(--theme-srs-bar-medium); }
body.theme-cosmos .srs-segment-long::before { background-color: var(--theme-srs-bar-long); }
body.theme-cosmos .srs-segment-learned::before { background-color: var(--theme-srs-bar-learned); }
body.theme-cosmos #mc-example-sentence-display,
body.theme-cosmos #input-example-sentence-display,
body.theme-cosmos #dictation-example-sentence-display { color: var(--theme-text-secondary); }
body.theme-cosmos .study-example-action-button { color: var(--theme-text-secondary); }
body.theme-cosmos .study-example-action-button:hover { color: var(--theme-accent-secondary); }
body.theme-cosmos .study-example-action-button.saved-state { color: var(--theme-success-color); }
body.theme-cosmos .feedback-correct { color: var(--theme-success-color); text-shadow: 0 0 8px rgba(0, 255, 178, 0.5); }
body.theme-cosmos .feedback-incorrect { color: var(--theme-error-color); text-shadow: 0 0 8px rgba(255, 45, 149, 0.5); }
body.theme-cosmos .feedback-highlight { color: var(--theme-warning-color); }
body.theme-cosmos .input-field.border-correct {
    border-color: var(--theme-success-color);
    box-shadow: 0 0 0 2px rgba(0, 255, 178, 0.25), 0 0 10px rgba(0, 255, 178, 0.2);
}
body.theme-cosmos .input-field.border-incorrect {
    border-color: var(--theme-error-color);
    box-shadow: 0 0 0 2px rgba(255, 45, 149, 0.25), 0 0 10px rgba(255, 45, 149, 0.2);
}
body.theme-cosmos .mc-option-button {
    background-color: rgba(35, 38, 90, 0.8);
    border: 1px solid var(--theme-border-color);
    color: var(--theme-text-primary);
}
body.theme-cosmos .mc-option-button:hover:not(:disabled) {
    background-color: rgba(127, 95, 255, 0.15);
    border-color: var(--theme-accent-primary);
    box-shadow: 0 0 8px rgba(127, 95, 255, 0.3);
}
body.theme-cosmos .mc-option-button.selected {
    background-color: rgba(127, 95, 255, 0.2);
    border-color: var(--theme-accent-primary);
    box-shadow: 0 0 12px rgba(127, 95, 255, 0.4);
}
body.theme-cosmos .mc-option-button.correct {
    background-color: rgba(0, 255, 178, 0.15);
    border-color: var(--theme-success-color);
    color: var(--theme-success-color);
    box-shadow: 0 0 12px rgba(0, 255, 178, 0.3);
}
body.theme-cosmos .mc-option-button.incorrect {
    background-color: rgba(255, 45, 149, 0.15);
    border-color: var(--theme-error-color);
    color: var(--theme-error-color);
    box-shadow: 0 0 12px rgba(255, 45, 149, 0.3);
}
body.theme-cosmos #input-lives-container span, body.theme-cosmos #dictation-lives-container span { color: var(--theme-error-color); }
body.theme-cosmos #study-back-button { color: var(--theme-text-secondary); }
body.theme-cosmos #study-back-button:hover, body.theme-cosmos #study-back-button:focus-visible {
    color: var(--theme-accent-primary);
    border-color: var(--theme-accent-primary);
}
body.theme-cosmos .button-study-next-active {
    border-color: var(--theme-accent-primary);
    color: var(--theme-accent-primary);
    background-color: rgba(127, 95, 255, 0.1);
}

/* 8. AI EXPLANATION PANEL */
body.theme-cosmos .ai-explanation-display {
    background-color: rgba(24, 28, 58, 0.9);
    border: 1px solid rgba(127, 95, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
body.theme-cosmos .ai-main-word-transliteration { color: var(--theme-text-secondary); }
body.theme-cosmos .ai-main-explanation { color: var(--theme-text-primary); }
body.theme-cosmos .ai-main-explanation h3 { color: var(--theme-accent-primary); border-bottom-color: var(--theme-border-color); }
body.theme-cosmos .ai-main-explanation code { background-color: var(--theme-bg-primary); color: var(--theme-accent-secondary); }
body.theme-cosmos .ai-examples-section h4 { color: var(--theme-text-secondary); border-bottom-color: var(--theme-border-color); }
body.theme-cosmos .ai-example-item { border-bottom-color: var(--theme-border-color); }
body.theme-cosmos .ai-example-original { color: var(--theme-text-primary); }
body.theme-cosmos .ai-example-transliteration, body.theme-cosmos .ai-example-translation { color: var(--theme-text-secondary); }
body.theme-cosmos .quick-add-example-btn { color: var(--theme-text-secondary); }
body.theme-cosmos .quick-add-example-btn:hover:not(:disabled) { color: var(--theme-accent-secondary); }
body.theme-cosmos .quick-add-example-btn.saved, body.theme-cosmos .quick-add-example-btn:disabled { color: var(--theme-success-color); }

/* 9. ГЛАВНАЯ СТРАНИЦА */
body.theme-cosmos .progress-svg-container { width: 150px; height: 150px; position: relative; }
body.theme-cosmos .progress-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
body.theme-cosmos .progress-svg__background-circle { fill: none; stroke: var(--theme-bg-content); stroke-width: 10; }
body.theme-cosmos .progress-svg__bar-circle {
    fill: none;
    stroke: var(--theme-accent-primary);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.5s ease-out;
    filter: drop-shadow(0 0 4px var(--theme-accent-primary));
}
body.theme-cosmos .progress-svg__text {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem; font-weight: bold;
    color: var(--theme-text-primary);
}
body.theme-cosmos #home-words-learned-stats { color: var(--theme-text-secondary); }
body.theme-cosmos #page-home .grid span { color: var(--theme-text-primary); }
body.theme-cosmos #daily-reward-section { background-color: rgba(35, 38, 90, 0.6); border: 1px solid rgba(127, 95, 255, 0.2); }
body.theme-cosmos #daily-reward-text { color: var(--theme-text-primary); }
body.theme-cosmos #daily-reward-text strong { color: var(--theme-accent-primary); text-shadow: 0 0 8px rgba(127, 95, 255, 0.5); }
body.theme-cosmos #daily-reward-text em { color: var(--theme-accent-secondary); }

/* 10. СПИСКИ СЛОВ И КУРСОВ */
body.theme-cosmos #all-words-list-container .list-item-bg,
body.theme-cosmos #course-words-list-container .list-item-bg { background-color: rgba(35, 38, 90, 0.7); border: 1px solid var(--theme-border-color); }
body.theme-cosmos #all-words-list-container .list-item-text-secondary,
body.theme-cosmos #course-words-list-container .list-item-text-secondary { color: var(--theme-text-secondary); }
body.theme-cosmos #all-words-list-container .list-item-accent,
body.theme-cosmos #course-words-list-container .list-item-accent { color: var(--theme-accent-secondary); }
body.theme-cosmos .visibility-toggle-button { color: var(--theme-text-secondary); }
body.theme-cosmos .visibility-toggle-button:hover, body.theme-cosmos .visibility-toggle-button:focus-visible {
    color: var(--theme-accent-primary);
    border-color: var(--theme-accent-primary);
}
body.theme-cosmos .visibility-toggle-button.active .material-symbols-rounded { color: var(--theme-error-color); }
body.theme-cosmos .example-indicator-icon { color: var(--theme-accent-primary); }
body.theme-cosmos #words-list-controls-panel,
body.theme-cosmos #course-words-list-controls-panel {
    background-color: rgba(24, 28, 58, 0.9);
    border: 1px solid var(--theme-border-color);
}
body.theme-cosmos #words-list-controls-panel label:not(.sr-only),
body.theme-cosmos #course-words-list-controls-panel label:not(.sr-only) { color: var(--theme-text-secondary); }
body.theme-cosmos #words-list-controls-panel label[for="filter-no-examples"],
body.theme-cosmos #course-words-list-controls-panel label[for="course-words-filter-no-examples"] { color: var(--theme-text-primary); }
body.theme-cosmos #scroll-to-top-words-button,
body.theme-cosmos #scroll-to-top-course-words-button {
    background-color: var(--theme-accent-primary);
    color: var(--theme-button-text-on-accent);
    box-shadow: 0 0 12px rgba(127, 95, 255, 0.5);
}
body.theme-cosmos #scroll-to-top-words-button:hover,
body.theme-cosmos #scroll-to-top-course-words-button:hover {
    box-shadow: 0 0 20px rgba(127, 95, 255, 0.7);
    filter: brightness(1.1);
}

/* 11. СТАТИСТИКА */
body.theme-cosmos .srs-bar-container { background-color: var(--theme-bg-content); }
body.theme-cosmos .srs-bar-short-term { background-color: var(--theme-srs-bar-short); }
body.theme-cosmos .srs-bar-medium-term { background-color: var(--theme-srs-bar-medium); }
body.theme-cosmos .srs-bar-long-term { background-color: var(--theme-srs-bar-long); }
body.theme-cosmos .srs-bar-learned { background-color: var(--theme-srs-bar-learned); }
body.theme-cosmos #stats-srs-distribution-list .srs-count { color: var(--theme-text-primary); }
body.theme-cosmos #stats-srs-distribution-list .srs-level-description { color: var(--theme-text-secondary); }
body.theme-cosmos .srs-level-group-title { color: var(--theme-accent-primary); border-bottom: 1px solid var(--theme-border-color); }

/* 12. ЧАТ И ГРАММАТИКА */
body.theme-cosmos .chat-messages-container { scrollbar-color: var(--theme-accent-primary) var(--theme-bg-primary); }
body.theme-cosmos .chat-avatar { background-color: var(--theme-bg-content); color: var(--theme-text-secondary); }
body.theme-cosmos .chat-message-user .chat-message-content {
    background-color: var(--theme-accent-primary);
    color: var(--theme-button-text-on-accent);
    box-shadow: 0 0 8px rgba(127, 95, 255, 0.4);
}
body.theme-cosmos .chat-message-gemini .chat-message-content {
    background-color: rgba(35, 38, 90, 0.8);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border-color);
}
body.theme-cosmos #grammar-chat-container { background-color: var(--theme-grammar-chat-bg); }
body.theme-cosmos #grammar-chat-messages .chat-message-user .chat-message-content {
    background-color: var(--theme-grammar-chat-user-msg-bg);
    color: var(--theme-grammar-chat-user-msg-text);
}
body.theme-cosmos #grammar-chat-messages .chat-message-gemini .chat-message-content {
    background-color: var(--theme-grammar-chat-ai-msg-bg);
    color: var(--theme-grammar-chat-ai-msg-text);
}
body.theme-cosmos .course-category-header { color: var(--theme-accent-primary); border-bottom: 1px solid var(--theme-border-color); }
body.theme-cosmos .course-category-description { color: var(--theme-text-secondary); }
body.theme-cosmos .course-card,
body.theme-cosmos .grammar-topic-card,
body.theme-cosmos .course-category-item,
body.theme-cosmos .grammar-exercise-type-card {
    background-color: rgba(24, 28, 58, 0.85);
    border: 1px solid var(--theme-border-color);
}
body.theme-cosmos .course-card:hover,
body.theme-cosmos .grammar-topic-card:hover,
body.theme-cosmos .course-category-item:hover,
body.theme-cosmos .grammar-exercise-type-card:hover {
    border-color: var(--theme-accent-primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 0 12px rgba(127, 95, 255, 0.2);
}
body.theme-cosmos .course-card h3, body.theme-cosmos .course-card h4,
body.theme-cosmos .grammar-topic-card h3, body.theme-cosmos .grammar-topic-card h4,
body.theme-cosmos .course-category-item h3,
body.theme-cosmos .grammar-exercise-type-card h3 { color: var(--theme-accent-secondary); }
body.theme-cosmos .course-category-item p, body.theme-cosmos .grammar-exercise-type-card p { color: var(--theme-text-secondary); }
body.theme-cosmos .course-category-item .category-arrow,
body.theme-cosmos .grammar-exercise-type-card .category-arrow { color: var(--theme-text-secondary); }
body.theme-cosmos .course-category-item:hover .category-arrow,
body.theme-cosmos .grammar-exercise-type-card:hover .category-arrow { color: var(--theme-accent-primary); }
body.theme-cosmos .course-category-item-pinned {
    background-color: rgba(127, 95, 255, 0.08);
    border: 1px solid rgba(0, 234, 255, 0.3);
}
body.theme-cosmos .course-category-item-pinned:hover { border-color: var(--theme-accent-primary); }
body.theme-cosmos #course-detail-progress-bar { background-color: var(--theme-srs-bar-learned); }
body.theme-cosmos .feedback-correct-grammar-bg {
    background-color: var(--theme-grammar-feedback-correct-bg);
    border: 1px solid var(--theme-grammar-feedback-correct-border);
    color: var(--theme-grammar-feedback-correct-text);
}
body.theme-cosmos .feedback-incorrect-grammar-bg {
    background-color: var(--theme-grammar-feedback-incorrect-bg);
    border: 1px solid var(--theme-grammar-feedback-incorrect-border);
    color: var(--theme-grammar-feedback-incorrect-text);
}
body.theme-cosmos #grammar-ai-explanation-container {
    border: 1px solid var(--theme-grammar-ai-explanation-border);
    background-color: var(--theme-grammar-ai-explanation-bg);
    color: var(--theme-grammar-ai-explanation-text);
}
body.theme-cosmos #grammar-ai-explanation-container strong { color: var(--theme-accent-primary); }
body.theme-cosmos #grammar-ai-explanation-container em { color: var(--theme-accent-secondary); }
body.theme-cosmos #sentence-scramble-word-bank { background-color: var(--theme-bg-content); border: 1px solid var(--theme-border-color); }
body.theme-cosmos .scramble-token {
    background-color: rgba(24, 28, 58, 0.9);
    border: 1px solid var(--theme-border-color);
    color: var(--theme-text-primary);
}
body.theme-cosmos .scramble-token:hover {
    border-color: var(--theme-accent-primary);
    background-color: rgba(127, 95, 255, 0.15);
    box-shadow: 0 0 8px rgba(127, 95, 255, 0.3);
}
body.theme-cosmos .scramble-token.used { background-color: var(--theme-bg-primary); border-color: rgba(42, 42, 90, 0.5); opacity: 0.5; }
body.theme-cosmos .scramble-answer-area { background-color: var(--theme-bg-primary); border-color: var(--theme-border-color); }
body.theme-cosmos .scramble-answer-area.drag-over {
    border-color: var(--theme-accent-primary);
    background-color: rgba(127, 95, 255, 0.08);
}
body.theme-cosmos .answer-token {
    background-color: rgba(0, 234, 255, 0.2);
    border: 1px solid var(--theme-accent-secondary);
    color: var(--theme-accent-secondary);
}
body.theme-cosmos .answer-token:hover { background-color: rgba(0, 234, 255, 0.3); }

/* 13. ПРОЧИЕ КОМПОНЕНТЫ */
body.theme-cosmos .info-icon { color: var(--theme-text-secondary); }
body.theme-cosmos .info-icon:hover, body.theme-cosmos .info-icon:focus-visible { color: var(--theme-accent-primary); }
body.theme-cosmos .info-icon:focus-visible { box-shadow: 0 0 0 2px var(--theme-focus-ring-color); }
body.theme-cosmos .custom-tooltip {
    background-color: rgba(24, 28, 58, 0.95);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-accent-primary);
    box-shadow: 0 2px 12px rgba(0,0,0,0.4), 0 0 8px rgba(127, 95, 255, 0.2);
}
body.theme-cosmos .feedback-icon-correct-animated { color: var(--theme-success-color); }
body.theme-cosmos .feedback-icon-incorrect-animated { color: var(--theme-error-color); }

/* 14. СКРОЛЛБАР */
body.theme-cosmos ::-webkit-scrollbar { width: 8px; height: 8px; }
body.theme-cosmos ::-webkit-scrollbar-track { background: var(--theme-bg-secondary); border-radius: 4px; }
body.theme-cosmos ::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--theme-accent-primary), var(--theme-accent-secondary));
    border-radius: 4px;
}
body.theme-cosmos ::-webkit-scrollbar-thumb:hover { opacity: 0.8; }
