:root {
    color-scheme: dark;
    --bg: #07080b;
    --bg-soft: #101219;
    --panel: #151821;
    --panel-strong: #1c202b;
    --text: #f4f4f6;
    --muted: #a7acba;
    --line: rgba(255, 255, 255, .1);
    --red: #e50914;
    --gold: #f6c453;
    --cyan: #3dd6d0;
    --green: #4ade80;
    --danger: #fb7185;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 14% 8%, rgba(229, 9, 20, .28), transparent 28rem),
        radial-gradient(circle at 88% 16%, rgba(61, 214, 208, .12), transparent 24rem),
        linear-gradient(180deg, #090a0f 0%, #050609 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    padding: 13px 14px;
    outline: none;
}

select option {
    background: #11131a;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(246, 196, 83, .75);
    box-shadow: 0 0 0 3px rgba(246, 196, 83, .12);
}

button {
    cursor: pointer;
}

.login-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 440px);
    gap: 32px;
    min-height: 100vh;
    align-items: center;
    padding: 48px clamp(18px, 5vw, 80px);
}

.student-login-shell {
    grid-template-columns: minmax(560px, 720px) minmax(340px, 410px);
    justify-content: center;
    align-items: center;
    gap: clamp(28px, 4vw, 52px);
    min-height: calc(100vh - 58px);
    padding-inline: clamp(18px, 3vw, 40px);
}

.admin-login-shell {
    grid-template-columns: minmax(320px, 440px);
    justify-content: center;
    align-content: center;
    gap: 18px;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(229, 9, 20, .12), rgba(246, 196, 83, .08));
}

.login-brand {
    max-width: 760px;
}

.brand-mark {
    display: grid;
    width: 74px;
    height: 74px;
    place-items: center;
    border: 1px solid rgba(246, 196, 83, .45);
    border-radius: 8px;
    background: linear-gradient(135deg, #e50914, #7a1118 54%, #f6c453);
    font-weight: 950;
    letter-spacing: 0;
    box-shadow: 0 24px 80px rgba(229, 9, 20, .28);
}

.brand-logo {
    display: block;
    width: min(420px, 70vw);
    max-height: 180px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .55));
}

.login-media-panel {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 48px;
    width: 100%;
    max-width: 720px;
    justify-self: center;
}

.login-media-panel .brand-logo {
    width: min(190px, 42vw);
    max-height: 70px;
    object-position: center;
}

.login-video-box {
    position: relative;
    width: 100%;
    max-width: 720px;
    overflow: hidden;
    border: 1px solid rgba(246, 196, 83, .2);
    border-radius: var(--radius);
    aspect-ratio: 16 / 9;
    background: #000;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

.student-login-shell .auth-card {
    width: 100%;
    max-width: 410px;
    min-height: 405px;
    justify-self: center;
}

.student-login-shell .auth-card h2 {
    font-size: 1.9rem;
    line-height: 1.12;
}

.login-video-box iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.youtube-protected iframe {
    pointer-events: none;
}

.video-sound-button {
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 3;
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .36);
    border-radius: 50%;
    padding: 0;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, .5);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .45);
    backdrop-filter: blur(10px);
    transition: opacity .2s ease, transform .2s ease, background .2s ease;
}

.video-sound-button span {
    display: block;
    width: 0;
    height: 0;
    margin-left: 5px;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 22px solid #fff;
}

.video-sound-button:hover {
    background: rgba(229, 9, 20, .8);
    transform: translate(-50%, -50%) scale(1.04);
}

.video-sound-button.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.9);
}

.login-video-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: rgba(255, 255, 255, .58);
    font-weight: 900;
    background:
        radial-gradient(circle at 50% 0%, rgba(246, 196, 83, .12), transparent 16rem),
        linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.auth-card h1,
.auth-card h2,
.topbar h1,
.student-header h1 {
    margin: 0;
    letter-spacing: 0;
}

.login-copy {
    max-width: 560px;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.65;
}

.login-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.login-metrics span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    padding: 10px 14px;
    color: var(--text);
}

.auth-card,
.panel,
.data-section,
.question-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(17, 19, 26, .86);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
}

.auth-card {
    padding: 30px;
}

.auth-card h2 {
    font-size: 2rem;
    margin-bottom: 22px;
}

.form-stack {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 700;
}

.primary-button,
.secondary-button,
.comment-form button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    border: 0;
    border-radius: var(--radius);
    padding: 12px 18px;
    color: white;
    font-weight: 900;
}

.primary-button {
    background: linear-gradient(135deg, #e50914, #b50610);
}

.secondary-button {
    background: linear-gradient(135deg, #f6c453, #b7791f);
    color: #100d06;
}

.subtle-link,
.helper-text {
    display: inline-block;
    margin-top: 18px;
    color: var(--muted);
}

.login-footer {
    width: 100%;
    padding: 0 18px 24px;
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.4;
    text-align: center;
}

.student-login-footer {
    display: block;
    margin: -10px auto 0;
    padding-bottom: 28px;
}

.login-footer a,
.student-credit a {
    color: var(--gold);
    font-weight: 900;
}

.admin-login-footer {
    align-self: start;
}

.alert,
.floating-alert,
.empty-state {
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 18px 0;
    font-weight: 800;
}

.alert-success {
    background: rgba(74, 222, 128, .14);
    color: #bbf7d0;
}

.alert-error {
    background: rgba(251, 113, 133, .14);
    color: #fecdd3;
}

.admin-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 60px;
}

.topbar,
.student-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.topbar nav,
.student-header a {
    display: flex;
    gap: 10px;
}

.topbar nav a,
.student-header a {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 14px;
    background: rgba(255, 255, 255, .05);
    color: var(--muted);
    font-weight: 800;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0;
}

.stat-grid article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035));
}

.stat-grid strong {
    display: block;
    font-size: 2rem;
}

.stat-grid span {
    color: var(--muted);
    font-weight: 800;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.panel,
.data-section {
    padding: 22px;
}

.panel h2,
.data-section h2,
.question-card h2 {
    margin: 0 0 18px;
}

.wide {
    grid-column: 1 / -1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.full {
    grid-column: 1 / -1;
}

.data-section {
    margin-top: 18px;
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 10px;
    text-align: left;
}

th {
    color: var(--gold);
    font-size: .82rem;
    text-transform: uppercase;
}

td {
    color: var(--muted);
}

code {
    color: var(--cyan);
    font-weight: 900;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.danger-button {
    min-height: 34px;
    border: 1px solid rgba(251, 113, 133, .38);
    border-radius: var(--radius);
    padding: 8px 12px;
    background: rgba(251, 113, 133, .12);
    color: #fecdd3;
    font-size: .82rem;
    font-weight: 900;
}

.danger-button:hover {
    border-color: rgba(251, 113, 133, .78);
    background: rgba(251, 113, 133, .22);
}

.lesson-list,
.comment-board,
.status-list,
.setup-notes {
    display: grid;
    gap: 12px;
}

.status-list p,
.setup-notes p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.lesson-list article {
    display: grid;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: rgba(255, 255, 255, .045);
}

.drive-file-card {
    grid-template-columns: minmax(220px, .75fr) minmax(280px, 1.25fr);
    align-items: start;
    gap: 18px;
}

.drive-file-meta {
    display: grid;
    gap: 6px;
}

.drive-import-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, .65fr) minmax(96px, .35fr);
    gap: 12px;
}

.drive-import-form .primary-button {
    grid-column: 1 / -1;
}

.lesson-list span,
.question-card span,
.reel-caption span,
.lesson-info-box > span,
.lesson-comment-box > div > span {
    color: var(--gold);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.lesson-list small,
.question-card footer {
    color: var(--muted);
}

.student-mode {
    overflow-x: hidden;
    background:
        radial-gradient(circle at 16% 0%, rgba(229, 9, 20, .18), transparent 26rem),
        radial-gradient(circle at 92% 10%, rgba(246, 196, 83, .1), transparent 22rem),
        #050609;
}

.student-shell {
    width: min(1180px, calc(100% - 32px));
    min-height: calc(100vh - 46px);
    margin: 0 auto;
    padding: 24px 0 44px;
}

.student-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(180px, 320px) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 0 0 22px;
    background: rgba(10, 11, 15, .88);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .3);
    backdrop-filter: blur(16px);
}

.student-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0;
}

.student-brand img {
    width: min(176px, 38vw);
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .55));
}

.module-picker {
    display: grid;
    gap: 4px;
}

.module-picker label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.module-picker select {
    min-height: 44px;
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
    backdrop-filter: blur(10px);
    font-weight: 900;
}

.student-exit {
    justify-self: end;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
    padding: 11px 16px;
    color: var(--text);
    font-weight: 900;
    backdrop-filter: blur(10px);
}

.course-room {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    align-items: start;
    gap: 22px;
}

.lesson-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.lesson-player {
    overflow: hidden;
    border: 1px solid rgba(246, 196, 83, .2);
    border-radius: var(--radius);
    aspect-ratio: 16 / 9;
    background: #000;
    box-shadow: 0 24px 90px rgba(0, 0, 0, .44);
}

.lesson-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.lesson-info-box,
.lesson-comment-box,
.lesson-sidebar {
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius);
    background: rgba(17, 19, 26, .88);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
    padding: clamp(18px, 3vw, 26px);
}

.lesson-info-box h1,
.lesson-comment-box h2,
.lesson-sidebar h2 {
    margin: 8px 0 0;
    letter-spacing: 0;
}

.lesson-info-box h1 {
    font-size: clamp(1.65rem, 3vw, 2.55rem);
    line-height: 1.05;
}

.lesson-info-box p {
    max-width: 760px;
    margin: 12px 0 0;
    color: rgba(255, 255, 255, .78);
    line-height: 1.65;
}

.lesson-comment-box {
    display: grid;
    gap: 14px;
}

.lesson-box-heading h2,
.lesson-sidebar-heading h2 {
    font-size: 1.25rem;
}

.lesson-navigation {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 10px;
}

.next-lesson-button {
    min-width: 180px;
}

.lesson-end {
    color: var(--muted);
    font-weight: 800;
}

.lesson-sidebar {
    position: sticky;
    top: 94px;
    display: grid;
    gap: 14px;
    padding: 18px;
}

.lesson-sidebar-heading span {
    color: var(--gold);
    font-size: .76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.lesson-playlist {
    display: grid;
    gap: 10px;
    max-height: calc(100vh - 176px);
    overflow: auto;
    padding-right: 4px;
}

.lesson-playlist a {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: var(--radius);
    padding: 12px;
    background: rgba(255, 255, 255, .045);
}

.lesson-playlist a.is-current {
    border-color: rgba(246, 196, 83, .55);
    background: rgba(246, 196, 83, .11);
}

.lesson-playlist small {
    color: var(--gold);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.lesson-playlist strong {
    color: var(--text);
    line-height: 1.32;
}

.reels-feed {
    height: 100svh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    background: #000;
}

.reels-feed::-webkit-scrollbar {
    display: none;
}

.reel {
    position: relative;
    display: block;
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: #000;
}

.reel-video {
    position: absolute;
    inset: 0;
    background: #000;
}

.reel-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.reel-horizontal .reel-video {
    display: grid;
    place-items: center;
}

.reel-horizontal .reel-video iframe {
    width: min(100vw, calc(100vh * 16 / 9));
    height: min(100vh, calc(100vw * 9 / 16));
    box-shadow: 0 24px 90px rgba(0, 0, 0, .55);
}

.reel-gradient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .5), transparent 22%, transparent 56%, rgba(0, 0, 0, .82)),
        linear-gradient(90deg, rgba(0, 0, 0, .45), transparent 42%, rgba(0, 0, 0, .32));
}

.reel-caption {
    position: absolute;
    left: clamp(16px, 4vw, 48px);
    right: min(120px, 24vw);
    bottom: clamp(54px, 8vh, 96px);
    z-index: 4;
    max-width: 640px;
    display: grid;
    gap: 8px;
}

.reel-caption h2 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4.8rem);
    line-height: .95;
    text-shadow: 0 12px 28px rgba(0, 0, 0, .68);
}

.reel-caption p {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: 1rem;
    line-height: 1.55;
    text-shadow: 0 8px 20px rgba(0, 0, 0, .7);
}

.download-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.download-links a {
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(0, 0, 0, .48);
    padding: 9px 12px;
    color: white;
    font-size: .86rem;
    font-weight: 900;
    backdrop-filter: blur(10px);
}

.reel-action-rail {
    position: absolute;
    right: clamp(12px, 2.7vw, 34px);
    bottom: clamp(80px, 14vh, 140px);
    z-index: 8;
    display: grid;
    justify-items: center;
    gap: 10px;
}

.reel-action-rail form {
    display: grid;
    justify-items: center;
    gap: 6px;
}

.reel-action-rail span {
    color: white;
    font-size: .78rem;
    font-weight: 950;
    text-shadow: 0 6px 12px rgba(0, 0, 0, .8);
}

.action-button {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(0, 0, 0, .45);
    color: white;
    padding: 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .28);
}

.action-button svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.action-button.is-active {
    background: linear-gradient(135deg, #e50914, #f43f5e);
    border-color: rgba(255, 255, 255, .28);
}

.comment-drawer {
    position: absolute;
    right: clamp(14px, 3vw, 34px);
    bottom: clamp(16px, 5vh, 42px);
    z-index: 18;
    width: min(420px, calc(100vw - 28px));
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius);
    background: rgba(10, 11, 15, .9);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .55);
    backdrop-filter: blur(16px);
    padding: 20px;
    opacity: 0;
    transform: translateY(18px) scale(.98);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.comment-drawer.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.comment-drawer span {
    display: block;
    margin-right: 34px;
    color: var(--gold);
    font-size: .76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.comment-drawer h3 {
    margin: 8px 34px 14px 0;
    font-size: 1.4rem;
}

.comment-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: white;
    font-size: 1.35rem;
    line-height: 1;
}

.comment-form {
    display: grid;
    gap: 10px;
}

.comment-form textarea {
    background: rgba(255, 255, 255, .08);
}

.comment-form button {
    background: var(--text);
    color: #08090d;
}

.student-credit {
    position: static;
    z-index: auto;
    transform: none;
    padding: 0 16px 24px;
    color: rgba(255, 255, 255, .52);
    font-size: .76rem;
    font-weight: 700;
    text-align: center;
    pointer-events: auto;
}

.student-credit a {
    pointer-events: auto;
}

.student-empty {
    position: static;
    transform: none;
    width: min(420px, calc(100% - 32px));
    margin: 80px auto;
}

.student-mode .floating-alert {
    position: fixed;
    top: 82px;
    left: 50%;
    z-index: 40;
    width: min(520px, calc(100% - 28px));
    margin: 0;
    transform: translateX(-50%);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .36);
}

.question-card {
    padding: 20px;
}

.question-card p {
    color: var(--text);
    line-height: 1.65;
}

.empty-state {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .06);
    color: var(--muted);
}

@media (max-width: 1020px) {
    .student-login-shell {
        grid-template-columns: minmax(0, min(720px, 100%));
        min-height: auto;
        align-content: start;
        gap: 18px;
        padding: 24px clamp(14px, 4vw, 28px);
    }

    .login-media-panel {
        width: 100%;
        max-width: 720px;
    }

    .login-video-box {
        width: 100%;
        max-width: 720px;
    }

    .student-login-shell .auth-card {
        max-width: 520px;
        min-height: auto;
    }

    .login-footer {
        padding-bottom: 22px;
    }

    .student-login-footer {
        margin-top: 0;
        padding: 4px 16px 26px;
    }
}

@media (max-width: 860px) {
    .login-shell,
    .admin-grid,
    .form-grid,
    .drive-file-card,
    .drive-import-form {
        grid-template-columns: 1fr;
    }

    .login-shell {
        isolation: isolate;
        min-height: auto;
        padding: 26px 18px;
    }

    .login-shell::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: -2;
        background:
            radial-gradient(circle at 50% 8%, rgba(246, 196, 83, .16), transparent 18rem),
            linear-gradient(180deg, #08090d, #030406);
    }

    .login-shell::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: -1;
        background: radial-gradient(circle at 50% 12%, rgba(246, 196, 83, .18), transparent 18rem);
    }

    .brand-logo {
        width: min(360px, 88vw);
        object-position: center;
    }

    .login-media-panel {
        gap: 28px;
        max-width: 560px;
    }

    .login-media-panel .brand-logo {
        width: min(170px, 48vw);
        max-height: 62px;
    }

    .login-video-box {
        width: min(560px, 100%);
    }

    .auth-card {
        background: rgba(11, 12, 17, .82);
        backdrop-filter: blur(10px);
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .student-header {
        grid-template-columns: minmax(118px, 1fr) minmax(150px, 220px) auto;
        gap: 10px;
        padding: 12px;
    }

    .student-brand img {
        width: min(150px, 34vw);
    }

    .module-picker select {
        min-height: 40px;
        padding: 10px 12px;
        font-size: .86rem;
    }

    .student-exit {
        padding: 10px 12px;
        font-size: .86rem;
    }

    .student-shell {
        width: min(100% - 24px, 860px);
        padding-top: 16px;
    }

    .course-room {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .lesson-sidebar {
        position: static;
        order: -1;
    }

    .lesson-playlist {
        max-height: none;
        overflow: visible;
    }

    .lesson-navigation {
        justify-content: stretch;
    }

    .next-lesson-button {
        width: 100%;
    }

    .reel-caption {
        right: 84px;
        bottom: 74px;
    }

    .reel-caption h2 {
        font-size: 2.15rem;
    }

    .reel-caption p {
        font-size: .92rem;
    }

    .reel-action-rail {
        right: 12px;
        bottom: 112px;
    }

    .action-button {
        width: 48px;
        height: 48px;
    }

    .action-button svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 520px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .auth-card,
    .panel,
    .data-section {
        padding: 18px;
    }

    .student-login-shell {
        gap: 18px;
        align-content: start;
        padding-top: 18px;
    }

    .student-shell {
        width: min(100% - 20px, 560px);
        padding-top: 12px;
        padding-bottom: 30px;
    }

    .lesson-info-box,
    .lesson-comment-box,
    .lesson-sidebar {
        padding: 16px;
    }

    .lesson-info-box h1 {
        font-size: 1.55rem;
        line-height: 1.12;
    }

    .login-media-panel .brand-logo {
        width: min(145px, 52vw);
    }

    .student-header {
        grid-template-columns: 1fr auto;
        position: static;
    }

    .module-picker {
        grid-column: 1 / -1;
        order: 3;
    }

    .student-brand img {
        width: 152px;
    }

    .reel-caption {
        left: 14px;
        right: 76px;
        bottom: 62px;
    }

    .reel-caption h2 {
        font-size: 1.7rem;
    }

    .reel-caption p {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .comment-drawer {
        left: 10px;
        right: 10px;
        bottom: 18px;
        width: auto;
    }
}

.student-mode {
    background: #f4f5f7;
    color: #111827;
}

.member-shell {
    width: 100%;
    min-height: calc(100vh - 42px);
    margin: 0;
    padding: 0;
}

.member-topbar {
    display: grid;
    grid-template-columns: 190px 1fr auto;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 12px 22px;
}

.member-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.member-brand img {
    display: block;
    width: min(168px, 36vw);
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
}

.member-topbar > span {
    color: #6b7280;
    font-size: .9rem;
    font-weight: 800;
}

.member-exit {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    padding: 10px 14px;
    font-weight: 900;
}

.member-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 326px;
    align-items: start;
    min-height: calc(100vh - 74px);
}

.member-content {
    min-width: 0;
    background: #f4f5f7;
}

.member-player {
    display: grid;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(68vh, calc(100vw * 9 / 16));
    place-items: center;
    overflow: hidden;
    background: #232323;
}

.member-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.member-lesson-card,
.member-support-card,
.member-comments-card {
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 22px 24px;
}

.member-lesson-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.member-lesson-card span,
.member-card-heading span {
    color: #111827;
    font-size: .82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.member-lesson-card h1,
.member-card-heading h2 {
    margin: 8px 0 0;
    color: #111827;
    letter-spacing: 0;
}

.member-lesson-card h1 {
    font-size: clamp(1.35rem, 2vw, 2.1rem);
    line-height: 1.18;
}

.member-lesson-card p,
.member-muted {
    max-width: 760px;
    margin: 10px 0 0;
    color: #6b7280;
    line-height: 1.6;
}

.member-next-button {
    min-width: 164px;
    background: #111827;
}

.member-finished {
    color: #6b7280;
    font-weight: 800;
}

.member-support-card,
.member-comments-card {
    display: grid;
    gap: 14px;
}

.member-downloads a {
    border-color: #d1d5db;
    background: #f9fafb;
    color: #111827;
    backdrop-filter: none;
}

.member-comment-form {
    grid-template-columns: minmax(0, 1fr) 118px;
    align-items: end;
    gap: 12px;
}

.member-comment-form textarea {
    min-height: 48px;
    border-color: #d1d5db;
    background: #ffffff;
    color: #111827;
}

.member-comment-form button {
    min-height: 42px;
    border-radius: 8px;
    background: #6b777c;
    color: #ffffff;
}

.member-sidebar {
    position: sticky;
    top: 0;
    min-height: calc(100vh - 74px);
    max-height: calc(100vh - 74px);
    overflow: auto;
    border-left: 1px solid #e5e7eb;
    background: #ffffff;
}

.member-sidebar-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 18px 16px;
}

.member-sidebar-header h2 {
    margin: 0;
    color: #111827;
    font-size: 1.35rem;
}

.member-sidebar-header span {
    color: #6b7280;
    font-size: .82rem;
    font-weight: 800;
}

.member-module {
    border-bottom: 1px solid #eef0f3;
}

.member-module summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 16px;
    cursor: pointer;
    list-style: none;
    background: #f5f5f6;
}

.member-module summary::-webkit-details-marker {
    display: none;
}

.member-module summary strong {
    color: #111827;
    line-height: 1.35;
}

.member-module summary span {
    color: #111827;
    font-size: .78rem;
}

.member-module summary::after {
    content: "v";
    color: #111827;
    font-size: 1rem;
}

.member-module[open] summary::after {
    content: "^";
}

.member-lessons {
    display: grid;
    background: #ffffff;
}

.member-lessons p {
    margin: 0;
    padding: 14px 16px;
    color: #6b7280;
    font-size: .9rem;
}

.member-lessons a {
    display: grid;
    grid-template-columns: 18px 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 56px;
    border-bottom: 1px solid #f1f2f4;
    padding: 12px 16px;
    color: #111827;
}

.member-lessons a.is-current {
    background: #fff7df;
}

.member-check {
    width: 18px;
    height: 18px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
}

.member-lessons small {
    color: #111827;
    font-size: .94rem;
    font-weight: 700;
}

.member-lessons strong {
    overflow: hidden;
    color: #111827;
    font-size: .92rem;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.member-shell + .student-credit {
    background: #f4f5f7;
    color: #6b7280;
}

.member-shell + .student-credit a {
    color: #111827;
}

@media (max-width: 980px) {
    .member-layout {
        grid-template-columns: 1fr;
    }

    .member-sidebar {
        position: static;
        order: -1;
        min-height: 0;
        max-height: none;
        border-left: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .member-content {
        display: grid;
    }
}

@media (max-width: 640px) {
    .member-topbar {
        grid-template-columns: 1fr auto;
        padding: 10px 12px;
    }

    .member-topbar > span {
        display: none;
    }

    .member-brand img {
        width: 146px;
    }

    .member-layout {
        min-height: auto;
    }

    .member-lesson-card {
        grid-template-columns: 1fr;
        padding: 18px 14px;
    }

    .member-support-card,
    .member-comments-card {
        padding: 18px 14px;
    }

    .member-comment-form {
        grid-template-columns: 1fr;
    }

    .member-comment-form button,
    .member-next-button {
        width: 100%;
    }

    .member-sidebar-header {
        padding: 16px 14px;
    }

    .member-module summary,
    .member-lessons a {
        padding-inline: 14px;
    }
}
