/* 원본 화면에 없던 요소(드롭다운, 시트, 플레이어 등)를 같은 디자인 언어로 그린다. */
.text-muted { color: rgba(var(--fg-rgb), .56); }
.text-accent { color: var(--accent); }

/* ---------- 헤더 드롭다운 / 툴팁 ---------- */
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; z-index: 60;
  background: var(--bg); border: 1px solid var(--divider); border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 6px 0;
}
.dropdown button, .dropdown a { display: block; width: 100%; text-align: left; padding: 10px 16px; font-size: 16px; line-height: 24px; }
.dropdown button:hover, .dropdown a:hover { background: var(--hover); }
.tooltip {
  position: absolute; right: -8px; top: calc(100% + 10px); width: max-content; max-width: 240px; z-index: 60;
  background: var(--fg); color: var(--bg); font-size: 13px; line-height: 20px; padding: 8px 12px; border-radius: 4px;
}
.tooltip::before { content: ""; position: absolute; right: 12px; top: -5px; border: 5px solid transparent; border-top: 0; border-bottom-color: var(--fg); }

/* ---------- 바텀 시트 (추가영상) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 80; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet {
  width: 100%; max-width: 768px; max-height: 80dvh; overflow-y: auto; background: var(--bg);
  padding: 24px 40px calc(24px + var(--safe-bottom)); border-radius: 8px 8px 0 0; animation: up .25s cubic-bezier(.25, .46, .45, .94);
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }

/* ---------- 강의 카드 / 목록 행 ---------- */
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-sub); overflow: hidden; border-radius: 2px; flex-shrink: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .72); color: #fff; font-size: 12px; line-height: 18px; padding: 0 6px; border-radius: 2px; }
.thumb .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(var(--fg-rgb), .25); }
.thumb .now { position: absolute; inset: 0; background: rgba(0, 60, 224, .55); color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.minibar { height: 4px; background: var(--track); border-radius: 2px; overflow: hidden; }
.minibar > div { height: 100%; background: linear-gradient(to right, var(--accent), var(--accent-2)); }
.tag-unplayable { display: inline-block; font-size: 12px; line-height: 18px; padding: 0 6px; border-radius: 2px; border: 1px solid var(--danger); color: var(--danger); }
.tag-done { display: inline-block; font-size: 12px; line-height: 18px; padding: 0 6px; border-radius: 2px; border: 1px solid var(--ok-icon); color: var(--ok-icon); }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
@media (max-width: 520px) { .card-grid { grid-template-columns: minmax(0, 1fr); } }
.card { display: flex; flex-direction: column; gap: 8px; }
.card:hover .card-title { text-decoration: underline; }

.row-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(var(--fg-rgb), .08); align-items: flex-start; }
.row-item .thumb { width: 136px; }
.row-item.current { background: linear-gradient(to right, rgba(0, 60, 224, .06), transparent); box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
.row-item:hover .row-title { text-decoration: underline; }
.row-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }

/* ---------- 입력 ---------- */
.field { width: 100%; height: 48px; border-bottom: 1px solid var(--fg); font-size: 18px; outline: none; padding: 0 2px; }
.field::placeholder { color: rgba(var(--fg-rgb), .35); }
.btn-primary { width: 100%; height: 48px; background: var(--fg); color: var(--bg); font-size: 16px; border-radius: 2px; }
.btn-primary:disabled { opacity: .4; }
.search-box { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--fg); height: 48px; }
.search-box input { flex: 1; min-width: 0; height: 100%; font-size: 18px; outline: none; }
.search-box input::placeholder { color: rgba(var(--fg-rgb), .35); }

.menu-row { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 20px 0; border-bottom: 1px solid rgba(var(--fg-rgb), .08); font-size: 18px; line-height: 28px; text-align: left; }
.pre { white-space: pre-wrap; word-break: break-word; }
.toast { position: fixed; left: 50%; bottom: calc(var(--bottom-bar-h) + 24px); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 4px; font-size: 14px; z-index: 100; }

/* ---------- 재생 화면: 전체 화면형 플레이어 (캡처 화면 기준) ---------- */
.watch-full { position: fixed; inset: 0; background: #000; z-index: 1; }
.watch-full > .vp { width: 100%; height: 100%; }
/* 가로 보기: 웹 전체화면이 없는 아이폰에서 세로로 들고 있어도 플레이어를 90° 돌려 꽉 채운다 */
.watch-full > .vp.vp-rotated { position: absolute; top: 0; left: 0; width: var(--rot-w, 100vh); height: var(--rot-h, 100vw);
  transform-origin: 0 0; transform: translateX(var(--rot-h, 100vw)) rotate(90deg); }

.vp { --pad: 28px; position: relative; overflow: hidden; background: #000; color: #fff; outline: none;
  user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none; font-size: 13px; line-height: 20px; }
.vp video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; background: #000; }
.vp:fullscreen { width: 100vw; height: 100vh; }
.vp:-webkit-full-screen { width: 100vw; height: 100vh; }
.vp button { color: #fff; }
.vp .vp-ico { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.vp .vp-ico:hover { background: rgba(255, 255, 255, .1); }
.vp-surface { position: absolute; inset: 0; }

/* 움직이는 반투명 워터마크 */
.vp-wm { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; white-space: nowrap; font-size: 15px; font-weight: 600;
  letter-spacing: .02em; color: #d2d2d2; text-shadow: 0 0 2px rgba(0, 0, 0, .35); will-change: transform; }

/* 컨트롤 레이어 */
.vp-ui { position: absolute; inset: 0; z-index: 4; pointer-events: none; transition: opacity .2s;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0) 22%, rgba(0,0,0,0) 70%, rgba(0,0,0,.6)), rgba(0,0,0,.18); }
.vp-ui > * { pointer-events: auto; }
.vp.idle .vp-ui, .vp.panel-open .vp-ui, .vp.locked .vp-ui { opacity: 0; }
.vp.idle .vp-ui *, .vp.panel-open .vp-ui *, .vp.locked .vp-ui * { pointer-events: none !important; }
.vp.idle { cursor: none; }

.vp-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) var(--pad) 14px calc(var(--pad) - 8px); }
.vp-top-l, .vp-top-r { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vp-title { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; padding: 6px 4px; }

.vp-side { position: absolute; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vp-side.left { left: calc(var(--pad) - 8px); }
.vp-side.right { right: calc(var(--pad) - 8px); }
.vp-side-ico { display: flex; align-items: center; justify-content: center; width: 36px; height: 32px; color: rgba(255,255,255,.9); }
.vp-vs { width: 36px; height: clamp(84px, 15vh, 128px); display: flex; justify-content: center; cursor: pointer; touch-action: none; }
.vp-vs-track { position: relative; width: 4px; height: 100%; border-radius: 2px; background: rgba(255,255,255,.28); overflow: hidden; }
.vp-vs-fill { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 2px; }

.vp-mid { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: clamp(40px, 9vw, 110px); }
.vp .vp-mid .vp-ico { width: 56px; height: 56px; }
.vp.waiting .vp-play { visibility: hidden; }
.vp-spinner { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; z-index: 5; pointer-events: none;
  border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.vp-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 var(--pad) max(16px, env(safe-area-inset-bottom)); }
.vp-row-full { display: flex; justify-content: flex-end; margin: 0 -8px 34px 0; }
.vp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vp-time { font-size: 13px; color: rgba(255,255,255,.85); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vp-time b { color: #fff; font-weight: 700; }
.vp-tools { display: flex; align-items: center; gap: 22px; }
.vp-tool { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; padding: 4px 0; }
.vp-tool.on { color: #78a9ff !important; }

.vp-seek { position: relative; height: 24px; margin-top: 4px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.vp-rail { position: relative; width: 100%; height: 2px; background: rgba(255,255,255,.3); transition: height .12s; }
.vp-seek:hover .vp-rail, .vp-seek.dragging .vp-rail { height: 4px; }
.vp-buf { position: absolute; top: 0; bottom: 0; background: rgba(255,255,255,.5); }
.vp-ab { position: absolute; top: -3px; bottom: -3px; display: none; background: rgba(69,137,255,.55); }
.vp-played { position: absolute; left: 0; top: 0; bottom: 0; background: #fff; }
.vp-knob { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.4); }
.vp-hover { position: absolute; bottom: 24px; transform: translateX(-50%); background: rgba(0,0,0,.85); font-size: 12px; line-height: 18px; padding: 2px 6px; border-radius: 2px; pointer-events: none; display: none; font-variant-numeric: tabular-nums; }
.vp-seek:hover .vp-hover, .vp-seek.dragging .vp-hover { display: block; }

/* 잠금 */
.vp-lockbtn { position: absolute; z-index: 6; top: max(14px, env(safe-area-inset-top)); right: calc(var(--pad) + 2 * 44px); opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.35) !important; }
.vp-lockbtn.show { opacity: 1; }

/* 안내 / 더블탭 */
.vp-osd { position: absolute; top: 20%; left: 50%; transform: translateX(-50%); z-index: 6; background: rgba(0,0,0,.72); font-size: 15px; font-weight: 600; padding: 8px 16px; border-radius: 4px; pointer-events: none; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.vp-osd.show { opacity: 1; }
.vp-ripple { position: absolute; top: 0; bottom: 0; width: 38%; z-index: 2; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity .25s; background: rgba(255,255,255,.1); }
.vp-ripple.left { left: 0; border-radius: 0 50% 50% 0; }
.vp-ripple.right { right: 0; border-radius: 50% 0 0 50%; }
.vp-ripple.show { opacity: 1; }

/* 오른쪽 패널 (설정 · 북마크 · 재생속도 · 강의 목록) */
.vp-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 7; width: 48%; min-width: 320px; max-width: 100%; background: #2b2b2b; overflow-y: auto; touch-action: pan-y; animation: vp-in .2s ease; }
@keyframes vp-in { from { transform: translateX(24px); opacity: 0; } }
.vp-panel-in { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.vp-ph { position: sticky; top: 0; z-index: 1; background: #2b2b2b; display: flex; align-items: center; gap: 4px; padding: max(12px, env(safe-area-inset-top)) 10px 12px 18px; border-bottom: 2px solid rgba(255,255,255,.82); }
.vp-ph-title { flex: 1; font-size: 14px; font-weight: 600; }
.vp-ph [data-p-back] { margin-left: -10px; }
.vp-blue { color: #78a9ff; font-weight: 600; }
.vp-red { color: #ff8389; }
.vp-prow { display: flex; width: 100%; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 16px 0 18px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 13px; font-weight: 600; text-align: left; }
.vp-prow:hover { background: rgba(255,255,255,.04); }
.vp-prow.sel { color: #78a9ff !important; }
.vp-prow-r { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.7); }
.vp-prow.sel .vp-prow-r { color: #78a9ff; }
.vp-switch { position: relative; width: 38px; height: 22px; border-radius: 11px; background: rgba(255,255,255,.25); transition: background .15s; flex-shrink: 0; }
.vp-switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.vp-switch.on { background: #0f62fe; }
.vp-switch.on i { transform: translateX(16px); }
.vp-pnote { padding: 14px 18px; font-size: 12px; line-height: 19px; color: rgba(255,255,255,.55); }
.vp-pbody { padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.vp-outline { width: 100%; height: 40px; border: 1px solid rgba(255,255,255,.55); border-radius: 2px; font-size: 13px; font-weight: 600; }
.vp-outline:hover { background: rgba(255,255,255,.06); }
.vp-bm { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.vp-bm-time { color: #78a9ff !important; font-weight: 600; font-variant-numeric: tabular-nums; padding: 8px 0; }
.vp-bm-memo { flex: 1; min-width: 0; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 2px; font-size: 13px; color: #fff; outline: none; user-select: text; -webkit-user-select: text; }
.vp-bm-memo:focus { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.05); }
.vp-speed { padding: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.vp-stepper { display: flex; align-items: center; justify-content: space-between; }
.vp-stepper b { font-size: 26px; font-weight: 300; font-variant-numeric: tabular-nums; }
.vp-stepper button { width: 48px; height: 38px; border: 1px solid rgba(255,255,255,.45); border-radius: 2px; font-size: 20px; }
.vp-speed input[type=range] { width: 100%; margin-top: 16px; accent-color: #fff; }
.vp-range-l { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,.5); }
.vp-li { display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 100%; padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; }
.vp-li:hover { background: rgba(255,255,255,.04); }
.vp-li.cur { box-shadow: inset 3px 0 0 #78a9ff; background: rgba(120,169,255,.08); }
.vp-li[data-off] { opacity: .5; }
.vp-li-sub { font-size: 12px; color: rgba(255,255,255,.6); }
.vp-li-title { font-size: 14px; font-weight: 600; word-break: keep-all; }
.vp-li-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255,255,255,.65); padding-top: 4px; font-variant-numeric: tabular-nums; }
.vp-li-bar { flex: 1; height: 3px; background: rgba(255,255,255,.2); border-radius: 2px; overflow: hidden; }
.vp-li-bar i { display: block; height: 100%; background: #78a9ff; }

/* 안내 레이어 (이어보기 · 다음 강의 · 오류) */
.vp-layer { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.72); padding: 20px; text-align: center; }
.vp-layer .box { max-width: 440px; }
.vp-layer .title { font-size: 20px; line-height: 30px; font-weight: 300; }
.vp-layer .sub { font-size: 14px; line-height: 22px; opacity: .8; margin-top: 6px; }
.vp-layer .actions { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.vp-layer .actions button { min-width: 112px; height: 44px; padding: 0 16px; border-radius: 2px; border: 1px solid rgba(255,255,255,.5); font-size: 15px; }
.vp-layer .actions button.primary { background: #0f62fe; border-color: #0f62fe; }
.p-countdown { font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .vp { --pad: 16px; }
  .vp-panel { width: 100%; min-width: 0; }
  .vp .vp-mid .vp-ico { width: 48px; height: 48px; }
  .vp-row-full { margin-bottom: 18px; }
  .vp-tools { gap: 14px; }
  .vp-lockbtn { right: calc(var(--pad) + 2 * 44px); }
}
@media (max-height: 420px) {
  .vp-row-full { margin-bottom: 6px; }
  .vp-vs { height: 72px; }
}
/* 패널이 열려 있으면 안내 문구를 왼쪽(보이는 영역) 가운데로 */
.vp.panel-open .vp-osd { left: 26%; z-index: 9; }
@media (max-width: 600px) { .vp.panel-open .vp-osd { left: 50%; top: auto; bottom: 12%; } }

/* 휴대폰(769px 미만): 원본처럼 바깥 여백 20px — 시트도 같은 여백 */
@media (max-width: 768px) {
  .sheet { padding-left: 20px; padding-right: 20px; }
}
.qr-box { width: min(240px, 64vw); aspect-ratio: 1; background: #fff; padding: 8px; border: 1px solid var(--divider); border-radius: 4px; }
.qr-box svg { width: 100%; height: 100%; display: block; }

