/* 강의 스트리밍 — 아카이브 앱과 통일한 디자인 토큰 */
:root {
  --bg: #f7f0e1;
  --bg-soft: #efe7d5;
  --card: #fffcf5;
  --card-hover: #f6f0e4;
  --border: #e8dfcd;
  --text: #2b2723;
  --text-dim: #7c7261;
  --accent: #c0392b;
  --accent-soft: rgba(192, 57, 43, 0.10);
  --accent-dim: #a83226;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(120, 100, 70, 0.14);
  --shadow-sm: 0 2px 8px rgba(120, 100, 70, 0.10);
  --paper: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27520%27%20height%3D%27520%27%3E%3Cfilter%20id%3D%27p%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.012%27%20numOctaves%3D%276%27%20seed%3D%2711%27%20stitchTiles%3D%27stitch%27%20result%3D%27n%27%2F%3E%3CfeDiffuseLighting%20in%3D%27n%27%20surfaceScale%3D%272.0%27%20diffuseConstant%3D%271.03%27%20lighting-color%3D%27%23ffffff%27%20result%3D%27l%27%3E%3CfeDistantLight%20azimuth%3D%27235%27%20elevation%3D%2759%27%2F%3E%3C%2FfeDiffuseLighting%3E%3CfeComposite%20in%3D%27l%27%20in2%3D%27SourceGraphic%27%20operator%3D%27arithmetic%27%20k1%3D%271%27%20k2%3D%270%27%20k3%3D%270%27%20k4%3D%270%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20fill%3D%27%23faf6ec%27%20filter%3D%27url%28%23p%29%27%2F%3E%3C%2Fsvg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image: var(--paper);
  background-size: 520px 520px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font-family: inherit; color: inherit; }   /* iOS: color 없는 버튼 텍스트가 기본 파란색으로 뜨는 것 방지 */
select { font-family: inherit; color: var(--text); }   /* iOS: select 텍스트 파란색 방지 */
input[type="date"], input[type="month"], input[type="time"], input[type="datetime-local"] { color: var(--text); }
a { color: var(--accent); }
/* 체크박스 커스텀(아이패드 사파리는 accent-color 미적용 → 직접 그림) */
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; min-width: 18px; flex: none;
  border: 1.5px solid #c9bda3; border-radius: 5px; background-color: #fff; cursor: pointer;
  margin: 0; vertical-align: middle; padding: 0; box-sizing: border-box;
  background-repeat: no-repeat; background-position: center; background-size: 12px 12px;
}
input[type="checkbox"]:checked {
  background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

/* ---------- 상단바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  background: rgba(255, 252, 245, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .logo { height: 38px; width: auto; }
.topbar .brand { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.topbar .brand .sub { color: var(--text-dim); font-weight: 500; font-size: 13px; margin-left: 6px; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--text-dim); }
.topbar .who b { color: var(--text); }
.role-pill {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; margin-left: 8px;
  background: var(--accent-soft); color: var(--accent);
}
.role-pill.student { background: rgba(60,120,90,.12); color: #3a7d5b; }

/* ---------- 버튼 ---------- */
.btn {
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); padding: 8px 15px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn:hover { background: var(--card-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dim); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { color: var(--text); background: var(--accent-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.danger { color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- 레이아웃 ---------- */
.wrap { max-width: 1000px; margin: 0 auto; padding: 26px 20px 80px; }
.page-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 22px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.page-head .count { color: var(--text-dim); font-size: 14px; }
.page-head .ph-sub { color: var(--text-dim); font-size: 13.5px; }
.mem-head { font-weight: 800; font-size: 14px; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.mem-head .mem-count { color: var(--accent); font-size: 13px; }
.mem-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); }
.mem-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.mem-row:last-child { border-bottom: 0; }
.mem-main { font-size: 14.5px; }
.mem-name { font-weight: 700; }
.mem-nick { color: var(--text-dim); font-weight: 500; font-size: 13px; }
.mem-sub { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.mem-badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--bg-soft); color: var(--text-dim); }
.mem-badge.warn { background: #f3e7cf; color: #9a6b1c; }
.page-head .spacer { flex: 1; }

/* ---------- 랜딩(로그인 전 메인) ---------- */
#landing { min-height: 100vh; display: flex; flex-direction: column; }
.ld-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: rgba(255, 252, 245, 0.8); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.ld-topbar .ld-logo { height: 38px; width: auto; }
.ld-topbar .ld-brand { font-family: "IBM Plex Sans KR", "Noto Sans KR", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.ld-topbar .ld-spacer { flex: 1; }

.landing-hero { display: flex; align-items: center; justify-content: center; padding: clamp(48px, 12vh, 120px) 24px clamp(40px, 8vh, 80px); }
.landing-inner { max-width: 780px; margin: 0 auto; text-align: center; }
.landing-eyebrow { font-size: 13px; letter-spacing: .16em; color: var(--accent); font-weight: 700; text-transform: uppercase; margin-bottom: 18px; }
.landing-title { font-family: "Nanum Brush Script", "IBM Plex Sans KR", sans-serif; font-size: clamp(44px, 8.5vw, 80px); font-weight: 400; letter-spacing: 0; line-height: 1.2; margin: 0 0 22px; text-wrap: balance; color: var(--text); }
.landing-lede { font-size: clamp(16px, 1.7vw, 19px); color: var(--text-dim); line-height: 1.7; margin: 0 auto 36px; }
.landing-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn.lg { padding: 13px 30px; font-size: 16px; border-radius: 12px; font-weight: 700; }

.ld-features { max-width: 960px; margin: 0 auto; padding: 8px 24px 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.ld-feat { border-top: 2px solid var(--text); padding-top: 16px; }
.lf-h { font-family: "IBM Plex Sans KR", "Noto Sans KR", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; margin-bottom: 10px; color: var(--text); }
.lf-d { font-size: 14.5px; color: var(--text-dim); line-height: 1.75; }

.ld-foot { text-align: center; padding: 20px 24px 30px; font-size: 13px; color: var(--text-dim); border-top: 1px solid var(--border); margin-top: 8px; }
.ld-foot a { color: var(--accent); font-weight: 600; text-decoration: none; }
.ld-foot a:hover { text-decoration: underline; }

@media (max-width: 720px) { .ld-features { grid-template-columns: 1fr; gap: 26px; } .landing-hero { padding: 44px 20px 32px; } }

/* ---------- 홈(대시보드) ---------- */
.hello { font-size: 20px; margin: 4px 0 20px; }
.hello b { font-weight: 700; }
.home-hero { text-align: center; padding: 26px 0 24px; margin-bottom: 6px; }
.hh-lockup { display: inline-flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.hh-lockup .hh-logo { height: 44px; width: auto; display: block; }
.hh-tag { font-size: 1.5rem; font-weight: 800; letter-spacing: .01em; color: var(--text-dim); line-height: 1; transform: translateY(0.18em); }
.hh-title { font-family: "IBM Plex Sans KR", "Noto Sans KR", sans-serif; font-size: clamp(24px, 4vw, 36px); font-weight: 700; letter-spacing: -0.025em; margin: 0 0 8px; color: var(--text); text-wrap: balance; }
.hh-sub { font-size: 14.5px; color: var(--text-dim); margin: 0; }
.hh-sub b { color: var(--text); font-weight: 700; }
.home-head { font-weight: 700; font-size: 16px; margin: 0 0 14px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-tile { text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); transition: .15s; font-family: inherit; }
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-tile .sv { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.stat-tile .sl { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.stat-tile.alert { border-color: var(--accent); }
.stat-tile.alert .sv { color: var(--accent); }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 로그인 ---------- */
.login-card { position: relative; }
.login-back { position: absolute; top: 14px; left: 14px; background: none; border: none; color: var(--text-dim); font-size: 13px; cursor: pointer; padding: 4px 6px; }
.login-back:hover { color: var(--accent); }
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 360px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 30px;
}
.login-card .logo { height: 56px; display: block; margin: 0 auto 16px; }
.login-card h2 { text-align: center; margin: 0 0 4px; font-size: 20px; }
.login-card .tag { text-align: center; color: var(--text-dim); font-size: 13px; margin: 0 0 22px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fff; font-size: 14px; font-family: inherit;
  color: var(--text); -webkit-text-fill-color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.bg-row { display: flex; gap: 12px; align-items: center; }
.bg-preview { width: 96px; height: 54px; border-radius: 8px; background-size: cover; background-position: center; border: 1px solid var(--border); flex-shrink: 0; }
.bg-preview.empty { background: var(--bg-soft); }
.bg-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.login-card .btn { width: 100%; margin-top: 8px; }
.form-msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.form-msg.error { color: var(--accent); }
.form-msg.ok { color: #3a7d5b; }
.login-hint { text-align: center; font-size: 12px; color: var(--text-dim); margin-top: 16px; line-height: 1.7; }

/* ---------- 검색·정렬 바 ---------- */
.listbar { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; align-items: center; }
.listbar .search { position: relative; flex: 1; min-width: 200px; }
.listbar .search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .55; pointer-events: none; }
.listbar .search input {
  width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card); font-family: inherit; font-size: 14px; color: var(--text);
}
.listbar .search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lb-select {
  padding: 9px 30px 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); font-family: inherit; font-size: 14px; color: var(--text); cursor: pointer;
}
.lb-select:focus { outline: none; border-color: var(--accent); }

/* ---------- 과목 섹션 ---------- */
.subject-group { margin-bottom: 30px; }
.subject-head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 12px;
}
.subject-dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.subject-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.subject-head .n { color: var(--text-dim); font-size: 13px; font-weight: 500; }

/* ---------- 강의 카드 그리드 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.lecture {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: .15s; display: flex; flex-direction: column;
}
.lecture:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lecture .thumb {
  aspect-ratio: 16 / 9; background: var(--bg-soft);
  display: grid; place-items: center; position: relative;
  border-bottom: 1px solid var(--border);
}
.lecture .thumb .thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lecture .thumb .play {
  position: relative; z-index: 1;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(20,16,12,.5); display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  opacity: 0; transition: opacity .15s;
}
.lecture:hover .thumb .play { opacity: 1; }
.lecture .thumb .play svg { width: 18px; height: 18px; fill: #fff; margin-left: 2px; }
@media (hover: none) { .lecture .thumb .play { opacity: 0; } }
.lecture .thumb .tags { position: absolute; top: 8px; left: 8px; display: flex; gap: 5px; z-index: 1; }
.lecture .thumb .subtag {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #4a4235;
}
.lecture .thumb .gradetag {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: var(--text); box-shadow: var(--shadow-sm);
}
.lecture .meta { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.lecture .meta .title { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.lecture .meta .sub { font-size: 12px; color: var(--text-dim); margin-top: auto; display: flex; gap: 8px; }
.lecture .meta .lock { color: var(--accent); font-weight: 600; }

/* ---------- 빈 상태 ---------- */
.empty {
  text-align: center; padding: 70px 20px; color: var(--text-dim);
  border: 1.5px dashed var(--border); border-radius: var(--radius); background: rgba(255,252,245,.5);
}
.empty .big { font-size: 40px; margin-bottom: 8px; opacity: .5; }
.empty p { margin: 4px 0; }

/* ---------- 공지사항 ---------- */
.notice-sec {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px 18px; margin-bottom: 26px;
}
.notice-sechead { font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.notice-sec .notice:not(:last-child) { margin-bottom: 10px; }
.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 14px 44px 14px 16px;
}
.notice-sec .notice { background: var(--bg-soft); box-shadow: none; }
.notice-title { font-weight: 700; font-size: 15px; }
.notice-body { font-size: 14px; color: var(--text); margin-top: 6px; line-height: 1.65; }
.notice-meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.notice-del { position: absolute; top: 12px; right: 12px; }

/* ---------- 탭 ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 22px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  padding: 9px 4px; margin-right: 14px; background: none; border: none;
  border-bottom: 2px solid transparent; color: var(--text-dim);
  font-size: 15px; font-weight: 600; cursor: pointer; flex-shrink: 0; white-space: nowrap;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- 클래스 / 수강신청 ---------- */
.class-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.class-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; }
.cc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cc-name { font-weight: 700; font-size: 16px; line-height: 1.3; }
.cc-tags { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; }
.ctag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #4a4235; }
.ctag.grade { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); }
.cc-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.cc-teacher { font-size: 12.5px; font-weight: 600; color: var(--accent); margin: 6px 0 2px; }
.cc-stat { font-size: 13px; color: var(--text-dim); }
.cc-stat b { color: var(--text); }
.cc-pend { color: var(--accent); font-weight: 700; }
.cc-actions { display: flex; gap: 8px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.cc-go { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 4px; }
.enroll-badge { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.enroll-badge.ok { background: rgba(60, 120, 90, .12); color: #3a7d5b; }
.enroll-badge.pend { background: var(--accent-soft); color: var(--accent); }
.class-card.clickable { cursor: pointer; transition: .15s; }
.class-card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* 클래스 상세 */
.cd-header { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cd-titlerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cd-title { font-weight: 700; font-size: 20px; }
.cd-meta { font-size: 13px; color: var(--text-dim); }
.cd-meta b { color: var(--text); }
.cd-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* 강의 행(순서 관리) */
.lec-rows { display: flex; flex-direction: column; gap: 0; }
.insert-zone { position: relative; height: 16px; flex-shrink: 0; }
.insert-zone .iz-line { position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%); background: transparent; border-radius: 2px; transition: background .12s; }
.insert-zone .iz-btns { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 6px; z-index: 2; opacity: 0; transition: opacity .12s; }
.insert-btn { white-space: nowrap; font-size: 11.5px; font-weight: 700; padding: 3px 11px; border: 1px dashed var(--accent); background: var(--card); color: var(--accent); border-radius: 999px; cursor: pointer; box-shadow: var(--shadow-sm); }
.insert-btn.sec { border-color: var(--text-dim); color: var(--text-dim); }
.insert-zone:hover, .insert-zone.drop-here { height: 24px; }
.insert-zone:hover .iz-btns { opacity: 1; }
.insert-zone:hover .iz-line, .insert-zone.drop-here .iz-line { background: var(--accent); opacity: .35; }
.insert-zone.drop-here .iz-line { opacity: 1; height: 3px; }
.insert-zone.drop-here .iz-btns { display: none; }

/* 섹션(단원/시험 구분선) */
.sec-row { display: flex; align-items: center; gap: 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.sec-row.dragging { opacity: .9; box-shadow: var(--shadow); border-color: var(--accent); }
.sec-toggle { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--text); padding: 0 4px; line-height: 1; width: 24px; }
.sec-title { font-weight: 700; font-size: 14.5px; cursor: pointer; }
.sec-count { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.sec-actions { display: flex; gap: 6px; }
.ssec-head { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.ssec-title { font-weight: 700; font-size: 14px; cursor: pointer; }
.lec-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; flex-wrap: wrap; }
.lec-row.dragging { opacity: .9; border-color: var(--accent); box-shadow: var(--shadow); background: var(--card-hover); }
.lr-grip { cursor: grab; color: var(--text-dim); font-size: 16px; line-height: 1; user-select: none; flex-shrink: 0; touch-action: none; padding: 2px; }
.lr-grip:active { cursor: grabbing; }
.lr-num { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: var(--bg-soft); color: var(--text-dim); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.lr-main { flex: 1; min-width: 140px; }
.lr-title { font-weight: 600; font-size: 14.5px; }
.lr-date { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.lr-move { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.ic-btn { width: 28px; height: 20px; border: 1px solid var(--border); background: var(--card); border-radius: 5px; cursor: pointer; font-size: 9px; color: var(--text-dim); line-height: 1; display: grid; place-items: center; padding: 0; }
.ic-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.ic-btn:disabled { opacity: .3; cursor: default; }
.lr-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------- 질문 ---------- */
.tab-badge { font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 6px; margin-left: 3px; }
.q-section { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 20px; }
.q-sechead { font-weight: 700; font-size: 16px; margin-bottom: 12px; }
.q-sechead span { font-size: 12px; color: var(--text-dim); font-weight: 500; margin-left: 6px; }
.q-ask { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px; }
.q-ask textarea, .q-answerform textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font-family: inherit; font-size: 14px; resize: vertical; color: var(--text); background: #fff;
}
.q-ask textarea:focus, .q-answerform textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.q-list { display: flex; flex-direction: column; gap: 14px; }
.q-list.inbox { gap: 12px; }
.q-item { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 40px 12px 14px; }
.q-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.q-meta b { color: var(--text); font-size: 13px; }
.q-text { font-size: 14px; line-height: 1.6; }
.q-a { margin-top: 10px; margin-left: 14px; padding: 10px 12px; background: var(--accent-soft); border-left: 2px solid var(--accent); border-radius: 8px; }
.q-answerform { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.q-answerform button { align-self: flex-end; }
.q-waiting { margin-top: 8px; font-size: 12.5px; color: var(--text-dim); font-style: italic; }
.q-del { position: absolute; top: 9px; right: 9px; background: none; border: none; color: var(--text-dim); font-size: 18px; line-height: 1; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; }
.q-del:hover { background: var(--accent-soft); color: var(--accent); }
.q-empty { color: var(--text-dim); font-size: 13.5px; padding: 8px 2px; }
.q-inbox-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.q-inbox-item .q-item { border: none; padding: 0 30px 0 0; background: none; }
.q-inbox-item .q-del { top: -2px; right: -4px; }
.q-lec { font-size: 13px; font-weight: 700; color: var(--text-dim); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.q-new { font-size: 10.5px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 7px; }

/* ---------- 모달 ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(43, 39, 35, .45);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 440px; max-height: 90vh;
  overflow: auto; padding: 24px;
}
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.up-progress { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; }
.up-progress #upPct { font-size: 12.5px; font-weight: 700; color: var(--accent); width: 56px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.checks { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; max-height: 150px; overflow: auto; }
.checks label { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; font-weight: 500; color: var(--text); }
.checks label input { width: auto; }

/* ---------- 카드 진행바 (이어보기) ---------- */
.progbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: rgba(43,39,35,.14);
}
.progbar > span { display: block; height: 100%; background: var(--accent); }
.progbar.sm { position: static; flex: 1; height: 7px; border-radius: 999px; overflow: hidden; }
.progbar.sm > span { border-radius: 999px; }
.watchtag {
  position: absolute; bottom: 10px; right: 8px; font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.92);
  color: var(--accent); box-shadow: var(--shadow-sm);
}
.watchtag.done { color: #3a7d5b; }

/* ---------- 플레이어 ---------- */
.player-wrap { max-width: 900px; margin: 0 auto; padding: 20px; }
.player-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.player-top h2 { margin: 0; font-size: 20px; }
video.player { width: 100%; border-radius: var(--radius); background: #000; box-shadow: var(--shadow); display: block; }
.player-meta { color: var(--text-dim); font-size: 13.5px; margin-top: 12px; display: flex; gap: 12px; }
.resume-msg {
  margin-top: 10px; font-size: 13px; color: var(--accent); font-weight: 600;
  background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 12px;
}
.player-actions { display: flex; gap: 8px; margin-top: 18px; }


/* 북마크 · 메모 */
.bm-sec { margin-top: 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.bm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bm-title { font-weight: 700; font-size: 14.5px; }
.bm-form { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.bm-at { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; font-size: 13px; flex: none; }
.bm-form input { flex: 1; min-width: 150px; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; outline: none; background: var(--bg-soft); color: var(--text); }
.bm-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bm-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.bm-empty { font-size: 13px; color: var(--text-dim); padding: 2px 0; }
.bm-item { display: flex; align-items: center; gap: 10px; }
.bm-time { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.bm-time:hover { filter: brightness(.95); }
.bm-note { flex: 1; font-size: 13.5px; color: var(--text); word-break: break-word; }
.bm-note i { color: var(--text-dim); font-style: italic; }
.bm-del { flex: none; border: 0; background: none; color: var(--text-dim); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 7px; border-radius: 6px; }
.bm-del:hover { color: var(--accent); background: var(--accent-soft); }

/* 설치 유도 바 */
.install-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 60;
  display: flex; align-items: center; gap: 10px; max-width: 92vw;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 8px 8px 16px; box-shadow: 0 8px 30px rgba(120, 100, 70, .22);
}
.install-bar .ib-ic { font-size: 18px; flex: none; }
.install-bar .ib-tx { font-size: 13px; color: var(--text); }
.install-bar .ib-tx b { color: var(--accent); }
.install-bar .ib-x { flex: none; border: 0; background: none; color: var(--text-dim); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 8px; }
.install-bar .ib-x:hover { color: var(--text); }

/* ---------- 시청 현황 ---------- */
.view-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow: auto; }
.view-row { display: flex; align-items: center; gap: 12px; }
.view-row .nm { font-weight: 600; font-size: 14px; width: 80px; flex-shrink: 0; }
.view-row .vpct { font-size: 12.5px; font-weight: 700; color: var(--accent); width: 44px; text-align: right; flex-shrink: 0; }
.view-row .vpct.done { color: #3a7d5b; }
.view-row .vpct.none { color: var(--text-dim); font-weight: 500; }
.view-row2 { display: flex; flex-direction: column; gap: 5px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.view-row2:last-child { border-bottom: 0; }
.vr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.vr-top .nm { font-weight: 600; font-size: 14px; }
.vr-top .vpct { font-size: 13px; font-weight: 700; color: var(--accent); }
.vr-top .vpct.done { color: #3a7d5b; }
.vr-top .vpct.none { color: var(--text-dim); font-weight: 500; }
.vr-meta { font-size: 12px; color: var(--text-dim); }
.vr-meta b { color: var(--text); font-weight: 700; }
.dev-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.dev-pill.mobile { background: rgba(184, 138, 58, .16); color: #9a6b1c; }
.dev-pill.pc { background: var(--bg-soft); color: var(--text-dim); }
.dev-pill.tablet { background: rgba(60, 150, 110, .14); color: #3a8d6b; }

/* 학생 관리 표 */
.stud-list { display: flex; flex-direction: column; gap: 8px; }
.stud-row {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px;
}
.stud-row .nm { font-weight: 600; }
.stud-row .id { color: var(--text-dim); font-size: 13px; }
.stud-row.pending { background: var(--card); }

/* 승인 대기 */
.pending-sec {
  background: var(--accent-soft); border: 1px solid rgba(192, 57, 43, .2);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 8px;
}
.pending-sec .stud-list { gap: 8px; }
.pending-head { font-size: 14px; font-weight: 700; margin: 2px 0 10px; display: flex; align-items: center; gap: 8px; }
.pending-head.sub { margin: 24px 0 10px; color: var(--text-dim); }
.pending-head .badge {
  font-size: 11px; font-weight: 700; background: var(--accent); color: #fff;
  border-radius: 999px; padding: 1px 8px; min-width: 20px; text-align: center;
}
.pending-head.sub .badge { background: var(--bg-soft); color: var(--text-dim); }
.login-hint a { color: var(--accent); font-weight: 600; text-decoration: none; }
.login-hint a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  /* 상단바: 한 줄 유지 + 세로 글씨 방지 + 공간 절약 */
  .topbar { gap: 5px; padding: 8px 10px; }
  .topbar .logo { height: 26px; }
  .topbar .brand { font-size: 14px; }
  .topbar .brand .sub { display: none; }
  .topbar > * { flex-shrink: 0; }                         /* 눌려서 글자가 세로로 깨지는 것 방지 */
  .topbar .brand, .topbar .who, .topbar .btn { white-space: nowrap; }
  .topbar .who { font-size: 12px; max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; }
  .topbar .btn.ghost.sm { padding: 5px 6px; }
  /* 텍스트 버튼 → 아이콘(가로폭 절약, 클릭은 그대로) */
  #pwBtn { font-size: 0; } #pwBtn::before { content: "🔑"; font-size: 15px; }
  #logoutBtn { font-size: 0; } #logoutBtn::before { content: "🚪"; font-size: 15px; }
  #devBtn { font-size: 0; } #devBtn::before { content: "🛠"; font-size: 15px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}
@media (max-width: 400px) {
  .topbar .who b { display: none; }      /* 아주 좁은 화면: 이름 숨기고 역할 배지만 */
  .topbar .who { max-width: none; }
}

/* 카테고리(클래스 분류) */
.cat-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--text); margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.cat-head:first-child { margin-top: 4px; }
.cat-count { font-size: 12px; font-weight: 700; color: var(--text-dim); background: var(--bg-soft); border-radius: 10px; padding: 1px 8px; }
.cat-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.cat-row { display: flex; align-items: center; gap: 8px; background: var(--bg-soft); border-radius: 10px; padding: 8px 12px; }
.cat-row .cat-name { font-weight: 700; font-size: 14px; }

/* 알림(벨) + 알림센터 */
.notif-btn { position: relative; font-size: 16px; padding: 6px 8px; }
.notif-badge { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; }
.notif-panel { position: fixed; top: 56px; right: 16px; width: 340px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(60,45,25,.22); z-index: 60; }
.notif-panel .np-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 14px; position: sticky; top: 0; background: var(--card); }
.notif-panel .np-head .spacer { flex: 1; }
.notif-panel .np-head button { font-size: 12px; }
.notif-item { display: block; width: 100%; text-align: left; border: none; background: none; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: var(--bg-soft); }
.notif-item.unread { background: rgba(192,57,43,.06); }
.notif-item .ni-title { font-weight: 700; font-size: 13.5px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.notif-item.unread .ni-title::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.notif-item .ni-body { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.notif-item .ni-time { font-size: 11px; color: var(--text-dim); margin-top: 4px; opacity: .8; }
.notif-empty { padding: 24px 14px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* 출제 버튼/배지 */
.btn.assigned { background: #e8f5ec; color: #1e7a43; border-color: #b7e0c4; }
.assign-banner { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--bg-soft); font-size: 13px; }
.assign-banner.done { background: #e8f5ec; }
.assign-banner .ab-ico { font-size: 16px; }
.assign-banner .ab-txt { flex: 1; }
.assign-banner .ab-txt b { color: var(--accent); }
.assign-banner.done .ab-txt b { color: #1e7a43; }
.assign-banner .progbar { flex: 1; max-width: 140px; }

/* 학생 홈 출제 과제 카드 */
.asg-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.asg-card:hover { border-color: var(--accent); }
.asg-card .asg-main { flex: 1; min-width: 0; }
.asg-card .asg-title { font-weight: 700; font-size: 14px; }
.asg-card .asg-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.asg-card .asg-state { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 10px; flex: none; }
.asg-card .asg-state.done { background: #e8f5ec; color: #1e7a43; }
.asg-card .asg-state.todo { background: rgba(192,57,43,.1); color: var(--accent); }

/* 출제 학생 선택 모달 */
.assign-list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.assign-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.assign-row:hover { background: var(--bg-soft); }
.assign-row.all { margin-bottom: 8px; border: 1px dashed var(--border); border-radius: 8px; }
.assign-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.assign-row .ar-name { font-weight: 600; }
.assign-row .ar-state { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 9px; flex: none; }
.assign-row .ar-state.done { background: #e8f5ec; color: #1e7a43; }
.assign-row .ar-state.todo { background: rgba(192,57,43,.1); color: var(--accent); }

/* 과제 마감 */
.asg-card .asg-state.over { background: #fdeaea; color: #c0392b; }
.asg-sub.overdue { color: #c0392b; font-weight: 600; }

/* 알림 패널 푸시 토글 */
.notif-panel .np-prefs { border-top: 1px solid var(--border); padding: 10px 14px 4px; }
.notif-panel .npp-head { font-size: 12px; font-weight: 800; color: var(--text-dim); margin-bottom: 6px; }
.notif-panel .npp-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }
.notif-panel .npp-label { flex: 1; font-size: 13.5px; font-weight: 600; }
.notif-panel .npp-sw { width: 18px; height: 18px; accent-color: var(--accent); flex: none; cursor: pointer; }
.notif-panel .np-foot { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--border); padding: 10px 12px; }
.notif-panel .np-push { width: 100%; justify-content: center; }
.notif-panel .np-hint { font-size: 12.5px; color: var(--text-dim); text-align: center; line-height: 1.6; padding: 4px 2px; }
.notif-panel .np-hint b { color: var(--accent); }
.notif-panel .np-push.on { color: #1e7a43; }

/* 선생님 전용 별명: 실제 가입 이름 작게 병기 */
.stud-row .nick-real { font-size: 12px; color: var(--text-dim); margin-left: 6px; }

/* 미완료 과제 상단 배너(학생) */
.assign-alert { display: block; width: 100%; text-align: left; margin: 0 0 16px; padding: 13px 16px; border: none; border-radius: 12px; background: rgba(192,57,43,.1); color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; }
.assign-alert:hover { background: rgba(192,57,43,.16); }
.assign-alert b { font-weight: 800; }

/* 카테고리 그룹: 클래스 가로 스크롤 */
.class-list.hrow { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 14px; padding-bottom: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.class-list.hrow > .class-card { flex: 0 0 clamp(220px, 62vw, 280px); scroll-snap-align: start; }
.class-list.hrow::-webkit-scrollbar { height: 8px; }
.class-list.hrow::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.class-list.hrow::-webkit-scrollbar-track { background: transparent; }

/* 공개/비공개/예약 배지 & 설정 */
.vis-badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 9px; margin-left: 6px; vertical-align: middle; }
.vis-badge.hidden { background: #eee6d8; color: #8a7a5c; }
.vis-badge.sched { background: #f3e7cf; color: #9a6b1c; }
.lec-row.dimmed, .class-card.dimmed { opacity: .58; }
.class-card.dimmed:hover { opacity: .8; }
.vis-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.vis-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.vis-opt:hover { background: var(--bg-soft); }
.vis-opt input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.vis-opt .vo-d { font-size: 12px; color: var(--text-dim); font-weight: 400; }

/* 라이브 */
.live-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.live-badge { display: inline-block; background: #c0392b; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .05em; padding: 3px 10px; border-radius: 20px; animation: livepulse 1.6s infinite; }
@keyframes livepulse { 0%,100%{opacity:1} 50%{opacity:.55} }
.live-card .live-title { font-size: 20px; font-weight: 800; margin: 10px 0 4px; }
.live-card .live-sub { font-size: 13px; color: var(--text-dim); }
.live-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.live-start { max-width: 460px; margin-bottom: 14px; }
.lns-box { max-width: 460px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); padding: 8px 10px; max-height: 240px; overflow-y: auto; margin-top: -4px; }
.lns-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); padding: 2px 2px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.lns-row { display: flex; align-items: center; gap: 9px; padding: 6px 4px; font-size: 14px; cursor: pointer; }
.lns-row input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.lns-empty { color: var(--text-dim); font-size: 13px; padding: 8px 4px; }
.live-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.live-list .live-card { margin-bottom: 0; }
.live-list .live-actions { margin-top: 14px; }
.live-start-head { font-size: 16px; font-weight: 800; margin: 8px 0 2px; padding-top: 14px; border-top: 1px solid var(--border); }
.live-start-head .lss-note { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }

.live-room { display: flex; flex-direction: column; gap: 12px; }
.lr-top { display: flex; align-items: center; gap: 12px; }
.lr-top .lr-name { color: var(--text-dim); font-size: 13px; font-weight: 600; }
.live-stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; }
.live-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.live-hint { position: absolute; color: #eee; font-size: 14px; background: rgba(0,0,0,.4); padding: 8px 14px; border-radius: 10px; }
.live-chat { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); display: flex; flex-direction: column; height: 280px; }
.lc-msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.lc-msg { font-size: 13.5px; line-height: 1.5; }
.lc-msg b { color: var(--accent); font-weight: 700; margin-right: 4px; }
.lc-msg.me b { color: var(--text); }
.lc-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.lc-form input { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-family: inherit; font-size: 14px; outline: none; background: var(--bg-soft); }
.live-side { display: flex; flex-direction: column; gap: 12px; }
.live-hands { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.live-hands .lh-head { font-weight: 800; font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.lh-list { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; max-height: 180px; overflow-y: auto; }
.lh-empty { color: var(--text-dim); font-size: 13px; }
.lh-row { display: flex; align-items: center; gap: 8px; }
.lh-row .lh-name { font-weight: 700; font-size: 14px; }
.lh-row .lh-on { font-size: 12px; font-weight: 800; color: #1e7a43; background: #e8f5ec; padding: 2px 8px; border-radius: 9px; }
.lr-ctrl { display: inline-flex; align-items: center; gap: 8px; }
.lr-wait { font-size: 12px; color: var(--text-dim); }
@media (min-width: 900px) { .live-room { display: grid; grid-template-columns: 1fr 340px; grid-template-areas: "top top" "stage side"; align-items: start; } .lr-top{grid-area:top} .live-stage{grid-area:stage} .live-side{grid-area:side} .live-chat{height:340px} }

/* 라이브: 카메라 썸네일(화면공유 시 작게) */
.live-stage .live-cam { position: absolute; right: 12px; bottom: 12px; width: 22%; max-width: 200px; min-width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 2px 10px rgba(0,0,0,.4); background: #000; z-index: 2; }
/* 화이트보드(PDF 배경 + 필기) */
.live-wb { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; background: #fff; z-index: 1; }
.live-wb .wb-bg, .live-wb .wb-ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.live-wb .wb-ink { touch-action: none; }
.wb-tools { position: absolute; left: 10px; top: 10px; z-index: 3; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 12px; padding: 6px 8px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.wb-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.wb-swatch.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.wb-btn { font-size: 12px; font-weight: 700; padding: 5px 9px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; color: var(--text); }
.wb-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.wb-page { font-size: 12px; font-weight: 700; color: var(--text); padding: 0 4px; }

/* 라이브 전체화면 버튼 */
.live-stage .live-fs { position: absolute; top: 10px; right: 10px; z-index: 4; width: 38px; height: 38px; border: none; border-radius: 10px; background: rgba(0,0,0,.5); color: #fff; font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.live-stage .live-fs:hover { background: rgba(0,0,0,.7); }
.live-stage .live-chattog { position: absolute; z-index: 4; width: 38px; height: 38px; border: none; border-radius: 10px; background: rgba(0,0,0,.5); color: #fff; font-size: 17px; cursor: pointer; display: none; place-items: center; }
.live-stage .live-chattog:hover { background: rgba(0,0,0,.7); }
.live-stage:fullscreen { display: flex; align-items: center; justify-content: center; }
.live-stage:fullscreen .live-video { width: 100%; height: 100%; }
.live-stage:-webkit-full-screen { display: flex; align-items: center; justify-content: center; }

/* 라이브 방 전체화면: 영상은 꽉 채우고, 채팅·손들기는 오버레이로 계속 표시 */
.live-room.fs-on { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; gap: 0; background: #000; z-index: 1000; }
body.live-immersive { overflow: hidden; }
.live-room.fs-on .live-stage { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.live-room.fs-on .lr-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30; margin: 0; padding: 10px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,.62), rgba(0,0,0,0)); color: #fff;
}
.live-room.fs-on .lr-top .lr-name { color: #ddd; }
.live-room.fs-on .lr-top .btn.ghost { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.14); }
/* 전체화면 컨트롤 버튼: 상단바 아래 좌측에 모아 배치(채팅과 안 겹침) */
.live-room.fs-on .live-fs { top: 54px; left: 14px; right: auto; bottom: auto; z-index: 40; }
.live-room.fs-on .live-chattog { display: grid; top: 54px; left: 62px; right: auto; bottom: auto; z-index: 40; }
.live-room.fs-on .live-chattog.off { background: rgba(255,255,255,.22); }
.live-room.fs-on .lr-top .btn { white-space: nowrap; }
/* 채팅 오버레이: 가로=우측 좁은 패널(반투명), 접기 가능 */
.live-room.fs-on .live-side {
  position: absolute; right: 0; top: auto; bottom: 0; z-index: 25;
  width: min(260px, 30vw); height: min(52%, 340px); margin: 0; padding: 8px; gap: 6px;
  overflow: hidden; background: none; pointer-events: none;   /* 텍스트만 떠 있고 뒤 영상 보이게 */
}
.live-room.fs-on .live-side .lc-form,
.live-room.fs-on .live-side .lc-msgs { pointer-events: auto; }
.live-room.fs-on .live-parts { display: none; }              /* 참가자 목록은 숨겨 화면 확보 */
.live-room.fs-on .live-chat { flex: 1; height: auto; min-height: 0; background: none; border: none; box-shadow: none; }
.live-room.fs-on .lc-msgs { padding: 6px 4px; gap: 3px; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24px); mask-image: linear-gradient(to bottom, transparent, #000 24px); }
.live-room.fs-on .lc-msg { font-size: 13px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 2px rgba(0,0,0,.8); }
.live-room.fs-on .lc-msg b { color: #ffd0c6; }
.live-room.fs-on .lc-msg.me b { color: #fff; }
.live-room.fs-on .lc-form { padding: 6px 4px 4px; border-top: none; gap: 6px; flex-wrap: nowrap; }
.live-room.fs-on .lc-form input { min-width: 0; background: rgba(0,0,0,.5); border-color: rgba(255,255,255,.35); color: #fff; }
.live-room.fs-on .lc-form .btn { flex: 0 0 auto; padding-left: 12px; padding-right: 12px; }
.live-room.fs-on .lc-form input::placeholder { color: rgba(255,255,255,.6); }
.live-room.fs-on.chat-hidden .live-side { display: none; }    /* 접으면 화면 전체가 영상 */
/* 세로 화면(폰): 채팅을 하단 시트로(낮게) → 영상은 위, 채팅·입력은 아래 */
@media (orientation: portrait) {
  .live-room.fs-on .live-side {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 30vh; height: 30dvh; max-height: 300px;
    padding: 8px 10px 10px; gap: 6px; flex-direction: column;
    background: linear-gradient(to top, rgba(0,0,0,.42), rgba(0,0,0,0));
  }
  .live-room.fs-on .live-chat { min-height: 0; }
}

/* 라이브: 빈 힌트(회색 알약) 숨김 */
.live-hint:empty { display: none !important; }

/* 과목 선택 칩 (클래스 목록 필터) */
.subj-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.subj-chip { border: 1px solid var(--border); background: var(--card); color: var(--text-dim); border-radius: 20px; padding: 6px 15px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; transition: .12s; }
.subj-chip:hover { border-color: var(--accent); color: var(--text); }
.subj-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.subj-chip.mine { border-color: var(--accent); color: var(--accent); }
.subj-chip.mine.on { background: var(--accent); color: #fff; }

/* 라이브 참가자 패널 */
.live-parts { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.live-parts .lp-head { font-weight: 800; font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.live-parts .lp-count { color: var(--accent); }
.live-parts .lp-list { display: flex; flex-direction: column; gap: 3px; padding: 8px 12px; max-height: 140px; overflow-y: auto; }
.live-parts .lp-item { font-size: 13px; }
.live-parts .lp-item.me { font-weight: 700; color: var(--accent); }

/* 개발모드 / 릴리즈 */
.dev-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: #2b2b2b; color: #ffd479; font-size: 12.5px; font-weight: 700; text-align: center; padding: 6px 10px; }
.dev-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; }
.dev-row .dev-sub { font-size: 12px; color: var(--text-dim); font-weight: 400; margin-top: 3px; }
.dev-sechead { font-weight: 800; font-size: 13px; margin: 6px 0 8px; }
.release-list { display: flex; flex-direction: column; gap: 6px; }
.release-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--bg-soft); border-radius: 10px; }
.release-name { font-weight: 700; font-size: 14px; }
.release-toggle { border: 1px solid var(--border); background: var(--card); border-radius: 8px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer; }
.release-toggle.on { background: #e8f5ec; color: #1e7a43; border-color: #b7e0c4; }
.release-empty { color: var(--text-dim); font-size: 13px; padding: 8px 2px; }

/* 계속 시청중인가요? 확인 오버레이 */
.still-watching { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.72); }
.still-watching .sw-box { background: var(--card); border-radius: 16px; padding: 26px 28px; text-align: center; max-width: 340px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.still-watching .sw-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.still-watching .sw-sub { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 18px; }

/* 배속 버튼 */
.player-speed { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.player-speed .ps-label { font-size: 12px; font-weight: 700; color: var(--text-dim); margin-right: 2px; }
.player-speed .ps-chip { border: 1px solid var(--border); background: var(--card); color: var(--text-dim); border-radius: 16px; padding: 5px 12px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.player-speed .ps-chip:hover { border-color: var(--accent); color: var(--text); }
.player-speed .ps-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 앱 설치 QR 팝업 ---------- */
.qr-modal { max-width: 360px; text-align: center; }
.qr-modal h3 { text-align: center; }
.qr-desc { margin: 0 0 16px; font-size: 13.5px; line-height: 1.7; color: var(--text-dim); }
.qr-desc b { color: var(--text); }
.qr-box {
  width: 220px; height: 220px; margin: 0 auto; padding: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-sm); display: grid; place-items: center;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.qr-url {
  margin: 12px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .2px;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.qr-again {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 14px;
  font-size: 13px; color: var(--text-dim); cursor: pointer;
}
.qr-again input { width: auto; margin: 0; }
.qr-modal .actions { justify-content: center; margin-top: 16px; }

/* ---------- 다중 선택 (일괄 작업) ---------- */
.bulk-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 120;
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: 999px; padding: 8px 12px; max-width: calc(100vw - 24px);
}
.bulk-bar .bb-count { font-size: 13.5px; color: var(--text-dim); white-space: nowrap; padding: 0 4px; }
.bulk-bar .bb-count b { color: var(--accent); font-size: 15px; }
.sel-cb { flex-shrink: 0; cursor: pointer; }
.class-card.selectable { position: relative; cursor: pointer; }
.class-card.selectable .cc-actions { display: none; }
.class-card.selectable .sel-cb { position: absolute; top: 12px; right: 12px; z-index: 2; }
.class-card.selectable .cc-top { padding-right: 26px; }
.class-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.lec-rows.selecting .lr-grip,
.lec-rows.selecting .lr-actions,
.lec-rows.selecting .insert-zone,
.lec-rows.selecting .sec-actions { display: none !important; }
.lec-rows.selecting .lec-row { cursor: pointer; }
.lec-row .lr-cb { margin: 0 6px 0 2px; }
.lec-row.selected { background: rgba(192, 57, 43, .08); }

/* ---------- 전체 영상 (관리자) ---------- */
.al-filters { display: flex; gap: 10px; margin: 4px 0 16px; flex-wrap: wrap; }
.al-filters #alSearch { flex: 1; min-width: 200px; }
.al-filters #alClass { min-width: 200px; }
.al-cls { font-weight: 600; color: var(--text); }
.al-subj { display: inline-block; margin-left: 7px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #4a3b1e; }

/* 앵커를 버튼처럼 (다운로드 링크) */
a.btn { display: inline-block; text-decoration: none; line-height: 1.4; }
a.btn:hover { text-decoration: none; }

/* ---------- 설치 QR 팝업: 안드/아이폰 설치방법 ---------- */
.qr-modal { max-width: 420px; }
.qr-guide {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 16px 0 4px; text-align: left;
}
.qrg-col {
  background: var(--card-hover, rgba(0,0,0,.03)); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 12px;
}
.qrg-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 7px;
}
.qrg-ic { font-size: 15px; }
.qr-guide ol { margin: 0; padding-left: 16px; }
.qr-guide li {
  font-size: 12px; line-height: 1.6; color: var(--text-dim); margin-bottom: 3px;
}
.qr-guide li b { color: var(--text); font-weight: 600; }
@media (max-width: 380px) { .qr-guide { grid-template-columns: 1fr; } }

/* ---------- 카테고리 접기/펼치기 ---------- */
.cat-head.cat-toggle { cursor: pointer; user-select: none; -webkit-user-select: none; }
.cat-head.cat-toggle .cat-caret {
  font-size: 12px; color: var(--text-dim); width: 14px; flex-shrink: 0;
  transition: transform .12s ease;
}
.cat-head.cat-toggle .cat-name-t { flex: 0 1 auto; }
.cat-head.cat-toggle .cat-count { margin-left: 2px; }
.cat-head.cat-toggle:hover { color: var(--accent); }
.cat-head.cat-toggle.collapsed { border-bottom-style: dashed; opacity: .92; }
/* hidden 속성이 display:flex(.class-list.hrow)에 무시되지 않도록 강제 */
.class-list[hidden] { display: none !important; }

/* ---------- 다중 영상 업로드: 파일별 제목 ---------- */
.up-titles { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; padding: 2px; }
.up-title-row { display: flex; align-items: center; gap: 8px; }
.up-title-row .utr-name { flex: 0 0 32%; font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-title-row .utr-title { flex: 1; }

/* ---------- 강의 목록 행 썸네일(선생님 관리 화면) ---------- */
.lr-thumb { width: 104px; height: 59px; flex-shrink: 0; border-radius: 7px; object-fit: cover; background: var(--bg-soft); border: 1px solid var(--border); }
.lr-thumb.none { display: grid; place-items: center; font-size: 22px; color: var(--text-dim); }

/* ---------- 썸네일 크게 보기(라이트박스) ---------- */
.img-lightbox { cursor: zoom-out; }
.lb-box { max-width: min(880px, 92vw); max-height: 90vh; }
.lb-img { width: 100%; height: auto; max-height: 78vh; object-fit: contain; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.45); display: block; }
.lb-cap { color: #fff; text-align: center; margin-top: 12px; font-size: 14px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.al-cls { cursor: default; }
