/* 쌤맵 — 디자인 토큰
   참고: 메가스터디(Pretendard, 1010px), 이투스(Noto Sans KR, 1280px, 카드 12px 라운드), 대성마이맥(10px 라운드, 파스텔 섹션).
   공통 문법(선생님 얼굴 중심, 학년 선택이 1차 메뉴, 12px 라운드 카드, 진한 단색 브랜드)은 따르고,
   유료 사이트의 약점(12px 글자 남발, 배너·팝업 과다)은 따르지 않는다. 본문 15~16px, 배너 없음. */
:root {
  --brand: #3554e0;
  --brand-strong: #2440c4;
  --brand-soft: #edf1ff;
  --ink: #191f28;
  --ink-2: #333d4b;
  --muted: #6b7684;
  --faint: #8b95a1;
  --line: #e5e8eb;
  --line-2: #f2f4f6;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --star: #ffb400;
  --free: #0f9d6b;
  --free-soft: #e6f6ef;
  --player-bg: #0b0d12;
  --shadow-sm: 0 1px 2px rgba(25, 31, 40, .06);
  --shadow: 0 2px 6px rgba(25, 31, 40, .05), 0 10px 24px rgba(25, 31, 40, .06);
  --r: 12px;
  --r-lg: 18px;
  --wrap: 1200px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #6f8bff; --brand-strong: #8ea3ff; --brand-soft: #1d2442;
    --ink: #eef0f3; --ink-2: #d1d6db; --muted: #9aa4b1; --faint: #7d8794;
    --line: #2b313a; --line-2: #22272f; --bg: #121418; --surface: #1a1d23;
    --free: #3ccf91; --free-soft: #173528;
    --shadow-sm: none; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #6f8bff; --brand-strong: #8ea3ff; --brand-soft: #1d2442;
  --ink: #eef0f3; --ink-2: #d1d6db; --muted: #9aa4b1; --faint: #7d8794;
  --line: #2b313a; --line-2: #22272f; --bg: #121418; --surface: #1a1d23;
  --free: #3ccf91; --free-soft: #173528;
  --shadow-sm: none; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  letter-spacing: -0.01em; word-break: keep-all;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ── 헤더 ── */
.header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -0.04em; white-space: nowrap; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 800; letter-spacing: -0.05em; }
.logo small { font-size: 11px; font-weight: 500; color: var(--faint); letter-spacing: 0; }
.scope { display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--line-2); border-radius: 10px; }
.scope a, .scope span { padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.scope a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.scope .soon { color: var(--faint); font-weight: 500; cursor: default; }
.scope .soon::after { content: "준비중"; font-size: 10px; margin-left: 4px; vertical-align: 1px; color: var(--faint); }
.search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search input { width: 100%; height: 40px; padding: 0 16px 0 40px; border: 1px solid transparent; border-radius: 999px; background: var(--line-2); }
.search input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.search::before { content: ""; position: absolute; left: 15px; top: 50%; width: 13px; height: 13px; margin-top: -8px; border: 2px solid var(--faint); border-radius: 50%; }
.search::after { content: ""; position: absolute; left: 27px; top: 25px; width: 6px; height: 2px; background: var(--faint); transform: rotate(45deg); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.locale select { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--line-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; }
.notice { background: #fff6d6; color: #6b4e00; font-size: 13px; padding: 8px 0; }

/* ── 공통 조각 ── */
.section { margin: 48px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.more-link { font-size: 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.more-link:hover { color: var(--brand); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.free { background: var(--free-soft); color: var(--free); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.gray { background: var(--line-2); color: var(--muted); font-weight: 600; }
.stars { color: var(--star); letter-spacing: 1px; font-size: 13px; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.rating strong { font-weight: 700; }
.rating .n { color: var(--faint); }
.no-review { font-size: 13px; color: var(--faint); }
.avatar { border-radius: 50%; object-fit: cover; background: var(--line-2); flex: none; }
.empty { padding: 56px 24px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--r); border: 1px dashed var(--line); }
.skeleton { background: linear-gradient(90deg, var(--line-2), var(--line), var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── 홈 ── */
.hero { background: linear-gradient(160deg, var(--brand) 0%, #5b3fd6 100%); color: #fff; }
.hero .wrap { padding-top: 56px; padding-bottom: 56px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; }
.hero h1 { margin: 0; font-size: 40px; line-height: 1.25; letter-spacing: -0.045em; font-weight: 800; }
.hero p { margin: 14px 0 26px; font-size: 17px; opacity: .88; }
.hero-search { display: flex; gap: 8px; background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); max-width: 560px; }
.hero-search input { flex: 1; border: 0; padding: 0 14px; font-size: 16px; color: #191f28; background: transparent; min-width: 0; }
.hero-search input:focus { outline: none; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-chips a { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 14px; font-weight: 600; }
.hero-chips a:hover { background: rgba(255, 255, 255, .26); }
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hero-stat { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--r); padding: 18px; }
.hero-stat b { display: block; font-size: 28px; letter-spacing: -0.03em; }
.hero-stat span { font-size: 13px; opacity: .85; }
.hero-stat.wide { grid-column: span 2; display: flex; align-items: center; gap: 12px; }
.hero-stat.wide b { font-size: 18px; }

.semester { margin-bottom: 20px; }
.semester h3 { font-size: 15px; color: var(--muted); margin: 0 0 10px; font-weight: 700; }
.unit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.unit-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s, box-shadow .15s; min-height: 150px; }
.unit-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.unit-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 17px; font-family: "Times New Roman", serif; font-style: italic; }
.unit-card h4 { margin: 0; font-size: 17px; letter-spacing: -0.03em; }
.unit-card .topics { font-size: 13px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.unit-card .count { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--brand); }

.course-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.course-card { background: var(--surface); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.course-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--line-2); }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-thumb .stack { position: absolute; right: 0; top: 0; bottom: 0; width: 38%; background: rgba(10, 12, 18, .78); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; gap: 2px; }
.course-thumb .stack b { font-size: 22px; }
.course-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-title { font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.by { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: auto; }

.teacher-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.teacher-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 12px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; transition: border-color .15s, transform .15s; }
.teacher-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.teacher-card .avatar { width: 72px; height: 72px; margin-bottom: 6px; }
.teacher-card b { font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.teacher-card small { font-size: 12px; color: var(--muted); }

.mission { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.mission h3 { margin: 0 0 6px; font-size: 16px; }
.mission p { margin: 0; font-size: 14px; color: var(--muted); }

/* ── 목록(단원·주제) ── */
.browse { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 32px; padding-top: 28px; padding-bottom: 56px; }
.tree { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; padding-right: 4px; }
.tree-title { font-size: 12px; font-weight: 700; color: var(--faint); margin: 0 0 8px 10px; }
.tree a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.tree a:hover { background: var(--line-2); }
.tree a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.tree .u { font-weight: 700; margin-top: 6px; }
.tree .t { padding-left: 22px; color: var(--muted); font-size: 13.5px; }
.tree .c { font-size: 12px; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.tree-toggle { display: none; }

.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--brand); }
.page-title { margin: 6px 0 4px; font-size: 28px; letter-spacing: -0.04em; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0; }
.std-box { margin: 16px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.std-box summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink-2); list-style: none; display: flex; justify-content: space-between; }
.std-box summary::after { content: "펼치기"; font-size: 12px; color: var(--faint); font-weight: 500; }
.std-box[open] summary::after { content: "접기"; }
.std { font-size: 13.5px; color: var(--muted); margin-top: 8px; display: flex; gap: 8px; }
.std code { font-family: inherit; flex: none; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--line-2); padding: 1px 7px; border-radius: 5px; height: fit-content; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 14px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.chip.text { padding: 0 12px; }
.chip .avatar { width: 24px; height: 24px; }
.chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.chip .c { color: var(--faint); font-weight: 500; }
.seg { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: 10px; flex: none; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.result-count { font-size: 14px; color: var(--muted); }
.result-count b { color: var(--ink); }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; }
.vcard { display: flex; flex-direction: column; gap: 10px; }
.vthumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--line-2); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.vcard:hover .vthumb img { transform: scale(1.03); }
.vthumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 5px; }
.vthumb .done { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .3); }
.vthumb .done span { display: block; height: 100%; background: #ff3b3b; }
.vthumb .watched { position: absolute; left: 8px; top: 8px; }
.vmeta { display: grid; grid-template-columns: 36px 1fr; gap: 10px; }
.vmeta .avatar { width: 36px; height: 36px; }
.vtitle { font-weight: 700; font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vsub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.vrow { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.load-more { display: flex; justify-content: center; margin-top: 32px; }

/* ── 선생님 ── */
.teacher-hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.teacher-hero .wrap { display: grid; grid-template-columns: 112px 1fr auto; gap: 24px; align-items: center; padding-top: 36px; padding-bottom: 28px; }
.teacher-hero .avatar { width: 112px; height: 112px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.teacher-hero h1 { margin: 0; font-size: 30px; letter-spacing: -0.04em; }
.teacher-hero .handle { color: var(--muted); font-size: 14px; }
.teacher-hero .desc { color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 640px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kpis { display: flex; gap: 28px; margin-top: 14px; flex-wrap: wrap; }
.kpi b { display: block; font-size: 20px; letter-spacing: -0.03em; }
.kpi span { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 700; font-size: 15px; color: var(--faint); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.coverage { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cov { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13px; }
.cov b { display: block; font-size: 18px; }
.cov.zero { opacity: .45; }

/* ── 강의실 ── */
.room { background: var(--player-bg); color: #e8eaed; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; max-width: 1600px; margin: 0 auto; }
.room-main { padding: 20px 24px 20px; min-width: 0; }
.player { position: relative; aspect-ratio: 16 / 9; min-height: 200px; background: #000; border-radius: 12px; overflow: hidden; }
.player iframe, .player > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: #000; }
.player-poster img { width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.play-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 26px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); padding-left: 5px; }
.controls { display: flex; align-items: center; gap: 8px; padding: 12px 0 0; flex-wrap: wrap; }
.cbtn { height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid #2c313b; background: #171a21; color: #d6dae0; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cbtn:hover { background: #20242d; }
.cbtn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.cbtn:disabled { opacity: .4; cursor: default; }
.speed { display: inline-flex; border: 1px solid #2c313b; border-radius: 8px; overflow: hidden; }
.speed button { border: 0; background: #171a21; color: #aeb4bd; height: 32px; padding: 0 9px; font-size: 12.5px; font-weight: 700; }
.speed button[aria-pressed="true"] { background: #e8eaed; color: #0b0d12; }
.ctl-sep { flex: 1; }
.room-title { margin: 16px 0 6px; font-size: 21px; line-height: 1.4; letter-spacing: -0.03em; color: #fff; }
.room-sub { display: flex; align-items: center; gap: 10px; color: #9aa1ab; font-size: 13px; flex-wrap: wrap; }
.room-sub a:hover { color: #fff; }
.room-sub .avatar { width: 28px; height: 28px; }
.room-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.room-tags .badge { background: #1d212a; color: #c5cbd3; }
.room-tags a.badge:hover { background: #262b36; }
.index { margin-top: 16px; background: #12151b; border: 1px solid #22262f; border-radius: 12px; padding: 12px; }
.index h3 { margin: 0 0 8px; font-size: 13px; color: #9aa1ab; }
.index button { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: 0; color: #d6dae0; padding: 6px 8px; border-radius: 6px; font-size: 14px; }
.index button:hover { background: #1b1f27; }
.index time { color: var(--brand-strong); font-variant-numeric: tabular-nums; font-weight: 700; flex: none; width: 52px; }

.side { background: #12151b; border-left: 1px solid #1f232b; display: flex; flex-direction: column; max-height: calc(100vh - 64px); position: sticky; top: 64px; }
.side-head { padding: 18px 18px 12px; border-bottom: 1px solid #1f232b; }
.side-head small { color: #8b929c; font-size: 12px; }
.side-head h3 { margin: 4px 0 10px; font-size: 16px; color: #fff; line-height: 1.4; }
.progress { height: 6px; border-radius: 999px; background: #262a33; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--free); }
.progress-text { display: flex; justify-content: space-between; font-size: 12px; color: #8b929c; margin-top: 6px; }
.playlist { overflow: auto; flex: 1; padding: 6px 0; }
.pl-item { display: grid; grid-template-columns: 28px 96px 1fr; gap: 10px; padding: 8px 14px; align-items: center; color: #c5cbd3; font-size: 13px; }
.pl-item:hover { background: #181c23; }
.pl-item[aria-current="true"] { background: #1c2340; color: #fff; }
.pl-item .num { color: #6e7580; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.pl-item[aria-current="true"] .num { color: var(--brand-strong); }
.pl-item .num.ok { color: var(--free); font-weight: 800; }
.pl-item .pthumb { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #222; }
.pl-item .pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pl-item .pthumb span { position: absolute; right: 3px; bottom: 3px; background: rgba(0, 0, 0, .8); color: #fff; font-size: 10.5px; padding: 0 4px; border-radius: 3px; }
.pl-item .ptitle { line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-item.off { opacity: .55; }

.room-below { padding-top: 8px; padding-bottom: 64px; }
.below-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.desc { font-size: 14px; color: var(--muted); white-space: pre-wrap; max-height: 11em; overflow: hidden; position: relative; }
.desc.open { max-height: none; }
.score-row { display: flex; align-items: baseline; gap: 10px; }
.score-row strong { font-size: 40px; letter-spacing: -0.04em; line-height: 1; }
.dim { display: grid; grid-template-columns: 70px 1fr 28px; align-items: center; gap: 10px; font-size: 13px; margin-top: 10px; color: var(--ink-2); }
.bar { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.disclosure { font-size: 12px; color: var(--faint); margin-top: 12px; }
.review-form { display: grid; gap: 12px; }
.frow { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 10px; font-size: 14px; }
.star-input { display: inline-flex; gap: 2px; }
.star-input button { border: 0; background: none; font-size: 26px; line-height: 1; padding: 0 1px; color: var(--line); transition: transform .1s; }
.star-input button:hover { transform: scale(1.12); }
.star-input button.on { color: var(--star); }
.review-form textarea, .review-form input[type="text"] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.review-form textarea { min-height: 88px; resize: vertical; }
.form-msg { font-size: 13px; color: var(--muted); }
.review { border-top: 1px solid var(--line); padding: 14px 0; }
.review:first-of-type { border-top: 0; padding-top: 0; }
.review-head { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.review p { margin: 6px 0 0; white-space: pre-wrap; }
.notes textarea { width: 100%; min-height: 120px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); resize: vertical; }
.bookmark-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.bookmark-list li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.bookmark-list button { border: 0; background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 2px 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini { display: grid; grid-template-columns: 128px 1fr; gap: 12px; margin-bottom: 14px; }
.mini img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.mini .vtitle { font-size: 14px; }

.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0 48px; font-size: 13px; color: var(--muted); }
.footer b { color: var(--ink); }
.footer p { margin: 6px 0 0; max-width: 760px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #191f28; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 100; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }

/* ── 반응형 ── */
@media (max-width: 1180px) {
  .room-grid { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: 520px; border-left: 0; border-top: 1px solid #1f232b; }
  .teacher-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .course-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-top: 40px; padding-bottom: 40px; }
  .hero h1 { font-size: 32px; }
  .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .browse { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 16px; }
  .tree { position: static; max-height: none; }
  .tree-toggle { display: flex; width: 100%; }
  .tree .tree-body { display: none; margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
  .tree.open .tree-body { display: block; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .below-grid { grid-template-columns: minmax(0, 1fr); }
  .mission { grid-template-columns: minmax(0, 1fr); }
  .coverage { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .teacher-hero .wrap { grid-template-columns: 80px 1fr; }
  .teacher-hero .avatar { width: 80px; height: 80px; }
  .teacher-hero .wrap > .btn { grid-column: span 2; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .header-row { height: auto; flex-wrap: wrap; padding: 10px 0; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .scope { order: 4; flex-basis: 100%; overflow-x: auto; }
  .header-tools .btn { display: none; }
  .header-tools { margin-left: auto; }
  .hero h1 { font-size: 27px; }
  .hero p { font-size: 15px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-grid { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .section { margin: 36px 0; }
  .page-title { font-size: 23px; }
  .room-main { padding: 0 0 16px; }
  .player { border-radius: 0; }
  .controls, .room-title, .room-sub, .room-tags, .index { margin-left: 16px; margin-right: 16px; }
  .controls { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .coverage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-hero h1 { font-size: 23px; }
}

/* 코스 목록 안의 다른 학년·과목 표시 */
.pl-label { display: block; font-style: normal; font-size: 11px; color: #f0b44c; margin-top: 2px; }
div.pl-item.off { cursor: default; }
div.pl-item.off .pthumb { background: #1a1d24; }

/* ── 학년·과목 선택(메가 메뉴) ── */
.picker-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; white-space: nowrap; }
.picker-btn .lv { color: var(--brand); }
.picker-btn .caret { color: var(--faint); font-size: 11px; transition: transform .15s; }
.picker-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.picker-btn:hover { border-color: var(--brand); }
.picker-recent { display: flex; gap: 6px; }
.picker-recent a { height: 32px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--line-2); white-space: nowrap; }
.picker-recent a:hover { color: var(--brand); }
.picker-backdrop { position: fixed; inset: 64px 0 0 0; background: rgba(15, 18, 25, .32); z-index: 40; }
.picker { position: fixed; left: 0; right: 0; top: 64px; z-index: 45; max-height: calc(100vh - 64px); overflow: auto; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px rgba(25, 31, 40, .12); }
.picker-inner { display: grid; grid-template-columns: 180px 220px minmax(0, 1fr); min-height: 340px; }
.picker-col { padding: 20px 16px; border-right: 1px solid var(--line); }
.picker-col.subjects { border-right: 0; padding: 20px 24px; }
.picker-col h4 { margin: 0 0 10px; font-size: 12px; color: var(--faint); font-weight: 700; letter-spacing: .02em; }
.lv-btn, .gr-btn { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--ink-2); text-align: left; }
.lv-btn:hover, .gr-btn:hover { background: var(--line-2); }
.lv-btn[aria-selected="true"], .gr-btn[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }
.lv-btn small, .gr-btn small { font-size: 12px; color: var(--faint); font-weight: 500; }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.subj { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; min-height: 84px; }
.subj b { font-size: 15px; }
.subj span { font-size: 12px; color: var(--muted); }
.subj.ready { border-color: var(--brand); padding-bottom: 32px; }
.subj.ready::after { content: "바로 보기 →"; position: absolute; right: 12px; bottom: 12px; font-size: 12px; font-weight: 700; color: var(--brand); }
.subj:not(.ready) { background: var(--bg); }
.subj:hover { border-color: var(--brand); }
.subj-group { margin-bottom: 18px; }
.subj-group h5 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.picker-foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 12px 24px; font-size: 12px; color: var(--faint); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sheet-head { display: none; }
@media (max-width: 720px) {
  .picker-recent { display: none; }
  .picker-backdrop { inset: 0; }
  .picker { position: fixed; inset: auto 0 0 0; top: auto; max-height: 86vh; overflow: auto; border-radius: 18px 18px 0 0; z-index: 60; }
  .picker-backdrop { z-index: 55; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; position: sticky; top: 0; background: var(--surface); }
  .sheet-head b { font-size: 17px; }
  .picker-inner { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .picker-col { border-right: 0; padding: 8px 16px; }
  .picker-col.subjects { padding: 8px 16px 16px; }
  .lv-list, .gr-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .lv-btn, .gr-btn { width: auto; flex: none; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
  .lv-btn small, .gr-btn small { display: none; }
  .subj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 강의실 제목 아래 한 줄 별점(누르면 리뷰 칸으로) */
.quick-rate { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 14px; background: #12151b; border: 1px solid #22262f; border-radius: 12px; color: #c5cbd3; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.quick-rate small { color: #8b929c; font-weight: 500; font-size: 12px; }
.qr-stars { display: inline-flex; }
.qr-stars button { border: 0; background: none; color: #3a404b; font-size: 26px; line-height: 1; padding: 0 2px; transition: color .1s, transform .1s; }
.qr-stars:hover button { color: var(--star); }
.qr-stars button:hover ~ button { color: #3a404b; }
.qr-stars button:hover { transform: scale(1.15); }
@media (max-width: 720px) { .quick-rate { margin-left: 16px; margin-right: 16px; } }

/* ── 2026-11-20 1단계: 계정·리뷰 자격·관리자·문서 ── */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.wrap.narrow { max-width: 720px; }
.booting #main > .ssr { visibility: hidden; }
.ssr { padding-top: 28px; padding-bottom: 40px; color: var(--muted); }
.ssr h1 { color: var(--ink); }
.ssr ul { padding-left: 18px; }
.browse.no-tree { grid-template-columns: minmax(0, 1fr); }
.account { position: relative; }
.menu { position: absolute; right: 0; top: 44px; min-width: 160px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; display: grid; }
.menu a, .menu button { text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: none; font-size: 14px; }
.menu a:hover, .menu button:hover { background: var(--line-2); }
.footer-links { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.linkish { border: 0; background: none; padding: 0; color: var(--brand); font-size: 13px; font-weight: 600; cursor: pointer; }
.linkish-dark { border: 0; cursor: pointer; }
.btn.block { width: 100%; }

.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.track-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.track-card span { font-size: 12px; color: var(--muted); font-weight: 500; }
.track-card:hover { border-color: var(--brand); }

/* 모달 */
body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 25, .45); z-index: 150; display: grid; place-items: center; padding: 16px; }
.modal { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 18px; padding: 26px 24px 20px; box-shadow: 0 30px 60px rgba(0, 0, 0, .25); }
.modal-x { position: absolute; right: 12px; top: 12px; border: 0; background: var(--line-2); width: 32px; height: 32px; border-radius: 50%; font-size: 14px; color: var(--muted); }
.modal-title { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.03em; }
.modal-sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.modal-foot { margin: 16px 0 0; font-size: 12px; color: var(--faint); }
.socials { display: grid; gap: 8px; margin-top: 12px; }
.social { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 10px; font-weight: 700; font-size: 15px; border: 1px solid var(--line); }
.social small { font-weight: 500; opacity: .7; margin-left: 4px; }
.social.kakao { background: #fee500; color: #191919; border-color: #fee500; }
.social.naver { background: #03c75a; color: #fff; border-color: #03c75a; }
.social.google { background: #fff; color: #1f1f1f; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 18px 0 8px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tabs.small { margin: 0 0 12px; }
.tabs.small button { font-size: 14px; padding: 8px 10px; }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.auth-form label small { font-weight: 500; color: var(--faint); }
.auth-form input:not([type="checkbox"]):not([type="radio"]), .auth-form select, .auth-form textarea { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 15px; }
.auth-form textarea { height: auto; min-height: 80px; padding: 10px 12px; }
.auth-form input:focus, .auth-form textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.auth-form label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; font-size: 14px; }
.auth-form label.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }
.auth-form label.check a { color: var(--brand); text-decoration: underline; }
.form-msg { font-size: 13px; color: #d23a3a; min-height: 1em; }
.done-box { background: var(--free-soft); border-radius: 12px; padding: 16px; }
.done-box p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }

/* 리뷰 자격 */
.gate { background: var(--brand-soft); border-radius: 12px; padding: 14px; font-size: 14px; color: var(--ink-2); margin-bottom: 14px; display: grid; gap: 8px; }
.gate small { color: var(--muted); }
.progress.light { background: var(--surface); }
.progress.light span { background: var(--brand); }
.review-form.locked { opacity: .45; pointer-events: none; }
.review-actions { display: flex; gap: 14px; margin-top: 8px; }
.review-actions .mine { font-size: 12px; color: var(--brand); font-weight: 700; }
.review-actions .linkish { color: var(--muted); font-weight: 500; }
.review-actions .linkish.on { color: var(--brand); font-weight: 700; }
.quick-rate.pulse { animation: pulse 1.2s ease-in-out 3; border-color: var(--star); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 180, 0, .25); } }

/* 관리자 */
.admin .kpis { margin: 10px 0 0; }
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: 14px; margin-top: 12px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--line-2); font-size: 12px; color: var(--muted); }
.tbl .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
.admin form.panel { max-width: 520px; }

/* 문서 */
.legal { padding-top: 32px; padding-bottom: 64px; line-height: 1.75; }
.legal h1 { font-size: 26px; letter-spacing: -0.03em; }
.legal h2 { font-size: 18px; margin-top: 28px; }
.legal .meta { color: var(--muted); font-size: 13px; }
.legal .draft { background: #fff6d6; color: #6b4e00; padding: 10px 14px; border-radius: 10px; font-size: 14px; }

@media (max-width: 720px) {
  .header-tools .btn { display: inline-flex; }
  .modal { padding: 22px 18px 16px; }
  .tbl { display: block; overflow-x: auto; }
}

/* 2단계: 강의 질문·선생님 게시판 */
.question, .post-answers .answer, .answers .answer { border-top: 1px solid var(--line); padding: 14px 0; }
.question:first-of-type { border-top: 0; padding-top: 0; }
.question p, .answer p, .post-body { margin: 6px 0 0; white-space: pre-wrap; }
.time-chip { border: 0; background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 1px 8px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; }
.answers { margin: 10px 0 0 14px; padding-left: 14px; border-left: 3px solid var(--line-2); }
.answer.accepted { background: var(--free-soft); border-radius: 10px; padding: 10px 12px; }
.answer-form { display: grid; gap: 8px; margin-top: 10px; }
.answer-form textarea { min-height: 60px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); resize: vertical; }
.answer-form .btn { justify-self: start; }
.post h3 { font-size: 16px; }

/* ── 연습문제·모의시험 ── */
.practice-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.practice-head h3 small { color: var(--muted); font-weight: 500; margin-left: 6px; font-size: 13px; }
.pq-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 14px; }
.pq { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface); }
.pq.right { border-color: var(--free); }
.pq.wrong { border-color: #e5484d; }
.pq-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pq-level { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--line-2); color: var(--muted); }
.pq-level.l2 { background: var(--brand-soft); color: var(--brand); }
.pq-level.l3 { background: #fff1e6; color: #c25a00; }
.pq-topic { font-size: 12px; color: var(--faint); }
.pq-q { margin: 10px 0 12px; font-size: 15px; line-height: 1.6; color: var(--ink); white-space: normal; }
.pq-q.shake { animation: pq-shake .35s; }
@keyframes pq-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pq-choices { display: grid; gap: 6px; margin-bottom: 10px; }
.pq-choice { text-align: left; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 10px; padding: 9px 12px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.pq-choice:hover:not(:disabled) { border-color: var(--brand); }
.pq-choice[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.pq-choice.is-answer { border-color: var(--free); background: var(--free-soft); color: var(--ink); }
.pq.wrong .pq-choice[aria-checked="true"]:not(.is-answer) { border-color: #e5484d; text-decoration: line-through; }
.pq-num { color: var(--muted); margin-right: 4px; }
.pq-input { width: min(260px, 100%); height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 15px; background: var(--surface); color: var(--ink); margin-bottom: 10px; display: block; }
.pq-result { margin-top: 8px; font-size: 14px; color: var(--ink-2); background: var(--line-2); border-radius: 10px; padding: 10px 12px; }
.pq-result p { margin: 6px 0; line-height: 1.6; }
.pq.right .pq-result b { color: var(--free); }
.pq.wrong .pq-result b { color: #e5484d; }
.practice-foot { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 600; }
.exam-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 8px; }
.exam-units .chk { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; }
.exam-units .chk small { color: var(--faint); margin-left: auto; }
.exam-summary h3 small { color: var(--muted); font-weight: 500; }
/* 강의실 아래 탭 5개가 휴대폰 폭(375px)에 한 줄로 들어가게 */
@media (max-width: 480px) { .room-below .tabs button { padding: 12px 10px; font-size: 14px; } }
