:root {
    color-scheme: dark;
    --bg: #191b1d;
    --panel: #202224;
    --line: #393d40;
    --text: #def3f8;
    --muted: #a9b5bd;
    --green: #30dc88;
    --amber: #efc47b;
    --radius: 16px;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.shell { width: min(100% - 48px, 1120px); margin-inline: auto; }
.topbar { background: #1f2123; border-bottom: 1px solid #2b2e30; }
.topbar-inner { min-height: 68px; display: flex; align-items: center; justify-content: center; }
.brand { display: inline-flex; gap: 12px; align-items: center; font-size: 1.08rem; font-weight: 750; }
.brand-icon { display: inline-grid; place-items: center; width: 36px; height: 34px; padding-left: 2px; border-radius: 10px; background: #133c2a; color: var(--green); font-size: 0.95rem; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: .7rem; font-weight: 750; letter-spacing: .14em; }
.dot { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.button { display: inline-flex; width: fit-content; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); font-size: .88rem; font-weight: 700; }
.button:hover { border-color: #809096; }
.button.primary { background: var(--green); border-color: var(--green); color: #0c2318; }
.button.primary:hover { background: #68eca9; border-color: #68eca9; }
.button.subtle { background: transparent; }
.small { font-size: .87rem; }

.catalog { padding-block: 64px 88px; }
.section-intro { margin-bottom: 32px; }
.section-intro h1 { margin-block: 9px 10px; font-size: clamp(2.25rem, 6vw, 3.8rem); line-height: 1.08; letter-spacing: -.045em; }
.section-intro > p:last-child { color: var(--muted); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.product-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; transition: border-color .18s ease, transform .18s ease; }
.product-card:hover { border-color: #638172; transform: translateY(-3px); }
.cover { --cover-color: #56d49c; --cover-base: #153d2f; position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate; color: var(--cover-color); background: radial-gradient(ellipse at 90% 0%, var(--cover-base), #111b19 82%); }
.cover.theme-2 { --cover-color: #a8d8dc; --cover-base: #26464b; }
.cover.theme-3 { --cover-color: #c3bcf1; --cover-base: #423a56; }
.cover.theme-4 { --cover-color: #f0c58a; --cover-base: #493a2b; }
.cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.cover-rings { position: absolute; right: -8%; top: -38%; width: 76%; aspect-ratio: 1; border: 1px solid currentColor; border-radius: 50%; opacity: .19; }
.cover-rings::before, .cover-rings::after { content: ""; position: absolute; border: 1px solid currentColor; border-radius: 50%; inset: 13%; }
.cover-rings::after { inset: 26%; }
.cover-icon { border: 1px solid currentColor; border-radius: 16px; width: 54px; height: 54px; display: grid; place-items: center; font-size: 1.42rem; background: #151a1bb3; }
.cover-caption { position: absolute; left: 16px; bottom: 14px; font-size: .63rem; font-weight: 750; letter-spacing: .13em; }
.card-info { padding: 17px 18px 16px; }
.card-info h2 { font-size: 1.08rem; line-height: 1.3; overflow-wrap: anywhere; }
.status { display: flex; align-items: center; gap: 7px; margin-block: 9px 15px; font-size: .79rem; font-weight: 650; }
.available { color: var(--green); }
.pending { color: var(--amber); }
.card-action { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding-top: 12px; font-size: .85rem; font-weight: 650; }

.classroom { width: min(100% - 48px, 800px); padding-block: 43px 68px; }
.class-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; gap: 12px; padding-bottom: 24px; border-bottom: 1px solid #43474a; }
.class-heading h1 { font-size: clamp(1.4rem, 4.8vw, 2.35rem); line-height: 1.19; letter-spacing: -.03em; text-align: center; overflow-wrap: anywhere; }
.back-icon { display: grid; place-items: center; width: 42px; height: 42px; color: #accbd5; border-radius: 10px; font-size: 1.5rem; }
.back-icon:hover { background: var(--panel); color: var(--text); }
.lesson-section { padding-top: 24px; }
.lesson-title { margin-block: 7px 22px; color: var(--green); font-size: clamp(1.45rem, 4vw, 2rem); letter-spacing: -.025em; overflow-wrap: anywhere; }
.player { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); border: 1px solid #2b3030; overflow: hidden; background: #080b0a; }
.player iframe, .player video { display: block; border: 0; width: 100%; height: 100%; }
.player-empty { height: 100%; display: grid; align-content: center; justify-items: center; gap: 14px; color: var(--muted); font-size: .83rem; background: radial-gradient(ellipse at 50% 0%, #18231e, transparent 75%); }
.play-symbol { display: grid; place-items: center; width: clamp(48px, 10vw, 74px); height: clamp(48px, 10vw, 74px); border-radius: 50%; padding-left: 4px; color: #1a2924; background: #e1ece7; font-size: 1.25rem; }
.lesson-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; margin-top: 22px; color: #c6d1d7; }
.materials { margin-top: 23px; display: grid; gap: 8px; }
.materials h3 { font-size: .97rem; margin-bottom: 3px; }
.material { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.material:hover { border-color: var(--green); }
.pdf-tag { border-radius: 5px; padding: 4px 6px; background: #293d36; color: var(--green); font-size: .65rem; font-weight: 800; }
.download-icon { margin-left: auto; color: var(--green); }
.contents { margin-top: 38px; }
.contents-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.contents-title h2 { font-size: 1.38rem; letter-spacing: -.02em; }
.contents-title > span { color: var(--muted); font-size: .85rem; }
.module { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 13px; overflow: hidden; }
.module.active { border-color: #426554; }
.module.active::before { content: ""; position: absolute; inset: 0 auto auto 0; height: 66px; width: 4px; background: var(--green); }
.module summary { display: grid; grid-template-columns: 35px minmax(0, 1fr) 16px; gap: 13px; align-items: center; min-height: 66px; cursor: pointer; padding: 12px 17px; list-style: none; overflow-wrap: anywhere; }
.module summary::-webkit-details-marker { display: none; }
.module summary:hover { background: #26292b; }
.module summary small { display: block; color: var(--muted); margin-top: 4px; font-size: .76rem; }
.module summary strong { font-size: .95rem; }
.module-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: #b3c3ca; background: #2a2d30; font-size: 1.24rem; font-weight: 700; }
.chevron { width: 9px; height: 9px; transform: translateY(-2px) rotate(45deg); border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); }
.module[open] .chevron { transform: translateY(2px) rotate(225deg); }
.module-items { border-top: 1px solid var(--line); padding: 7px; }
.module-items a { display: flex; gap: 11px; align-items: center; padding: 12px; border-radius: 8px; overflow-wrap: anywhere; }
.module-items a:hover, .module-items a[aria-current] { background: #20332a; }
.module-items a[aria-current] { color: var(--green); }
.lesson-icon { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border-radius: 50%; background: #30363a; font-size: .58rem; }
.module-items a[aria-current] .lesson-icon { background: var(--green); color: #133123; }
.lesson-item-label { min-width: 0; }
.lesson-item-label small { display: block; margin-top: 3px; color: var(--muted); font-size: .73rem; }
.module-items a.featured-item { border: 1px solid #42ee9e; background: #192d24; box-shadow: 0 0 12px #30dc8840, inset 0 0 10px #30dc8819; margin: 5px; }
.module-items a.featured-item:hover, .module-items a.featured-item[aria-current] { background: #214331; }
.feature-badge { flex: none; margin-left: auto; padding: 3px 7px; border-radius: 5px; background: #173d2b; color: #91f4bd; font-size: .68rem; font-weight: 750; white-space: nowrap; }
.lesson-title .feature-badge { display: inline-block; vertical-align: middle; margin-left: 4px; }
.empty-note, .empty-module { color: var(--muted); padding: 12px; }
.state-page { max-width: 800px; padding-block: 34px 60px; }
.state-page > h1 { margin: 12px 0 22px; }
.back-link { display: inline-flex; padding: 7px 0; margin-bottom: 22px; color: var(--muted); }
.back-link:hover { color: var(--text); }
.state-panel { display: grid; justify-items: start; gap: 14px; padding: clamp(20px, 6vw, 44px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.state-panel h1 { font-size: clamp(1.6rem, 5vw, 2.6rem); overflow-wrap: anywhere; }
.state-panel p:not(.eyebrow, .countdown) { color: var(--muted); }
.state-icon { display: grid; place-items: center; width: 48px; height: 48px; color: var(--amber); background: #3b3328; border-radius: 11px; font-size: 1.7rem; }
.countdown { color: var(--amber); background: #342e26; border: 1px solid #51412d; border-radius: 8px; padding: 9px 12px; font-weight: 750; }

.auth-shell { display: grid; align-items: center; width: min(100% - 32px, 430px); min-height: 100dvh; margin: auto; padding-block: 25px; }
.auth-card { padding: clamp(20px, 6vw, 35px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.auth-card .eyebrow { margin-top: 17px; }
.auth-card h1 { margin-top: 6px; }
.auth-card > p:not(.eyebrow, .alert) { margin-block: 8px 22px; color: var(--muted); }
.auth-card .alert { margin-bottom: 16px; }
.form-stack { display: grid; gap: 15px; }
.form-stack label, .inline-form label { display: grid; gap: 6px; font-size: .88rem; font-weight: 650; }
.form-stack small { color: var(--muted); font-weight: 400; }
input:not([type=hidden], [type=checkbox]), select, textarea { width: 100%; min-width: 0; min-height: 43px; border-radius: 8px; border: 1px solid #454b50; background: #191b1d; color: var(--text); padding: 10px 12px; }
input[type=file]::file-selector-button { margin-right: 8px; border-radius: 6px; padding: 5px 8px; border: 1px solid var(--line); background: #2a2d30; color: var(--text); cursor: pointer; }
textarea { resize: vertical; }
.admin-topbar .topbar-inner { justify-content: space-between; }
.admin-shell { display: grid; grid-template-columns: 205px minmax(0, 1fr); align-items: start; gap: 30px; padding-block: 32px 64px; }
.admin-sidebar { background: var(--panel); border: 1px solid var(--line); padding: 15px; border-radius: var(--radius); }
.admin-sidebar nav { display: grid; gap: 5px; margin-top: 10px; }
.admin-sidebar nav + p { margin-top: 22px; }
.admin-sidebar nav a { padding: 9px; border-radius: 7px; font-size: .85rem; overflow-wrap: anywhere; }
.admin-sidebar a:hover, .admin-sidebar a[aria-current] { background: #293c34; }
.admin-sidebar a[aria-current] { color: var(--green); }
.admin-sidebar .add-product { width: 100%; margin-top: 12px; }
.admin-content { display: grid; gap: 16px; }
.admin-heading h1 { margin-top: 5px; font-size: clamp(1.65rem, 5vw, 2.5rem); letter-spacing: -.03em; overflow-wrap: anywhere; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .86rem; color: var(--muted); }
.breadcrumbs a { color: var(--green); overflow-wrap: anywhere; }
.editor-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 4vw, 24px); display: grid; gap: 14px; }
.editor-panel h2 { font-size: 1.15rem; }
.editor-panel > p { color: var(--muted); font-size: .87rem; }
.editor-cover { width: min(100%, 260px); aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px; }
.editor-list { display: grid; gap: 7px; }
.editor-list a, .editor-file { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #191b1d; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: .89rem; overflow-wrap: anywhere; }
.editor-list a:hover { border-color: #638172; }
.editor-list a span + span { flex-shrink: 0; color: var(--green); font-size: .77rem; }
.editor-list a small { display: block; margin-top: 4px; color: var(--muted); font-size: .74rem; }
.counter { margin-left: 5px; color: var(--muted); font-size: .76em; font-weight: 500; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.form-stack .feature-toggle { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #395f4d; background: #1b2c24; border-radius: 8px; cursor: pointer; }
.feature-toggle input { margin: 3px 0 0; accent-color: var(--green); }
.feature-toggle small { display: block; margin-top: 3px; }
.alert { padding: 12px; border-radius: 8px; font-size: .88rem; }
.success { background: #193b2b; color: #b0f9d2; }
.error { background: #492f31; color: #ffd4d4; }

@media (max-width: 800px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
    .admin-shell { grid-template-columns: 1fr; gap: 18px; }
    .admin-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
    .shell, .classroom { width: calc(100% - 32px); }
    .topbar-inner { min-height: 59px; }
    .catalog { padding-block: 38px 55px; }
    .section-intro { margin-bottom: 24px; }
    .product-grid { grid-template-columns: 1fr; }
    .classroom { padding-top: 26px; }
    .class-heading { padding-bottom: 19px; gap: 5px; grid-template-columns: 34px minmax(0, 1fr) 34px; }
    .back-icon { width: 34px; }
    .contents { margin-top: 30px; }
    .inline-form, .form-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .product-card { transition: none; }
    .product-card:hover { transform: none; }
}
