/* ===================================================================
   짬짬이 수업영상 — 클린 클래스룸 + 소프트 3D
   짬짬이 게임·영상의 디자인 언어를 잇는다:
   네이비 헤더 + 밝은 본문(#F5F7FA) + 화이트 카드 + 포인트 색
   이 사이트의 포인트 색은 번트 오렌지(#E8590C) — 다른 짬짬이와 구별된다.
   =================================================================== */

@font-face {
  font-family: 'Pretendard Variable';
  font-style: normal;
  font-weight: 45 920;
  font-display: swap;
  src: url('assets/fonts/PretendardVariable.subset.woff2') format('woff2-variations');
}

:root {
  --navy:      #152447;
  --navy-2:    #1F3468;
  --navy-deep: #0C1730;
  --ink:       #1C2333;
  --bg:        #F5F7FA;
  --card:      #FFFFFF;
  --line:      #E4E7EE;
  --accent:    #E8590C;   /* 번트 오렌지 — 이 사이트의 포인트 */
  --accent-dk: #C2410C;
  --accent-lt: #FFF1E8;
  --sub:       #7A8499;
  --radius:    14px;
  --shadow-card:  0 1px 3px rgba(21,36,71,0.06);
  --shadow-hover: 0 10px 24px rgba(21,36,71,0.14);
  --grad-accent: linear-gradient(135deg, #FF9A4D 10%, #E8590C 55%, #C2410C 100%);
  --grad-navy:   linear-gradient(135deg, #2A4378 0%, #152447 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

.s3d {
  width: 1.4em; height: 1.4em;
  flex-shrink: 0;
  vertical-align: -0.26em;
  filter: drop-shadow(0 3px 5px rgba(21,36,71,0.28));
}
.s3d-18 { width: 1.45em; height: 1.45em; }
.s3d-20 { width: 1.4em;  height: 1.4em; }
.s3d-22 { width: 1.5em;  height: 1.5em; }

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

/* ── 헤더 ───────────────────────────────────────────────── */
/* 헤더는 짬짬이 영상(video/)과 같은 틀로 맞춘다 — 가운데 1200px 상자, 단색 네이비,
   46px 로고, 큰 제목. 예전엔 화면 끝까지 꽉 찬 그라데이션 띠에 작은 제목이라
   시리즈 안에서 혼자 달라 보였다(2026-11-17). */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 14px 20px;
  background: var(--navy);
  box-shadow: 0 10px 24px rgba(21,36,71,0.18);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand-logo { display: block; width: 46px; height: 46px; filter: drop-shadow(0 5px 9px rgba(0,0,0,0.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { color: #fff; font-size: 1.45rem; font-weight: 900; letter-spacing: -0.01em; white-space: nowrap; }
.brand-text small { color: #9DB0D8; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.wood-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  background: var(--navy-2);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.wood-btn:hover { background: #2A4378; }
.wood-btn:active { transform: translateY(1px); }

/* ── CTA 스트립 ─────────────────────────────────────────── */
.cta-strip {
  width: min(1200px, 100%);
  margin: 0 auto;
  background: var(--accent-lt);
  border-bottom: 1px solid #FBD9C4;
  padding: 10px 18px;
  text-align: center;
}
.cta-copy { font-size: 0.93rem; color: #7A3A10; }
.cta-copy b { color: var(--accent-dk); }

/* ── 본문 ───────────────────────────────────────────────── */
/* 본문도 헤더와 같은 1200px 상자 — 좌우 끝선이 헤더·안내 띠와 맞게(짬짬이 영상과 같은 값) */
.board { width: min(1200px, 100%); margin: 0 auto; padding: 18px 20px 56px; }

/* 과목·검색 고르기 */
.picker {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 20px;
}
/* 검색을 맨 위에 두고, 그 아래로 출판사 → 교과 → 학년 → 단원을 좁혀 간다.
   선생님이 가장 먼저 확인하는 것은 "내 교과서가 여기 있나"이지만,
   이미 아는 사람은 곧장 검색한다. 그래서 검색이 위, 고르기가 아래다. */
.searchtop { position: relative; color: var(--navy); }
.searchtop input {
  width: 100%;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 11px 38px 11px 42px;
  font-size: 0.96rem; font-family: inherit; color: var(--ink); background: #fff;
}
.searchtop input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.searchtop-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; opacity: 0.55; pointer-events: none;
}
.pick-divider { height: 1px; background: var(--line); }

/* 한 줄에 다 넣는다. 네 항목은 바꾸는 빈도가 다르다 —
   출판사·교과·학년은 학기 내내 한 번 정하면 끝이라 접어 두고(드롭다운),
   단원은 진도 따라 자주 바뀌므로 펼쳐 둔다(칩). */
.pick-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pick-fixed { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pick-label { font-size: 0.86rem; font-weight: 800; color: var(--navy); }
.sel-cap { font-size: 0.86rem; font-weight: 800; color: var(--navy); }
.sel-slot { display: inline-flex; align-items: center; }

/* 브라우저 기본 select 를 쓴다. 직접 만들면 코드가 늘고 키보드·화면낭독기
   대응이 나빠진다. 모바일에서는 OS 피커로 떠서 오히려 누르기 편하다. */
.pick-select {
  appearance: none;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px;
  padding: 7px 30px 7px 14px;
  font-family: inherit; font-size: 0.92rem; font-weight: 700;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A8499' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
.pick-select:hover { border-color: #C8CEDA; }
.pick-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 고를 것이 하나뿐일 때는 드롭다운으로 두지 않는다 —
   눌러도 아무것도 없는 것을 누를 수 있게 보이면 거짓말이 된다. */
.sel-fixed {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 7px 4px;
  font-size: 0.92rem; font-weight: 700; color: var(--ink);
}
.sel-fixed .n { font-size: 0.76rem; color: var(--sub); font-variant-numeric: tabular-nums; }

.pick-sep { width: 1px; align-self: stretch; min-height: 22px; background: var(--line); }
.pick-units { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.picker-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picker-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.86rem; font-weight: 700; color: var(--navy);
  min-width: 84px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.88rem; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.chip:hover { border-color: var(--accent); color: var(--accent-dk); }
.chip[aria-pressed="true"] {
  background: var(--grad-accent); border-color: transparent; color: #fff;
}

.search-box { position: relative; flex: 1 1 260px; min-width: 200px; }
.search-box input {
  width: 100%;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 38px 8px 14px;
  font-size: 0.92rem; font-family: inherit; color: var(--ink);
  background: #fff;
}
.search-box input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--sub);
  cursor: pointer; font-size: 0.9rem; padding: 4px 6px;
}

/* ── 단원 구역 ──────────────────────────────────────────── */
.units { display: flex; flex-direction: column; gap: 26px; }

.unit-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding-bottom: 8px; margin-bottom: 12px;
  border-bottom: 2px solid var(--line);
}
.unit-no {
  background: var(--grad-navy); color: #fff;
  border-radius: 8px; padding: 2px 10px;
  font-size: 0.82rem; font-weight: 800;
}
.unit-title { font-size: 1.08rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.unit-count { font-size: 0.82rem; color: var(--sub); }

/* 차시 카드 — 세로 영상이라 카드도 세로로 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  padding: 0;
  transition: transform .12s ease, box-shadow .12s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.thumb-wrap {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--navy-deep);
  overflow: hidden;
}
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(12,23,48,0.86); color: #fff;
  border-radius: 8px; padding: 2px 8px;
  font-size: 0.76rem; font-weight: 800;
}
.thumb-time {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(12,23,48,0.86); color: #fff;
  border-radius: 6px; padding: 1px 6px;
  font-size: 0.74rem; font-variant-numeric: tabular-nums;
}
.thumb-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: 0; transition: opacity .12s ease;
}
.card:hover .thumb-play, .card:focus-visible .thumb-play { opacity: 1; }
.thumb-play svg { width: 54px; height: 54px; }

.card-body { padding: 9px 11px 12px; display: flex; flex-direction: column; gap: 3px; }
.card-topic { font-size: 0.95rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.card-lesson { font-size: 0.78rem; color: var(--sub); }

/* ── 보기 탭: 차시별 / 낱말 사전 ─────────────────────────── */
.viewtabs { display: inline-flex; align-self: flex-start; gap: 4px; background: #EEF1F6; border-radius: 999px; padding: 4px; }
.vtab {
  border: 0; background: transparent; border-radius: 999px; padding: 7px 18px;
  font-family: inherit; font-size: 0.95rem; font-weight: 800; color: var(--sub); cursor: pointer;
}
.vtab[aria-selected="true"] { background: var(--grad-navy); color: #fff; box-shadow: 0 2px 6px rgba(21,36,71,.2); }
.vtab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.view-words .pick-units, body.view-words .pick-sep { display: none; }

/* ── 차시 한 줄 ─────────────────────────────────────────── */
.rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 600px), 1fr)); gap: 12px; }
.row {
  display: grid; grid-template-columns: 76px 1fr auto; grid-template-areas: "th body act";
  column-gap: 14px; row-gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 12px;
}
.row-thumb {
  grid-area: th; position: relative; width: 76px; aspect-ratio: 9 / 16; align-self: start;
  border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--navy-deep); cursor: pointer;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-thumb .thumb-time { bottom: 5px; right: 5px; font-size: 0.7rem; }
.row-thumb .thumb-play svg { width: 36px; height: 36px; }
.row-thumb:hover .thumb-play, .row-thumb:focus-visible .thumb-play { opacity: 1; }
.row-body { grid-area: body; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row-no { font-size: 0.8rem; font-weight: 700; color: var(--accent-dk); }
.row-title {
  border: 0; background: none; padding: 0; text-align: left; font-family: inherit; cursor: pointer;
  font-size: 1.04rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; line-height: 1.38;
}
.row-title:hover { color: var(--accent-dk); }
.row-sum { font-size: 0.84rem; color: var(--sub); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.wchip {
  display: inline-flex; align-items: baseline; gap: 6px;
  border: 1.5px solid #FFD0B0; background: #FFF8F3; color: var(--ink);
  border-radius: 999px; padding: 4px 12px; font-family: inherit; cursor: pointer;
}
.wchip .w { font-size: 0.9rem; font-weight: 800; }
.wchip .t { font-size: 0.72rem; color: var(--sub); font-variant-numeric: tabular-nums; }
.wchip.xchip { border-color: #C9D3EA; background: #F1F4FA; color: var(--navy); }
.wchip.xchip::before { content: ''; width: 14px; height: 9px; border: 2px solid currentColor; border-radius: 2px; align-self: center; }
.wchip:hover { border-color: var(--accent); background: var(--accent-lt); color: var(--accent-dk); }
.row-act { grid-area: act; display: flex; justify-content: flex-end; align-items: center; }
.go-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; border-radius: 10px; padding: 8px 14px;
  background: var(--grad-accent); color: #fff;
  font-family: inherit; font-size: 0.9rem; font-weight: 800; cursor: pointer;
}
.go-btn svg { width: 20px; height: 20px; }
.go-btn .t { font-size: 0.74rem; font-weight: 600; opacity: .85; }
.go-btn.plain { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.go-btn.plain .t { color: var(--sub); }
.go-btn:hover { filter: brightness(1.05); }
.go-btn.plain:hover { border-color: var(--accent); color: var(--accent-dk); }

/* ── 낱말 사전 ──────────────────────────────────────────── */
.dict { display: flex; flex-direction: column; gap: 12px; }
.dict-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.dict-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.wcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.wcard-play { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font-family: inherit; cursor: pointer; text-align: left; }
.wcard-play svg { width: 30px; height: 30px; flex: none; }
.wcard-play .k { font-size: 1.12rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.wcard-play .t { font-size: 0.76rem; color: var(--sub); font-variant-numeric: tabular-nums; }
.wcard-play:hover .k { color: var(--accent-dk); }
.wcard .m { font-size: 0.88rem; color: #3D465C; }
.refs { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.refs .cap { font-size: 0.74rem; color: var(--sub); margin-right: 2px; }
.ref { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 1px 9px; font-family: inherit; font-size: 0.78rem; color: var(--ink); cursor: pointer; }
.ref.mine { border-color: var(--navy); color: var(--navy); font-weight: 700; }
.ref:hover { border-color: var(--accent); color: var(--accent-dk); }

.empty-msg { text-align: center; color: var(--sub); padding: 40px 0; }

/* ── 푸터 ───────────────────────────────────────────────── */
.footer {
  text-align: center; padding: 22px 16px 34px;
  color: var(--sub); font-size: 0.84rem;
  border-top: 1px solid var(--line);
}
.footer-note { font-size: 0.76rem; margin-top: 4px; }

/* ── 세로 재생 모달 ─────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8,14,28,0.82); }
.modal-panel {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(8,14,28,0.5);
  max-width: 980px; width: 100%;
  max-height: calc(100vh - 36px);
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 0;
}
.modal-close {
  position: absolute; top: 8px; right: 10px; z-index: 3;
  border: 0; background: rgba(12,23,48,0.6); color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 0.95rem;
}
/* 9:16 을 그대로. 잘라내거나 레터박스를 넣지 않는다. */
.modal-player {
  background: var(--navy-deep);
  display: grid; place-items: center;
  padding: 14px;
  border-radius: 18px 0 0 18px;
}
.modal-player .frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: calc(100vh - 92px);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.modal-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.modal-side { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 12px; align-content: start; }
.modal-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  background: var(--accent-lt); color: var(--accent-dk);
  border-radius: 999px; padding: 3px 11px;
  font-size: 0.78rem; font-weight: 700;
}
.pill-unit { background: #EDF1F9; color: var(--navy); }
.pill-time { background: #F1F3F7; color: var(--sub); font-variant-numeric: tabular-nums; }
.modal-title { font-size: 1.24rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; line-height: 1.34; }
.modal-desc { font-size: 0.95rem; color: #3D465C; }

.kw { background: #FAFBFD; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kw-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.88rem; font-weight: 800; color: var(--navy); margin-bottom: 7px;
}
.kw-list { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; }
.kw-list li {
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 10px;
  font-size: 0.82rem; color: var(--ink);
}

/* 재생목록 (차시 영상 + 핵심 낱말 영상) */
.word-meaning { font-size: 0.95rem; color: #3D465C; background: var(--accent-lt); border-radius: 10px; padding: 9px 12px; }
.word-meaning b { color: var(--accent-dk); margin-right: 4px; }
.pl { border: 1px solid #FFD8BF; background: #FFFBF8; border-radius: 12px; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.pl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pl-head .kw-head { margin-bottom: 0; }
.pl-total { font-size: 0.78rem; color: var(--sub); font-variant-numeric: tabular-nums; }
.pl-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.pl-item {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 12px; border: 0; border-top: 1px solid var(--line); background: #fff;
  font-family: inherit; text-align: left; cursor: pointer; color: var(--ink);
}
.pl-item:first-child { border-top: 0; }
.pl-item .n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: #F1F3F7; color: var(--sub); font-size: 0.74rem; font-weight: 800;
}
.pl-item .w { display: flex; flex-direction: column; min-width: 0; }
.pl-item .w b { font-size: 0.98rem; font-weight: 800; letter-spacing: -0.02em; }
.pl-item .w small { font-size: 0.78rem; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-item .t { font-size: 0.78rem; color: var(--sub); font-variant-numeric: tabular-nums; }
.pl-item:hover { background: #FFF6F0; }
.pl-item[aria-current="true"] { background: var(--accent-lt); }
.pl-item[aria-current="true"] .n { background: var(--grad-accent); color: #fff; }
.pl-item[aria-current="true"] .w b { color: var(--accent-dk); }
.pl-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pl-nav { display: inline-flex; gap: 6px; }
.pl-nav .gold-btn { padding: 6px 11px; font-size: 0.84rem; }
.pl-nav .gold-btn:disabled { opacity: .4; cursor: default; }
.pl-hint { font-size: 0.76rem; color: var(--sub); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 700; color: var(--navy); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #D5DAE4; position: relative; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 19px; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 설명 영상(16:9)을 틀 때는 영상 칸을 넓히고 가로 비율로 */
.modal-panel.is-wide { max-width: 1240px; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); }
.modal-panel.is-wide .modal-player .frame { aspect-ratio: 16 / 9; max-height: none; }
.frame-wait { position: absolute; inset: 0; display: grid; place-items: center; color: #C3CEE6; font-size: 0.9rem; }
.modal-player .frame > div:not(.frame-wait), .modal-player .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gold-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--grad-accent); color: #fff;
  border: 0; border-radius: 10px;
  padding: 9px 15px;
  font-size: 0.9rem; font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: none;
}
.gold-btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.gold-btn.ghost:hover { border-color: var(--accent); color: var(--accent-dk); }

/* ── 전자칠판 (1280px 이상) — 글씨와 카드를 키운다 ──────── */
@media (min-width: 1280px) {
  body { font-size: 1.06rem; }
  .brand-text b { font-size: 1.7rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 18px; }
  .unit-title { font-size: 1.22rem; }
  .card-topic { font-size: 1.04rem; }
  .modal-panel { max-width: 1120px; grid-template-columns: minmax(300px, 400px) 1fr; }
  .modal-panel.is-wide { max-width: 1400px; grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr); }
  .row-title { font-size: 1.1rem; }
  .wchip .w { font-size: 0.96rem; }
}

/* ── 좁은 화면 ──────────────────────────────────────────── */
@media (max-width: 720px) {
  /* 짬짬이 영상과 같은 방식 — 좁으면 상단바를 두 줄로 접는다 */
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; row-gap: 8px; }
  .brand-text small { display: none; }
  .picker-label { min-width: 0; }
  .pick-sep { display: none; }
  .pick-bar { gap: 10px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
  .modal { padding: 0; }
  .modal-panel {
    grid-template-columns: 1fr;
    border-radius: 0; max-height: 100vh; height: 100vh;
  }
  .modal-player { border-radius: 0; padding: 0; }
  .modal-player .frame { border-radius: 0; max-height: 62vh; }
  .modal-panel.is-wide { grid-template-columns: 1fr; }
  .modal-side { padding: 16px 16px 24px; }
  .row { grid-template-columns: 64px 1fr; grid-template-areas: "th body" "th act"; padding: 10px; column-gap: 12px; align-items: start; }
  .row-thumb { width: 64px; }
}

/* ── 오프라인 표시 ──────────────────────────────────────── */
body.is-offline .cta-strip::after {
  content: '오프라인 — 목록은 보이지만 영상 재생은 인터넷이 필요합니다';
  display: block; margin-top: 4px;
  font-size: 0.8rem; color: var(--accent-dk); font-weight: 700;
}

@media (max-width: 560px) {
  .topbar { padding: 12px 16px; }
}
