:root {
  color-scheme: light;
  --nada-navy: #06142f;
  --nada-midnight: #0b244f;
  --nada-yellow: #ffd42a;
  --nada-blue: #1769ff;
  --nada-font: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --ink: #172d33;
  --subtle: #52666b;
  --line: #cad4d4;
  --accent: #155863;
  --deep: #153c45;
  --paper: #fff;
  --canvas: #f3f6f5;
  --pale: #e7f2ee;
  --lime: #d8eea6;
  --danger: #922d34;
  font: 100%/1.55 "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; word-break: keep-all; overflow-wrap: anywhere; }
.wrap { width: min(1120px, calc(100% - 4rem)); margin-inline: auto; }
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 1rem; padding-block: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-size: 1.22rem; font-weight: 800; letter-spacing: -.07em; white-space: nowrap; }
.brand-symbol { width: 1.65rem; height: 1.65rem; position: relative; display: inline-block; background: var(--deep); border-radius: .25rem; }
.brand-symbol::before { content: ''; position: absolute; inset: 24%; border-left: 3px solid var(--lime); border-bottom: 3px solid var(--lime); }
.account,.actions,.row-head,.toolbar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.account { justify-content: flex-end; font-size: .91rem; }
main { padding-block: clamp(1.5rem, 6vh, 4rem) 4rem; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { letter-spacing: -.06em; line-height: 1.23; }
h1 { font-size: clamp(2.45rem, 6vw, 4.25rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3 { font-size: 1.1rem; }
button,input,select { font: inherit; }
button { background: var(--paper); color: var(--ink); border: 1px solid var(--line); padding: .57rem .9rem; border-radius: .35rem; cursor: pointer; font-weight: 700; line-height: 1.45; }
button:hover { border-color: var(--accent); background: var(--pale); }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #267dba; outline-offset: 3px; }
button.primary { color: white; background: var(--accent); border-color: var(--accent); }
button.primary:hover { background: var(--deep); }
button.danger { color: var(--danger); }
.full { width: 100%; }
.skip { position: absolute; top: -10rem; left: 1rem; padding: .8rem; background: white; }
.skip:focus { top: .5rem; z-index: 10; }
.notice { padding: .85rem 1rem; margin-bottom: 1rem; border-left: 4px solid var(--accent); background: var(--pale); }
.notice:empty { display: none; }
.notice.error { background: #f9eceb; border-color: var(--danger); }
.login-layout { display: grid; grid-template-columns: .98fr 1.02fr; background: var(--paper); border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; }
.cover { background: var(--deep); color: white; position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.cover-content { padding: clamp(2rem, 4.5vw, 4.15rem); z-index: 1; }
.cover-label { display: flex; align-items: center; gap: .65rem; color: #e0ebea; font-size: .94rem; font-weight: 700; }
.cover-label i { width: 1.7rem; height: 2px; background: var(--lime); }
.cover h1 { margin: 2.2rem 0 1.3rem; font-size: clamp(4rem, 7vw, 6.75rem); letter-spacing: -.09em; line-height: 1.05; }
.title-dot { color: var(--lime); }
.cover p { font-size: 1.06rem; line-height: 1.75; color: #dfebed; }
.cover-lines { margin: 0 0 2rem auto; width: 46%; display: grid; gap: .75rem; transform: skewY(-13deg); opacity: .8; }
.cover-lines i { height: 1px; background: #73958d; }
.cover-lines i:last-child { height: 3px; background: var(--lime); }
.entry { display: grid; place-items: center; min-height: 520px; padding: clamp(2rem, 4vw, 4rem); }
.form-card { max-width: 23rem; width: 100%; }
.student-pin-card { margin: clamp(2rem, 8vh, 5rem) auto; padding: 1.5rem; border: 1px solid #d3deed; border-radius: .65rem; background: white; }
.form-card h2 { font-size: clamp(1.9rem, 3.5vw, 2.65rem); }
.intro,.help,.muted { color: var(--subtle); }
.intro { margin: .75rem 0 1.8rem; }
.help { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.5rem; font-size: .92rem; }
form { display: grid; gap: 1rem; }
form label { display: grid; gap: .38rem; font-size: .94rem; font-weight: 700; }
input,select { width: 100%; min-width: 0; min-height: 2.85rem; padding: .58rem .7rem; color: var(--ink); background-color: #fff; border: 1px solid #aababb; border-radius: .32rem; font-size: 1rem; }
select { appearance: none; padding-right: 2.4rem; background-image: linear-gradient(45deg,transparent 50%,var(--subtle) 50%),linear-gradient(135deg,var(--subtle) 50%,transparent 50%); background-position: calc(100% - 17px) center,calc(100% - 12px) center; background-size: 5px 5px; background-repeat: no-repeat; }
.form-card button { min-height: 3rem; margin-top: .3rem; }
.page-head { padding: .45rem 0 1.75rem; }
.page-head h1 { margin: .3rem 0 .55rem; }
.section-label { color: var(--accent); font-weight: 700; font-size: .94rem; }
.section-label::before { content: ''; display: inline-block; width: 1.5rem; height: 2px; background: var(--accent); margin-right: .6rem; vertical-align: middle; }
.row-head { justify-content: space-between; }
.panel { border: 1px solid var(--line); border-radius: .5rem; padding: clamp(1.1rem, 3vw, 2rem); background: var(--paper); min-width: 0; }
.panel > h2,.panel > .row-head { margin-bottom: 1.25rem; }
.record { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .7rem 1.2rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.record:last-child { padding-bottom: 0; }
.record > div:first-child { min-width: 0; flex: 1 1 10rem; }
.record small,.lesson-title small { display: block; color: var(--subtle); font-size: .9rem; margin-top: .25rem; font-weight: 400; }
.empty { padding: 1.1rem 0; color: var(--subtle); }
.admin-tabs { display: flex; gap: .4rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.admin-tabs button[aria-pressed=true] { background: var(--deep); color: white; border-color: var(--deep); }
.admin-content { display: grid; grid-template-columns: minmax(15rem, .7fr) minmax(0,1.3fr); gap: 1rem; align-items: start; }
.form-note { font-size: .9rem; color: var(--subtle); font-weight: 400; }
.panel form + button,.panel p + button { margin-top: .85rem; }
.player { margin: 0 0 1.25rem; }
.player video { display: block; width: 100%; background: #071014; max-height: 65vh; border-radius: .3rem; }
.player .row-head h2 { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.subject-tabs { display: flex; flex-wrap: wrap; gap: .35rem; padding: .45rem; margin-bottom: clamp(1.4rem,3vw,2.2rem); background: #e6edec; border: 1px solid #d8e2df; border-radius: .65rem; }
.subject-tabs button { max-width: 100%; min-height: 2.75rem; padding-inline: 1.25rem; border: 1px solid transparent; background: transparent; color: #435e62; overflow-wrap: anywhere; }
.subject-tabs button:hover { color: var(--deep); background: #f7faf9; }
.subject-tabs button[aria-pressed=true] { color: white; border-color: var(--deep); background: var(--deep); }
.subject-overview { min-width: 0; }
body:has(.student-hero) {
  --canvas: #f3f5f8;
  --paper: #fff;
  --ink: #101a30;
  --deep: var(--nada-midnight);
  --accent: #104ab6;
  --subtle: #50617b;
  --pale: #edf3ff;
  --line: #d7e0ed;
  display: flow-root;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--nada-font);
}
body:has(.student-hero) main { padding-block: clamp(1rem, 2.6vw, 2.3rem) 2.5rem; }
.student-hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto; grid-template-areas: "copy message portrait";
  align-items: center; gap: clamp(.6rem, 3vw, 2rem);
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1.4rem, 4.2vw, 3.5rem);
  margin-bottom: 1.25rem; border-radius: .65rem;
  background: linear-gradient(108deg, var(--nada-navy), var(--nada-midnight) 75%, #133465); color: #fff;
}
.student-hero:has(.student-totals) { grid-template-areas: "copy message portrait" "totals message portrait"; row-gap: .85rem; }
.student-hero:has(.student-totals) .page-head { align-self: end; }
.student-hero .page-head { grid-area: copy; padding: 0; }
.student-hero .section-label { color: var(--nada-yellow); font-size: .88rem; }
.student-hero .section-label::before { background: currentColor; }
.student-hero h1 { margin: .55rem 0; font-size: clamp(2.1rem, 4.2vw, 3.5rem); line-height: 1.1; font-weight: 850; }
.student-hero .muted { color: #dfe7f3; }
.student-message {
  grid-area: message; margin: 0; font-size: clamp(1.4rem, 2.75vw, 2.45rem);
  line-height: 1.28; font-weight: 550; letter-spacing: -.045em;
}
.student-message strong { display: block; color: var(--nada-yellow); font-weight: 800; }
.student-portrait { grid-area: portrait; display: block; width: clamp(6.9rem, 12.4vw, 10.8rem); height: auto; }
.student-hero .classroom-return { min-height: 44px; margin-top: .55rem; color: var(--nada-navy); background: var(--nada-yellow); border: 0; }
.student-hero .classroom-return:hover { background: #ffe573; }
.student-hero :focus-visible { outline-color: #fff; }
.student-totals { grid-area: totals; align-self: start; display: flex; gap: clamp(1.05rem,2.5vw,2rem); margin: 0; }
.student-totals dt { color: #dfe7f3; font-size: .9rem; }
.student-totals dd { margin: .17rem 0 0; font-size: clamp(1.8rem,3vw,2.5rem); font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.student-totals dd span { margin-left: .23rem; font-size: .88rem; font-weight: 500; }
.overview-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.overview-title h2 { font-size: clamp(1.4rem,3vw,1.9rem); }
.overview-title > span { font-size: .94rem; }
.subject-overview .panel > p { margin-top: .5rem; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,18.5rem),1fr)); gap: 1rem; }
.subject-card { display: flex; flex-direction: column; align-items: stretch; text-align: left; min-width: 0; min-height: 11.8rem; background: white; padding: 1.4rem 1.5rem 1.1rem; border: 1px solid #cad5d2; border-top: 3px solid var(--deep); border-radius: .5rem; }
.subject-card:hover { border-color: var(--accent); background: #f9fcfa; }
.subject-card > strong { font-size: clamp(1.4rem,2.45vw,1.85rem); line-height: 1.22; letter-spacing: -.055em; }
.subject-count { color: var(--subtle); font-weight: 500; font-size: .95rem; margin: .5rem 0 1.3rem; }
.card-link { color: var(--accent); border-top: 1px solid #e0e8e5; padding-top: .65rem; margin-top: auto; font-size: .94rem; }
.card-link::before { content: ''; display: inline-block; width: .8rem; height: .65rem; margin-right: .45rem; vertical-align: -.015rem; background: linear-gradient(var(--accent) 0 0) left top/100% 1.5px,linear-gradient(var(--accent) 0 0) left center/100% 1.5px,linear-gradient(var(--accent) 0 0) left bottom/70% 1.5px; background-repeat: no-repeat; }
.subject-label { font-size: 1rem; margin-bottom: .35rem; font-weight: 700; color: var(--accent); }
.syllabus-sheet { background: white; padding: clamp(1.2rem, 3.3vw, 2.75rem); border: 1px solid var(--line); border-radius: .5rem; }
.syllabus-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.syllabus-heading h2 { font-size: clamp(1.8rem,3.4vw,2.5rem); }
.syllabus-heading > span { font-size: .92rem; }
.syllabus { width: 100%; table-layout: fixed; border-collapse: collapse; border-top: 2px solid var(--nada-midnight); }
.syllabus thead { background: #f0f4fa; border-bottom: 1px solid var(--line); }
.syllabus thead th { font-weight: 700; padding: .8rem .65rem; font-size: .94rem; color: #3c4b64; }
.syllabus tbody tr { border-bottom: 1px solid var(--line); }
.syllabus td,.syllabus tbody th { padding: .95rem .65rem; text-align: center; }
.syllabus thead th:first-child,.syllabus .lesson-title { text-align: left; padding-inline-start: 1rem; }
.syllabus .lesson-title { font-weight: 600; }
.col-watch { width: 17%; }
.col-book { width: 16%; }
.col-duration { width: 11%; }
.play-btn { min-height: 44px; border: 0; padding: .5rem 1rem; font-size: .94rem; color: white; background: #145bd6; }
.play-btn:hover { color: white; background: #104ab6; }
.lesson-meta { font-size: .94rem; color: var(--subtle); font-variant-numeric: tabular-nums; }
.mobile-label { display: none; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 2rem); }
  .topbar { min-height: 64px; }
  .login-layout,.admin-content { grid-template-columns: 1fr; }
  .cover-content { padding: 1.5rem; }
  .cover h1 { margin: .9rem 0 .65rem; font-size: clamp(2.65rem, 9vw, 4rem); }
  .cover h1 br { display: none; }
  .cover p { font-size: 1rem; }
  .cover p br { display: none; }
  .cover-lines { position: absolute; right: 0; bottom: 0; width: 20%; opacity: .4; }
  .entry { min-height: auto; padding: 1.75rem 1.25rem; }
  .account { gap: .5rem; }
  .account button { padding: .4rem .6rem; }
}
@media (max-width: 420px) {
  .topbar { align-items: flex-start; }
  .account { max-width: 47%; }
  .admin-tabs button { flex: 1 1 42%; }
}
@media (max-width: 600px) {
  .student-hero { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "copy portrait" "message portrait"; row-gap: .9rem; }
  .student-hero:has(.student-totals) { grid-template-areas: "copy portrait" "message portrait" "totals totals"; }
  .student-message { font-size: clamp(1.05rem, 4vw, 1.4rem); }
  .student-totals { gap: 1.75rem; padding: .8rem 0 0; border-left: 0; border-top: 1px solid #607797; }
  .student-totals dd { font-size: 1.55rem; }
  .subject-tabs { gap: .2rem; padding: .3rem; }
  .subject-tabs button { padding-inline: .75rem; }
  .subject-grid { gap: .7rem; }
  .subject-card { min-height: 0; padding: 1rem 1.1rem .85rem; }
  .subject-count { margin-bottom: .8rem; }
  .syllabus,.syllabus tbody { display: block; }
  .syllabus colgroup { display: none; }
  .syllabus thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .syllabus tbody tr { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: .5rem 1rem; padding: 1rem 0; }
  .syllabus .lesson-title { grid-column: 1 / -1; padding: 0; }
  .syllabus td { padding: 0; text-align: left; }
  .syllabus .watch { grid-column: 1 / -1; grid-row: 3; margin-top: .2rem; }
  .syllabus .lesson-meta { grid-row: 2; font-size: .89rem; overflow-wrap: anywhere; }
  .mobile-label { display: inline; margin-right: .3rem; font-weight: 700; }
}
.admin-content.admin-register { display: block; padding: clamp(1.1rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: .5rem; background: var(--paper); }
.admin-register > .panel { border: 0; border-radius: 0; padding: 0; }
.admin-register > .panel + .panel,.admin-register > .lesson-toolbar + .panel { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1.4rem; }
.admin-register .record { padding-block: .85rem; }
.admin-register .record strong { font-size: 1.04rem; }
.admin-register .record .actions { gap: .38rem; }
.admin-register .actions button { font-size: .9rem; }
.subject-create form,.subject-edit form { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; }
.subject-create label,.subject-edit label { flex: 1 1 13rem; max-width: 24rem; }
.subject-create button,.subject-edit form button { min-height: 2.85rem; }
.subject-edit { border: 0; border-top: 2px solid var(--accent); border-radius: 0; background: var(--canvas); padding: 1rem; margin-block: .75rem; }
.subject-edit h2 { font-size: 1.1rem; }
.lesson-toolbar { display: flex; align-items: end; justify-content: space-between; gap: .75rem 1.5rem; flex-wrap: wrap; }
.lesson-toolbar label { display: grid; gap: .35rem; font-size: .94rem; font-weight: 700; min-width: 0; flex: 1 1 13rem; max-width: 25rem; }
.lesson-toolbar .actions { padding-bottom: .1rem; }
.lesson-editor form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; gap: .85rem 1.25rem; max-width: 52rem; }
.lesson-editor form button { align-self: end; justify-self: start; }
.lesson-editor .lesson-source { grid-column: 1 / -1; margin: 0; padding: 1rem; min-width: 0; border: 1px solid var(--line); border-radius: .35rem; display: grid; gap: .8rem; }
.lesson-source legend { font-weight: 700; padding-inline: .25rem; }
.lesson-source [hidden] { display: none !important; }
.source-inputs { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap: .75rem 1rem; }
.source-inputs input[type=file] { font-size: .9rem; }
.auto-duration { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.source-message { margin: 0; font-size: .94rem; color: var(--subtle); }
.source-message:empty { display: none; }
.source-message.error { color: var(--danger); }
.upload-progress { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .65rem; }
.upload-progress progress { width: 100%; accent-color: var(--accent); }
.transfer-percent { font-variant-numeric: tabular-nums; font-size: .9rem; }
.main-tab-editor > p { margin-bottom: 1rem; max-width: 46rem; }
.main-tab-editor form { max-width: 44rem; }
.main-tab-editor form button { justify-self: start; }
.main-tabs-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(13rem,.75fr); gap: clamp(1.25rem,3vw,3rem); align-items: start; }
.main-tabs-layout form { min-width: 0; }
.main-tabs-actions { display: grid; justify-items: start; gap: .45rem; }
.main-tabs-status { color: var(--subtle); font-size: .94rem; }
.main-tabs-status.error { color: var(--danger); font-weight: 700; }
.main-tabs-current { border-left: 2px solid var(--accent); padding: .4rem 0 .4rem 1rem; }
.main-tabs-current h3 { margin-bottom: .65rem; }
.main-tabs-current ol { display: grid; gap: .45rem; margin: 0; padding-inline-start: 1.5rem; }
.main-tabs-current li::marker { color: var(--accent); font-weight: 700; }
.main-tabs-current p { margin-top: .8rem; font-size: .94rem; }
.admin-register .panel > button { margin-right: .4rem; }
@media (max-width: 650px) {
  .main-tabs-layout { grid-template-columns: minmax(0,1fr); }
  .admin-register .record { display: grid; justify-content: stretch; gap: .6rem; }
  .lesson-editor form { grid-template-columns: minmax(0,1fr); }
  .lesson-toolbar { display: grid; align-items: stretch; }
  .lesson-toolbar label { max-width: none; }
}

/* The current view owns the admin palette, including when a session ends in another tab. */
body:has(.admin-hero) {
  --canvas: #f3f5f8;
  --paper: #fff;
  --ink: #101a30;
  --deep: var(--nada-navy);
  --accent: #145acb;
  --subtle: #536278;
  --line: #d8e0ea;
  --pale: #eef4ff;
  --danger: #ac303c;
  --admin-width: min(1200px, calc(100% - clamp(2rem, 8vw, 8rem)));
  min-height: 100vh;
  display: flow-root;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--nada-font);
}
body:has(.admin-hero) .wrap { width: var(--admin-width); }
body:has(.admin-hero) main { padding-block: clamp(1rem, 2.6vw, 2.2rem) 3rem; }
body:has(.admin-hero) .account { color: #43516a; font-weight: 650; }
body:has(.admin-hero) .account button { padding-inline: .95rem; min-height: 42px; }
body:has(.admin-hero) :focus-visible { outline: 3px solid #1769ff; outline-offset: 3px; }
.admin-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  padding: clamp(1.25rem, 2.8vw, 2.05rem) clamp(1.25rem, 3vw, 2.55rem);
  color: #fff; background: var(--nada-navy); border-radius: .75rem .75rem 0 0;
}
.admin-hero .page-head { padding: 0; }
.admin-hero .section-label { display: flex; align-items: center; gap: .5rem; color: var(--nada-yellow); font-size: .86rem; font-weight: 750; }
.admin-hero .section-label::before { width: 1.15rem; height: 2px; margin: 0; background: currentColor; }
.admin-hero h1 { margin: .35rem 0 0; font-size: clamp(2.15rem, 4vw, 3.2rem); font-weight: 830; line-height: 1.12; }
.admin-session {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .26rem .45rem;
  padding-inline-start: clamp(1.1rem, 2.4vw, 2rem); border-inline-start: 1px solid #45607c;
  color: #e3eaf4; font-size: .91rem; font-weight: 600;
}
.admin-session strong { color: var(--nada-yellow); font-size: 1.65rem; font-variant-numeric: tabular-nums; line-height: 1.25; }
.admin-session .admin-capacity { color: #d0daea; font-weight: 500; }
.admin-tabs {
  display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 0;
  margin-bottom: clamp(1rem, 2vw, 1.65rem); background: white;
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 .6rem .6rem;
}
.admin-tabs button {
  position: relative; min-height: 54px; border: 0; border-radius: 0;
  padding: .65rem .5rem; font-weight: 680; color: #52617a; background: transparent;
}
.admin-tabs button:first-child { border-end-start-radius: .55rem; }
.admin-tabs button:last-child { border-end-end-radius: .55rem; }
.admin-tabs button:hover { background: #f4f7fd; color: var(--accent); }
.admin-tabs button[aria-pressed=true] { background: #edf3ff; color: #124da6; font-weight: 800; }
.admin-tabs button[aria-pressed=true]::after { content: ''; position: absolute; inset: auto .8rem 0; height: 3px; background: var(--nada-blue); }
.admin-tabs button:focus-visible { z-index: 1; }
.admin-content { grid-template-columns: minmax(17rem, .76fr) minmax(0, 1.24fr); gap: clamp(1rem, 2vw, 1.5rem); }
.admin-content .panel, .admin-content.admin-register {
  background: #fff; border: 1px solid var(--line); border-radius: .65rem;
  padding: clamp(1.15rem, 2.5vw, 2rem); box-shadow: 0 2px 6px #06142f05;
}
.admin-content h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); font-weight: 780; color: var(--nada-midnight); }
.admin-content .panel > h2 { margin-bottom: 1.25rem; }
.admin-content .admin-count { margin-inline-start: .2rem; color: #1554b4; font-size: .8em; font-variant-numeric: tabular-nums; }
.admin-content form { gap: 1.05rem; }
.admin-content label { color: #263651; font-weight: 700; }
.admin-content input, .admin-content select {
  min-height: 46px; color: #172742; border-color: #a9b8ca; border-radius: .38rem;
}
.admin-content input:hover:not(:disabled), .admin-content select:hover:not(:disabled) { border-color: #7289a8; }
.admin-content .form-note { font-size: .87rem; line-height: 1.5; }
.admin-content button { min-height: 42px; padding-inline: .85rem; color: #2e435f; border-color: #c4cfdd; border-radius: .38rem; }
.admin-content button:hover:not(:disabled) { color: #16448a; background: #f0f5ff; border-color: #8099bf; }
.admin-content button.primary { color: #fff; background: #145bd6; border-color: #145bd6; }
.admin-content button.primary:hover:not(:disabled) { color: #fff; background: #104bb8; border-color: #104bb8; }
.admin-content button.danger { color: var(--danger); }
.admin-content button.danger:hover:not(:disabled) { color: #912132; border-color: #d8a3a9; background: #fff3f4; }
.admin-content .record { border-color: #dde4ed; padding-block: .9rem; }
.admin-content .record strong { font-size: 1.06rem; line-height: 1.32; color: var(--nada-midnight); font-weight: 730; }
.admin-content .record small { margin-top: .17rem; }
.admin-content .record:last-child { padding-bottom: .1rem; }
.admin-student-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: .55rem clamp(.6rem, 2.1vw, 1.65rem); }
.admin-user-status { display: inline-flex; align-items: center; gap: .38rem; font-weight: 650; font-size: .9rem; color: #1853a5; }
.admin-user-status::before { content: ''; width: .43rem; height: .43rem; border-radius: 50%; background: #2874dd; }
.admin-user-status.inactive { color: #627083; }
.admin-user-status.inactive::before { background: #8894a6; }
.admin-content .usage-open { color: #124da6; background: #f2f6ff; border-color: #bacde9; }
.admin-content .usage-panel { grid-column: 1 / -1; min-width: 0; }
.student-import-dialog {
  width: min(48rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 2rem); margin: auto;
  padding: clamp(1rem, 3vw, 2rem); box-sizing: border-box; overflow-y: auto;
  color: var(--ink); background: #fff; border: 1px solid #c4cfdd; border-radius: .65rem;
}
.student-import-dialog::backdrop { background: rgb(6 20 47 / 55%); }
.student-import-dialog [hidden] { display: none; }
.student-import-dialog .row-head { margin-bottom: 1.1rem; }
.student-import-entry { display: grid; gap: .65rem; }
.student-import-entry > button { justify-self: start; }
.student-import-entry > label { display: grid; gap: .4rem; margin-top: .2rem; }
.student-import-dialog p { line-height: 1.55; }
.student-import-status:not(:empty) { margin: 1rem 0; padding: .65rem .8rem; background: #edf3ff; border-left: 3px solid var(--nada-blue); }
.student-import-status.error, .student-import-errors { color: #8a221c; background: #fff1ef; }
.student-import-errors { max-height: 9rem; overflow: auto; padding: .75rem .85rem .75rem 2rem; }
.student-import-dialog h3 { margin: .85rem 0 .4rem; }
.student-import-dialog button.primary { margin-top: 1rem; }
.student-import-scroll { max-height: 40vh; margin-top: .55rem; overflow: auto; border-block: 1px solid #c4cfdd; }
.student-import-scroll table { width: 100%; min-width: 31rem; border-collapse: collapse; font-size: .9rem; }
.student-import-scroll th, .student-import-scroll td { padding: .55rem .65rem; text-align: left; vertical-align: top; border-bottom: 1px solid #e0e6ef; }
.student-import-scroll thead th { position: sticky; top: 0; background: #edf3fa; }
.student-import-scroll tbody th small { display: block; font-weight: 450; color: #546378; }
.student-import-scroll tr:last-child td, .student-import-scroll tbody tr:last-child th { border-bottom: 0; }
.admin-content.enrollment-admin { grid-template-columns: minmax(0,1fr); }
.enrollment-student { display: grid; gap: .35rem; max-width: 28rem; }
.enrollment-checklist { margin-top: 1rem; }
.enrollment-group { min-inline-size: 0; border: 0; padding: 0; margin: 0; }
.enrollment-group legend { padding: 0; margin-bottom: .5rem; color: var(--nada-midnight); font-weight: 750; }
.enrollment-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit,minmax(min(100%,16rem),1fr)); }
.enrollment-card { min-width: 0; align-self: start; border: 1px solid #ced9e7; border-radius: .45rem; }
.enrollment-card:has(:checked) { border-color: #87a9df; background: #f2f6ff; }
.enrollment-card .enrollment-choice {
  display: grid; align-items: center; grid-template-columns: auto minmax(0,1fr); gap: .18rem .55rem;
  padding: .72rem .85rem; min-height: 46px; overflow-wrap: anywhere; cursor: pointer;
}
.enrollment-choice small { grid-column: 2; color: var(--subtle); font-size: .8rem; font-weight: 500; line-height: 1.45; }
.admin-content .enrollment-choice input { width: 1.15rem; height: 1.15rem; min-height: 0; margin: 0; padding: 0; accent-color: #145bd6; }
.enrollment-card .enrollment-date { display: flex; align-items: center; gap: .6rem; padding: 0 .85rem .7rem; color: var(--subtle); font-size: .84rem; }
.enrollment-date span { flex: none; }
.admin-content .enrollment-date input { min-height: 2.4rem; padding: .25rem .4rem; font-size: .94rem; }
.enrollment-card .enrollment-date[hidden] { display: none; }
.enrollment-footer {
  position: sticky; bottom: 0; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .8rem;
  padding: .8rem 0; border-top: 1px solid var(--line); background: #fff;
}
.enrollment-footer > div { flex: 1 1 12rem; min-width: 0; }
.enrollment-footer strong { color: var(--nada-midnight); }
.enrollment-status:not(:empty) { margin: .15rem 0 0; }
.enrollment-status:empty { margin: 0; }
.enrollment-status.error { color: var(--danger); }
.enrollment-overview summary { cursor: pointer; font-weight: 750; color: var(--nada-midnight); }
.enrollment-overview[open] summary { margin-bottom: .8rem; }
.usage-toolbar, .usage-identity { display: flex; align-items: center; flex-wrap: wrap; }
.usage-toolbar { justify-content: space-between; gap: .8rem 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.usage-toolbar h2 { margin: 0; }
.usage-toolbar .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; max-width: 100%; }
.usage-toolbar select { max-width: 100%; width: auto; }
.usage-identity { gap: .45rem .9rem; margin-block: 1.35rem .9rem; }
.usage-identity h3 { display: flex; align-items: baseline; gap: .3rem .55rem; flex-wrap: wrap; margin: 0; overflow-wrap: anywhere; font-size: 1.22rem; }
.usage-identity h3 small { color: #536278; font-size: .88rem; font-weight: 500; }
.usage-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) repeat(2,minmax(0,1.25fr)); margin: 0; background: #f3f6fc; border-block: 1px solid #d7e1ef; }
.usage-metrics div { min-width: 0; padding: 1rem .9rem; }
.usage-metrics dt { color: #465a75; font-size: .85rem; font-weight: 600; }
.usage-metrics dd { margin: .35rem 0 0; font-size: 1.04rem; font-weight: 750; color: #10264a; font-variant-numeric: tabular-nums; }
.usage-note { margin: .7rem 0 1.6rem; font-size: .86rem; line-height: 1.6; color: #536278; }
.usage-report > h3 { margin: 0 0 .6rem; font-size: 1.15rem; }
.usage-report > p:first-child { margin-block: 1.5rem 0; }
.usage-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .92rem; border-top: 2px solid #18345c; }
.usage-table thead th { color: #42546e; background: #f4f6fa; text-align: start; font-weight: 650; }
.usage-table th, .usage-table td { padding: .75rem .65rem; border-bottom: 1px solid #dbe2ec; overflow-wrap: anywhere; }
.usage-table th:first-child { width: 34%; text-align: start; }
.usage-table th:last-child { width: 20%; }
.usage-table td { font-variant-numeric: tabular-nums; }
.usage-table small, .usage-table strong { display: block; }
.usage-table small { color: #536278; font-weight: 550; }
.usage-mobile-label { display: none; }
.usage-report h4 { margin: 1.35rem 0 .6rem; font-size: 1.04rem; }
.usage-course-header { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; }
.usage-course-header h3 { flex: 1 1 12rem; margin: 0; font-size: 1.18rem; }
.usage-course-header select { width: auto; max-width: 100%; }
.admin-content .usage-subject-link { padding: .35rem .45rem; color: #124da6; background: transparent; border: 0; text-align: start; text-decoration: underline; text-underline-offset: .18em; }
.usage-all-lessons { margin-top: 1.25rem; }
.usage-all-lessons summary { cursor: pointer; font-weight: 700; padding-block: .6rem; }
.usage-access-log { list-style: none; padding: 0; margin: 0 0 .65rem; max-height: 15rem; overflow-y: auto; border-top: 2px solid #18345c; }
.usage-access-log li { display: grid; grid-template-columns: minmax(9.5rem,12rem) minmax(0,1fr) auto; gap: .3rem .75rem; align-items: baseline; padding: .65rem; border-bottom: 1px solid #dbe2ec; font-size: .92rem; }
.usage-access-log small { color: #465a75; font-variant-numeric: tabular-nums; }
.usage-access-log time { color: #465a75; font-variant-numeric: tabular-nums; }
.usage-access-log strong { margin-inline-start: .65rem; overflow-wrap: anywhere; }
.lesson-materials { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .65rem; margin-top: .5rem; }
.lesson-materials small { margin: 0; color: #50617b; }
.lesson-materials .material-download, .material-list .material-download {
  max-width: 100%; min-width: 0; min-height: 36px; padding: .25rem 0; color: #124da6;
  background: transparent; border: 0; text-decoration: underline; text-underline-offset: .2em;
  font-size: .93rem; font-weight: 600; overflow-wrap: anywhere; text-align: start;
}
.lesson-materials .material-download:hover, .material-list .material-download:hover { color: #072e70; }
.material-editor, .caption-editor { flex: 1 1 100%; min-width: 0; padding: 1rem; margin-top: .2rem; border: 1px solid #d7e1ee; border-radius: .45rem; background: #f6f8fc; }
.material-editor[hidden], .caption-editor[hidden] { display: none; }
:is(.material-editor,.caption-editor) h3 { margin: 0 0 .7rem; font-size: 1.06rem; }
:is(.material-editor,.caption-editor) input[type=file] { background: white; min-width: 0; width: 100%; }
:is(.material-editor,.caption-editor) label { max-width: 38rem; }
.caption-filename { margin: 0 0 .8rem; color: #455872; overflow-wrap: anywhere; }
.caption-editor .actions { margin-top: .65rem; }
.material-editor > button { margin-top: .65rem; }
.material-status { margin: .5rem 0 0; overflow-wrap: anywhere; color: #455872; font-size: .9rem; }
.material-status:empty, .material-list:empty { display: none; }
.material-list { list-style: none; margin: 0 0 .9rem; padding: 0; }
.material-list li { display: flex; justify-content: space-between; align-items: center; gap: .65rem; border-bottom: 1px solid #dbe3ef; padding: .25rem 0; }
.material-list .danger { flex-shrink: 0; }
@media (max-width: 800px) {
  .lesson-materials .material-download { min-height: 44px; }
}
@media (max-width: 800px) {
  .usage-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .usage-table, .usage-table tbody { display: block; }
  .usage-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .usage-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem .85rem; padding: .85rem .25rem; border-bottom: 1px solid var(--line); }
  .usage-table tbody th:first-child { width: auto; grid-column: 1 / -1; }
  .usage-table tbody th, .usage-table tbody td { border: 0; padding: 0; }
  .usage-mobile-label { display: block; color: #536278; font-size: .81rem; }
}
@media (max-width: 520px) {
  .usage-course-header h3 { flex-basis: 100%; }
  .usage-course-header select { flex: 1; min-width: 0; }
  .usage-access-log li { grid-template-columns: 1fr; }
  .admin-student-row .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .admin-content .admin-student-row { grid-template-columns: minmax(0,1fr) auto; }
  .usage-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .usage-metrics div { padding: .7rem; }
  .usage-toolbar select { width: 100%; }
}
.admin-content .empty {
  padding: clamp(1.7rem, 4vw, 3rem) 1rem; text-align: center;
  border-block: 1px solid #e1e7ef; color: #596b83; background: #f7f9fc;
}
.admin-content.admin-register > .panel { border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.admin-register > .panel + .panel, .admin-register > .lesson-toolbar + .panel {
  border-top: 1px solid var(--line); padding-top: 1.4rem;
}
.admin-content .subject-edit { margin-block: .6rem; padding: 1rem; background: #f5f8fd; border: 1px solid #bdcde5; }
.admin-content .subject-edit h2 { font-size: 1.15rem; }
.admin-content .main-tabs-current {
  border: 1px solid #d9e3f2; border-top: 3px solid #225dbd; border-radius: .4rem;
  padding: 1.15rem 1.25rem; background: #f5f8fd;
}
.admin-content .main-tabs-current h3 { color: var(--nada-midnight); }
.admin-content .lesson-source { background: #f6f8fc; }
.admin-content input[type=file]::file-selector-button {
  margin-inline-end: .6rem; padding: .3rem .55rem; color: #194d9f; background: #e9f1ff;
  border: 1px solid #b9cbe8; border-radius: .27rem; font: inherit; font-weight: 650; cursor: pointer;
}
@media (max-width: 820px) {
  .admin-content { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 600px) {
  body:has(.admin-hero) { --admin-width: calc(100% - 1.5rem); }
  body:has(.admin-hero) .topbar { align-items: center; }
  body:has(.admin-hero) .account { min-width: 0; max-width: 58%; font-size: .83rem; gap: .25rem .5rem; }
  body:has(.admin-hero) .account button { min-height: 40px; padding-inline: .55rem; }
  .admin-hero { align-items: start; justify-content: start; flex-direction: column; gap: .8rem; }
  .admin-session { padding: 0; border: 0; font-size: .84rem; }
  .admin-session strong { font-size: 1.15rem; }
  .admin-tabs button { min-width: 0; min-height: 48px; font-size: .88rem; padding: .55rem .1rem; }
  .admin-tabs button[aria-pressed=true]::after { inset-inline: .3rem; }
  .admin-content button { min-height: 44px; }
  .admin-content .record .actions { gap: .35rem; }
  .admin-student-row { gap: .4rem .65rem; }
}
