:root {
    color-scheme: light;
    --bg: #f4f9ff;
    --panel: rgba(255, 255, 255, 0.94);
    --panel-strong: #ffffff;
    --line: rgba(37, 99, 235, 0.12);
    --text: #10233e;
    --muted: #5f7491;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --warm: #f59e0b;
    --danger: #e11d48;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.academy-shell,
body.academy-page {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(125, 211, 252, 0.22), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #eef5ff 52%, #f4f9ff 100%);
    color: var(--text);
    font-family: 'Manrope', sans-serif;
}

a {
    color: inherit;
}

::selection {
    background: rgba(37, 99, 235, 0.18);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.18);
}

::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.3);
    border-radius: 999px;
}

.page-orb {
    position: fixed;
    inset: auto;
    width: 30rem;
    height: 30rem;
    border-radius: 999px;
    filter: blur(110px);
    pointer-events: none;
    opacity: 0.38;
    z-index: -1;
}

.page-orb-a {
    top: -8rem;
    left: -10rem;
    background: rgba(37, 99, 235, 0.18);
}

.page-orb-b {
    right: -10rem;
    top: 10rem;
    background: rgba(59, 130, 246, 0.15);
}

.glass-nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(37, 99, 235, 0.12);
}

.eyebrow,
.metric-label,
.revision-label {
    color: #7dd3fc;
    text-transform: uppercase;
    letter-spacing: 0.26em;
    font-size: 0.75rem;
    font-weight: 700;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.8rem);
    line-height: 0.96;
    font-weight: 800;
    max-width: 12ch;
}

.hero-copy {
    color: var(--muted);
    max-width: 42rem;
    font-size: 1.05rem;
    line-height: 1.75;
}

.hero-panel,
.panel-card,
.metric-card,
.quiz-card,
.study-rail-block,
.exam-panel,
.hero-card,
.stat-chip {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.08);
    backdrop-filter: blur(18px);
}

.hero-panel,
.panel-card {
    border-radius: 1.5rem;
}

.hero-panel {
    padding: 1.25rem;
}

.hero-panel-grid {
    display: grid;
    gap: 1rem;
}

.hero-card {
    border-radius: 1.25rem;
    padding: 1.25rem;
}

.hero-card-accent {
    background: linear-gradient(145deg, rgba(219, 234, 254, 0.95), rgba(239, 246, 255, 0.98));
}

.hero-card-kicker {
    display: inline-flex;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #a5f3fc;
    margin-bottom: 0.75rem;
}

.hero-card h2 {
    margin: 0 0 0.6rem;
    font-size: 1.2rem;
    font-weight: 800;
}

.hero-card p,
.stat-chip-label,
.metric-subtext,
.section-head span {
    color: var(--muted);
    font-size: 0.92rem;
}

.primary-cta,
.secondary-cta,
.danger-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-cta {
    background: linear-gradient(135deg, var(--accent) 0%, #60a5fa 100%);
    color: white;
}

.secondary-cta {
    background: rgba(255, 255, 255, 0.95);
    color: #16325c;
    border: 1px solid rgba(37, 99, 235, 0.14);
}

.danger-cta {
    background: rgba(244, 63, 94, 0.18);
    color: #fecdd3;
    border: 1px solid rgba(251, 113, 133, 0.28);
    padding: 0.7rem 1rem;
    border-radius: 0.85rem;
}

.primary-cta:hover,
.secondary-cta:hover,
.danger-cta:hover,
.course-pill:hover,
.nav-pill:hover,
.topic-pill:hover,
.search-result-item:hover,
.reference-chip:hover {
    transform: translateY(-1px);
}

.stat-chip {
    border-radius: 1.1rem;
    padding: 1rem 1.1rem;
}

.stat-chip strong {
    display: block;
    margin-top: 0.35rem;
    color: #10233e;
}

.continue-card {
    width: 100%;
    text-align: left;
    border-radius: 1.25rem;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.92));
    padding: 1.1rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.continue-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.1);
}

.brand-mark {
    width: 2.65rem;
    height: 2.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.95rem;
    background: linear-gradient(135deg, #1d4ed8, #60a5fa);
    color: white;
    font-weight: 800;
    font-size: 1.15rem;
}

.nav-pill,
.course-pill,
.mini-badge,
.reference-chip {
    border: 1px solid rgba(37, 99, 235, 0.1);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 999px;
}

.nav-pill {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    color: #33527b;
}

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

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nav-pill-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-avatar-badge {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.7rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(125, 211, 252, 0.22));
    color: #12356a;
    font-weight: 800;
    overflow: hidden;
}

.nav-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-pill-active,
.course-pill-active {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.28);
    color: #12356a;
}

.search-input,
.note-input,
.exam-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(37, 99, 235, 0.12);
    color: var(--text);
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus,
.note-input:focus,
.exam-input:focus {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.search-results {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    right: 0;
    border-radius: 1.1rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    overflow: hidden;
    box-shadow: 0 24px 50px rgba(37, 99, 235, 0.12);
}

.google-signin-slot {
    min-height: 44px;
}

.selection-menu {
    position: absolute;
    z-index: 120;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.65rem;
    border-radius: 1rem;
    background: rgba(8, 17, 31, 0.96);
    box-shadow: 0 18px 35px rgba(8, 17, 31, 0.28);
}

.selection-menu button {
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
}

.search-result-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 1rem;
    text-align: left;
    transition: background 0.18s ease;
}

.search-result-item span {
    font-size: 0.85rem;
    color: var(--muted);
}

.metric-card {
    border-radius: 1.3rem;
    padding: 1.25rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 0.45rem;
    color: #10233e;
}

.course-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.workspace-grid {
    display: grid;
    gap: 1.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.workspace-container {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.workspace-container.workspace-wide {
    max-width: 1720px;
    width: 100%;
}

.panel-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.6rem;
    background: rgba(15, 23, 42, 0.8);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.panel-toggle-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    color: #ffffff;
    border-color: rgba(59, 130, 246, 0.35);
}

.panel-toggle-btn.active {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.4);
}


.panel-collapse-trigger {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.panel-collapse-trigger:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #ffffff;
}

.side-panel-collapse-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.side-panel-collapse-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    transform: translateY(-1px);
}

.workspace-panel {
    min-height: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.workspace-panel-scroll {
    min-height: 0;
}

.mobile-panel-toggle {
    display: none;
}

.unit-card {
    border: 1px solid rgba(37, 99, 235, 0.08);
    border-radius: 1rem;
    padding: 0.95rem;
    background: rgba(248, 251, 255, 0.95);
}

.unit-card-active {
    border-color: rgba(37, 99, 235, 0.24);
    background: rgba(219, 234, 254, 0.7);
}

.unit-trigger,
.unit-toggle {
    border: 0;
    background: transparent;
}

.unit-trigger {
    flex: 1;
    width: 100%;
    text-align: left;
}

.unit-toggle {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    background: rgba(255, 255, 255, 0.92);
    color: #1d4ed8;
    font-size: 1.15rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topic-pill {
    width: 100%;
    text-align: left;
    border-radius: 0.9rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.95);
    color: #1f3657;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.topic-pill-active {
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(219, 234, 254, 0.72);
}

.topic-pill-icons {
    color: #2563eb;
    display: inline-flex;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.topic-prose {
    color: #274164;
    line-height: 1.8;
}

.topic-prose h3,
.topic-prose h4 {
    color: #10233e;
}

.topic-prose table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 1rem;
}

.topic-prose th,
.topic-prose td {
    padding: 0.85rem;
}

.topic-prose tbody tr {
    transition: transform 0.18s ease, background 0.18s ease;
}

.topic-prose tbody tr:hover {
    transform: translateX(4px);
    background: rgba(37, 99, 235, 0.05);
}

.content-shell {
    max-width: 62rem;
}

.topic-fold {
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.topic-fold-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    padding: 1rem 1.2rem;
    font-weight: 800;
    color: #10233e;
}

.topic-fold-summary::-webkit-details-marker {
    display: none;
}

.topic-fold-hint {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.topic-fold-body {
    padding: 0 1.2rem 1.2rem;
}

.revision-banner,
.exam-panel,
.study-rail-block,
.quiz-card {
    border-radius: 1.25rem;
    padding: 1.25rem;
}

.revision-banner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.2rem;
    background: linear-gradient(140deg, rgba(219, 234, 254, 0.9), rgba(239, 246, 255, 0.95));
    border: 1px solid rgba(37, 99, 235, 0.16);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-head h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #10233e;
    margin: 0;
}

.quiz-option {
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(37, 99, 235, 0.1);
    background: rgba(255, 255, 255, 0.95);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.quiz-option:hover:enabled {
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(219, 234, 254, 0.55);
}

.quiz-option-correct {
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(16, 185, 129, 0.14);
}

.quiz-option-wrong {
    border-color: rgba(251, 113, 133, 0.42);
    background: rgba(244, 63, 94, 0.12);
}

.quiz-option-muted {
    opacity: 0.56;
}

.quiz-feedback {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1px solid transparent;
}

.quiz-feedback-correct {
    color: #bbf7d0;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(52, 211, 153, 0.26);
}

.quiz-feedback-wrong {
    color: #fecdd3;
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(251, 113, 133, 0.22);
}

.reference-chip {
    padding: 0.8rem 1rem;
    color: #16325c;
}

.timer-pill {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.24);
}

.note-input {
    min-height: 12rem;
    resize: vertical;
}

.exam-input {
    min-height: 9rem;
    resize: vertical;
}

.exam-input-tall {
    min-height: 13rem;
}

.modal-shell {
    width: min(95vw, 84rem);
    border-radius: 1.4rem;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(37, 99, 235, 0.12);
}

.student-highlight {
    background: linear-gradient(120deg, rgba(191, 219, 254, 0.95), rgba(147, 197, 253, 0.9));
    color: #0f2f61;
    border-radius: 0.35rem;
    padding: 0 0.2rem;
}

.academy-shell .text-white,
.academy-page .text-white {
    color: #10233e !important;
}

.academy-shell .text-gray-400,
.academy-shell .text-gray-300,
.academy-page .text-gray-400,
.academy-page .text-gray-300 {
    color: #5f7491 !important;
}

.academy-shell .bg-gray-900,
.academy-shell .bg-gray-800,
.academy-shell .bg-gray-700,
.academy-page .bg-gray-900,
.academy-page .bg-gray-800,
.academy-page .bg-gray-700 {
    background: #f8fbff !important;
}

.academy-shell .border-gray-700,
.academy-shell .border-gray-800,
.academy-page .border-gray-700,
.academy-page .border-gray-800 {
    border-color: rgba(37, 99, 235, 0.14) !important;
}

.academy-shell .text-gray-200,
.academy-page .text-gray-200 {
    color: #21406c !important;
}

.academy-shell .divide-gray-700 > :not([hidden]) ~ :not([hidden]),
.academy-shell .divide-gray-800 > :not([hidden]) ~ :not([hidden]),
.academy-page .divide-gray-700 > :not([hidden]) ~ :not([hidden]),
.academy-page .divide-gray-800 > :not([hidden]) ~ :not([hidden]) {
    border-color: rgba(37, 99, 235, 0.12) !important;
}

.academy-shell .bg-red-900\/30,
.academy-page .bg-red-900\/30 {
    background: rgba(254, 226, 226, 0.9) !important;
}

.academy-shell .text-red-200,
.academy-page .text-red-200 {
    color: #9f1239 !important;
}

.academy-shell .text-purple-300,
.academy-page .text-purple-300,
.academy-shell .text-indigo-400,
.academy-page .text-indigo-400,
.academy-shell .text-blue-300,
.academy-page .text-blue-300,
.academy-shell .text-blue-400,
.academy-page .text-blue-400,
.academy-shell .text-green-400,
.academy-page .text-green-400,
.academy-shell .text-yellow-400,
.academy-page .text-yellow-400,
.academy-shell .text-orange-400,
.academy-page .text-orange-400 {
    color: #2563eb !important;
}

.academy-shell .bg-black\/50,
.academy-page .bg-black\/50 {
    background: rgba(239, 246, 255, 0.95) !important;
}

.empty-state {
    padding: 4rem 1rem;
    text-align: center;
}

.reveal {
    animation: fadeSlideUp 0.65s ease both;
}

.rise-in {
    animation-delay: 80ms;
}

.rise-in-delayed {
    animation-delay: 180ms;
}

.hero-exit {
    animation: heroFadeOut 0.38s ease forwards;
}

.academy-footer {
    margin-top: 3rem;
    background: rgba(8, 17, 31, 0.92);
    border-top: 1px solid rgba(96, 165, 250, 0.18);
}

.profile-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.profile-name-input {
    min-width: min(100%, 16rem);
}

.progress-row {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(37, 99, 235, 0.1);
    background: rgba(248, 251, 255, 0.92);
}

.progress-bar {
    margin-top: 0.8rem;
    height: 0.7rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb 0%, #7dd3fc 100%);
}

.summary-list {
    display: grid;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: capitalize;
    border: 1px solid rgba(37, 99, 235, 0.14);
}

.status-synced {
    color: #0f766e;
    background: rgba(45, 212, 191, 0.12);
}

.status-local-only,
.status-cloud-error {
    color: #8a4b08;
    background: rgba(245, 158, 11, 0.14);
}

.social-card,
.chat-message {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(37, 99, 235, 0.08);
    background: rgba(248, 251, 255, 0.94);
}

.chat-thread {
    display: grid;
    gap: 0.85rem;
    max-height: 24rem;
    overflow: auto;
}

.chat-thread-whatsapp {
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.95), rgba(226, 232, 240, 0.9));
    border: 1px solid rgba(37, 99, 235, 0.08);
    border-radius: 1.25rem;
    padding: 1rem;
}

.chat-bubble {
    max-width: 86%;
}

.chat-bubble-own {
    margin-left: auto;
    background: rgba(219, 234, 254, 0.98);
    border-color: rgba(37, 99, 235, 0.16);
}

.chat-bubble-peer {
    margin-right: auto;
    background: rgba(255, 255, 255, 0.98);
}

.avatar-shell {
    width: 9rem;
    height: 9rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.95), rgba(239, 246, 255, 0.98));
    color: #16325c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    overflow: hidden;
}

.avatar-shell-small {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    font-size: 1.2rem;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 1280px) {
    .workspace-grid {
        grid-template-columns: 280px minmax(0, 1fr) 320px;
        align-items: start;
    }

    .workspace-grid.left-collapsed:not(.right-collapsed) {
        grid-template-columns: auto minmax(0, 1fr) 320px;
    }

    .workspace-grid.right-collapsed:not(.left-collapsed) {
        grid-template-columns: 280px minmax(0, 1fr) auto;
    }

    .workspace-grid.left-collapsed.right-collapsed {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .workspace-grid.left-collapsed .workspace-panel-left {
        display: none !important;
    }

    .workspace-grid.right-collapsed .workspace-panel-right {
        display: none !important;
    }

    .workspace-panel {
        position: sticky;
        top: 6.75rem;
        height: calc(100vh - 8.5rem);
    }

    .workspace-panel-center {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        width: 100%;
        min-width: 0;
    }

    .workspace-panel-left,
    .workspace-panel-right {
        overflow: hidden;
    }

    .workspace-panel-left .workspace-panel-scroll,
    .workspace-panel-right.workspace-panel-scroll,
    .workspace-panel-center .workspace-panel-scroll {
        overflow-y: auto;
    }

    .workspace-panel-left .workspace-panel-scroll {
        max-height: calc(100vh - 14.5rem);
        padding-right: 0.25rem;
    }

    .topic-content-scroll {
        overscroll-behavior: contain;
    }
}

@media (max-width: 1279px) {
    .mobile-panel-toggle {
        display: inline-flex;
    }

    .workspace-mobile-hidden,
    .workspace-grid.left-collapsed .workspace-panel-left,
    .workspace-grid.right-collapsed .workspace-panel-right {
        display: none !important;
    }

    .workspace-panel-left,
    .workspace-panel-right {
        height: auto;
    }
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.95rem 0.8rem;
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
    text-align: left;
    color: #274164;
}

.admin-table tbody tr {
    cursor: pointer;
    transition: background 0.18s ease;
}

.admin-table tbody tr:hover,
.admin-row-active {
    background: rgba(219, 234, 254, 0.6);
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroFadeOut {
    to {
        opacity: 0;
        transform: scale(0.98);
    }
}

@media (max-width: 1024px) {
    .hero-title {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .metric-value {
        font-size: 1.6rem;
    }

    .modal-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===================================================
   Enhanced Practice Modules & Interactive Modes
   =================================================== */

.practice-mode-tab {
    padding: 0.32rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid rgba(37, 99, 235, 0.2);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}

.practice-mode-tab:hover {
    border-color: rgba(37, 99, 235, 0.4);
    background: rgba(255, 255, 255, 0.95);
}

.practice-mode-tab.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* Flashcard 3D Interactive Container */
.flashcard-wrapper {
    perspective: 1000px;
    width: 100%;
    min-height: 280px;
    cursor: pointer;
}

.flashcard-card {
    position: relative;
    width: 100%;
    min-height: 280px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 1rem;
}

.flashcard-card.flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.08);
}

.flashcard-front {
    transform: rotateY(0deg);
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
    border-color: rgba(59, 130, 246, 0.35);
}

/* Speed Drill Streak Flame Pulse */
@keyframes streakPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

.streak-active {
    animation: streakPulse 1.2s infinite ease-in-out;
}

/* Lecture Playlist Sidebar & Collapsible Styling */
.side-panel-collapse-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(51, 65, 85, 0.6);
    cursor: pointer;
    transition: all 0.18s ease;
}

.side-panel-collapse-btn:hover {
    color: #ffffff;
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(96, 165, 250, 0.5);
}

.playlist-item {
    cursor: pointer;
    user-select: none;
}

