        :root {
            /* Тёмная тема по умолчанию */
            --tg-theme-bg-color: #1a1a1a;
            --tg-theme-text-color: #ffffff;
            --tg-theme-hint-color: #8b8b8b;
            --tg-theme-link-color: #60a5fa;
            --tg-theme-button-color: #3b82f6;
            --tg-theme-button-text-color: #ffffff;
            --tg-theme-secondary-bg-color: #2d2d2d;
            --tg-theme-section-separator-color: #404040;
            --color-bg: var(--tg-theme-bg-color);
            --color-surface: var(--tg-theme-secondary-bg-color);
            --color-text: var(--tg-theme-text-color);
            --color-muted: var(--tg-theme-hint-color);
            --color-accent: var(--tg-theme-button-color);
            --color-accent-text: var(--tg-theme-button-text-color);
            --color-border: var(--tg-theme-section-separator-color);
            --space-1: 4px;
            --space-2: 8px;
            --space-3: 12px;
            --space-4: 16px;
            --space-5: 20px;
            --space-6: 24px;
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.14);
            --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.18);
            --motion-fast: 140ms;
            --motion-base: 220ms;
            --motion-emphasis: 320ms;
            --motion-toast-out: 160ms;
            --motion-banner-out: 160ms;
            --motion-overlay: 180ms;
            --motion-enter-x: 22px;
            --motion-exit-x: 18px;
            --motion-enter-y: 12px;
            --motion-sheet-y: 24px;
            --motion-toast-y: 14px;
            --motion-banner-y: -10px;
            --ease-standard: cubic-bezier(.2, .8, .2, 1);
            --ease-decelerate: cubic-bezier(.16, 1, .3, 1);
            --ease-accelerate: cubic-bezier(.7, 0, .84, 0);
        }

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

        html {
            background-color: var(--tg-theme-bg-color);
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--tg-theme-bg-color);
            color: var(--tg-theme-text-color);
            padding: 0;
            min-height: 100vh;
            min-height: 100dvh;
            overflow-x: hidden;
        }

        body.modal-open {
            overflow: hidden;
            touch-action: none;
        }

        .is-entering,
        .is-exiting {
            --motion-translate-x: 0px;
            --motion-translate-y: 0px;
            --motion-duration: var(--motion-base);
            --motion-exit-duration: var(--motion-toast-out);
            animation-fill-mode: both;
            will-change: transform, opacity;
        }

        .is-entering {
            animation-name: motionEnter;
            animation-duration: var(--motion-duration);
            animation-timing-function: var(--ease-decelerate);
        }

        .is-exiting {
            animation-name: motionExit;
            animation-duration: var(--motion-exit-duration);
            animation-timing-function: var(--ease-accelerate);
            pointer-events: none;
        }

        .from-left {
            --motion-translate-x: calc(var(--motion-enter-x) * -1);
        }

        .from-right {
            --motion-translate-x: var(--motion-enter-x);
        }

        .from-bottom {
            --motion-translate-y: var(--motion-sheet-y);
        }

        .from-top {
            --motion-translate-y: var(--motion-banner-y);
        }

        .shared-axis-y {
            --motion-translate-y: var(--motion-enter-y);
        }

        .fade-only {
            --motion-translate-x: 0px;
            --motion-translate-y: 0px;
        }

        @keyframes motionEnter {
            from {
                opacity: 0;
                transform: translate3d(var(--motion-translate-x), var(--motion-translate-y), 0);
            }

            to {
                opacity: 1;
                transform: translate3d(0, 0, 0);
            }
        }

        @keyframes motionExit {
            from {
                opacity: 1;
                transform: translate3d(0, 0, 0);
            }

            to {
                opacity: 0;
                transform: translate3d(var(--motion-translate-x), var(--motion-translate-y), 0);
            }
        }

        .stagger-item {
            --stagger-index: 0;
            --stagger-step: 24ms;
            animation: motionRevealUp var(--motion-base) var(--ease-decelerate) both;
            animation-delay: calc(var(--stagger-index) * var(--stagger-step));
            will-change: transform, opacity, box-shadow;
        }

        .stagger-item.current-glow {
            animation-name: motionRevealUp, lessonCurrentGlow;
            animation-duration: var(--motion-base), var(--motion-emphasis);
            animation-timing-function: var(--ease-decelerate), var(--ease-decelerate);
            animation-fill-mode: both, both;
            animation-delay: calc(var(--stagger-index) * var(--stagger-step)), calc(var(--stagger-index) * var(--stagger-step) + 40ms);
        }

        @keyframes motionRevealUp {
            from {
                opacity: 0;
                transform: translate3d(0, 12px, 0);
            }

            to {
                opacity: 1;
                transform: translate3d(0, 0, 0);
            }
        }

        @keyframes lessonCurrentGlow {
            0% {
                box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
            }

            35% {
                box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.24);
            }

            100% {
                box-shadow: 0 0 0 2px var(--tg-theme-button-color);
            }
        }

        .motion-spin-once {
            animation: motionSpinOnce var(--motion-emphasis) var(--ease-decelerate) 1;
            transform-origin: center;
        }

        @keyframes motionSpinOnce {
            from {
                transform: rotate(-18deg) scale(0.94);
                opacity: 0.65;
            }

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


        .container {
            max-width: 100%;
            margin: 0 auto;
            padding: 0;
            min-height: 100vh;
            min-height: 100dvh;
            background: var(--tg-theme-bg-color);
        }

        .header {
            background: var(--color-surface, #f4f4f5);
            padding: 12px 14px;
            border-bottom: 1px solid var(--color-border, #e4e4e7);
        }

        .sticky-header {
            position: sticky;
            top: 0;
            z-index: 10;
            background: var(--color-bg, #ffffff);
        }

        .header-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: var(--space-4);
        }

        .header-content {
            flex: 1;
            min-width: 0;
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            flex-shrink: 0;
        }

        .schedule-context {
            display: block;
            padding: 0;
            border: none;
            background: none;
        }

        .schedule-context-main {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .schedule-context-row {
            display: flex;
            align-items: center;
            gap: 8px;
            min-height: 32px;
            flex-wrap: wrap;
        }

        .context-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            width: fit-content;
            max-width: 100%;
            padding: 4px 8px;
            border-radius: 999px;
            background: rgba(59, 130, 246, 0.14);
            color: var(--color-accent);
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .context-title {
            font-size: 22px;
            font-weight: 700;
            line-height: 1.1;
            color: var(--color-text);
            word-break: break-word;
        }

        .context-subtitle {
            font-size: 13px;
            color: var(--color-muted);
            line-height: 1.35;
        }

        .view-btn.icon-btn-sm {
            flex: 0 0 auto;
            width: 44px;
            min-width: 44px;
            min-height: 44px;
            height: 44px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: var(--color-bg, #ffffff);
            border-radius: var(--radius-sm);
        }

        .view-btn.icon-btn-sm i {
            font-size: 16px;
        }

        button:focus-visible,
        a:focus-visible,
        input:focus-visible {
            outline: 2px solid var(--color-accent, #3b82f6);
            outline-offset: 2px;
        }

        .help-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 20px;
            opacity: 0;
        }

        .help-modal.show {
            display: flex;
            opacity: 1;
        }

        .help-content {
            background: var(--color-surface, #ffffff);
            border-radius: 12px;
            padding: 20px;
            max-width: 320px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            will-change: transform, opacity;
        }

        .help-content h3 {
            margin: 0 0 12px 0;
            color: var(--tg-theme-text-color, #000000);
            font-size: 16px;
            text-align: center;
        }

        .help-content p {
            margin: 0 0 16px 0;
            color: var(--tg-theme-hint-color, #71717a);
            font-size: 16px;
            line-height: 1.5;
        }

        .help-close {
            width: 100%;
            padding: 10px;
            background: var(--tg-theme-button-color, #3b82f6);
            color: var(--tg-theme-button-text-color, #ffffff);
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
        }

        .help-version {
            font-size: 12px;
            color: var(--tg-theme-hint-color);
            margin-bottom: 12px;
            text-align: center;
        }

        .help-patchnotes {
            margin: 16px 0;
        }

        .help-patchnotes-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--tg-theme-text-color);
            margin-bottom: 8px;
        }

        .help-patchnote-link {
            display: block;
            padding: 8px 12px;
            margin-bottom: 6px;
            background: var(--color-surface, #f4f4f5);
            border-radius: 8px;
            color: var(--tg-theme-link-color, #3b82f6);
            font-size: 13px;
            text-decoration: none;
            cursor: pointer;
            transition: background 0.2s;
        }

        .help-patchnote-link:hover {
            background: var(--tg-theme-section-separator-color, #e4e4e7);
        }

        .help-patchnote-link:active {
            opacity: 0.9;
        }

        .help-patchnotes-entry {
            margin: 12px 0;
            font-size: 16px;
        }

        .help-patchnotes-entry i {
            margin-right: 8px;
            opacity: 0.8;
        }

        .help-patchnotes-list {
            margin-bottom: 16px;
        }

        .patchnote-back {
            width: 44px;
            height: 44px;
            border: none;
            background: var(--tg-theme-secondary-bg-color);
            border-radius: 8px;
            color: var(--tg-theme-link-color);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .patchnote-detail-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
        }

        .patchnote-detail-header h3 {
            margin: 0;
            text-align: left;
            flex: 1;
        }

        .patchnote-close {
            width: 44px;
            height: 44px;
            border: none;
            background: var(--tg-theme-secondary-bg-color);
            border-radius: 8px;
            color: var(--tg-theme-hint-color);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .patchnote-detail-body {
            font-size: 16px;
            line-height: 1.6;
            color: var(--tg-theme-text-color);
            margin-bottom: 16px;
            white-space: pre-line;
        }

        .user-info {
            font-size: 13px;
            color: var(--tg-theme-hint-color, #71717a);
            margin-bottom: 8px;
            line-height: 1.25;
        }

        .user-info.mode-user-info {
            margin-bottom: 4px;
        }

        .mode-user-top {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }

        .mode-entity-name {
            margin-top: 3px;
            font-size: 14px;
            font-weight: 600;
            color: var(--tg-theme-text-color, #000000);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .mode-entity-subtitle {
            margin-top: 1px;
            font-size: 11px;
            color: var(--tg-theme-hint-color, #71717a);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .view-switcher {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            padding: var(--space-2) var(--space-4);
            background: var(--color-bg, #ffffff);
            border-bottom: 1px solid var(--color-border, #e4e4e7);
        }

        .mode-banner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 10px 16px 12px;
            background: rgba(59, 130, 246, 0.08);
            border-bottom: 1px solid var(--color-border, #e4e4e7);
        }

        .mode-banner.hidden {
            display: none;
        }

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

        .mode-banner-title {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: var(--color-accent);
        }

        .mode-banner-text {
            font-size: 13px;
            line-height: 1.35;
            color: var(--color-text);
        }

        .mode-banner-action {
            flex: 0 0 auto;
            min-height: 36px;
            padding: 0 12px;
            border: 1px solid rgba(59, 130, 246, 0.28);
            border-radius: 999px;
            background: rgba(59, 130, 246, 0.16);
            color: var(--color-text);
            font-size: 12px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            white-space: nowrap;
        }

        .view-btn {
            flex: 1;
            min-height: 44px;
            padding: 10px 12px;
            background: var(--color-surface, #f4f4f5);
            border: none;
            border-radius: var(--radius-sm);
            font-size: 14px;
            color: var(--tg-theme-text-color, #000000);
            cursor: pointer;
            transition:
                background var(--motion-fast) var(--ease-standard),
                color var(--motion-fast) var(--ease-standard),
                box-shadow var(--motion-fast) var(--ease-standard),
                transform var(--motion-fast) var(--ease-standard);
            font-weight: 600;
        }

        .view-btn.active {
            background: var(--tg-theme-button-color, #3b82f6);
            color: var(--tg-theme-button-text-color, #ffffff);
            box-shadow: 0 10px 20px rgba(59, 130, 246, 0.18);
        }

        .view-btn:active {
            transform: scale(0.98);
        }

        .days-nav {
            display: flex;
            overflow-x: auto;
            gap: 8px;
            padding: 12px 16px;
            background: var(--color-bg, #ffffff);
            border-bottom: 1px solid var(--color-border, #e4e4e7);
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }

        .days-nav::-webkit-scrollbar {
            display: none;
        }

        .days-nav.hidden {
            display: none;
        }

        .day-btn {
            flex: 0 0 auto;
            min-height: 44px;
            padding: 10px 16px;
            background: var(--color-surface, #f4f4f5);
            border: none;
            border-radius: 8px;
            font-size: 14px;
            color: var(--tg-theme-text-color, #000000);
            cursor: pointer;
            transition:
                background var(--motion-fast) var(--ease-standard),
                color var(--motion-fast) var(--ease-standard),
                box-shadow var(--motion-fast) var(--ease-standard),
                transform var(--motion-fast) var(--ease-standard);
            white-space: nowrap;
            font-weight: 500;
        }

        .day-btn.active {
            background: var(--tg-theme-button-color, #3b82f6);
            color: var(--tg-theme-button-text-color, #ffffff);
            box-shadow: 0 8px 16px rgba(59, 130, 246, 0.16);
        }

        .day-btn:active {
            transform: scale(0.95);
        }

        .schedule-content {
            padding: 16px;
            background: var(--tg-theme-bg-color);
        }

        .next-lesson-summary {
            position: relative;
            overflow: hidden;
            background: var(--color-surface);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-md);
            padding: var(--space-3);
            margin-bottom: var(--space-3);
            box-shadow: var(--shadow-sm);
            will-change: transform, opacity;
        }

        .next-lesson-summary::after {
            content: "";
            position: absolute;
            inset: 0;
            pointer-events: none;
            opacity: 0;
            background: linear-gradient(110deg,
                    transparent 0%,
                    rgba(255, 255, 255, 0.04) 35%,
                    rgba(255, 255, 255, 0.14) 50%,
                    rgba(255, 255, 255, 0.04) 65%,
                    transparent 100%);
            transform: translate3d(-24%, 0, 0);
        }

        .next-lesson-summary.hidden {
            display: none;
        }

        .next-lesson-summary.motion-update {
            animation: summaryRefresh 220ms var(--ease-standard);
        }

        .next-lesson-summary.motion-update::after {
            animation: summarySweep 320ms var(--ease-decelerate);
        }

        .next-lesson-summary.motion-update .next-lesson-summary-title {
            animation: summaryFadeUp 160ms var(--ease-decelerate) 20ms both;
        }

        .next-lesson-summary.motion-update .next-lesson-summary-subject {
            animation: summaryFadeUp 180ms var(--ease-decelerate) 45ms both;
        }

        .next-lesson-summary.motion-update .next-lesson-summary-detail {
            animation: summaryChipIn 180ms var(--ease-decelerate) both;
        }

        .next-lesson-summary.motion-update .next-lesson-summary-detail:nth-child(1) {
            animation-delay: 70ms;
        }

        .next-lesson-summary.motion-update .next-lesson-summary-detail:nth-child(2) {
            animation-delay: 100ms;
        }

        .next-lesson-summary.motion-update .next-lesson-summary-detail:nth-child(3) {
            animation-delay: 130ms;
        }

        .next-lesson-summary.motion-update .next-lesson-summary-detail.status {
            animation:
                summaryChipIn 180ms var(--ease-decelerate) 130ms both,
                summaryStatusAccent 320ms var(--ease-decelerate) 160ms both;
        }

        @keyframes summaryRefresh {
            from {
                opacity: 0;
                transform: translate3d(0, 8px, 0);
            }

            to {
                opacity: 1;
                transform: translate3d(0, 0, 0);
            }
        }

        @keyframes summarySweep {
            0% {
                opacity: 0;
                transform: translate3d(-24%, 0, 0);
            }

            35% {
                opacity: 1;
            }

            100% {
                opacity: 0;
                transform: translate3d(24%, 0, 0);
            }
        }

        @keyframes summaryFadeUp {
            from {
                opacity: 0;
                transform: translate3d(0, 8px, 0);
            }

            to {
                opacity: 1;
                transform: translate3d(0, 0, 0);
            }
        }

        @keyframes summaryChipIn {
            from {
                opacity: 0;
                transform: translate3d(0, 10px, 0) scale(0.98);
            }

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

        @keyframes summaryStatusAccent {
            0% {
                box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
            }

            45% {
                box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
            }
        }

        .next-lesson-summary-title {
            font-size: 12px;
            color: var(--color-muted);
            margin-bottom: var(--space-1);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .next-lesson-summary-subject {
            font-size: 16px;
            font-weight: 700;
            line-height: 1.3;
        }

        .next-lesson-summary-details {
            margin-top: var(--space-2);
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: var(--space-2);
        }

        .next-lesson-summary-detail {
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 7px 8px;
            border-radius: 8px;
            border: 1px solid var(--color-border);
            background: rgba(148, 163, 184, 0.12);
            color: var(--color-muted);
            font-size: 13px;
            line-height: 1.2;
        }

        .next-lesson-summary-detail i {
            flex: 0 0 auto;
            color: var(--color-accent);
            font-size: 11px;
        }

        .next-lesson-summary-detail span {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .next-lesson-summary-detail.status {
            grid-column: 1 / -1;
            font-weight: 600;
            font-size: 12px;
            color: var(--color-text);
            background: rgba(59, 130, 246, 0.12);
        }

        .next-lesson-summary-detail.status span {
            white-space: normal;
        }

        .schedule-content.list-view {
            padding: 0 0 20px;
        }

        .schedule-content.list-view .day-section .date-header {
            position: sticky;
            top: 0;
            z-index: 2;
            background: var(--color-bg);
            margin: 0 -16px 10px;
            padding: 12px 16px 10px;
            border-bottom: 1px solid var(--color-border);
        }

        .schedule-content.list-view .day-section {
            padding: 0 16px 16px;
            background: var(--tg-theme-bg-color);
        }

        .schedule-content.list-view .day-section:last-child {
            padding-bottom: 8px;
        }

        .schedule-content.list-view .lesson-card {
            margin-top: 8px;
            margin-bottom: 12px;
        }

        .schedule-content.list-view .lesson-card:last-child {
            margin-bottom: 0;
        }

        .schedule-content.list-view .day-section .lesson-card:first-child,
        .schedule-content.list-view .day-section .status-card:first-child {
            margin-top: 0;
        }

        .schedule-content.list-view .day-empty {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 14px;
            border-radius: 14px;
            border: 1px dashed var(--color-border);
            background: rgba(148, 163, 184, 0.08);
            color: var(--color-muted);
        }

        .schedule-content.list-view .day-empty i {
            flex: 0 0 auto;
            font-size: 14px;
            color: var(--color-accent);
        }

        .schedule-content.list-view .day-empty-text {
            font-size: 13px;
            line-height: 1.35;
        }

        .day-section {
            padding: 16px;
            border-bottom: 2px solid var(--tg-theme-section-separator-color, #e4e4e7);
        }

        .day-section:last-child {
            border-bottom: none;
        }

        .day-section[data-today="true"] .date-header {
            color: var(--tg-theme-link-color, #3b82f6);
            font-weight: 700;
        }

        .date-header {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--color-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }


        .lesson-info {
            font-size: 16px;
            line-height: 1.5;
            color: var(--tg-theme-text-color, #000000);
        }

        .lesson-subject {
            font-weight: 600;
            color: var(--tg-theme-text-color, #000000);
            font-size: 15px;
            margin-bottom: 6px;
        }

        .lesson-room-number {
            color: var(--tg-theme-link-color, #3b82f6);
            font-weight: 600;
        }

        .no-lessons {
            text-align: center;
            padding: 40px 20px;
            color: var(--tg-theme-hint-color, #71717a);
            font-size: 16px;
        }

        .loading {
            text-align: center;
            padding: 40px 20px;
            color: var(--tg-theme-hint-color, #71717a);
            font-size: 16px;
        }

        /* Скелетон-загрузка */
        .skeleton-container {
            padding: 0;
        }

        .skeleton-card {
            background: var(--color-surface, #f4f4f5);
            border-radius: 12px;
            padding: 14px;
            margin-bottom: 12px;
        }

        .skeleton-line {
            background: linear-gradient(90deg,
                    var(--tg-theme-hint-color, #e4e4e7) 25%,
                    var(--tg-theme-secondary-bg-color, #f4f4f5) 50%,
                    var(--tg-theme-hint-color, #e4e4e7) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
            border-radius: 4px;
            opacity: 0.3;
        }

        .skeleton-time {
            width: 100px;
            height: 18px;
            margin-bottom: 10px;
        }

        .skeleton-subject {
            width: 85%;
            height: 16px;
            margin-bottom: 8px;
        }

        .skeleton-room {
            width: 60%;
            height: 14px;
        }

        @keyframes shimmer {
            0% {
                background-position: 200% 0;
            }

            100% {
                background-position: -200% 0;
            }
        }

        .error {
            text-align: center;
            padding: 20px;
            color: #f87171;
            font-size: 16px;
            background: rgba(239, 68, 68, 0.15);
            border-radius: 8px;
            margin: 16px;
        }

        .separator {
            height: 1px;
            background: var(--tg-theme-section-separator-color, #e4e4e7);
            margin: 16px 0;
        }

        /* Экран инструкции установки */
        .install-screen,
        .group-select-screen {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            height: 100vh;
            height: 100dvh;
            background: var(--color-bg, #ffffff);
            z-index: 1000;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            opacity: 0;
        }

        .install-screen.show,
        .group-select-screen.show {
            display: block;
            opacity: 1;
        }

        .install-screen-content,
        .group-select-content {
            padding: 40px 24px;
            max-width: 400px;
            margin: 0 auto;
        }

        .group-select-header {
            display: flex;
            align-items: center;
            gap: var(--space-4);
            margin-bottom: 24px;
        }

        .group-select-back {
            width: 44px;
            height: 44px;
            border: none;
            border-radius: 12px;
            background: var(--tg-theme-secondary-bg-color);
            color: var(--tg-theme-link-color);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .group-select-back:active {
            opacity: 0.8;
        }

        .group-select-title {
            margin: 0;
            font-size: 22px;
            font-weight: 700;
            color: var(--tg-theme-text-color);
        }

        .install-logo {
            font-size: 64px;
            text-align: center;
            margin-bottom: 16px;
            color: var(--tg-theme-link-color);
        }

        .install-logo i {
            display: inline-block;
        }

        .install-title {
            font-size: 24px;
            font-weight: 700;
            text-align: center;
            margin-bottom: 8px;
            color: var(--tg-theme-text-color, #000000);
        }

        .install-subtitle {
            font-size: 16px;
            text-align: center;
            color: var(--tg-theme-hint-color, #71717a);
            margin-bottom: 32px;
        }

        .install-instructions {
            background: var(--color-surface, #f4f4f5);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 16px;
        }

        .install-instructions h3 {
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--tg-theme-text-color, #000000);
        }

        .install-browser {
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid var(--color-outline, rgba(0, 0, 0, 0.08));
        }

        .install-browser:first-of-type {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }

        .install-browser h4 {
            margin: 0 0 10px;
            font-size: 16px;
            font-weight: 700;
            color: var(--tg-theme-text-color, #000000);
        }

        .install-browser-warning {
            background: rgba(245, 158, 11, 0.08);
            margin-left: -16px;
            margin-right: -16px;
            padding-left: 16px;
            padding-right: 16px;
        }

        .install-instructions p {
            margin: 0;
            font-size: 15px;
            line-height: 1.6;
            color: var(--tg-theme-text-color, #000000);
        }

        .install-instructions ol {
            margin: 0;
            padding-left: 20px;
        }

        .install-instructions ul {
            margin: 0;
            padding-left: 20px;
        }

        .install-instructions li {
            font-size: 16px;
            line-height: 1.6;
            color: var(--tg-theme-text-color, #000000);
            margin-bottom: 8px;
        }

        .install-instructions li:last-child {
            margin-bottom: 0;
        }

        .install-note {
            font-size: 13px;
            text-align: left;
            line-height: 1.6;
            color: var(--tg-theme-hint-color, #71717a);
            margin-top: 24px;
            padding: 14px 16px;
            background: var(--color-surface, #f4f4f5);
            border-radius: 8px;
        }

        /* Экран выбора группы */
        .search-container {
            margin-bottom: 16px;
            position: relative;
        }


        .search-icon {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--tg-theme-hint-color);
            font-size: 16px;
        }

        .group-search {
            width: 100%;
            padding: 14px 16px 14px 44px;
            font-size: 16px;
            border: 2px solid var(--tg-theme-section-separator-color);
            border-radius: 12px;
            background: var(--tg-theme-secondary-bg-color);
            color: var(--tg-theme-text-color);
            outline: none;
            transition: border-color 0.2s;
        }

        .group-search:focus {
            border-color: var(--tg-theme-button-color);
        }

        .group-search::placeholder {
            color: var(--tg-theme-hint-color);
        }

        .group-list {
            max-height: min(400px, 50dvh);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        .group-item {
            padding: var(--space-3) var(--space-4);
            background: var(--color-surface, #f4f4f5);
            border-radius: 10px;
            margin-bottom: 8px;
            cursor: pointer;
            transition:
                background var(--motion-fast) var(--ease-standard),
                border-color var(--motion-fast) var(--ease-standard),
                transform var(--motion-fast) var(--ease-standard);
            font-size: 15px;
            font-weight: 500;
            color: var(--tg-theme-text-color, #000000);
            border: 1px solid transparent;
        }

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

        .group-item:hover {
            background: var(--tg-theme-button-color, #3b82f6);
            color: var(--tg-theme-button-text-color, #ffffff);
        }

        .group-item-hint {
            font-size: 12px;
            color: var(--tg-theme-hint-color, #71717a);
            margin-top: 2px;
            font-weight: 400;
        }

        .group-item:hover .group-item-hint {
            color: rgba(255, 255, 255, 0.8);
        }

        .no-groups {
            text-align: center;
            padding: 20px;
            color: var(--tg-theme-hint-color);
            font-size: 16px;
        }

        /* Кнопка преподавателя */
        .teacher-btn {
            flex: 0 0 auto !important;
            width: 44px;
            padding: 8px !important;
        }

        .teacher-btn i {
            font-size: 16px;
        }

        /* Модальное окно преподавателя */
        .teacher-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            height: 100vh;
            height: 100dvh;
            max-height: 100vh;
            max-height: 100dvh;
            background: rgba(0, 0, 0, 0.6);
            z-index: 1000;
            align-items: flex-end;
            justify-content: center;
            overflow: hidden;
            opacity: 0;
        }

        .teacher-modal.show {
            display: flex;
            opacity: 1;
        }

        .teacher-modal.closing {
            display: flex;
            pointer-events: none;
        }

        .teacher-modal-content {
            background: var(--tg-theme-bg-color);
            border-radius: 16px 16px 0 0;
            width: 100%;
            height: 85vh;
            height: 85dvh;
            padding: 20px;
            padding-top: 16px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            will-change: transform, opacity;
        }

        .modal-search-row {
            flex-shrink: 0;
            margin-bottom: 12px;
        }

        .modal-search-row .search-container {
            margin-bottom: 0;
        }

        .modal-results-wrap {
            flex: 1 1 0;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .modal-results-wrap .teacher-modal-header,
        .modal-results-wrap .room-tabs {
            flex-shrink: 0;
        }

        .modal-list-scroll {
            flex: 1 1 0;
            min-height: 0;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        .modal-results-wrap .teacher-list,
        .modal-results-wrap .room-list {
            max-height: none;
            overflow-y: visible;
        }

        .teacher-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .teacher-modal-header h3 {
            font-size: 18px;
            font-weight: 600;
            color: var(--tg-theme-text-color);
        }

        .teacher-modal-header h3 i {
            margin-right: 8px;
            color: var(--tg-theme-link-color);
        }

        .teacher-modal-close {
            background: var(--tg-theme-secondary-bg-color);
            border: none;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--tg-theme-hint-color);
            font-size: 16px;
        }

        .teacher-list {
            max-height: 50vh;
            max-height: 50dvh;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            flex: 1;
            min-height: 0;
        }

        .teacher-item {
            padding: var(--space-3) var(--space-4);
            background: var(--tg-theme-secondary-bg-color);
            border-radius: 10px;
            margin-bottom: 8px;
            cursor: pointer;
            transition:
                background var(--motion-fast) var(--ease-standard),
                border-color var(--motion-fast) var(--ease-standard),
                transform var(--motion-fast) var(--ease-standard);
            border: 1px solid transparent;
        }

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

        .teacher-item:hover {
            background: var(--tg-theme-button-color);
        }

        .teacher-item:hover .teacher-name,
        .teacher-item:hover .teacher-subjects {
            color: var(--tg-theme-button-text-color);
        }

        .teacher-name {
            font-size: 15px;
            font-weight: 600;
            color: var(--tg-theme-text-color);
            margin-bottom: 4px;
        }

        .teacher-subjects {
            font-size: 12px;
            color: var(--tg-theme-hint-color);
        }

        .search-modal-content {
            height: 88vh;
            height: 88dvh;
            background:
                radial-gradient(circle at 10% 0%, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0) 35%),
                var(--tg-theme-bg-color);
        }

        .search-switch {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
            flex-shrink: 0;
        }

        .search-switch-btn {
            flex: 1;
            min-height: 44px;
            border: 1px solid var(--color-border);
            border-radius: 10px;
            background: var(--color-surface);
            color: var(--color-text);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all var(--motion-fast) ease;
            padding: 0 8px;
            white-space: nowrap;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .search-switch-btn.active {
            background: var(--color-accent);
            border-color: var(--color-accent);
            color: var(--color-accent-text);
        }

        .search-mode-switch {
            margin-bottom: 14px;
        }

        .search-mode-btn {
            border-radius: 12px;
            min-height: 46px;
        }

        .search-mode-btn i {
            width: 16px;
            text-align: center;
            color: var(--color-accent);
            transition: color var(--motion-fast) ease;
        }

        .search-mode-btn.active i {
            color: var(--color-accent-text);
        }

        .unified-search-row.hidden {
            display: none;
        }

        .search-mode-stage {
            position: relative;
            flex: 1 1 0;
            min-height: 0;
            overflow: hidden;
        }

        .search-mode-empty {
            height: 100%;
            border: 1px dashed var(--color-border);
            border-radius: 14px;
            padding: 24px 18px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: var(--color-muted);
            background: rgba(148, 163, 184, 0.08);
        }

        .search-mode-empty.hidden {
            display: none;
        }

        .search-mode-empty-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 10px;
            color: var(--color-accent);
            background: rgba(59, 130, 246, 0.18);
            font-size: 20px;
        }

        .search-mode-empty-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--tg-theme-text-color);
            margin-bottom: 6px;
        }

        .search-mode-empty-text {
            font-size: 13px;
            line-height: 1.4;
            max-width: 260px;
        }

        .search-quick-actions {
            width: 100%;
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
            margin-top: 18px;
        }

        .search-quick-action {
            border: 1px solid var(--color-border);
            border-radius: 14px;
            background: var(--color-surface);
            color: var(--color-text);
            padding: 14px 12px;
            text-align: left;
            display: flex;
            flex-direction: column;
            gap: 6px;
            cursor: pointer;
        }

        .search-quick-action i {
            color: var(--color-accent);
            font-size: 16px;
        }

        .search-quick-action-title {
            font-size: 14px;
            font-weight: 700;
        }

        .search-quick-action-text {
            font-size: 12px;
            color: var(--color-muted);
            line-height: 1.35;
        }

        .search-hint {
            margin-bottom: 12px;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid var(--color-border);
            background: rgba(148, 163, 184, 0.08);
            font-size: 12px;
            line-height: 1.45;
            color: var(--color-muted);
        }

        .search-pane {
            position: absolute;
            inset: 0;
            display: none;
            flex-direction: column;
            height: 100%;
            min-height: 0;
            opacity: 0;
        }

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

        .search-pane.slide-out-left {
            animation: searchSlideOutLeft 0.18s var(--ease-accelerate) forwards;
        }

        .search-pane.slide-out-right {
            animation: searchSlideOutRight 0.18s var(--ease-accelerate) forwards;
        }

        .search-pane.slide-in-left {
            animation: searchSlideInLeft 0.22s var(--ease-decelerate) forwards;
        }

        .search-pane.slide-in-right {
            animation: searchSlideInRight 0.22s var(--ease-decelerate) forwards;
        }

        @keyframes searchSlideOutLeft {
            from {
                opacity: 1;
                transform: translateX(0);
            }

            to {
                opacity: 0;
                transform: translateX(-20px);
            }
        }

        @keyframes searchSlideOutRight {
            from {
                opacity: 1;
                transform: translateX(0);
            }

            to {
                opacity: 0;
                transform: translateX(20px);
            }
        }

        @keyframes searchSlideInLeft {
            from {
                opacity: 0;
                transform: translateX(20px);
            }

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

        @keyframes searchSlideInRight {
            from {
                opacity: 0;
                transform: translateX(-20px);
            }

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

        /* Режим преподавателя в шапке */
        .teacher-mode-info {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            flex-wrap: nowrap;
        }

        .teacher-mode-badge {
            background: var(--tg-theme-button-color);
            color: var(--tg-theme-button-text-color);
            padding: 4px 8px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 600;
            flex: 0 0 auto;
            max-width: 130px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .back-to-group {
            background: none;
            border: none;
            color: var(--tg-theme-link-color);
            font-size: 12px;
            cursor: pointer;
            padding: 2px 0;
            line-height: 1.2;
            flex: 1 1 auto;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            text-align: left;
        }

        /* Модальное окно аудиторий */
        .room-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            height: 100vh;
            height: 100dvh;
            max-height: 100vh;
            max-height: 100dvh;
            background: rgba(0, 0, 0, 0.6);
            z-index: 1000;
            align-items: flex-end;
            justify-content: center;
            overflow: hidden;
            opacity: 0;
        }

        .room-modal.show {
            display: flex;
            opacity: 1;
        }

        .room-modal.closing {
            display: flex;
            pointer-events: none;
        }

        .room-modal-content {
            background: var(--tg-theme-bg-color);
            border-radius: 16px 16px 0 0;
            width: 100%;
            height: 85vh;
            height: 85dvh;
            padding: 20px;
            padding-top: 16px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            will-change: transform, opacity;
        }


        .room-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }

        .room-tab {
            flex: 1;
            min-height: 44px;
            padding: 10px;
            border: none;
            background: var(--tg-theme-secondary-bg-color);
            color: var(--tg-theme-text-color);
            border-radius: 8px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .room-tab.active {
            background: var(--tg-theme-button-color);
            color: var(--tg-theme-button-text-color);
        }

        .room-search-content {
            display: none;
        }

        .room-search-content.active {
            display: block;
        }

        .room-item {
            padding: var(--space-3) var(--space-4);
            background: var(--tg-theme-secondary-bg-color);
            border-radius: 10px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: background 0.2s, transform 0.1s;
        }

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

        .room-item:hover {
            background: var(--tg-theme-button-color);
        }

        .room-item:hover .room-name,
        .room-item:hover .room-info {
            color: var(--tg-theme-button-text-color);
        }

        .room-name {
            font-size: 15px;
            font-weight: 600;
            color: var(--tg-theme-text-color);
            margin-bottom: 4px;
        }

        .room-info {
            font-size: 12px;
            color: var(--tg-theme-hint-color);
        }

        .room-list {
            max-height: 50vh;
            max-height: 50dvh;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            flex: 1;
            min-height: 0;
        }

        .free-room-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .free-room-badge {
            background: #22c55e;
            color: white;
            padding: 4px 8px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 600;
        }

        .time-select-group {
            margin-bottom: 16px;
        }

        .time-select-label {
            font-size: 13px;
            color: var(--tg-theme-hint-color);
            margin-bottom: 8px;
            display: block;
        }

        .time-select {
            width: 100%;
            padding: 12px;
            border: 1px solid var(--tg-theme-secondary-bg-color);
            border-radius: 8px;
            background: var(--tg-theme-secondary-bg-color);
            color: var(--tg-theme-text-color);
            font-size: 16px;
        }

        /* Модальное окно настроек */
        .settings-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            height: 100vh;
            height: 100dvh;
            max-height: 100vh;
            max-height: 100dvh;
            background: rgba(0, 0, 0, 0.6);
            z-index: 1000;
            align-items: flex-end;
            justify-content: center;
            overflow: hidden;
            opacity: 0;
        }

        .settings-modal.show {
            display: flex;
            opacity: 1;
        }

        .settings-modal.closing {
            display: flex;
            pointer-events: none;
        }

        .settings-modal-content {
            background: var(--tg-theme-bg-color);
            border-radius: 16px 16px 0 0;
            width: 100%;
            max-height: 70vh;
            max-height: 70dvh;
            padding: 20px;
            will-change: transform, opacity;
        }

        .settings-section {
            margin-bottom: 20px;
        }

        .settings-section-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--tg-theme-hint-color);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 12px;
        }

        .settings-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: var(--space-3) var(--space-4);
            background: var(--tg-theme-secondary-bg-color);
            border-radius: 10px;
            margin-bottom: 8px;
        }

        button.settings-item {
            width: 100%;
            border: none;
            text-align: left;
            cursor: pointer;
        }

        .settings-item-label {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 15px;
            color: var(--tg-theme-text-color);
        }

        .settings-item-label i {
            color: var(--tg-theme-link-color);
            width: 20px;
            text-align: center;
        }

        /* Toggle switch */
        .toggle-switch {
            position: relative;
            width: 50px;
            height: 28px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #52525b;
            transition: 0.3s;
            border-radius: 28px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 22px;
            width: 22px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: 0.3s;
            border-radius: 50%;
        }

        input:checked+.toggle-slider {
            background-color: var(--tg-theme-button-color);
        }

        input:checked+.toggle-slider:before {
            transform: translateX(22px);
        }

        /* Светлая тема */
        .light-theme {
            --tg-theme-bg-color: #f4f7fb;
            --tg-theme-text-color: #0b1220;
            --tg-theme-hint-color: #5f6f84;
            --tg-theme-link-color: #1d4ed8;
            --tg-theme-button-color: #0f766e;
            --tg-theme-button-text-color: #ffffff;
            --tg-theme-secondary-bg-color: #ffffff;
            --tg-theme-section-separator-color: #d3deea;
            --color-bg: #f4f7fb;
            --color-surface: #ffffff;
            --color-text: #0b1220;
            --color-muted: #5f6f84;
            --color-border: #d3deea;
            --color-accent: #0f766e;
            --color-accent-text: #ffffff;
            --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.08);
            --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.10);
            color-scheme: light;
        }

        .light-theme .toggle-slider {
            background-color: #d4d4d8;
        }

        .light-theme .lesson-card.past {
            opacity: 0.72;
        }

        .light-theme .header,
        .light-theme .sticky-header,
        .light-theme .view-switcher,
        .light-theme .days-nav {
            background: var(--tg-theme-bg-color);
        }

        .light-theme .view-btn:not(.active),
        .light-theme .day-btn:not(.active),
        .light-theme .view-btn.icon-btn-sm,
        .light-theme .search-mode-btn {
            background: #ffffff;
            border: 1px solid var(--tg-theme-section-separator-color);
            color: var(--tg-theme-text-color);
        }

        .light-theme .view-btn.active,
        .light-theme .day-btn.active,
        .light-theme .room-tab.active,
        .light-theme .search-switch-btn.active {
            box-shadow: 0 4px 12px rgba(15, 118, 110, 0.22);
        }

        .light-theme .next-lesson-summary,
        .light-theme .lesson-card,
        .light-theme .no-lessons {
            border: 1px solid var(--tg-theme-section-separator-color);
            box-shadow: var(--shadow-sm);
        }

        .light-theme .no-lessons {
            border-radius: var(--radius-md);
            background: #ffffff;
        }

        .light-theme .teacher-modal-content,
        .light-theme .room-modal-content,
        .light-theme .settings-modal-content,
        .light-theme .help-content,
        .light-theme .update-modal-content,
        .light-theme .group-select-content {
            background: #ffffff;
            border: 1px solid var(--tg-theme-section-separator-color);
        }

        .light-theme .search-modal-content {
            background:
                radial-gradient(circle at 10% 0%, rgba(15, 118, 110, 0.14) 0%, rgba(15, 118, 110, 0) 34%),
                #ffffff;
        }

        .light-theme .group-search,
        .light-theme .time-select {
            background: #f8fbff;
            border-color: var(--tg-theme-section-separator-color);
            color: var(--tg-theme-text-color);
        }

        .light-theme .group-search::placeholder {
            color: #7b8ca4;
        }

        .light-theme .teacher-modal-close {
            background: #f1f5f9;
            color: #334155;
            border: 1px solid var(--tg-theme-section-separator-color);
        }

        .light-theme .teacher-item,
        .light-theme .room-item,
        .light-theme .group-item,
        .light-theme .settings-item,
        .light-theme .install-note {
            background: #ffffff;
            border: 1px solid var(--tg-theme-section-separator-color);
        }

        .light-theme .room-tab:not(.active),
        .light-theme .search-switch-btn:not(.active) {
            background: #f8fbff;
            border: 1px solid var(--tg-theme-section-separator-color);
            color: var(--tg-theme-text-color);
        }

        .light-theme .teacher-item:hover,
        .light-theme .room-item:hover,
        .light-theme .group-item:hover {
            background: #eaf3ff;
            border-color: #bfdbfe;
        }

        .light-theme .teacher-item:hover .teacher-name,
        .light-theme .room-item:hover .room-name,
        .light-theme .group-item:hover {
            color: var(--tg-theme-text-color);
        }

        .light-theme .teacher-item:hover .teacher-subjects,
        .light-theme .room-item:hover .room-info,
        .light-theme .group-item:hover .group-item-hint {
            color: var(--tg-theme-hint-color);
        }

        .light-theme .teacher-modal,
        .light-theme .room-modal,
        .light-theme .search-modal,
        .light-theme .settings-modal,
        .light-theme .help-modal,
        .light-theme .update-modal {
            background: rgba(15, 23, 42, 0.35);
        }

        .light-theme .search-mode-empty {
            border-color: #c6d7eb;
            background: #f8fbff;
            color: #5f6f84;
        }

        .light-theme .search-mode-empty-icon {
            background: #e4f1ff;
            color: #0f766e;
        }

        .light-theme .offline-banner {
            border-bottom-color: var(--tg-theme-section-separator-color);
        }

        .light-theme .offline-banner[data-variant="offline"] {
            background: #fff7e6;
            color: #92400e;
        }

        .light-theme .offline-banner[data-variant="context"] {
            background: #eff6ff;
            color: #1d4ed8;
        }

        .light-theme .offline-banner[data-variant="warning"] {
            background: #fef2f2;
            color: #b91c1c;
        }

        .light-theme .date-header,
        .light-theme .next-lesson-summary-subject {
            color: #0b1220;
        }

        .light-theme .next-lesson-summary-title {
            color: #5f6f84;
        }

        .light-theme .next-lesson-summary-detail {
            background: #f8fbff;
            border-color: #d3deea;
            color: #4f627a;
        }

        .light-theme .next-lesson-summary-detail.status {
            background: #e8f5f3;
            border-color: #b8ddd8;
            color: #0f4f49;
        }

        /* Анимации переходов */
        .schedule-content {
            position: relative;
            overflow: hidden;
            min-height: calc(100vh - 240px);
            touch-action: pan-y;
            background: var(--tg-theme-bg-color);
        }

        #scheduleContainer {
            will-change: transform, opacity;
            background: var(--tg-theme-bg-color);
        }

        #scheduleContainer.slide-out-left {
            animation: slideOutLeft 180ms var(--ease-accelerate) forwards;
        }

        #scheduleContainer.slide-out-right {
            animation: slideOutRight 180ms var(--ease-accelerate) forwards;
        }

        #scheduleContainer.slide-in-left {
            animation: slideInLeft 240ms var(--ease-decelerate) forwards;
        }

        #scheduleContainer.slide-in-right {
            animation: slideInRight 240ms var(--ease-decelerate) forwards;
        }

        @keyframes slideInLeft {
            from {
                opacity: 0;
                transform: translate3d(var(--motion-enter-x), 0, 0);
            }

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

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translate3d(calc(var(--motion-enter-x) * -1), 0, 0);
            }

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

        @keyframes slideOutLeft {
            from {
                opacity: 1;
                transform: translate3d(0, 0, 0);
            }

            to {
                opacity: 0;
                transform: translate3d(calc(var(--motion-exit-x) * -1), 0, 0);
            }
        }

        @keyframes slideOutRight {
            from {
                opacity: 1;
                transform: translate3d(0, 0, 0);
            }

            to {
                opacity: 0;
                transform: translate3d(var(--motion-exit-x), 0, 0);
            }
        }

        /* Новый дизайн карточек */
        .lesson-card {
            background: var(--tg-theme-secondary-bg-color);
            border-radius: 14px;
            padding: var(--space-3) var(--space-4);
            padding-top: 18px;
            margin-bottom: 16px;
            margin-top: 10px;
            display: flex;
            align-items: center;
            gap: 14px;
            position: relative;
            opacity: 1;
            box-shadow: var(--shadow-sm);
        }

        .lesson-card.current {
            background: linear-gradient(135deg, #1e3a5f 0%, var(--tg-theme-secondary-bg-color) 100%);
            box-shadow: 0 0 0 2px var(--tg-theme-button-color);
        }

        .lesson-card.soon {
            box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.6);
        }

        .lesson-card.past {
            opacity: 0.66;
        }

        .lesson-card.has-subgroups {
            flex-direction: column;
            align-items: stretch;
        }

        .lesson-card.window-card {
            background: var(--tg-theme-secondary-bg-color);
            padding-top: 12px;
            padding-bottom: 12px;
            min-height: 0;
        }

        .lesson-card.window-card .pair-num,
        .lesson-card.window-card .lesson-subject,
        .lesson-card.window-card .info-row,
        .lesson-card.window-card .time-range {
            color: var(--tg-theme-hint-color);
        }

        .lesson-card.lunch-card .pair-num {
            font-size: 18px;
            letter-spacing: 0.02em;
        }

        .lesson-card.window-card .divider {
            background: linear-gradient(to bottom, rgba(120, 120, 125, 0.9), rgba(92, 92, 96, 0.7));
        }

        .lesson-card.window-card .info-row i {
            color: rgba(148, 163, 184, 0.88);
        }

        .lesson-card.window-card .lesson-subject {
            margin-bottom: 0;
        }

        .lesson-card .time-block {
            text-align: center;
            min-width: 50px;
            flex-shrink: 0;
        }

        .lesson-card .pair-num {
            font-size: 24px;
            font-weight: 800;
            color: var(--tg-theme-button-color);
            line-height: 1;
        }

        .lesson-card .time-range {
            font-size: 10px;
            color: var(--tg-theme-hint-color);
            margin-top: 2px;
        }

        .lesson-card .divider {
            width: 3px;
            min-height: 45px;
            align-self: stretch;
            background: linear-gradient(to bottom, var(--tg-theme-button-color), var(--tg-theme-link-color));
            border-radius: 2px;
            flex-shrink: 0;
        }

        .lesson-card .card-content {
            flex: 1;
            min-width: 0;
        }

        .lesson-card.single-subgroup-layout .subgroups-vertical {
            margin-top: 10px;
            padding-top: 10px;
            gap: 8px;
        }

        .lesson-card.single-subgroup-layout .subgroup-card {
            background: var(--tg-theme-bg-color);
            padding: 10px 11px;
        }

        .lesson-card .card-header {
            display: flex;
            align-items: center;
            gap: 14px;
            width: 100%;
        }

        .lesson-card .lesson-subject {
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 6px;
            line-height: 1.3;
            color: var(--tg-theme-text-color);
        }

        .lesson-card .info-details {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .lesson-card .info-row {
            font-size: 12px;
            color: var(--tg-theme-hint-color);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .lesson-card .info-row i {
            width: 14px;
            color: var(--tg-theme-button-color);
            font-size: 11px;
        }

        .lesson-card .room-badge {
            position: absolute;
            top: -10px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--tg-theme-button-color);
            color: var(--tg-theme-button-text-color);
            padding: 4px 12px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 700;
            white-space: nowrap;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
            z-index: 1;
        }

        /* Подгруппы */
        .lesson-card .subgroups-vertical {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 14px;
            padding-top: 14px;
            border-top: 1px dashed var(--tg-theme-hint-color);
        }

        .lesson-card .subgroup-card {
            background: var(--tg-theme-bg-color);
            border-radius: 10px;
            padding: 12px;
            border-left: 3px solid var(--tg-theme-button-color);
        }

        .lesson-card .subgroup-card:nth-child(2) {
            border-left-color: #22c55e;
        }

        .lesson-card .subgroup-card.green {
            border-left-color: #22c55e;
        }

        .lesson-card .subgroup-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .lesson-card .subgroup-badge {
            width: 22px;
            height: 22px;
            background: var(--tg-theme-button-color);
            color: var(--tg-theme-button-text-color);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 700;
        }

        .lesson-card .subgroup-badge.green {
            background: #22c55e;
        }

        .lesson-card .subgroup-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--tg-theme-text-color);
        }

        .lesson-card .subgroup-details {
            display: flex;
            flex-direction: column;
            gap: var(--space-2);
        }

        .lesson-card .subgroup-badge-inline {
            font-size: 12px;
            color: var(--tg-theme-hint-color, #6b7280);
            font-weight: 600;
            margin-left: 4px;
        }

        .lesson-card .room-inline {
            background: var(--tg-theme-button-color);
            color: var(--tg-theme-button-text-color);
            padding: 2px 8px;
            border-radius: 5px;
            font-size: 12px;
            font-weight: 600;
        }

        .lesson-card .room-inline.green {
            background: #22c55e;
        }


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

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

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

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

        /* Светлая тема для карточек */
        .light-theme .lesson-card.current {
            background: linear-gradient(135deg, #e6f6f3 0%, #ffffff 58%);
            border-color: #0f766e;
            box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.2), var(--shadow-sm);
        }

        .light-theme .lesson-card.soon {
            box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.45), var(--shadow-sm);
        }

        .light-theme .lesson-card.window-card {
            background: var(--tg-theme-secondary-bg-color);
        }

        .light-theme .lesson-card .subgroups-vertical {
            border-top-color: #d4d4d8;
        }

        .light-theme .lesson-card.single-subgroup-layout .subgroup-card {
            background: var(--tg-theme-bg-color);
        }

        .light-theme .context-pill {
            background: rgba(15, 118, 110, 0.12);
            color: #0f766e;
        }

        .light-theme .mode-banner {
            background: #eef8f6;
            border-bottom-color: var(--tg-theme-section-separator-color);
        }

        .light-theme .mode-banner-action {
            background: rgba(15, 118, 110, 0.12);
            border-color: rgba(15, 118, 110, 0.22);
        }

        .light-theme .search-quick-action,
        .light-theme .search-hint {
            background: #ffffff;
            border-color: var(--tg-theme-section-separator-color);
        }

        .light-theme .install-screen,
        .light-theme .group-select-screen,
        .light-theme .download-screen {
            background: var(--tg-theme-bg-color);
            color: var(--tg-theme-text-color);
        }

        .light-theme .group-select-back,
        .light-theme .download-info,
        .light-theme .status-card,
        .light-theme .action-toast,
        .light-theme .update-toast,
        .light-theme .download-btn-secondary {
            background: #ffffff;
            border: 1px solid var(--tg-theme-section-separator-color);
            color: var(--tg-theme-text-color);
        }

        .light-theme .download-progress {
            background: #dbe6f2;
        }

        .light-theme .download-screen .push-toggle-row {
            border-top-color: var(--tg-theme-section-separator-color);
        }

        /* Экран скачивания расписания */
        .download-screen {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--color-bg, #ffffff);
            z-index: 1100;
            overflow-y: auto;
            opacity: 0;
        }

        .download-screen.show {
            display: block;
            opacity: 1;
        }

        .download-screen-content {
            padding: 40px 24px;
            max-width: 400px;
            margin: 0 auto;
        }

        .download-info {
            background: var(--color-surface, #f4f4f5);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 20px;
        }

        .download-info-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 13px;
            color: var(--tg-theme-text-color);
            padding: 6px 0;
        }

        .download-info-item span:first-child {
            color: var(--tg-theme-hint-color, #71717a);
        }

        .download-progress {
            width: 100%;
            height: 6px;
            background: var(--tg-theme-secondary-bg-color, #e4e4e7);
            border-radius: 3px;
            overflow: hidden;
            margin-bottom: 20px;
            transform-origin: top;
            will-change: transform, opacity;
        }

        .download-progress-bar {
            height: 100%;
            background: var(--tg-theme-button-color, #3b82f6);
            border-radius: 3px;
            width: 0%;
            transition: width 0.3s var(--ease-standard);
        }

        .download-btn {
            width: 100%;
            padding: 14px;
            background: var(--tg-theme-button-color, #3b82f6);
            color: var(--tg-theme-button-text-color, #ffffff);
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .download-btn:active {
            transform: scale(0.98);
        }

        .download-btn-secondary {
            background: var(--color-surface, #f4f4f5);
            color: var(--tg-theme-text-color, #000000);
        }

        .download-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        /* Переключатель уведомлений в экране скачивания */
        .download-screen .push-toggle-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: var(--space-4);
            margin: 16px 0 0;
            padding: 16px 0;
            border-top: 1px solid var(--tg-theme-section-separator-color, #e4e4e7);
        }

        .download-screen .push-toggle-row .push-toggle-label {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 15px;
            color: var(--tg-theme-text-color);
            flex: 1;
            min-width: 0;
        }

        .download-screen .push-toggle-row .push-toggle-label i {
            color: var(--tg-theme-link-color);
            width: 20px;
            text-align: center;
            flex-shrink: 0;
        }

        .download-screen .push-toggle-row .toggle-switch {
            flex-shrink: 0;
        }

        .download-screen .push-status {
            font-size: 12px;
            color: var(--tg-theme-hint-color);
            margin: 4px 0 20px 0;
            padding: 0;
            text-align: left;
            line-height: 1.4;
        }

        /* Модалка обновления расписания */
        .update-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 1200;
            align-items: center;
            justify-content: center;
            padding: 20px;
            opacity: 0;
        }

        .update-modal.show {
            display: flex;
            opacity: 1;
        }

        .update-modal-content {
            background: var(--color-surface, #ffffff);
            border-radius: 16px;
            padding: 28px 24px;
            max-width: 320px;
            width: 100%;
            text-align: center;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            will-change: transform, opacity;
        }

        .update-icon {
            font-size: 48px;
            color: var(--tg-theme-link-color, #3b82f6);
            margin-bottom: 16px;
        }

        .update-modal-content h3 {
            margin: 0 0 8px 0;
            font-size: 18px;
            color: var(--tg-theme-text-color);
        }

        .update-modal-content p {
            margin: 0 0 20px 0;
            font-size: 16px;
            color: var(--tg-theme-hint-color, #71717a);
            line-height: 1.5;
        }

        /* Офлайн-баннер */
        .offline-banner {
            text-align: left;
            padding: 7px 16px;
            font-size: 11px;
            font-weight: 500;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 6px;
            border-bottom: 1px solid var(--color-border);
            will-change: transform, opacity;
        }

        .offline-banner i {
            font-size: 11px;
            opacity: 0.9;
        }

        .offline-banner[data-variant="offline"] {
            background: rgba(245, 158, 11, 0.14);
            color: #fbbf24;
        }

        .offline-banner[data-variant="context"] {
            background: rgba(37, 99, 235, 0.14);
            color: #93c5fd;
        }

        .offline-banner[data-variant="warning"] {
            background: rgba(239, 68, 68, 0.14);
            color: #fca5a5;
        }

        .status-card {
            border: 1px solid var(--color-border);
            border-radius: 16px;
            padding: 18px 16px;
            background: var(--color-surface);
            text-align: center;
            color: var(--color-text);
            box-shadow: var(--shadow-sm);
        }

        .status-card i {
            font-size: 20px;
            margin-bottom: 10px;
            color: var(--color-accent);
        }

        .status-card-title {
            font-size: 15px;
            font-weight: 700;
            margin-bottom: 6px;
        }

        .status-card-text {
            font-size: 13px;
            color: var(--color-muted);
            line-height: 1.45;
        }

        .status-card.error i,
        .status-card.error .status-card-title {
            color: #ef4444;
        }

        .status-card.success i {
            color: #22c55e;
        }

        .offline-banner.hidden {
            display: none;
        }

        .mode-banner {
            will-change: transform, opacity;
        }

        .list-load-more-wrap {
            padding: 12px 16px 20px;
        }

        .list-load-more-btn {
            width: 100%;
        }

        .update-toast {
            position: fixed;
            left: 12px;
            right: 12px;
            bottom: 16px;
            z-index: 1200;
            display: none;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 12px;
            border-radius: 12px;
            background: var(--color-surface);
            border: 1px solid var(--color-border);
            box-shadow: var(--shadow-md);
            will-change: transform, opacity;
        }

        .update-toast.show {
            display: flex;
        }

        .update-toast button {
            min-width: 120px;
        }

        .update-toast .view-btn {
            flex: 0 0 auto;
            min-height: 40px;
            padding: 8px 12px;
        }

        .action-toast {
            position: fixed;
            left: 12px;
            right: 12px;
            bottom: 16px;
            z-index: 1250;
            padding: 12px 14px;
            border-radius: 14px;
            border: 1px solid var(--color-border);
            background: var(--color-surface);
            color: var(--color-text);
            box-shadow: var(--shadow-md);
            display: none;
            align-items: center;
            gap: 10px;
            will-change: transform, opacity;
        }

        .action-toast.show {
            display: flex;
        }

        .action-toast i {
            color: var(--color-accent);
        }

        @media (prefers-reduced-motion: reduce) {
            :root {
                --motion-fast: 80ms;
                --motion-base: 110ms;
                --motion-emphasis: 120ms;
                --motion-toast-out: 80ms;
                --motion-banner-out: 80ms;
                --motion-enter-x: 0px;
                --motion-exit-x: 0px;
                --motion-enter-y: 0px;
                --motion-sheet-y: 0px;
                --motion-toast-y: 0px;
                --motion-banner-y: 0px;
            }

            .skeleton-line,
            #scheduleContainer[data-startup-shell="1"] .skeleton-line {
                animation: none;
            }

            .is-entering,
            .is-exiting,
            .stagger-item,
            .stagger-item.current-glow,
            .motion-spin-once,
            #scheduleContainer.slide-in-left,
            #scheduleContainer.slide-in-right,
            .search-pane.slide-out-left,
            .search-pane.slide-out-right,
            .search-pane.slide-in-left,
            .search-pane.slide-in-right,
            .next-lesson-summary.motion-update,
            .next-lesson-summary.motion-update .next-lesson-summary-title,
            .next-lesson-summary.motion-update .next-lesson-summary-subject,
            .next-lesson-summary.motion-update .next-lesson-summary-detail,
            .next-lesson-summary.motion-update .next-lesson-summary-detail.status {
                animation-duration: 80ms !important;
                animation-delay: 0ms !important;
            }

            .next-lesson-summary::after,
            .next-lesson-summary.motion-update::after {
                animation: none !important;
                opacity: 0 !important;
            }

            .stagger-item,
            .stagger-item.current-glow,
            .motion-spin-once {
                animation-name: motionEnter !important;
            }
        }
