:root{
  --navy-900:#002251;--navy-700:#003478;--navy-600:#0D4694;
  --sky-500:#0F8BD9;--sky-100:#E6F3FC;
  --bg:#F6F8FB;--surface:#FFFFFF;--surface-hover:#F0F4F8;
  --text:#1A2332;--text-secondary:#5F6A7D;--border:#D9DEE5;
  --positive:#1E9E5F;--warning:#E8820E;--negative:#D62839;
  --gray-50:#F6F8FB;--gray-100:#EDF1F6;
  --radius-sm:4px;--radius-md:6px;--radius-lg:10px;
  --shadow-sm:0 1px 2px rgba(0,34,81,.04);
  --shadow-md:0 2px 6px rgba(0,34,81,.06);
  --shadow-lg:0 8px 20px rgba(0,34,81,.10);
  --font:'Pretendard',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  --h-head:56px;
  --pane-list-w:340px;
}
[data-theme="dark"]{
  --bg:#0B1220;--surface:#141E30;--surface-hover:#1B2842;
  --text:#E4E9F1;--text-secondary:#9FAABC;--border:#2A3650;
  --gray-50:#0F1828;--gray-100:#162238;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;font-family:var(--font);color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
input,textarea{font-family:inherit;font-size:14px;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:8px 10px;width:100%}
input:focus,textarea:focus{outline:none;border-color:var(--navy-700);box-shadow:0 0 0 3px rgba(0,52,120,.12)}
textarea{resize:vertical;min-height:80px;line-height:1.6}

.skip-link{position:absolute;top:-100%;left:16px;padding:8px 16px;background:var(--navy-700);color:#fff;border-radius:var(--radius-md);font-size:14px;font-weight:600;z-index:999}
.skip-link:focus{top:16px}

/* 헤더 */
.header{position:fixed;inset:0 0 auto 0;height:var(--h-head);background:var(--surface);border-bottom:1px solid var(--border);z-index:100}
.header-inner{max-width:1600px;margin:0 auto;height:100%;padding:0 20px;display:flex;align-items:center;gap:20px}
.logo{font-size:18px;font-weight:800;color:var(--navy-700);letter-spacing:-.02em}
.nav{display:flex;gap:18px;align-items:center;flex:1}
.nav a{font-size:13px;font-weight:600;color:var(--text-secondary);transition:color .15s}
.nav a:hover,.nav a.nav-current{color:var(--navy-700)}
.header-right{display:flex;align-items:center;gap:10px;font-size:13px}
.user-chip{display:flex;align-items:center;gap:8px;padding:4px 10px 4px 12px;background:var(--sky-100);border-radius:999px;font-weight:600;color:var(--navy-700)}
.user-chip .role{font-size:10px;font-weight:700;background:var(--navy-700);color:#fff;padding:2px 6px;border-radius:999px;letter-spacing:.04em}
.link-btn{font-size:13px;font-weight:600;color:var(--navy-700);padding:6px 12px;border:1px solid var(--navy-700);border-radius:var(--radius-md);background:transparent}
.link-btn:hover{background:var(--sky-100)}

/* 버튼 */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 14px;border-radius:var(--radius-md);font-size:13px;font-weight:600;transition:all .15s;font-family:var(--font);white-space:nowrap;border:1px solid transparent}
.btn-primary{background:var(--navy-700);color:#fff}
.btn-primary:hover:not(:disabled){background:var(--navy-900)}
.btn-ghost{background:transparent;color:var(--text-secondary)}
.btn-ghost:hover:not(:disabled){background:var(--surface-hover);color:var(--navy-700)}
.btn-outline{background:transparent;color:var(--navy-700);border-color:var(--navy-700)}
.btn-outline:hover:not(:disabled){background:var(--sky-100)}
.btn-sm{font-size:12px;padding:6px 12px}
.btn-danger{background:transparent;color:var(--negative);border-color:var(--negative)}
.btn-danger:hover:not(:disabled){background:rgba(214,40,57,.08)}
.btn:disabled{opacity:.4;cursor:not-allowed}

/* 2열 레이아웃 */
.app-layout{position:fixed;top:var(--h-head);left:0;right:0;bottom:0;display:grid;grid-template-columns:var(--pane-list-w) 1fr;gap:0;overflow:hidden}
.pane{background:var(--surface);display:flex;flex-direction:column;overflow:hidden;min-width:0}
.pane-list{border-right:1px solid var(--border)}
.pane-detail{background:var(--bg)}

/* 목록 패널 */
.pane-head{padding:14px 16px 8px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.pane-title{font-size:15px;font-weight:800;color:var(--text);letter-spacing:-.01em}
.pane-meta{font-size:12px;color:var(--text-secondary);font-weight:600}
.search-box{padding:10px 16px;border-bottom:1px solid var(--border)}
.search-box input{padding:7px 10px;font-size:13px}
.list-scroll{flex:1;overflow-y:auto;padding:8px 10px}
.list-item{display:flex;gap:10px;padding:10px;border-radius:var(--radius-md);cursor:pointer;margin-bottom:4px;transition:background .12s;border:1px solid transparent}
.list-item:hover{background:var(--surface-hover)}
.list-item.active{background:var(--navy-700);border-color:var(--navy-700);color:#fff}
.list-item.active .list-item-title{color:#fff}
.list-item.active .list-item-meta{color:rgba(255,255,255,.75)}
.list-item.active .list-item-thumb{background:linear-gradient(135deg,#4d7fb8,#2a4f7e);color:#fff;opacity:1}
.list-item.active .tag{background:rgba(255,255,255,.2);color:#fff}
.list-item-thumb{flex:0 0 68px;width:68px;aspect-ratio:16/10;border-radius:var(--radius-sm);overflow:hidden;background:linear-gradient(135deg,var(--sky-100),var(--surface-hover));display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:800;color:var(--navy-700);opacity:.85}
.list-item-thumb img{width:100%;height:100%;object-fit:cover}
.list-item-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.list-item-title{font-size:13px;font-weight:700;line-height:1.35;color:var(--text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.list-item-meta{font-size:11px;color:var(--text-secondary);display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.tag{display:inline-block;font-size:10px;font-weight:700;padding:1px 6px;border-radius:999px;background:rgba(15,139,217,.12);color:var(--sky-500);letter-spacing:.04em}
.tag.multi{background:rgba(30,158,95,.12);color:var(--positive)}
.list-empty,.list-error{padding:32px 20px;text-align:center;font-size:13px;color:var(--text-secondary)}
.list-error{color:var(--negative)}


/* 메타 아이콘 (이모티콘 대체) */
.meta-row{display:inline-flex;align-items:center;gap:4px}
.meta-row svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.list-item-meta .meta-row svg{width:12px;height:12px;stroke-width:1.8}
.detail-meta .meta-row svg{width:14px;height:14px;stroke:var(--text-secondary)}

/* 상세 패널 */
.pane-detail{overflow-y:auto}
.detail-content{padding:20px 24px 40px;max-width:1200px;margin:0 auto;display:flex;flex-direction:column;gap:14px}
.detail-head{display:flex;flex-direction:column;gap:8px}
.detail-title{font-size:22px;font-weight:800;line-height:1.25;letter-spacing:-.01em}
.detail-meta{font-size:13px;color:var(--text-secondary);display:flex;gap:14px;flex-wrap:wrap}
.detail-sections{display:flex;gap:6px;flex-wrap:wrap;margin-top:2px}
.sec-tab{padding:6px 12px;border-radius:var(--radius-md);background:var(--surface);border:1px solid var(--border);font-size:12px;font-weight:600;color:var(--text-secondary);transition:all .15s}
.sec-tab:hover{border-color:var(--navy-700);color:var(--navy-700)}
.sec-tab.active{background:var(--navy-700);color:#fff;border-color:var(--navy-700)}

/* 스테이지: 슬라이드 + 자막 양쪽 */
.stage{
  display:flex;flex-direction:column;gap:10px;
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:14px;box-shadow:var(--shadow-sm);
  /* 기존 2열 레이아웃(슬라이드 1.6fr + 자막 1fr)의 총 너비와 동일하게 유지 */
  width:100%;
}
.slide-frame{
  background:#000;border-radius:var(--radius-md);
  aspect-ratio:16/9;position:relative;overflow:hidden;
  display:flex;align-items:center;justify-content:center;
  width:100%;
}
.slide-frame img{width:100%;height:100%;object-fit:contain;display:block}
.slide-placeholder{color:#aaa;font-size:13px}
.slide-nav{display:flex;align-items:center;justify-content:space-between;gap:8px}
.slide-nav .btn{padding:6px 10px}
.slide-pos{font-family:'JetBrains Mono',monospace;font-size:12px;color:var(--text-secondary);font-weight:600}

/* 슬라이드 하단 자막 라인 (별도 블록, 오버레이 아님) */
.vtt-line{
  background:var(--gray-50);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:14px 20px;
  min-height:56px;
  display:flex;align-items:center;justify-content:center;
  font-size:16px;font-weight:500;line-height:1.5;
  color:var(--text);text-align:center;
  transition:all .15s;
}
.vtt-line:empty{opacity:.35;min-height:44px}
.vtt-line:empty::before{content:'자막 대기…';color:var(--text-secondary);font-size:12px;font-style:italic;font-weight:400}
@media(max-width:720px){
  .vtt-line{font-size:14px;padding:10px 14px;min-height:44px}
}

/* 오디오 바 */
.audio-bar{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:10px 14px;box-shadow:var(--shadow-sm)}
.audio-bar audio{width:100%;height:40px}

/* 토론 */
.discuss{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px 18px;box-shadow:var(--shadow-sm);display:flex;flex-direction:column;gap:10px}
.discuss-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.discuss-head h2{font-size:16px;font-weight:800}
.discuss-count{display:inline-block;font-size:11px;font-weight:700;color:#fff;background:var(--navy-700);padding:2px 8px;border-radius:999px;margin-left:4px}
.auth-hint{font-size:12px;color:var(--text-secondary);margin-left:auto}
.auth-hint.authed{color:var(--positive)}

.post-form{display:flex;flex-direction:column;gap:8px;background:var(--gray-50);border:1px solid var(--border);border-radius:var(--radius-md);padding:12px}
.form-actions{display:flex;justify-content:flex-end;gap:6px}
.form-error{font-size:12px;color:var(--negative);background:rgba(214,40,57,.08);border:1px solid rgba(214,40,57,.25);border-radius:var(--radius-md);padding:6px 10px}

.post-list{display:flex;flex-direction:column;gap:10px}
.post-item{border:1px solid var(--border);border-radius:var(--radius-md);padding:12px 14px;background:var(--surface)}
.post-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:6px}
.post-title{font-size:14px;font-weight:700;color:var(--text)}
.post-meta{font-size:11px;color:var(--text-secondary);display:flex;gap:8px;align-items:center}
.post-author{font-weight:600;color:var(--navy-700)}
.post-body{font-size:13.5px;line-height:1.65;color:var(--text);white-space:pre-wrap;word-break:break-word}
.post-actions{display:flex;justify-content:flex-end;gap:4px;margin-top:8px}
.post-actions button{font-size:11px;padding:3px 8px;border-radius:var(--radius-sm);background:transparent;color:var(--text-secondary);transition:all .12s}
.post-actions button:hover{color:var(--navy-700);background:var(--surface-hover)}
.post-actions .del:hover{color:var(--negative);background:rgba(214,40,57,.08)}

.comments{margin-top:10px;padding-top:10px;border-top:1px dashed var(--border);display:flex;flex-direction:column;gap:8px}
.comment-item{background:var(--gray-50);border-radius:var(--radius-md);padding:8px 10px;font-size:12.5px}
.comment-head{display:flex;gap:8px;align-items:baseline;font-size:11px;color:var(--text-secondary);margin-bottom:3px}
.comment-body{line-height:1.55;color:var(--text);white-space:pre-wrap;word-break:break-word}
.comment-actions{display:flex;justify-content:flex-end;margin-top:4px}
.comment-actions button{font-size:10px;padding:2px 6px;color:var(--text-secondary)}
.comment-form{display:flex;gap:6px;margin-top:6px}
.comment-form textarea{min-height:38px;font-size:12.5px;padding:6px 8px}
.comment-form button{flex:0 0 auto}

.post-empty{text-align:center;padding:20px;color:var(--text-secondary);font-size:13px}

/* 모달 */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;z-index:1000;padding:16px}
.modal-overlay[hidden]{display:none}
.modal{background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);padding:24px;max-width:480px;width:100%}
.modal h2{font-size:17px;font-weight:800;margin-bottom:10px}
.gate-msg{font-size:14px;line-height:1.65;color:var(--text-secondary)}
#editForm input{margin-bottom:8px}

/* 반응형 */
@media(max-width:960px){
  :root{--pane-list-w:260px}
  .stage{grid-template-columns:1fr}
  .stage-vtt{max-height:200px;min-height:140px}
}
@media(max-width:720px){
  .app-layout{grid-template-columns:1fr;grid-template-rows:45vh 1fr}
  .pane-list{border-right:none;border-bottom:1px solid var(--border)}
  .header-inner{gap:10px;padding:0 12px}
  .nav{gap:10px;overflow-x:auto;white-space:nowrap}
  .nav a{font-size:12px}
  .detail-content{padding:14px 16px 32px}
  .detail-title{font-size:18px}
}

/* Iter 2: 대댓글(threaded) 스타일 */
.comment-item.reply{background:var(--surface);border-left:2px solid var(--sky-500);padding-left:10px}
.comment-item.reply .comment-head{font-size:10.5px}
.comment-form.reply-form{margin-top:6px;background:var(--surface-hover);padding:6px;border-radius:var(--radius-sm)}
.comment-form.reply-form textarea{font-size:12px;min-height:32px}

/* Iter 3: Toast 알림 + 접근성 포커스 링 + 모바일 미세조정 */
.toast-host{position:fixed;right:16px;bottom:16px;display:flex;flex-direction:column;gap:8px;z-index:2000;pointer-events:none}
.toast{pointer-events:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:10px 14px;box-shadow:var(--shadow-lg);font-size:13px;font-weight:600;color:var(--text);min-width:240px;max-width:360px;animation:toastIn .2s ease-out}
.toast.hide{opacity:0;transform:translateX(20px);transition:all .25s}
.toast-info{border-left:3px solid var(--sky-500)}
.toast-success{border-left:3px solid var(--positive);color:var(--positive)}
.toast-warn{border-left:3px solid var(--warning);color:var(--warning)}
.toast-error{border-left:3px solid var(--negative);color:var(--negative)}
@keyframes toastIn{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:translateX(0)}}

/* 포커스 가시성 강화 (키보드 접근성) */
.list-item:focus-visible,
.sec-tab:focus-visible,
.btn:focus-visible,
.link-btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
.vtt-cue:focus-visible{
  outline:2px solid var(--sky-500);
  outline-offset:2px;
  box-shadow:0 0 0 4px rgba(15,139,217,.18);
}
.vtt-cue{tab-index:-1}

/* 모바일 미세조정 */
@media(max-width:720px){
  .stage{padding:8px;gap:8px}
  .audio-bar{padding:6px 10px}
  .discuss{padding:12px 14px}
  .toast-host{left:12px;right:12px;bottom:12px}
  .toast{min-width:auto;max-width:none}
  .pane-head{padding:10px 12px 6px}
  .search-box{padding:8px 12px}
  .list-item-thumb{flex:0 0 54px;width:54px}
  .detail-content{gap:10px}
}

/* 고대비·동작 저감 사용자 배려 */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms !important;transition-duration:.01ms !important}
}

/* Iter 3: 로딩 상태 */
.list-item.loading-placeholder{opacity:.5;pointer-events:none}

/* 운영: 오디오 진단줄 완전 숨김 */
#audioDiag{display:none !important}
#audioWarn{display:none !important}

/* 헤더 미니 플레이어 (전역 재생 연속성) */
.header-right{display:flex;align-items:center;gap:10px}
.auth-slot{display:flex;align-items:center;gap:10px}
.mini-player{
  display:flex;align-items:center;gap:8px;
  padding:4px 10px 4px 6px;
  background:var(--surface-hover);
  border:1px solid var(--border);
  border-radius:999px;
  max-width:320px;
  transition:all .15s;
}
.mini-player.playing{border-color:var(--navy-700);background:var(--sky-100)}
.mini-player[hidden]{display:none}
.mini-play-btn{
  flex:0 0 28px;width:28px;height:28px;border-radius:50%;
  background:var(--navy-700);color:#fff;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;transition:background .12s;padding:0;
}
.mini-play-btn:hover{background:var(--navy-900)}
.mini-play-btn svg{width:14px;height:14px;fill:currentColor}
.mini-title{
  font-size:12px;font-weight:600;color:var(--text);
  max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  cursor:pointer;
}
.mini-title:hover{color:var(--navy-700);text-decoration:underline}
.mini-time{font-family:'JetBrains Mono',monospace;font-size:11px;color:var(--text-secondary);font-weight:600;white-space:nowrap}
.mini-close{
  flex:0 0 20px;width:20px;height:20px;border-radius:50%;
  color:var(--text-secondary);display:flex;align-items:center;justify-content:center;
  cursor:pointer;transition:all .12s;padding:0;
}
.mini-close:hover{background:var(--border);color:var(--text)}
.mini-close svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}

@media(max-width:720px){
  .mini-player{max-width:180px;padding:3px 8px 3px 4px}
  .mini-title{max-width:80px;font-size:11px}
  .mini-time{display:none}
}

/* 공유 링크 기능 */
.detail-head{position:relative}
.share-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}
.btn-share{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:var(--surface);border:1px solid var(--navy-700);color:var(--navy-700);border-radius:var(--radius-md);font-size:12px;font-weight:600;cursor:pointer;transition:all .12s}
.btn-share:hover{background:var(--sky-100)}
.btn-share svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.share-output{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.share-output input{flex:1;min-width:200px;font-family:'JetBrains Mono',monospace;font-size:12px;padding:6px 8px;background:var(--surface-hover)}
.share-output .btn{padding:6px 10px;font-size:12px}
.share-copied{color:var(--positive);font-size:11px;font-weight:700;animation:fadeOut 2s forwards}
@keyframes fadeOut{0%{opacity:1}80%{opacity:1}100%{opacity:0}}


/* VTT 편집기 */
.stage-slide-row{
  display:flex;gap:10px;align-items:flex-start;min-width:0;
}
/* 슬라이드: 가로세로 비율 유지 + 편집 패널 높이 따라가지 않도록 자기 폭 내에서 16:9 고정 */
.stage-slide-row .slide-frame{flex:1;min-width:0;align-self:flex-start}
.vtt-edit-panel{
  flex:0 0 300px;width:300px;
  /* 높이는 JS가 슬라이드 실제 clientHeight와 동기화 */
  min-height:240px;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
  display:flex;flex-direction:column;overflow:hidden;
  animation:slideInRight .18s ease-out;
}
.vtt-edit-panel[hidden]{display:none}
@keyframes slideInRight{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:translateX(0)}}
.vtt-edit-header{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;background:var(--surface-hover);border-bottom:1px solid var(--border)}
.vtt-edit-header h3{font-size:13px;font-weight:700;color:var(--text)}
.vtt-edit-header .close-btn{background:none;border:none;color:var(--text-secondary);cursor:pointer;padding:2px 6px;font-size:18px;line-height:1}
.vtt-edit-header .close-btn:hover{color:var(--negative)}
.vtt-edit-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:0;min-height:0}
.vtt-edit-table{width:100%;border-collapse:collapse;font-size:11px}
.vtt-edit-table thead{position:sticky;top:0;background:var(--surface);z-index:1}
.vtt-edit-table th{text-align:left;padding:6px 8px;font-weight:700;font-size:10px;color:var(--text-secondary);border-bottom:2px solid var(--border);text-transform:uppercase;letter-spacing:.04em}
.vtt-edit-table td{padding:4px 6px;border-bottom:1px solid var(--border);vertical-align:top}
.vtt-edit-table tr.active{background:var(--sky-100)}
.vtt-edit-table .time-cell{font-family:'JetBrains Mono',monospace;font-size:10px;color:var(--text-secondary);width:72px;min-width:72px;max-width:72px;user-select:all;line-height:1.3;white-space:nowrap;padding:5px 6px;text-align:left}
.vtt-edit-table textarea.vtt-text-input{width:100%;min-height:38px;font-size:12px;padding:4px 6px;line-height:1.4;border:1px solid transparent;background:transparent;color:var(--text);resize:none;font-family:var(--font);overflow:hidden;box-sizing:border-box;display:block}
.vtt-edit-table textarea.vtt-text-input:focus{border-color:var(--navy-700);background:var(--surface);outline:none}
.vtt-edit-table textarea.vtt-text-input.dirty{border-color:var(--warning);background:rgba(232,130,14,.05)}
.vtt-edit-footer{padding:10px 12px;border-top:1px solid var(--border);display:flex;justify-content:space-between;gap:6px;align-items:center;background:var(--surface-hover)}
.vtt-edit-footer .status{font-size:11px;color:var(--text-secondary)}
.vtt-edit-footer .status.dirty{color:var(--warning);font-weight:600}
.vtt-edit-footer .btn{padding:5px 10px;font-size:11px}

/* VTT 라인 hover 수정 버튼 */
.vtt-line-wrap{position:relative}
.vtt-edit-btn{
  position:absolute;right:8px;top:50%;transform:translateY(-50%);
  background:var(--surface);border:1px solid var(--border);color:var(--text-secondary);
  border-radius:50%;width:26px;height:26px;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;opacity:0;transition:opacity .12s,color .12s,border-color .12s;
  z-index:2;
}
.vtt-edit-btn[hidden]{display:none}
.vtt-line-wrap:hover .vtt-edit-btn,.vtt-edit-btn:focus{opacity:1}
.vtt-edit-btn:hover{color:var(--navy-700);border-color:var(--navy-700);background:var(--sky-100)}

@media(max-width:720px){
  .stage-slide-row{flex-direction:column}
  .vtt-edit-panel{width:100%;flex:none;max-height:50vh}
}


/* VTT 편집기 — 검색 UI */
.vtt-edit-header-actions{display:flex;align-items:center;gap:4px}
.vtt-edit-header .icon-btn{
  background:none;border:none;color:var(--text-secondary);cursor:pointer;
  padding:4px;border-radius:var(--radius-sm);display:flex;align-items:center;justify-content:center;
  transition:color .12s,background .12s;
}
.vtt-edit-header .icon-btn:hover{color:var(--navy-700);background:var(--surface-hover)}
.vtt-edit-searchbar{
  display:flex;align-items:center;gap:4px;padding:6px 8px;
  background:var(--surface-hover);border-bottom:1px solid var(--border);
}
.vtt-edit-searchbar[hidden]{display:none}
.vtt-edit-searchbar input[type=search]{
  flex:1;font-size:12px;padding:4px 8px;line-height:1.4;
  border:1px solid var(--border);border-radius:var(--radius-sm);
  background:var(--surface);color:var(--text);outline:none;
}
.vtt-edit-searchbar input[type=search]:focus{border-color:var(--navy-700)}
.vtt-edit-searchbar .s-count{
  font-family:'JetBrains Mono',monospace;font-size:10px;color:var(--text-secondary);
  padding:0 4px;white-space:nowrap;min-width:34px;text-align:center;
}
.vtt-edit-searchbar .s-count.no-match{color:var(--negative)}
.vtt-edit-searchbar .icon-btn{
  background:var(--surface);border:1px solid var(--border);color:var(--text-secondary);
  padding:4px 6px;border-radius:var(--radius-sm);cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:all .12s;
}
.vtt-edit-searchbar .icon-btn:hover{color:var(--navy-700);border-color:var(--navy-700)}

/* 매칭 하이라이트: 검색어 포함 행은 배경 + textarea 형광색 */
.vtt-edit-table tbody tr.match{background:rgba(255,235,59,.25)}
.vtt-edit-table tbody tr.match textarea.vtt-text-input{background:rgba(255,235,59,.35);color:var(--text)}
.vtt-edit-table tbody tr.match-current{background:rgba(255,193,7,.55) !important}
.vtt-edit-table tbody tr.match-current textarea.vtt-text-input{background:rgba(255,193,7,.65)}
[data-theme="dark"] .vtt-edit-table tbody tr.match{background:rgba(255,235,59,.15)}
[data-theme="dark"] .vtt-edit-table tbody tr.match textarea.vtt-text-input{background:rgba(255,235,59,.20);color:#fff}
[data-theme="dark"] .vtt-edit-table tbody tr.match-current{background:rgba(255,193,7,.35) !important}
[data-theme="dark"] .vtt-edit-table tbody tr.match-current textarea.vtt-text-input{background:rgba(255,193,7,.40)}

/* ============================================================
   슬라이드 풀스크린 모드 — 더블클릭/더블탭으로 토글
   ============================================================ */
body.slide-fullscreen { overflow: hidden; }
body.slide-fullscreen .header,
body.slide-fullscreen .pane-list,
body.slide-fullscreen .detail-head,
body.slide-fullscreen .audio-bar,
body.slide-fullscreen .discuss,
body.slide-fullscreen .vtt-edit-panel { display: none !important; }
body.slide-fullscreen .app-layout { grid-template-columns: 1fr !important; padding: 0 !important; gap: 0 !important; }
body.slide-fullscreen .pane-detail { padding: 0 !important; border: 0 !important; box-shadow: none !important; background: #000 !important; }
body.slide-fullscreen .detail-content { padding: 0 !important; max-width: none !important; }
body.slide-fullscreen .stage { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: 0; margin: 0; }
body.slide-fullscreen .stage-slide-row { flex: 1 1 auto; min-height: 0; padding: 0; margin: 0; }
body.slide-fullscreen .slide-frame { width: 100vw; height: 100vh; height: 100dvh; max-width: 100vw; max-height: 100vh; max-height: 100dvh; border: 0; border-radius: 0; background: #000; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
body.slide-fullscreen .slide-frame img { width: 100%; height: 100%; object-fit: contain; background: #000; }
body.slide-fullscreen .vtt-line-wrap { position: fixed; left: 0; right: 0; bottom: 56px; padding: 8px 16px; pointer-events: none; z-index: 50; }
body.slide-fullscreen .vtt-line { background: rgba(0,0,0,.55); color: #fff; padding: 8px 12px; border-radius: 6px; max-width: 90vw; margin: 0 auto; text-align: center; }
body.slide-fullscreen .slide-nav { position: fixed; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 16px; align-items: center; z-index: 51; }
body.slide-fullscreen .slide-nav .btn { background: rgba(0,0,0,.5); color: #fff; border-color: rgba(255,255,255,.4); }
body.slide-fullscreen .slide-nav .slide-pos { color: #fff; background: rgba(0,0,0,.4); padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
body.slide-fullscreen html, body.slide-fullscreen body, body.slide-fullscreen main { background: #000 !important; }
@media (max-width: 640px) {
  body.slide-fullscreen .vtt-line-wrap { bottom: 64px; }
  body.slide-fullscreen .slide-nav { bottom: 12px; }
}
/* 일반 모드의 slideFrame 더블탭 사용성: 텍스트 선택 차단 (실수로 텍스트 드래그되는 거 방지) */
.slide-frame { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
