        :root {
            --primary: #6c5ce7;
            --primary-light: #a29bfe;
            --accent: #00cec9;
            --bg: #f8faff;
            --text: #2d3436;
            --white: #ffffff;
            --shadow: 0 10px 30px rgba(108, 92, 231, 0.1);
            --border: #e2e8f0;
            --divider: #94a3b8;
            --day-bg: #f8faff;
            --hover-bg: #f4f6ff;
            /* Светлая подсветка для дня */
        }

        /* 🌙 Цвета для ТЕМНОЙ ТЕМЫ */
        html.dark-mode {
            --bg: #0f172a;
            /* Глубокий темно-синий */
            --text: #f1f5f9;
            --white: #1e293b;
            /* Цвет карточек */
            --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            --border: #334155;
            --divider: #4a5568;
            --day-bg: #1e293b;
            --hover-bg: #2d3a4f;
            /* Спокойная тёмная подсветка */
        }

        *,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            background: var(--bg);
            color: var(--text);
            transition: background 0.3s, color 0.3s;
            font-family: 'Montserrat', sans-serif;
            /* Плавный переход */
        }

        /* --- ШАПКА / НАВИГАЦИЯ --- */
        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 40px;
            background: var(--white);
            box-shadow: var(--shadow);
        }

        .navbar-brand {
            font-family: 'Nunito', sans-serif;
            font-size: 1.5rem;
            color: var(--primary);
            font-weight: 800;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .navbar-nav {
            display: flex;
            gap: 20px;
            align-items: center;
        }

        .nav-link {
            text-decoration: none;
            color: var(--text);
            font-weight: 600;
            transition: 0.2s;
        }

        .nav-link:hover {
            color: var(--primary);
        }

        .btn-login {
            background: var(--primary);
            color: white;
            padding: 10px 20px;
            border-radius: 20px;
            text-decoration: none;
            font-weight: 600;
            transition: 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-login:hover {
            background: var(--accent);
        }

        .navbar .theme-toggle {
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--text);
            cursor: pointer;
            transition: 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 45px;
            height: 45px;
            border-radius: 50%;
            box-shadow: none;
        }

        .navbar .theme-toggle:hover {
            color: var(--primary);
            background: var(--bg);
            transform: none;
        }

        /* Поправляем специфичные цвета ячеек, чтобы они брали переменные */
        .table-card {
            background: var(--white);
            box-shadow: var(--shadow);
        }

        td {
            border-color: var(--border) !important;
            color: var(--text);
        }

        .day-col {
            background: var(--day-bg) !important;
            border-right: 3px solid var(--primary) !important;
            color: var(--primary) !important;
            font-weight: 800;
        }

        /* --- КОЛОНКА "ВРЕМЯ" --- */
        .time-col {
            background: var(--white) !important;
            border-right: 2px solid var(--border) !important;
            color: var(--text) !important;
            font-weight: 700;
            text-align: center;
        }

        /* Кнопка переключения */
        .theme-toggle {
            cursor: pointer;
            padding: 10px;
            border-radius: 50%;
            background: var(--white);
            box-shadow: var(--shadow);
            border: none;
            color: var(--primary);
            font-size: 1.2rem;
            transition: 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 45px;
            height: 45px;
        }

        .theme-toggle:hover {
            transform: scale(1.1) rotate(20deg);
        }

        /* Фиксированная кнопка темы для главной страницы */
        .theme-toggle-fixed {
            position: fixed;
            top: 18px;
            right: 18px;
            z-index: 1000;
        }

        .container {
            max-width: 1200px;
            margin: auto;
            padding: 20px;
        }

        /* --- ГЛАВНАЯ СТРАНИЦА (HOME) --- */
        .home-hero {
            text-align: center;
            padding: 60px 20px;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
            border-radius: 0 0 50px 50px;
            color: white;
            margin-bottom: 40px;
            box-shadow: var(--shadow);
        }

        .home-hero h1 {
            font-family: 'Nunito', sans-serif;
            font-size: 3.5rem;
            margin: 0;
            letter-spacing: -1px;
        }

        .home-hero p {
            font-size: 1.2rem;
            opacity: 0.9;
            margin-top: 10px;
        }

        .search-container {
            margin: -35px auto 20px;
            max-width: 600px;
            position: relative;
            padding: 0 20px;
        }

        .search-input {
            width: 100%;
            padding: 20px 30px 20px 60px;
            border-radius: 20px;
            border: none;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
            font-size: 1.1rem;
            font-family: 'Montserrat', sans-serif;
            outline: none;
            transition: 0.3s;
        }

        .search-input:focus {
            transform: translateY(-3px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
        }

        .search-icon {
            position: absolute;
            left: 45px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--primary);
            font-size: 1.2rem;
        }

        /* --- ПЕРЕКЛЮЧАТЕЛЬ УЧЕБНОГО ГОДА --- */
        .year-switcher {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin: 0 auto 35px;
            padding: 0 20px;
        }

        .year-btn {
            padding: 8px 20px;
            border-radius: 20px;
            border: 2px solid var(--border);
            background: var(--white);
            color: var(--text);
            font-family: 'Montserrat', sans-serif;
            font-weight: 700;
            font-size: 0.9rem;
            cursor: pointer;
            transition: 0.2s;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .year-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        .year-btn.active {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
            box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
        }

        .group-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 20px;
            padding: 20px;
            animation: fadeInUp 0.8s ease;
        }

        .group-card {
            background: var(--white);
            padding: 30px 20px;
            border-radius: 25px;
            text-align: center;
            text-decoration: none;
            color: var(--text);
            font-weight: 700;
            box-shadow: var(--shadow);
            transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            border: 2px solid transparent;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 15px;
        }

        .group-card i {
            font-size: 2rem;
            color: var(--primary);
        }

        .group-card:hover {
            transform: scale(1.05);
            background: var(--primary);
            color: white;
            border-color: var(--accent);
        }

        .group-card:hover i {
            color: white;
        }

        /* --- ВЫПАДАЮЩИЙ СПИСОК НЕДЕЛЬ --- */
        .file-select-container {
            margin-bottom: 25px;
            text-align: center;
            position: relative;
        }

        .file-dropdown {
            padding: 12px 20px;
            font-size: 1rem;
            font-family: 'Montserrat', sans-serif;
            border: 2px solid var(--border);
            border-radius: 15px;
            background-color: var(--white);
            color: var(--text);
            outline: none;
            cursor: pointer;
            box-shadow: var(--shadow);
            transition: 0.3s;
            width: 100%;
            max-width: 400px;
            appearance: none;
            -webkit-appearance: none;
            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%236c5ce7%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");
            background-repeat: no-repeat;
            background-position: right 15px top 50%;
            background-size: 12px auto;
        }

        .file-dropdown:hover,
        .file-dropdown:focus {
            border-color: var(--primary);
            box-shadow: 0 10px 25px rgba(108, 92, 231, 0.2);
        }

        /* --- СТРАНИЦА ТАБЛИЦЫ --- */
        .nav-header {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            padding: 20px 0;
            margin-bottom: 20px;
        }

        .nav-header .btn-back {
            justify-self: start;
        }

        .nav-header h2 {
            justify-self: center;
            text-align: center;
        }

        .nav-header .theme-toggle {
            justify-self: end;
        }

        /* --- BACK BAR (полоска под navbar) --- */
        .back-bar {
            background: var(--white);
            padding: 10px 20px;
            border-bottom: 1px solid var(--border);
        }

        .btn-back {
            text-decoration: none;
            color: var(--text);
            font-weight: 600;
            font-size: 0.95rem;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: 0.2s;
            padding: 4px 0;
        }

        .btn-back:hover {
            color: var(--primary);
        }

        .table-card {
            background: var(--white);
            border-radius: 30px;
            overflow: hidden;
            box-shadow: var(--shadow);
        }

        .exams-table tbody tr td {
            border-bottom: 2px solid var(--primary) !important;
        }

        .exams-table tbody tr:last-child td {
            border-bottom: none !important;
        }

        .exams-table th.time-col,
        .exams-table td.time-col {
            border-right: 2px solid var(--primary) !important;
        }

        /* 1. Жирная линия ТОЛЬКО между днями (пропускаем первый день) */
        .day-start {
            border-top: 3px solid var(--primary) !important;
        }

        /* 2. Убираем жирный низ у колонки дня, если это последний блок в таблице */
        /* Чтобы не было "тяжелого" финала у таблицы */
        .day-col {
            border-bottom: 1px solid var(--border) !important;
            /* Делаем стандартным */
        }

        /* 3. Если хочешь, чтобы колонка дня все же имела четкий низ внутри таблицы, 
   но не в самом конце, можно оставить так: */
        /* Выделение блока дня, если нужно */
        .day-start:not(:last-child) .day-col {
            border-bottom: 2px solid var(--border) !important;
        }

        /* 4. Убеждаемся, что у последней строки таблицы обычная тонкая граница */
        tbody tr:last-child td {
            border-bottom: 2px solid var(--border);
        }

        /* --- ОБНОВЛЕННЫЕ СТИЛИ ТАБЛИЦЫ --- */
        table {
            border-collapse: collapse;
            width: 100%;
            table-layout: fixed;
            background: var(--white);
            /* Внешняя рамка всей таблицы */
            border: 2px solid var(--border);
        }

        /* Календарный график: много колонок, нельзя fixed layout */
        .schedule-table {
            table-layout: auto;
            width: auto;
        }

        /* Стиль для всех заголовков (шапки) */
        th {
            background: var(--primary);
            color: white;
            padding: 18px 10px;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            /* Четкая темная граница под шапкой */
            border-bottom: 4px solid #5649c0;
            /* Тонкие светлые разделители между колонками в шапке */
            border-right: 1px solid rgba(255, 255, 255, 0.2);
        }

        /* Убираем border-right у последнего заголовка */
        th:last-child {
            border-right: none;
        }

        /* Общие стили ячеек */
        td {
            padding: 15px;
            border-bottom: 1px solid var(--border);
            border-right: 1px solid var(--border);
            vertical-align: middle;
        }

        /* --- КОЛОНКА "ДЕНЬ" (САМЫЙ ЖЕСТКИЙ РАЗДЕЛИТЕЛЬ) --- */
        .day-col {
            background: var(--day-bg) !important;
            /* Жирная цветная линия, отделяющая день от времени */
            border-right: 3px solid var(--primary) !important;
            color: var(--primary) !important;
            font-weight: 800;
            width: 150px;
        }

        /* --- КОЛОНКА "ВРЕМЯ" --- */
        .time-col {
            background: var(--white);
            /* Четкая линия после времени */
            border-right: 2px solid var(--border) !important;
            color: var(--text);
            font-weight: 700;
            text-align: center;
            width: 90px;
        }

        /* --- УЛЬТРА-КОМПАКТНАЯ МОБИЛЬНАЯ ВЕРСИЯ --- */
        @media (max-width: 768px) {
            .home-hero h1 {
                font-size: 2.2rem;
            }

            .navbar {
                padding: 15px 20px;
            }

            .navbar-brand span {
                display: inline;
                font-size: 1.2rem;
            }

            .btn-login {
                width: 45px;
                height: 45px;
                padding: 0;
                justify-content: center;
                border-radius: 50%;
            }

            .btn-login span,
            .user-name {
                display: none;
            }

            .btn-login {
                width: 40px;
                height: 40px;
            }

            .container {
                padding: 10px;
            }

            /* Исправляем наезд заголовка на кнопку назад */
            .nav-header {
                display: flex;
                flex-direction: column;
                align-items: center;
                text-align: center;
                gap: 10px;
                padding: 10px 0 20px;
            }

            .nav-header h2 {
                font-size: 1.1rem;
                line-height: 1.2;
            }

            .btn-back {
                font-size: 0.9rem;
            }

            /* Таблица: правильное сжатие */
            .table-card {
                border-radius: 12px;
                border: 1px solid var(--border);
                overflow: hidden;
            }

            table {
                table-layout: fixed;
                width: 100%;
            }

            th,
            td {
                padding: 8px 4px !important;
                /* Минимум отступов */
                font-size: 0.75rem;
                /* Уменьшаем шрифт */
            }

            /* Заголовки делаем еще меньше */
            th {
                padding: 10px 2px !important;
                font-size: 0.7rem;
                overflow: hidden;
            }

            /* Шапка колонки ДЕНЬ — стили на обёртке внутри th (iOS fix) */
            th.day-col {
                padding: 2px 0 !important;
                overflow: hidden;
                text-align: center;
                vertical-align: middle;
            }

            th.day-col span.day-wrapper {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 30px;
                vertical-align: middle;
            }

            /* Шапка колонки ВРЕМЯ — мелкий шрифт, горизонтально */
            th.time-col {
                white-space: nowrap;
                overflow: hidden;
                padding: 10px 1px !important;
                font-size: 0.55rem;
                letter-spacing: 0;
            }

            /* Колонка ДЕНЬ: вертикальный текст */
            .day-col {
                width: 32px !important;
                min-width: 32px;
                max-width: 32px;
                border-right: 2px solid var(--primary) !important;
                overflow: hidden;
                vertical-align: middle;
                padding: 4px 0 !important;
            }

            .day-wrapper {
                writing-mode: vertical-rl;
                transform: rotate(180deg);
                text-align: center;
                white-space: nowrap;
                overflow: hidden;
                width: 30px;
            }

            .day-text {
                font-size: 0.7rem;
                letter-spacing: 0.5px;
            }

            /* Колонка ВРЕМЯ: фиксируем ширину */
            .time-col {
                width: 46px !important;
                min-width: unset;
                font-size: 0.68rem;
                border-right: 1px solid var(--border) !important;
                white-space: nowrap;
                padding-left: 4px !important;
            }

            /* --- ПЕРЕВОРОТ ДАТЫ В ЭКЗАМЕНАХ --- */
            .exams-table .time-col {
                width: 32px !important;
                min-width: 32px !important;
                max-width: 32px !important;
                padding: 4px 0 !important;
                vertical-align: middle;
            }

            .exams-table .time-wrapper {
                writing-mode: vertical-rl;
                transform: rotate(180deg);
                text-align: center;
                white-space: nowrap;
                width: 30px;
                margin: 0 auto;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .exams-table .time-text {
                font-size: 0.75rem;
                letter-spacing: 0.5px;
            }

            /* Текст пар: занимает всю оставшуюся ширину */
            .subject-cell {
                line-height: 1.3;
                word-break: break-word;
                overflow-wrap: break-word;
                overflow: hidden;
            }

            /* Подгруппы внутри ячеек */
            .subgroup-container {
                flex-direction: column !important;
            }

            .subgroup-column {
                border-right: none !important;
                border-bottom: 1px dashed var(--border) !important;
                padding: 8px 12px !important;
            }

            .subgroup-column:last-child {
                border-bottom: none !important;
            }

            .single-class {
                padding: 8px 12px !important;
            }

            .window-slot {
                margin: 6px;
                padding: 8px;
                min-height: 42px;
                font-size: 0.75rem;
            }

            /* Адаптив для кнопки Окна */
            .toggle-btn .btn-text {
                display: none;
            }

            .toggle-btn {
                padding: 10px;
                border-radius: 50%;
                width: 45px;
                height: 45px;
                justify-content: center;
                align-items: center;
            }
        }

        /* Эффект при наведении на строку (зебра) */
        tbody tr:hover {
            background-color: var(--hover-bg) !important;
        }

        body.hide-empty .empty-row {
            display: none !important;
        }

        /* --- КНОПКА ТУГГЛЕРА ОКН --- */
        .toggle-btn {
            cursor: pointer;
            padding: 10px 18px;
            border-radius: 20px;
            background: var(--white);
            box-shadow: var(--shadow);
            border: 2px solid var(--border);
            color: var(--text);
            font-family: 'Montserrat', sans-serif;
            font-size: 0.9rem;
            font-weight: 600;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .toggle-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(108, 92, 231, 0.15);
        }

        .toggle-btn.active {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }

        .toggle-btn.active:hover {
            background: var(--primary-light);
            border-color: var(--primary-light);
            color: white;
        }

        .user-widget {
            display: flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            color: var(--text);
        }

        .user-avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 800;
            font-size: 1rem;
            font-family: 'Nunito', sans-serif;
            flex-shrink: 0;
        }

        .user-name {
            font-weight: 600;
            font-size: 0.9rem;
            max-width: 100px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .btn-logout {
            background: none;
            border: none;
            color: var(--text);
            cursor: pointer;
            transition: 0.3s;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 45px;
            height: 45px;
            border-radius: 50%;
            font-size: 1.2rem;
        }

        .btn-logout:hover {
            color: var(--primary);
            background: var(--bg);
        }

        /* --- СТИЛЬ ПУСТЫХ ЯЧЕЕК (ОКНА) --- */
        .window-slot {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            color: #94a3b8;
            font-size: 0.85rem;
            font-weight: 600;
            background: rgba(148, 163, 184, 0.04);
            border: 2px dashed rgba(148, 163, 184, 0.2);
            border-radius: 12px;
            padding: 12px;
            min-height: 48px;
            transition: all 0.3s ease;
            user-select: none;
            margin: 10px;
        }

        html.dark-mode .window-slot {
            color: #64748b;
            background: rgba(100, 116, 139, 0.04);
            border-color: rgba(100, 116, 139, 0.15);
        }

        .window-slot:hover {
            background: rgba(108, 92, 231, 0.08);
            border-color: var(--primary-light);
            color: var(--primary);
            transform: translateY(-1px);
        }

        html.dark-mode .window-slot:hover {
            background: rgba(162, 155, 254, 0.1);
            border-color: var(--primary-light);
            color: var(--primary-light);
        }

        /* --- ВЫРАВНИВАНИЕ ЯЧЕЕК И ПОДГРУПП --- */
        .subject-cell {
            padding: 0 !important;
            vertical-align: top;
        }

        .single-class {
            padding: 15px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            line-height: 1.4;
            overflow-wrap: anywhere;
            word-break: break-word;
        }

        .single-class > span {
            min-width: 0;
            flex: 1;
        }

        .subgroup-container {
            display: flex;
            width: 100%;
            align-items: stretch;
        }

        .subgroup-column {
            flex: 1;
            padding: 15px;
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            line-height: 1.4;
            overflow-wrap: anywhere;
            word-break: break-word;
            min-width: 0;
        }

        .subgroup-column > span {
            min-width: 0;
            flex: 1;
        }

        /* --- COMMENTS UI --- */
        .btn-comment {
            background: none;
            border: none;
            color: var(--primary);
            cursor: pointer;
            font-size: 1.1rem;
            margin-left: 8px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px;
            border-radius: 8px;
            transition: 0.2s;
            vertical-align: middle;
            flex-shrink: 0;
        }

        .btn-comment:hover {
            background: rgba(108, 92, 231, 0.1);
        }

        .comment-badge {
            font-size: 0.7rem;
            background: #ff7675;
            color: white;
            padding: 2px 6px;
            border-radius: 10px;
            font-weight: 700;
            border: 1px solid transparent;
        }

        .comment-badge.read {
            background: var(--white);
            color: var(--text-secondary);
            border: 1px solid var(--border);
        }

        /* Bottom Sheet */
        .bottom-sheet-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: 0.3s;
        }

        .bottom-sheet-overlay.active {
            opacity: 1;
            pointer-events: all;
        }

        .bottom-sheet {
            position: fixed;
            bottom: -100%;
            left: 0;
            right: 0;
            background: var(--bg);
            border-radius: 24px 24px 0 0;
            z-index: 1001;
            padding: 20px;
            padding-bottom: env(safe-area-inset-bottom, 20px);
            transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
        }

        .bottom-sheet.active {
            bottom: 0;
        }

        .sheet-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            border-bottom: 1px solid var(--border);
            padding-bottom: 10px;
        }

        .sheet-title {
            font-family: 'Nunito', sans-serif;
            font-size: 1.1rem;
            font-weight: 800;
            color: var(--primary);
        }

        .btn-close-sheet {
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--text-secondary);
            cursor: pointer;
        }

        .comments-list {
            flex: 1;
            overflow-y: auto;
            margin-bottom: 15px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding-right: 5px;
        }

        .comment-item {
            background: var(--white);
            padding: 12px 15px;
            border-radius: 16px;
            border: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .comment-item.grayed-out {
            opacity: 0.5;
            background: rgba(148, 163, 184, 0.1);
        }

        .comment-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.8rem;
        }

        .comment-author {
            font-weight: 700;
            color: var(--primary);
        }

        .comment-time {
            color: var(--text-secondary);
        }

        .comment-text {
            font-size: 0.95rem;
            line-height: 1.4;
            color: var(--text);
            word-wrap: break-word;
        }

        .comment-footer {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 10px;
        }

        .vote-btn {
            background: none;
            border: none;
            color: var(--divider);
            cursor: pointer;
            font-size: 1rem;
            transition: 0.2s;
        }

        .vote-btn:hover {
            color: var(--text);
        }

        .vote-btn.active-up {
            color: #00b894;
        }

        .vote-btn.active-down {
            color: #d63031;
        }

        .vote-score {
            font-weight: 700;
            font-size: 0.9rem;
            min-width: 20px;
            text-align: center;
        }

        .comment-form {
            display: flex;
            gap: 10px;
            align-items: flex-end;
        }

        .comment-input {
            flex: 1;
            padding: 12px 15px;
            border-radius: 20px;
            border: 1px solid var(--border);
            background: var(--white);
            color: var(--text);
            font-family: 'Montserrat', sans-serif;
            resize: none;
            outline: none;
            overflow: hidden;
        }

        .btn-send-comment {
            background: var(--primary);
            color: white;
            border: none;
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1.1rem;
            transition: 0.2s;
        }

        .btn-send-comment:hover {
            background: var(--primary-light);
        }

        /* --- REPLIES --- */
        .btn-reply {
            background: none;
            border: none;
            color: var(--divider);
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 600;
            font-family: 'Montserrat', sans-serif;
            padding: 2px 6px;
            border-radius: 6px;
            transition: 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .btn-reply:hover {
            color: var(--primary);
            background: rgba(108, 92, 231, 0.08);
        }

        .replies-container {
            margin-top: 8px;
            padding-left: 16px;
            border-left: 3px solid var(--border);
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .reply-item {
            background: var(--bg);
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .reply-form {
            display: flex;
            gap: 8px;
            align-items: flex-end;
            margin-top: 8px;
            padding-left: 16px;
            border-left: 3px solid var(--primary-light);
        }

        .reply-input {
            flex: 1;
            padding: 10px 14px;
            border-radius: 16px;
            border: 1px solid var(--border);
            background: var(--white);
            color: var(--text);
            font-family: 'Montserrat', sans-serif;
            font-size: 0.9rem;
            resize: none;
            outline: none;
            overflow: hidden;
        }

        .btn-send-reply {
            background: var(--primary);
            color: white;
            border: none;
            width: 38px;
            height: 38px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 0.95rem;
            transition: 0.2s;
            flex-shrink: 0;
        }

        .btn-send-reply:hover {
            background: var(--primary-light);
        }

        @media (max-width: 768px) {
            .btn-comment {
                font-size: 1.2rem;
                padding: 6px;
            }
            .replies-container {
                padding-left: 10px;
            }
            .reply-form {
                padding-left: 10px;
            }
        }
    
