/* 조이잉글리시 엘리트어학원 · 온라인 클래스 */
:root {
  --brand: #0F2884;
  --brand-dark: #0B1D63;
  --brand-tint: #E8ECF8;
  --gold: #C9A227;
  --gold-tint: #F6EFD7;
  --ink: #141B2D;
  --sub: #3D4659;
  --muted: #5B6476;
  --line: #E2E5EB;
  --line-soft: #EEF0F4;
  --field: #C8CDD8;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --ok: #1E7A4C;
  --ok-tint: #E6F4EC;
  --bad: #B4441F;
  --bad-tint: #FBEDE7;
  --radius: 14px;
  --font: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --latin: 'Montserrat', var(--font);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.6; word-break: keep-all;
}
body > main { flex: 1 0 auto; }
img { max-width: 100%; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #6F86E0; outline-offset: 2px; }

/* ── 레이아웃 ── */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 640px) { .wrap { padding-left: 24px; padding-right: 24px; } }
.section { padding-top: 28px; padding-bottom: 56px; }
.section-tight { padding-top: 12px; padding-bottom: 56px; }
.page-narrow { width: 100%; max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; }
.stack-xs > * + * { margin-top: 6px; }
.stack-sm > * + * { margin-top: 10px; }
.stack-md > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 24px; }
.stack-xl > * + * { margin-top: 32px; }
.stack-xs > *, .stack-sm > *, .stack-md > *, .stack-lg > *, .stack-xl > * { margin-bottom: 0; }
/* 숨은 입력칸(input hidden) 다음 첫 요소에는 위 여백을 주지 않아요 */
.stack-xs > input[type=hidden] + :not(input), .stack-sm > input[type=hidden] + :not(input), .stack-md > input[type=hidden] + :not(input),
.stack-lg > input[type=hidden] + :not(input), .stack-xl > input[type=hidden] + :not(input), .login-card > input[type=hidden] + :not(input) { margin-top: 0; }

/* ── 글자 ── */
.h1, .h2, .h3, .h4 { margin: 0; letter-spacing: -0.01em; line-height: 1.3; }
.h1 { font-size: 26px; font-weight: 900; }
.h2 { font-size: 21px; font-weight: 900; }
.h3 { font-size: 18px; font-weight: 700; }
.h4 { font-size: 16px; font-weight: 700; }
@media (min-width: 768px) { .h1 { font-size: 30px; } .h2 { font-size: 22px; } }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.6; }
.center { text-align: center; }
.with-icon { display: flex; align-items: flex-start; gap: 8px; }
.with-icon .icon { flex: 0 0 auto; margin-top: 3px; }
.icon { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.eyebrow { font-family: var(--latin); font-weight: 700; font-size: 12px; letter-spacing: 0.2em; color: var(--muted); }
.eyebrow-gold { font-family: var(--latin); font-weight: 700; font-size: 13px; letter-spacing: 0.22em; color: var(--gold); }
.eyebrow-muted { font-size: 14px; font-weight: 700; color: var(--muted); }
.link-strong { color: var(--brand); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.text-danger { color: var(--bad) !important; }
.req { color: var(--bad); }
.num { font-family: var(--latin); font-weight: 700; font-size: 14px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 6px; background: var(--line-soft); color: var(--sub); font-size: 13px; font-weight: 700; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── 헤더 ── */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
.header-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.brand-logo { height: 40px; width: auto; display: block; }
@media (min-width: 640px) { .brand-logo { height: 48px; } }
.brand-tag { padding: 4px 11px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge-admin { padding: 3px 9px; border-radius: 6px; background: var(--gold); color: var(--brand); font-size: 12px; font-weight: 700; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-nav a { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 10px; color: var(--sub); text-decoration: none; font-size: 15px; font-weight: 500; }
.admin-nav a:hover { background: var(--line-soft); color: var(--ink); }
.admin-nav a.is-active { background: var(--brand-tint); color: var(--brand); font-weight: 700; }
.count-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--brand); font-family: var(--latin); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.header-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.header-links > a:not(.btn) { min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; color: var(--muted); text-decoration: none; font-size: 14px; }
.header-links > a:not(.btn):hover { color: var(--ink); }
.header-links > a.link-strong { color: var(--brand); font-size: 15px; font-weight: 700; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--brand-tint); font-size: 14px; }
@media (max-width: 479px) { .header-links > a.link-strong { display: none; } .brand-tag { font-size: 12px; padding: 3px 9px; } }
.user-chip em { font-style: normal; color: var(--brand); font-weight: 700; }

/* ── 푸터 ── */
.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-top: 14px; padding-bottom: 14px; font-size: 13px; color: var(--muted); }
.footer-row a { color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; }

/* ── 알림 ── */
.flash-wrap { padding-top: 16px; }
.flash-wrap .flash + .flash { margin-top: 8px; }
.flash { padding: 13px 16px; border-radius: 12px; font-size: 15px; line-height: 1.6; background: var(--brand); color: #fff; }
.flash-error { background: var(--bad-tint); color: #8A2F12; border: 1px solid #F0C9BA; }
.flash-warn { background: var(--gold-tint); color: var(--ink); border: 1px solid #E8D9A8; }
.flash a { color: inherit; font-weight: 700; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--field); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-done { background: var(--ok-tint); color: var(--ok); }
.btn-done:hover { color: var(--ok); }
.btn-sm { min-height: 44px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 52px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }
.btn.is-disabled, .btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn-row.left { justify-content: flex-start; }
.btn-row.right { justify-content: flex-end; }
.btn-row > .btn-lg { flex: 1 1 200px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 10px; background: transparent; color: var(--sub); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }

/* ── 입력 ── */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.label { font-size: 14px; font-weight: 700; }
.label .muted { font-weight: 400; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--field); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 16px; line-height: 1.4;
}
textarea.input { resize: vertical; min-height: 80px; }
select.input { padding-right: 32px; }
.input:focus { border-color: var(--brand); outline: 3px solid rgba(15, 40, 132, .18); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1 1 auto; min-width: 0; }
.field-note { font-size: 13px; color: var(--muted); min-height: 0; }
.field-note:empty { display: none; }
.field-note.is-ok { color: var(--ok); font-weight: 500; }
.field-note.is-bad, .field-error { color: var(--bad); font-weight: 500; font-size: 13px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); flex: 0 0 auto; }
.grid-2, .grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-2 { grid-column: 1 / -1; }
}
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.form-row .grow { flex: 1 1 220px; }
.form-row .narrow { flex: 0 1 140px; }
.fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 0; }
.fieldset legend { padding: 0 6px; font-weight: 700; }
.fieldset .hint { margin-top: 12px; }
.agree-box { background: var(--bg); border-radius: 12px; padding: 8px 16px 12px; }
.agree-box details summary { cursor: pointer; font-size: 13px; color: var(--sub); min-height: 32px; display: flex; align-items: center; gap: 6px; list-style: none; }
.also-box summary { list-style: none; }
.agree-text { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--sub); }
.inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; margin-top: 8px; }
.also-box summary { cursor: pointer; font-weight: 700; font-size: 15px; min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--brand); }
.also-box summary::-webkit-details-marker, .agree-box summary::-webkit-details-marker { display: none; }
.also-box summary::before, .agree-box summary::before { content: '▸'; font-size: 12px; }
.also-box[open] > summary::before, .agree-box details[open] > summary::before { content: '▾'; }

/* ── 카드 ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.card-pad { padding: 22px 18px; }
@media (min-width: 640px) { .card-pad { padding: 28px; } }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .card-head { padding: 16px 24px; } }
.card-head-plain { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.card-pad > .empty, .card-pad.empty { padding: 12px 0; }

/* ── 로그인 ── */
.hero { background: var(--brand); color: #fff; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 36px 48px; padding-top: 44px; padding-bottom: 52px; }
@media (min-width: 900px) { .hero-row { padding-top: 64px; padding-bottom: 72px; } }
.hero-copy { flex: 1 1 420px; min-width: 0; }
.hero-copy > * + * { margin-top: 20px; }
.hero-title { margin: 0; font-size: 34px; line-height: 1.25; font-weight: 900; letter-spacing: -0.02em; }
@media (min-width: 640px) { .hero-title { font-size: 46px; } }
.hero-sub { font-size: 16px; line-height: 1.75; color: #D5DCF0; max-width: 520px; }
.hero-points { list-style: none; margin: 8px 0 0; padding: 0; }
.hero-points li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.hero-points li + li { margin-top: 10px; }
.hero-points .icon { color: var(--gold); }
.hero-quote { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid #3A4C9C; font-family: var(--latin); font-size: 14px; font-style: italic; color: #C3CCE8; max-width: 520px; }
.login-card { flex: 1 1 340px; max-width: 440px; min-width: 0; background: #fff; color: var(--ink); border-radius: 18px; padding: 30px 24px; box-shadow: 0 24px 48px rgba(5, 10, 40, .35); }
@media (min-width: 640px) { .login-card { padding: 36px 32px; } }
.login-card > * + * { margin-top: 18px; }
.login-shield { width: 44px; height: auto; display: block; margin-bottom: 8px; }
.login-foot { border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--sub); }
.page-login .hero-copy { order: 0; }
@media (max-width: 899px) { .page-login .login-card { order: -1; max-width: none; } .page-login .hero-copy { display: none; } .page-login .hero-row { padding-top: 24px; padding-bottom: 32px; } }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.steps li { display: flex; flex-direction: column; gap: 6px; }
.steps strong { font-size: 17px; }
.steps .muted { font-size: 14px; }
.step-no { font-family: var(--latin); font-weight: 800; font-size: 13px; color: var(--brand); letter-spacing: 0.1em; }

/* ── 가입 단계 · 대기 ── */
.pill-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill-steps li { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--line-soft); color: var(--sub); font-size: 14px; }
.pill-steps li span { font-family: var(--latin); font-weight: 700; }
.pill-steps li.is-current { background: var(--brand); color: #fff; font-weight: 700; }
.icon-circle { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; background: var(--gold-tint); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.status-steps { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.status-steps li { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: var(--line-soft); color: var(--sub); font-size: 14px; }
.status-steps li.is-done { background: var(--ok-tint); color: var(--ok); font-weight: 700; }
.status-steps li.is-current { background: var(--brand); color: #fff; font-weight: 700; }
.status-steps .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.info-list { margin: 0; background: var(--bg); border-radius: 12px; padding: 16px 20px; display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; text-align: left; font-size: 15px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 500; }

/* ── 학생 홈 ── */
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-radius: 12px; background: var(--gold-tint); }
.preview-bar .input { width: auto; min-width: 180px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.search-box { position: relative; flex: 0 1 340px; min-width: 220px; }
.search-box .input { padding-left: 44px; }
.search-box .search-icon { position: absolute; left: 15px; top: 15px; color: var(--muted); pointer-events: none; }
.two-up { display: flex; flex-wrap: wrap; gap: 20px; }
.two-up > .continue { flex: 2 1 540px; }
.two-up > :not(.continue) { flex: 1 1 300px; }
.two-up > * { min-width: 0; }
.continue { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.thumb { position: relative; flex: 1 1 240px; max-width: 340px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--brand); display: block; }
.thumb-grammar { background: #0F2884; } .thumb-reading { background: #1F4B4E; } .thumb-etc { background: #4A3A24; }
.thumb-label { position: absolute; left: 14px; top: 12px; right: 14px; display: flex; flex-direction: column; gap: 2px; color: #fff; }
.thumb-title { font-size: 14px; font-weight: 700; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-play { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: var(--gold); color: var(--brand); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.continue-body { flex: 1 1 220px; min-width: 0; }
.continue-body .btn { align-self: flex-start; }
.new-list { list-style: none; margin: 0; padding: 0; }
.new-list a { min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.new-list a:hover { background: var(--bg); }
.new-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.new-text strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-new { flex: 0 0 auto; padding: 2px 8px; border-radius: 6px; background: var(--gold); color: var(--brand); font-family: var(--latin); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; }
.date-chip { flex: 0 0 auto; padding: 2px 8px; border-radius: 6px; background: var(--line-soft); color: var(--sub); font-family: var(--latin); font-size: 12px; font-weight: 700; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: #E8EBF1; border-radius: 14px; }
.seg a { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: 10px; color: var(--sub); text-decoration: none; font-size: 15px; font-weight: 500; }
.seg a.is-active { background: var(--brand); color: #fff; font-weight: 700; }
.seg-count { font-family: var(--latin); font-size: 13px; color: var(--muted); }
.seg a.is-active .seg-count { color: var(--gold); }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.book-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.book-card:hover { color: var(--ink); box-shadow: 0 10px 24px rgba(15, 40, 132, .12); transform: translateY(-2px); }
.book-cover { height: 124px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; }
.book-cover.big { flex: 0 0 160px; height: 208px; border-radius: 12px; }
.cover-en { font-family: var(--latin); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; color: #E8D9A8; }
.cover-title { font-size: 19px; font-weight: 900; line-height: 1.3; }
.book-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--sub); }
.book-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.bar { display: block; height: 6px; border-radius: 999px; background: #E8EBF1; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar-row { display: flex; align-items: center; gap: 12px; max-width: 420px; }
.bar-row .bar { flex: 1 1 auto; height: 8px; }

/* ── 강의 목록 ── */
.lec-rows { list-style: none; margin: 0; padding: 0; }
.lec-rows li + li { border-top: 1px solid var(--line-soft); }
.lec-row { min-height: 60px; padding: 10px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--ink); text-decoration: none; }
@media (min-width: 640px) { .lec-row { padding: 10px 24px; } }
.lec-row:hover { background: var(--bg); color: var(--ink); }
.lec-no { flex: 0 0 44px; font-family: var(--latin); font-size: 14px; font-weight: 700; color: var(--muted); }
.lec-title { flex: 1 1 200px; min-width: 0; font-size: 16px; font-weight: 700; }
.lec-date { flex: 0 0 auto; }
.status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--line-soft); color: var(--sub); font-size: 13px; font-weight: 500; white-space: nowrap; }
.status-done { background: var(--ok-tint); color: var(--ok); font-weight: 700; }
.status-ing { background: var(--brand); color: #fff; font-weight: 700; }
.status-bad { background: var(--bad-tint); color: var(--bad); font-weight: 700; }
@media (max-width: 639px) { .lec-date { order: 3; flex-basis: 100%; padding-left: 58px; } }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); }
.crumbs a { min-height: 44px; display: inline-flex; align-items: center; color: var(--sub); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs [aria-current] { color: var(--ink); font-weight: 700; }
.book-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.book-hero-body { flex: 1 1 300px; min-width: 0; }
.book-hero-body .tag { align-self: flex-start; }

/* ── 강의 시청 ── */
.back-link { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: var(--sub); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--brand); }
.watch-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.watch-main { flex: 999 1 560px; min-width: 0; }
/* ── 강의 플레이어 ── */
.jp {
  --crop: clamp(60px, 15%, 140px);
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: #000; color: #fff; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
@media (max-width: 639px) { .jp { border-radius: 0; margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); } }
.jp [hidden] { display: none !important; }
.jp-stage { position: absolute; inset: 0; overflow: hidden; }
/* 유튜브 화면을 위아래로 조금 크게 놓고 잘라 내서, 왼쪽 위 제목 · 채널과 오른쪽 아래 유튜브 로고가 보이지 않게 합니다. */
.jp-frame { position: absolute; left: 0; width: 100%; top: calc(-1 * var(--crop)); height: calc(100% + 2 * var(--crop)); border: 0; pointer-events: none; }
.jp.cc-on { --crop: 0px; }
.jp.is-native .jp-frame { pointer-events: auto; }
/* 비메오: 비메오 자체 플레이어를 그대로 씁니다 (주소가 새어도 우리 사이트 밖에서는 재생되지 않게 잠가 둠) */
.jp.is-vimeo .jp-frame { top: 0; height: 100%; pointer-events: auto; }
.jp.is-vimeo .jp-shield, .jp.is-vimeo .jp-big, .jp.is-vimeo .jp-bar { display: none; }
/* 투명한 막: 유튜브 화면의 링크 · 로고를 누를 수 없게 덮습니다. */
.jp-shield { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; z-index: 2; -webkit-tap-highlight-color: transparent; }
.jp-shield:focus-visible { outline: 3px solid #6F86E0; outline-offset: -3px; }
.jp.is-native .jp-shield { display: none; }
.jp-big { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; pointer-events: none; background: rgba(0, 0, 0, .3); transition: opacity .2s; }
.jp-big span { width: 76px; height: 76px; border-radius: 50%; background: var(--gold); color: var(--brand); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.jp-big .icon { margin-left: 4px; }
.jp.is-playing .jp-big, .jp.is-native .jp-big { opacity: 0; }
.jp-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 5; margin: 0; padding: 8px 14px; max-width: calc(100% - 24px); border-radius: 999px; background: rgba(11, 29, 99, .94); color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.jp-end { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; background: #0B1426; text-align: center; }
.jp-end-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.jp-end-title .icon { color: #7ED9A5; }
.jp-end-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.jp-end .btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.jp-end .btn-outline:hover { color: #fff; border-color: #fff; }
.jp-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 30px 8px 4px; background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0)); transition: opacity .25s; }
.jp.is-idle .jp-bar { opacity: 0; pointer-events: none; }
.jp.is-idle, .jp.is-idle .jp-shield { cursor: none; }
.jp.is-touch:not(.is-started) .jp-bar, .jp.is-noapi .jp-bar { display: none; }
.jp-row { display: flex; align-items: center; gap: 2px; }
.jp-btn { flex: 0 0 auto; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; }
.jp-btn:hover { background: rgba(255, 255, 255, .15); }
.jp-btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.jp-text { width: auto; min-width: 42px; padding: 0 9px; font-size: 13px; font-weight: 700; }
.jp-btn[aria-pressed="true"] { background: #fff; color: var(--brand); }
.jp-time { padding: 0 8px; font-family: var(--latin); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.jp-spacer { flex: 1 1 auto; }
.jp-seek, .jp-vol { -webkit-appearance: none; appearance: none; margin: 0; background: transparent; cursor: pointer; }
.jp-seek { --pct: 0%; display: block; width: 100%; height: 20px; }
.jp-vol { --pct: 100%; width: 80px; height: 20px; }
.jp-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--gold) var(--pct), rgba(255, 255, 255, .35) var(--pct)); }
.jp-vol::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, #fff var(--pct), rgba(255, 255, 255, .35) var(--pct)); }
.jp-seek::-webkit-slider-thumb, .jp-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff; }
.jp-seek::-moz-range-track, .jp-vol::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .35); }
.jp-seek::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--gold); }
.jp-vol::-moz-range-progress { height: 4px; border-radius: 4px; background: #fff; }
.jp-seek::-moz-range-thumb, .jp-vol::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.jp-seek:focus-visible, .jp-vol:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: none) { .jp-vol { display: none; } }
@media (max-width: 479px) {
  .jp-btn { width: 38px; height: 38px; }
  .jp-text { min-width: 38px; padding: 0 6px; font-size: 12px; }
  .jp-time { padding: 0 4px; font-size: 12px; }
  .jp-big span { width: 60px; height: 60px; }
}
@media (max-width: 379px) { .jp-btn[data-act="back"], .jp-btn[data-act="fwd"] { display: none; } }
/* 전체 화면 */
.jp.is-fs { width: 100%; height: 100%; margin: 0; border-radius: 0; aspect-ratio: auto; }
.jp.is-fs .jp-stage { inset: auto; top: 50%; left: 50%; width: min(100vw, 177.78vh); height: auto; aspect-ratio: 16 / 9; transform: translate(-50%, -50%); }
.jp.is-pseudo-fs { position: fixed; inset: 0; z-index: 9999; width: 100vw; height: 100vh; height: 100dvh; }
html.jp-lock, html.jp-lock body { overflow: hidden; }
.watch-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.watch-actions form { margin: 0; }
.memo p { font-size: 15px; line-height: 1.75; color: var(--sub); }
.side-list { flex: 1 1 300px; min-width: 0; overflow: hidden; }
.side-list ol { list-style: none; margin: 0; padding: 6px; max-height: 640px; overflow-y: auto; }
.side-list a { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14px; }
.side-list a:hover { background: var(--bg); color: var(--ink); }
.side-list a.is-current { background: var(--brand); color: #fff; font-weight: 700; }
.side-no { flex: 0 0 36px; font-family: var(--latin); font-size: 13px; font-weight: 700; color: var(--muted); }
.side-list a.is-current .side-no { color: var(--gold); }
.side-title { flex: 1 1 auto; min-width: 0; }
.ok-mark { color: var(--ok); display: inline-flex; }

/* ── 관리자 ── */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar-form select.input { width: auto; min-width: 140px; }
.toolbar-form .search-box { flex: 1 1 220px; min-width: 200px; }
.member-head { display: none; }
.member-list { list-style: none; margin: 0; padding: 0; }
.member { padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 15px; }
.member + .member { border-top: 1px solid var(--line-soft); }
.member > span { min-width: 0; }
.m-name { display: flex; flex-direction: column; }
.m-id { font-family: var(--latin); font-size: 14px; color: var(--sub); }
.m-date { font-family: var(--latin); font-size: 13px; color: var(--muted); }
.m-label { display: inline; font-size: 12px; color: var(--muted); margin-right: 6px; }
.m-actions, .m-class { flex-basis: 100%; }
.m-actions select.input, .m-class select.input { width: auto; min-width: 140px; min-height: 44px; }
@media (min-width: 1024px) {
  .member-head { display: grid; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
  .member { display: grid; gap: 14px; padding: 12px 20px; }
  .m-actions, .m-class { flex-basis: auto; }
  .m-label { display: none; }
  .member-pending { grid-template-columns: 56px 130px 120px 150px 110px minmax(0, 1fr); }
  .member-pending .m-actions, .member-class .m-actions, .member-inactive .m-actions { justify-self: end; }
  .member-class, .member-inactive { display: flex; }
  .member-head span:last-child { text-align: right; }
}
.class-list { list-style: none; margin: 0; padding: 0; }
.class-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 18px; }
@media (min-width: 640px) { .class-item { padding: 14px 24px; } }
.class-item + .class-item { border-top: 1px solid var(--line-soft); }
.class-info { display: flex; flex-direction: column; }
.class-info strong { font-size: 16px; }

.admin-split { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.class-nav { flex: 1 1 220px; min-width: 0; padding: 12px; }
.class-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px; }
.class-group + .class-group { margin-top: 10px; }
.class-group-label { padding: 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.class-nav a { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; }
.class-nav a:hover { background: var(--bg); color: var(--ink); }
.class-nav a.is-active { background: var(--brand); color: #fff; font-weight: 700; }
.class-nav a .small { color: var(--muted); font-weight: 400; }
.class-nav a.is-active .small { color: #C9D1E3; }
@media (max-width: 899px) {
  .class-nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .class-nav-head { flex-basis: 100%; }
  .class-group { display: contents; }
  .class-group-label { display: none; }
  .class-nav a { border: 1px solid var(--line); }
  .class-nav a .small { display: none; }
}
.admin-main { flex: 999 1 640px; min-width: 0; }
.chip-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.chip { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 1px solid var(--field); border-radius: 12px; background: #fff; color: var(--sub); text-decoration: none; font-size: 15px; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active { border: 2px solid var(--brand); color: var(--brand); font-weight: 700; }
.chip-count { font-family: var(--latin); font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--line-soft); color: var(--sub); }
.chip.is-active .chip-count { background: var(--brand); color: #fff; }
.chip-dashed { border-style: dashed; border-color: #8E97A8; }
.add-book { position: relative; }
.add-book summary { list-style: none; }
.add-book summary::-webkit-details-marker { display: none; }
.add-book[open] summary { border-color: var(--brand); color: var(--brand); }
.add-book-form { margin-top: 8px; padding: 14px; width: min(420px, 86vw); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 28px rgba(20, 27, 45, .12); }
.add-book-form .label { display: block; margin-bottom: 6px; }
.admin-lec-list { list-style: none; margin: 0; padding: 0; }
.admin-lec-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 18px; }
@media (min-width: 640px) { .admin-lec-list li { padding: 10px 24px; } }
.admin-lec-list li + li { border-top: 1px solid var(--line-soft); }
.mini-thumb-vimeo { display: inline-flex; align-items: center; justify-content: center; background: #1AB7EA; color: #fff; font-size: 13px; font-weight: 700; }
.mini-thumb { color: transparent; width: 96px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--line-soft); flex: 0 0 auto; }
.admin-lec-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.admin-lec-text a { color: var(--sub); }
.admin-lec-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.book-settings summary { cursor: pointer; min-height: 32px; }
.grade-add { padding: 16px 18px 18px; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .grade-add { padding: 16px 24px 20px; } }
.grade-add .label { display: block; margin-bottom: 6px; }
.aud-grade-select { margin-top: 8px; width: auto; min-width: 140px; min-height: 44px; }
/* 교재 공개 범위 */
.chip-flag { padding: 1px 7px; border-radius: 6px; background: var(--gold); color: var(--brand); font-size: 11px; font-weight: 800; }
.audience-card { overflow: hidden; }
.audience-summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
.audience-summary::-webkit-details-marker { display: none; }
.audience-card[open] .audience-summary { border-bottom: 1px solid var(--line); }
.aud-icon { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px; background: var(--brand-tint); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.aud-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.aud-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aud-change { flex: 0 0 auto; color: var(--brand); font-size: 14px; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.audience-form { padding: 18px; }
@media (min-width: 640px) { .audience-form { padding: 20px 24px 24px; } .audience-summary { padding: 14px 24px; } }
.aud-options { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.aud-option { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--field); border-radius: 12px; cursor: pointer; }
.aud-option input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: 0 0 auto; }
.aud-option > span { display: flex; flex-direction: column; gap: 2px; }
.aud-option:has(input:checked) { border: 2px solid var(--brand); background: var(--brand-tint); padding: 13px; }
.aud-pick { background: var(--bg); border-radius: 12px; padding: 14px 16px; }
.aud-group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.aud-others summary { cursor: pointer; font-weight: 700; color: var(--brand); min-height: 44px; display: flex; align-items: center; }
.aud-others summary { list-style: none; gap: 8px; }
.aud-others summary::-webkit-details-marker { display: none; }
.aud-others summary::before { content: '▸'; font-size: 12px; }
.aud-others[open] > summary::before { content: '▾'; }
.aud-group { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.cover-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.book-badge { padding: 2px 8px; border-radius: 6px; background: var(--gold); color: var(--brand); font-size: 11px; font-weight: 800; white-space: nowrap; }
.tag-gold { background: var(--gold-tint); color: #6B5410; }
.book-settings > form { margin-top: 16px; }

/* 인쇄 · 동작 줄이기 */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── v17: 반 · 학생 관리 / 교재 중심 강의 관리 ───────────────── */
@media (min-width: 1200px) {
  .member-class { display: grid; grid-template-columns: 120px 110px minmax(0, 1fr) auto auto; }
  .member-inactive { display: grid; grid-template-columns: 120px 110px minmax(0, 1fr) 80px auto; }
}
.class-nav a.nav-setup { justify-content: flex-start; color: var(--brand); font-weight: 700; }
.class-nav a.nav-setup.is-active { color: #fff; }
.nav-search { margin: 6px 0 10px; }
.nav-search .input { min-height: 44px; }
@media (max-width: 899px) {
  .nav-search { flex-basis: 100%; margin: 0; order: -1; }
  .class-nav-head { order: -2; }
}

.lec-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.lec-filter > .field:first-child { flex: 0 1 240px; min-width: 180px; }
.lec-filter .grow { flex: 1 1 260px; }

.new-book { overflow: hidden; }
.new-book-summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 56px; padding: 0 18px; cursor: pointer; color: var(--brand); font-weight: 700; font-size: 16px; }
.new-book-summary::-webkit-details-marker { display: none; }
.new-book[open] .new-book-summary { border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .new-book-summary { padding: 0 24px; } }

.targets-classes { border: 0; margin: 0; padding: 0; min-width: 0; }
.targets-classes legend { margin-bottom: 8px; }
.targets .btn-row { margin-bottom: 8px; }
.grade-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 12px; padding: 8px 12px; background: var(--bg); border-radius: 12px; }
.grade-row .check-grid { flex: 1 1 300px; margin-top: 0; }
.grade-toggle { flex: 0 0 auto; min-height: 44px; min-width: 88px; padding: 0 12px; border: 1px solid var(--field); border-radius: 10px; background: #fff; color: var(--brand); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.grade-toggle:hover { border-color: var(--brand); }

.book-rows { list-style: none; margin: 0; padding: 0; }
.book-rows li + li { border-top: 1px solid var(--line-soft); }
.book-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 18px; color: var(--ink); text-decoration: none; }
.book-row:hover { background: var(--bg); color: var(--ink); }
@media (min-width: 640px) { .book-row { padding: 14px 24px; } }
.book-row-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.book-row-title strong { font-size: 16px; }
.book-row-meta { flex: 0 0 auto; }
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-chip { padding: 2px 8px; border-radius: 6px; background: var(--brand-tint); color: var(--brand); font-size: 12px; font-weight: 700; white-space: nowrap; }
.mini-chip-gold { background: var(--gold-tint); color: #6B5410; }
.mini-chip-warn { background: #FDECEC; color: #B42318; }
[hidden] { display: none !important; }
.book-row > svg:last-child { margin-left: auto; flex: 0 0 auto; }
.aud-others summary { flex-wrap: wrap; column-gap: 8px; row-gap: 0; }
.aud-others summary .muted { font-weight: 400; }

/* ── v18: 과목 관리 ───────────────────────────────────────── */
.wrap.page-mid { max-width: 920px; }
.grow-info { flex: 1 1 160px; min-width: 0; }
.subj-cover { flex: 0 0 auto; width: 92px; height: 52px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; color: #fff; font-family: var(--latin); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-align: center; line-height: 1.15; overflow: hidden; word-break: break-all; }
.class-item.subject-edit { display: block; }
.subject-edit > * + * { margin-top: 16px; }
.subject-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.subject-fields .subj-cover { width: 108px; height: 62px; font-size: 13px; }
.subject-fields .form-row { flex: 1 1 280px; }
.subject-fields .field.narrow { flex: 1 1 160px; }
.swatches { min-width: 0; }
.swatches legend { margin-bottom: 6px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch-dot { width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch input:checked + .swatch-dot { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--brand); }
.swatch input:focus-visible + .swatch-dot { outline: 2px solid var(--gold); outline-offset: 4px; }
.subject-delete { padding-top: 16px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.subject-delete .label { flex-basis: 100%; }
.subject-delete select.input { width: auto; min-width: 160px; min-height: 44px; }
.move-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.move-book { align-items: flex-start; padding: 8px 0; }
.move-book input { margin-top: 2px; }
.move-book-text { display: flex; flex-direction: column; min-width: 0; }
.toolbar .btn-sm { min-height: 44px; }
.swatches .label { margin: 0 0 6px; }
#move .field.narrow { flex: 0 1 260px; min-width: 200px; }
