:root{
  --bg:#08080a; --surface:#0d0d10; --surface-2:#111114; --card:#161619; --card-hover:#1c1c20;
  --border:#232327; --border-soft:#1a1a1d; --text:#f6f6f7; --text-secondary:#a3a3ab; --text-tertiary:#68686f;
  --mac-red:#ff5f57; --mac-yellow:#febc2e; --mac-green:#28c840;
  --font-sans:'Inter',-apple-system,BlinkMacSystemFont,sans-serif; --font-mono:'JetBrains Mono',ui-monospace,monospace;
  --ease:cubic-bezier(.16,1,.3,1);
}
*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{background:var(--bg); color:var(--text); font-family:var(--font-sans); -webkit-font-smoothing:antialiased; min-height:100vh; overflow-x:hidden;}
a{color:inherit; text-decoration:none;}
button{font-family:inherit; cursor:pointer; color:inherit;}
::-webkit-scrollbar{width:10px; height:10px;}
::-webkit-scrollbar-thumb{background:#26262a; border-radius:8px;}
.mono{font-family:var(--font-mono);}
.muted{color:var(--text-tertiary); font-size:13px;}
.muted-sm{color:var(--text-tertiary); font-size:11.5px; line-height:1.8;}

.grid-bg{position:fixed; inset:0; z-index:0; pointer-events:none;
  background-image:linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size:56px 56px; mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);}
.glow{position:fixed; top:-200px; left:50%; transform:translateX(-50%); width:900px; height:600px; z-index:0; pointer-events:none;
  background:radial-gradient(ellipse at center, rgba(255,255,255,0.05), transparent 70%);}

.app{position:relative; z-index:1;}
.view{display:none;}
.view.active{display:block; animation:fadein .35s var(--ease);}
@keyframes fadein{from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:translateY(0);}}
.wrap{max-width:1180px; margin:0 auto; padding:0 32px;}

nav.topnav{position:sticky; top:0; z-index:50; background:rgba(8,8,10,0.75); backdrop-filter:blur(14px); border-bottom:1px solid var(--border-soft);}
.topnav-inner{max-width:1180px; margin:0 auto; padding:0 32px; height:68px; display:flex; align-items:center; justify-content:space-between;}
.logo{display:flex; align-items:center; gap:9px; font-weight:800; font-size:15px; letter-spacing:0.02em;}
.nav-links{display:flex; gap:32px; align-items:center;}
.nav-links a{font-size:13.5px; color:var(--text-secondary); font-weight:500; transition:color .15s;}
.nav-links a:hover{color:var(--text);}
.nav-links a.current{color:var(--text);}
.nav-right{display:flex; align-items:center; gap:10px;}

.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:9px 18px; border-radius:9px; font-size:13.5px; font-weight:600; border:1px solid transparent; transition:all .15s var(--ease); white-space:nowrap;}
.btn-primary{background:#fff; color:#08080a;}
.btn-primary:hover{background:#e7e7e9; transform:translateY(-1px);}
.btn-ghost{background:transparent; color:var(--text); border-color:var(--border);}
.btn-ghost:hover{background:var(--card); border-color:#2c2c30;}
.btn-text{background:transparent; color:var(--text-secondary); padding:9px 10px;}
.btn-text:hover{color:var(--text);}
.btn-sm{padding:7px 13px; font-size:12.5px;}
.btn-lg{padding:13px 26px; font-size:15px;}
.btn-danger{background:transparent; color:#ff8a84; border-color:#3a2222;}
.btn-danger:hover{background:#1c1414;}
.btn:disabled{opacity:.4; cursor:not-allowed; transform:none !important;}

.hero{padding:120px 32px 70px; text-align:center; position:relative;}
.badge{display:inline-flex; align-items:center; gap:8px; font-family:var(--font-mono); font-size:11px; letter-spacing:0.08em; color:var(--text-secondary); border:1px solid var(--border); border-radius:99px; padding:6px 14px; margin-bottom:28px;}
.badge .dot{width:6px; height:6px; border-radius:50%; background:var(--mac-green); box-shadow:0 0 8px rgba(40,200,64,.6);}
.hero h1{font-size:clamp(40px,7vw,84px); line-height:0.98; font-weight:900; letter-spacing:-0.03em;}
.hero h1 .l2{color:#4b4b52;}
.hero p{max-width:520px; margin:26px auto 38px; color:var(--text-secondary); font-size:16.5px; line-height:1.6;}
.hero-ctas{display:flex; gap:12px; justify-content:center; flex-wrap:wrap;}

.win{background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:0 40px 100px -30px rgba(0,0,0,0.7); overflow:hidden;}
.win-titlebar{height:42px; display:flex; align-items:center; gap:20px; padding:0 16px; background:var(--surface-2); border-bottom:1px solid var(--border-soft);}
.macdots{display:flex; gap:8px;}
.macdots span{width:11px; height:11px; border-radius:50%; display:block;}
.macdots .r{background:var(--mac-red);} .macdots .y{background:var(--mac-yellow);} .macdots .g{background:var(--mac-green);}

.room-header{display:flex; align-items:center; justify-content:space-between; padding:14px 20px; border-bottom:1px solid var(--border-soft); background:var(--surface); flex-wrap:wrap; gap:10px;}
.room-header .rh-left{display:flex; align-items:center; gap:14px;}
.room-header .rh-left .rlogo{font-weight:800; font-size:13px;}
.room-header .rcode{font-family:var(--font-mono); font-size:11.5px; color:var(--text-tertiary); border:1px solid var(--border); padding:3px 9px; border-radius:6px;}
.room-header .rh-center{font-family:var(--font-mono); font-size:12px; color:var(--text-secondary); letter-spacing:.03em;}
.room-header .rh-right{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.players-pill{display:flex; align-items:center; gap:6px; font-family:var(--font-mono); font-size:11.5px; color:var(--text-secondary); border:1px solid var(--border); padding:5px 10px; border-radius:99px;}
.avatars-mini{display:flex;}
.avatars-mini .av{width:18px; height:18px; border-radius:50%; margin-left:-6px; border:2px solid var(--surface); font-size:9px; display:flex; align-items:center; justify-content:center; font-weight:700; color:#08080a;}

.room-body{display:grid; grid-template-columns:1fr 300px; gap:0;}
.room-main{padding:20px; border-right:1px solid var(--border-soft);}
.room-side{padding:20px; background:var(--surface);}

.video-frame{position:relative; aspect-ratio:16/9; background:#000; border-radius:10px; border:1px solid var(--border); overflow:hidden;}
.video-frame video{width:100%; height:100%; object-fit:contain; background:#000; display:block;}
.video-placeholder{width:100%;height:100%;display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#141417,#0a0a0c); color:var(--text-tertiary); font-size:12px; font-family:var(--font-mono);}
.video-controls{display:flex; align-items:center; gap:12px; padding:10px 4px 0;}
.play-btn{width:32px; height:32px; border-radius:50%; background:#fff; color:#08080a; border:none; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.vtrack{flex:1; height:4px; background:var(--border); border-radius:99px; position:relative; cursor:pointer;}
.vtrack .fill{position:absolute; left:0; top:0; height:100%; background:#fff; border-radius:99px; width:0%;}
.vtrack .knob{position:absolute; top:50%; width:11px; height:11px; border-radius:50%; background:#fff; left:0%; transform:translate(-50%,-50%);}
.vtime{font-family:var(--font-mono); font-size:11px; color:var(--text-tertiary); white-space:nowrap;}
.vol-wrap{display:flex; align-items:center; gap:6px;}
.vol-wrap input[type=range]{width:60px;}
.icon-btn{width:28px; height:28px; border-radius:6px; background:transparent; border:none; color:var(--text-secondary); display:flex; align-items:center; justify-content:center;}
.icon-btn:hover{background:var(--card); color:var(--text);}

.seg-row-wrap{position:relative; margin-top:14px;}
.seg-row{display:flex; gap:6px; overflow-x:auto; padding-bottom:4px; scrollbar-width:thin;}
.seg-row::-webkit-scrollbar{height:5px;}
.seg-row::-webkit-scrollbar-thumb{background:#2c2c30; border-radius:99px;}
.seg-row-fade{position:absolute; top:0; bottom:4px; width:36px; pointer-events:none; opacity:0; transition:opacity .15s;}
.seg-row-fade.left{left:0; background:linear-gradient(90deg, var(--surface) 10%, transparent);}
.seg-row-fade.right{right:0; background:linear-gradient(270deg, var(--surface) 10%, transparent);}
.seg-row-fade.show{opacity:1;}
.seg-chip{flex:0 0 auto; font-family:var(--font-mono); font-size:10.5px; letter-spacing:.03em; padding:8px 12px; border-radius:7px; border:1px solid var(--border); color:var(--text-tertiary); background:var(--card); white-space:nowrap; transition:all .15s;}
.seg-chip.active{border-color:#4c4c52; color:var(--text); background:var(--card-hover);}
.seg-chip.has-take::after{content:''; display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--mac-green); margin-left:8px;}
.seg-chip:hover{color:var(--text);}

input[type=range]{-webkit-appearance:none; height:3px; background:var(--border); border-radius:99px; outline:none;}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none; width:11px; height:11px; border-radius:50%; background:#fff; cursor:pointer;}

section{padding:100px 0;}
.section-head{text-align:center; max-width:560px; margin:0 auto 56px;}
.eyebrow{font-family:var(--font-mono); font-size:11px; letter-spacing:.1em; color:var(--text-tertiary); text-transform:uppercase; margin-bottom:14px;}
.section-head h2{font-size:clamp(28px,4vw,40px); font-weight:800; letter-spacing:-0.02em; margin-bottom:14px;}
.section-head p{color:var(--text-secondary); font-size:15px; line-height:1.6;}
.steps-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:1px; background:var(--border-soft); border:1px solid var(--border-soft); border-radius:16px; overflow:hidden;}
.step-card{background:var(--surface); padding:30px 24px;}
.step-num{font-family:var(--font-mono); font-size:11px; color:var(--text-tertiary); margin-bottom:20px;}
.step-card h3{font-size:16px; font-weight:700; margin-bottom:8px;}
.step-card p{font-size:13.5px; color:var(--text-secondary); line-height:1.55;}
footer{border-top:1px solid var(--border-soft); padding:40px 0; margin-top:40px;}
.footer-inner{display:flex; justify-content:space-between; align-items:center; font-size:12.5px; color:var(--text-tertiary); flex-wrap:wrap; gap:10px;}

.card{background:var(--card); border:1px solid var(--border); border-radius:16px; transition:all .18s var(--ease);}
.card:hover{background:var(--card-hover); border-color:#2b2b30;}

.page{padding:56px 32px 100px; min-height:80vh;}
.page-head{display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:34px; flex-wrap:wrap; gap:14px;}
.page-head h1{font-size:30px; font-weight:800; letter-spacing:-0.02em;}
.page-head p{color:var(--text-secondary); font-size:13.5px; margin-top:6px;}
.room-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:16px;}
.room-card{padding:20px; cursor:pointer;}
.room-thumb{aspect-ratio:16/9; border-radius:9px; background:linear-gradient(135deg,#1a1a1e,#0e0e10); margin-bottom:16px; display:flex; align-items:center; justify-content:center; color:var(--text-tertiary); border:1px solid var(--border-soft); overflow:hidden;}
.room-thumb video{width:100%;height:100%;object-fit:cover;}
.room-card h3{font-size:14.5px; font-weight:700; margin-bottom:8px;}
.room-meta{display:flex; gap:12px; font-family:var(--font-mono); font-size:11px; color:var(--text-tertiary); margin-bottom:14px; flex-wrap:wrap;}
.room-card .last{font-size:11.5px; color:var(--text-tertiary); margin-bottom:14px;}

.center-page{max-width:640px; margin:0 auto; padding:70px 32px 120px;}
.center-page.narrow{max-width:440px;}
.flow-steps{display:flex; align-items:center; gap:8px; margin-bottom:40px; justify-content:center; flex-wrap:wrap;}
.flow-step{display:flex; align-items:center; gap:8px; font-family:var(--font-mono); font-size:11px; color:var(--text-tertiary);}
.flow-step .fdot{width:20px; height:20px; border-radius:50%; border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:10px;}
.flow-step.active .fdot{background:#fff; color:#08080a; border-color:#fff;}
.flow-step.done .fdot{background:var(--card); border-color:#3a3a40; color:var(--text-secondary);}
.flow-step.active span.lbl{color:var(--text);}
.flow-sep{width:26px; height:1px; background:var(--border);}
h2.flow-title{font-size:26px; font-weight:800; text-align:center; letter-spacing:-0.02em; margin-bottom:8px;}
.flow-sub{text-align:center; color:var(--text-secondary); font-size:13.5px; margin-bottom:36px;}

.dropzone{border:1.5px dashed var(--border); border-radius:16px; padding:56px 24px; text-align:center; background:var(--surface); transition:all .15s; cursor:pointer;}
.dropzone.dragover{border-color:#5c5c63; background:var(--card);}
.dropzone .dz-icon{width:44px; height:44px; margin:0 auto 18px; border-radius:10px; background:var(--card); border:1px solid var(--border); display:flex; align-items:center; justify-content:center;}
.dropzone h3{font-size:15px; font-weight:700; margin-bottom:6px;}
.dropzone p{font-size:12.5px; color:var(--text-tertiary); margin-bottom:20px;}

.source-choice{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:22px 0 26px;}
.source-card{text-align:left; background:var(--surface); border:1.5px solid var(--border); border-radius:14px; padding:20px; cursor:pointer; transition:all .15s; color:var(--text);}
.source-card:hover{border-color:#3a3a40; background:var(--card);}
.source-card.active{border-color:#5c5c63; background:var(--card); box-shadow:0 0 0 1px #3a3a40 inset;}
.source-icon{font-size:22px; margin-bottom:10px;}
.source-title{font-size:14px; font-weight:700; margin-bottom:6px; color:var(--text);}
.source-desc{font-size:12px; color:var(--text-tertiary); line-height:1.5;}
@media (max-width:640px){.source-choice{grid-template-columns:1fr;}}

.cv-badge{background:#141a12; border:1px solid #2a3a24; color:#a8e6b0; font-size:12.5px; padding:10px 14px; border-radius:10px; margin-bottom:18px;}

.sep-card{background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:16px 18px; margin-bottom:18px;}
.sep-card-row{display:flex; align-items:center; justify-content:space-between; gap:16px;}
.sep-card-title{font-size:13px; font-weight:700; margin-bottom:4px;}
.sep-card-desc{font-size:12px; color:var(--text-tertiary); line-height:1.5; max-width:520px;}
.sep-card.state-done{border-color:#2a3a24; background:#101710;}
.sep-card.state-done .sep-card-title{color:#a8e6b0;}
.sep-card.state-error{border-color:#3a2424;}
.sep-card.state-error .sep-card-title{color:#ffb3b3;}
.sep-card.state-unavailable .sep-card-desc{color:var(--text-tertiary);}
.sep-progress-wrap{margin-top:12px;}

.mix-badge{font-family:var(--font-mono); font-size:10.5px; letter-spacing:.03em; padding:6px 10px; border-radius:7px; border:1px solid var(--border); color:var(--text-tertiary); display:none;}
.mix-badge.show{display:inline-block;}
.mix-badge.clean{border-color:#2a3a24; background:#101710; color:#a8e6b0;}
.mix-badge.duck{border-color:#3a3420; background:#171410; color:#e6cf8a;}

.file-row{display:flex; align-items:center; gap:14px; padding:16px; border:1px solid var(--border); border-radius:12px; background:var(--card);}
.file-icon{width:40px; height:40px; border-radius:8px; background:var(--surface-2); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.file-row .fname{font-size:13.5px; font-weight:600;}
.file-row .fmeta{font-family:var(--font-mono); font-size:11px; color:var(--text-tertiary); margin-top:4px; display:flex; gap:12px;}

.analysis-box{border:1px solid var(--border); border-radius:12px; padding:20px; background:var(--surface); font-family:var(--font-mono);}
.analysis-bar{height:6px; background:var(--border); border-radius:99px; overflow:hidden; margin:14px 0 18px; position:relative;}
.analysis-bar .fill{height:100%; background:linear-gradient(90deg,#5a5a60,#fff); width:0%; transition:width .3s;}
.analysis-bar .fill.indeterminate{position:absolute; width:40%; animation:indeterminate 1.1s infinite ease-in-out;}
@keyframes indeterminate{0%{left:-40%;} 100%{left:100%;}}

.seg-list{display:flex; flex-direction:column; gap:8px; margin-top:18px;}
.seg-item{display:flex; align-items:center; gap:10px; padding:12px 14px; border:1px solid var(--border); border-radius:10px; background:var(--card); flex-wrap:wrap;}
.seg-item.active-seg{border-color:#5c5c63; background:var(--card-hover);}
.seg-item .sidx{font-family:var(--font-mono); font-size:11px; color:var(--text-tertiary); width:20px;}
.seg-item .time-group{display:flex; align-items:center; gap:4px; flex-shrink:0;}
.time-input{width:64px; background:var(--surface-2); border:1px solid var(--border); color:var(--text); border-radius:6px; padding:6px 6px; font-size:11.5px; font-family:var(--font-mono); text-align:center;}
.time-input:focus{border-color:#5c5c63; outline:none;}
.time-arrow{color:var(--text-tertiary); font-size:11px;}
.set-time-btn{width:22px; height:22px; border-radius:5px; background:transparent; border:1px solid var(--border); color:var(--text-tertiary); font-size:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.set-time-btn:hover{color:var(--text); border-color:#4c4c52;}
.seg-item select, .seg-item input.charinput{background:var(--surface-2); border:1px solid var(--border); color:var(--text); border-radius:6px; padding:6px 8px; font-size:12.5px; font-family:inherit;}
.seg-item .sline{flex:1 1 140px; min-width:110px; font-size:12.5px; background:transparent; border:none; border-bottom:1px dashed var(--border-soft); color:var(--text-secondary); outline:none; font-family:inherit; padding:4px 2px;}
.seg-item .sactions{display:flex; gap:4px; margin-left:auto;}
.preview-btn{width:26px; height:26px; border-radius:50%; background:var(--surface-2); border:1px solid var(--border); color:var(--text); font-size:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.preview-btn:hover{border-color:#5c5c63;}

.mini-timeline{position:relative; height:32px; background:var(--surface-2); border:1px solid var(--border); border-radius:8px; margin:12px 0 6px; cursor:pointer; overflow:hidden;}
.mini-seg{position:absolute; top:4px; bottom:4px; border-radius:4px; opacity:.75; transition:opacity .12s; cursor:pointer;}
.mini-seg:hover{opacity:1;}
.mini-seg.active-seg{opacity:1; outline:1.5px solid #fff;}
.mini-playhead{position:absolute; top:0; bottom:0; width:2px; background:#fff; left:0%; pointer-events:none; box-shadow:0 0 6px rgba(255,255,255,0.6);}
.mini-timeline-legend{font-size:10.5px; color:var(--text-tertiary); margin-bottom:6px; display:flex; gap:14px; flex-wrap:wrap;}
.mini-timeline-legend .leg-item{display:flex; align-items:center; gap:5px;}
.mini-timeline-legend .leg-dot{width:8px; height:8px; border-radius:2px; display:inline-block;}

.checkline{display:flex; align-items:center; gap:10px; padding:14px 16px; border:1px solid var(--border); border-radius:10px; background:var(--card); cursor:pointer;}
.checkline input{accent-color:#fff;}
.checkline .clabel{font-size:13.5px; font-weight:600;}
.checkline .cdesc{font-size:11.5px; color:var(--text-tertiary); margin-top:2px;}

.roomcode-box{text-align:center; padding:30px; border:1px solid var(--border); border-radius:14px; background:var(--surface); margin:20px 0;}
.roomcode-box .code{font-family:var(--font-mono); font-size:34px; font-weight:700; letter-spacing:0.15em; margin:10px 0;}
.roomcode-box .clabel{font-family:var(--font-mono); font-size:11px; color:var(--text-tertiary); letter-spacing:.1em;}
.input-field{width:100%; padding:14px 16px; background:var(--surface); border:1px solid var(--border); border-radius:10px; color:var(--text); font-family:var(--font-mono); font-size:16px; letter-spacing:.1em; text-align:center; outline:none;}
.input-field:focus{border-color:#4c4c52;}
.input-field.text-left{text-align:left; letter-spacing:normal; font-family:var(--font-sans); font-size:14px;}
.flowbar{display:flex; justify-content:space-between; margin-top:36px; gap:10px; flex-wrap:wrap;}

.cast-list{display:flex; flex-direction:column; gap:8px;}
.cast-row{display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--border-soft); border-radius:9px; background:var(--surface-2); flex-wrap:wrap;}
.avatar{width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#08080a; flex-shrink:0;}
.cast-row .cname{font-size:12.5px; font-weight:600;}
.cast-row .cplayer{font-family:var(--font-mono); font-size:11px; color:var(--text-tertiary); margin-left:auto;}
.cast-row select{margin-left:auto; background:var(--surface); border:1px solid var(--border); color:var(--text); border-radius:6px; padding:5px 7px; font-size:11.5px; font-family:inherit;}
.side-title{font-family:var(--font-mono); font-size:10.5px; letter-spacing:.1em; color:var(--text-tertiary); margin-bottom:12px; text-transform:uppercase;}
.side-block{margin-bottom:28px;}
.players-list{display:flex; flex-direction:column; gap:8px;}
.player-row{display:flex; align-items:center; gap:9px; font-size:12.5px;}
.player-row .role{color:var(--text-tertiary); font-size:11px; margin-left:auto;}

.dub-card{border:1px solid var(--border); border-radius:14px; background:var(--surface); padding:24px; margin-top:16px;}
.dub-label{font-family:var(--font-mono); font-size:10.5px; letter-spacing:.1em; color:var(--text-tertiary); margin-bottom:6px;}
.dub-char{font-size:20px; font-weight:800; margin-bottom:18px;}
.dub-line{font-size:19px; font-weight:500; line-height:1.5; color:var(--text); margin-bottom:6px;}
.cast-note{font-size:11px; color:var(--text-tertiary); margin-bottom:18px;}
.rec-controls{display:flex; align-items:center; gap:16px; flex-wrap:wrap;}
.rec-btn{display:flex; align-items:center; gap:9px; padding:11px 20px; border-radius:99px; border:1px solid var(--border); background:var(--card); font-size:13px; font-weight:600; color:var(--text); transition:all .15s;}
.rec-btn .rdot{width:9px; height:9px; border-radius:50%; background:#ff5f57;}
.rec-btn.recording{background:#1c1010; border-color:#3a1f1f; color:#ff8a84;}
.rec-btn.recording .rdot{animation:pulse 1s infinite;}
.rec-btn:disabled{opacity:.4; cursor:not-allowed;}
@keyframes pulse{0%,100%{opacity:1;} 50%{opacity:.3;}}
.rec-time{font-family:var(--font-mono); font-size:12.5px; color:var(--text-tertiary);}
.waveform{flex:1; height:44px; display:flex; align-items:center; gap:2px; overflow:hidden; min-width:100px;}
.waveform span{width:3px; background:#3a3a40; border-radius:2px; transition:height .08s;}
.waveform.live span{background:#ff5f57;}
.rec-mode-toggle{display:flex; gap:8px; margin:16px 0 12px;}
.rmt-btn{flex:1; padding:8px 10px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--text-secondary); font-size:12px; font-weight:600; cursor:pointer; transition:all .15s;}
.rmt-btn:hover{color:var(--text); border-color:#3a3a40;}
.rmt-btn.active{background:var(--card); color:var(--text); border-color:#3a3a40;}

.sync-track-wrap{margin-top:4px;}
.sync-track{position:relative; height:40px; background:linear-gradient(180deg, var(--surface), var(--surface-2)); border:1px solid var(--border); border-radius:12px; overflow:hidden;}
.sync-progress{position:absolute; top:0; bottom:0; left:0; width:0%; background:rgba(255,255,255,0.045); transition:width .05s linear;}
.sync-zone{position:absolute; top:6px; bottom:6px; left:0; width:0%; border-radius:8px; background:rgba(255,255,255,0.05); border:1.5px dashed #3a3a40; transition:background .2s, border-color .2s;}
.sync-track.armed .sync-zone{background:rgba(40,200,64,0.16); border:1.5px solid var(--mac-green); animation:syncPulse 1.1s infinite;}
.sync-track.recording .sync-zone{background:rgba(255,95,87,0.22); border:1.5px solid var(--mac-red); animation:none;}
.sync-playhead{position:absolute; top:0; bottom:0; left:0%; width:2px; background:rgba(255,255,255,.85); box-shadow:0 0 10px rgba(255,255,255,.5); opacity:0; transition:opacity .15s;}
.sync-track.armed .sync-playhead, .sync-track.recording .sync-playhead{opacity:1;}
.sync-playhead-dot{position:absolute; top:50%; left:50%; width:13px; height:13px; border-radius:50%; background:#fff; box-shadow:0 0 0 4px rgba(255,255,255,.15), 0 2px 8px rgba(0,0,0,.45); transform:translate(-50%,-50%);}
.sync-track.recording .sync-playhead-dot{background:var(--mac-red); box-shadow:0 0 0 4px rgba(255,95,87,.22), 0 2px 8px rgba(0,0,0,.45);}
.sync-caption{margin-top:9px; font-size:11px; color:var(--text-tertiary); text-align:center; letter-spacing:.02em; min-height:14px;}
.sync-hint{margin-top:10px; line-height:1.5;}
.rec-btn.armed{background:#151c10; border-color:#2a3a24; color:#a8e6b0;}
.rec-btn.armed .rdot{background:var(--mac-green); animation:pulse 1.1s infinite;}
@keyframes syncPulse{0%,100%{box-shadow:0 0 0 0 rgba(40,200,64,0.28);} 50%{box-shadow:0 0 0 5px rgba(40,200,64,0);}}
.mic-status .mdot{width:7px; height:7px; border-radius:50%; background:#68686f;}
.input-level{height:5px; background:var(--border); border-radius:99px; overflow:hidden; margin-top:10px;}
.input-level .fill{height:100%; background:linear-gradient(90deg,#4c4c52,#fff); width:0%; transition:width .06s;}
.postrec-actions{display:flex; gap:8px; margin-top:16px; flex-wrap:wrap;}

.result-hero{text-align:center; padding:70px 32px 40px;}
.result-hero h1{font-size:clamp(30px,5vw,48px); font-weight:900; letter-spacing:-0.02em;}
.result-stats{display:flex; justify-content:center; gap:44px; margin:34px 0 44px; flex-wrap:wrap;}
.rstat{text-align:center;}
.rstat .rval{font-family:var(--font-mono); font-size:26px; font-weight:700;}
.rstat .rlbl{font-size:11px; color:var(--text-tertiary); letter-spacing:.05em; margin-top:4px;}
.result-video{max-width:820px; margin:0 auto; padding:0 20px;}
.result-video video{width:100%; height:100%; object-fit:contain;}
.result-actions{display:flex; justify-content:center; gap:12px; margin-top:26px; flex-wrap:wrap;}

.toast{position:fixed; bottom:26px; left:50%; transform:translateX(-50%) translateY(20px); background:#151517; border:1px solid var(--border); padding:12px 20px; border-radius:10px; font-size:13px; opacity:0; pointer-events:none; transition:all .25s var(--ease); z-index:200; display:flex; align-items:center; gap:10px; max-width:90vw;}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0);}
.toast.error{border-color:#3a2222; color:#ff8a84;}

.modal-overlay{position:fixed; inset:0; background:rgba(0,0,0,0.6); backdrop-filter:blur(3px); z-index:150; display:none; align-items:center; justify-content:center; padding:20px;}
.modal-overlay.show{display:flex;}
.modal{background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:28px; width:380px; max-width:100%; box-shadow:0 30px 80px rgba(0,0,0,.5);}
.modal h3{font-size:17px; font-weight:700; margin-bottom:8px;}
.modal p{font-size:13px; color:var(--text-secondary); margin-bottom:20px; line-height:1.5;}
.modal-actions{display:flex; gap:10px; justify-content:flex-end;}

@media (max-width:900px){
  .room-body{grid-template-columns:1fr;}
  .room-side{border-top:1px solid var(--border-soft);}
  .room-main{border-right:none;}
  .steps-grid{grid-template-columns:1fr 1fr;}
  .room-grid{grid-template-columns:1fr 1fr;}
}
@media (max-width:640px){
  .nav-links{display:none;}
  .steps-grid{grid-template-columns:1fr;}
  .room-grid{grid-template-columns:1fr;}
  .hero{padding:80px 20px 50px;}
  .wrap, .page{padding-left:18px; padding-right:18px;}
}


/* =========================================================
   DUBBING ROOM
   Natural page scroll — nothing is squeezed to fit a fixed viewport.
   The line the performer must say is the hero element: big, unclipped,
   impossible to miss.
========================================================= */
#view-room {
  min-height: 100vh;
  background:
    radial-gradient(circle at 48% 0%, rgba(255,255,255,.045), transparent 34%),
    var(--bg);
}
#view-room .room-header-pro {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  padding: 0 22px;
  background: rgba(8,8,10,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
  row-gap: 8px;
}
#view-room .room-body-pro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 22px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 24px 80px;
}
#view-room .room-main-pro {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- video --- */
#view-room .player-shell { min-width: 0; }
#view-room .video-frame-pro {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 52vh;
  border-radius: 14px;
  border: 1px solid #29292e;
  background: #000;
  box-shadow: 0 24px 70px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.035);
  overflow: hidden;
}
#view-room .video-frame-pro video { width: 100%; height: 100%; object-fit: contain; }
.video-overlay-top, .video-overlay-bottom {
  position: absolute; left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: center;
  pointer-events: none; z-index: 2;
}
.video-overlay-top { top: 14px; }
.video-overlay-bottom { bottom: 12px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.11); border-radius: 999px;
  background: rgba(7,7,9,.72); backdrop-filter: blur(10px);
  font: 700 9px var(--font-mono); letter-spacing: .09em; color: #d6d6da;
}
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--mac-red); box-shadow: 0 0 12px rgba(255,95,87,.7); }
.video-overlay-top .mono, .video-overlay-bottom .mono { font-size: 10px; color: rgba(255,255,255,.62); }
.video-overlay-bottom .mono { padding: 5px 8px; border-radius: 6px; background: rgba(7,7,9,.68); backdrop-filter: blur(8px); }
#view-room .video-controls-pro { height: 44px; padding: 8px 4px 0; gap: 12px; }
#view-room .play-btn { width: 34px; height: 34px; box-shadow: 0 4px 18px rgba(0,0,0,.3); flex-shrink: 0; }
.line-progress-wrap { flex: 1; min-width: 0; }
.line-progress { height: 5px; position: relative; border-radius: 99px; background: #242428; }
.line-progress .fill { height: 100%; border-radius: 99px; background: #f2f2f4; width: 0; transition: width .06s linear; box-shadow: 0 0 14px rgba(255,255,255,.16); }
.line-progress-labels { display:flex; justify-content:space-between; margin-top:5px; color:#5f5f66; font: 8px var(--font-mono); letter-spacing:.08em; }
#view-room .vol-wrap input[type=range] { width: 56px; }

/* --- CURRENT LINE hero card — the whole point of the redesign --- */
#view-room .turn-card {
  padding: 30px 34px 32px;
  border: 1px solid #29292e;
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(19,19,23,.98), rgba(10,10,13,.98));
  box-shadow: 0 22px 64px rgba(0,0,0,.28);
}
#view-room .turn-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
#view-room .dub-label { color: #6a6a72; font-size: 11px; letter-spacing: .16em; margin-bottom: 8px; }
#view-room .dub-char { font-size: 34px; line-height: 1.05; font-weight: 850; letter-spacing: -.02em; }
#view-room .turn-index {
  flex-shrink: 0; color: #8a8a92; font: 700 12px var(--font-mono);
  padding: 8px 12px; border: 1px solid #2c2c31; border-radius: 8px; background: #111114;
}

#view-room .line-copy {
  position: relative;
  margin-top: 22px;
  padding: 26px 30px 26px 34px;
  border-left: 3px solid #d9d9dd;
  border-radius: 0 12px 12px 0;
  background: rgba(255,255,255,.035);
  color: #fbfbfc;
  font-size: 30px;
  line-height: 1.5;
  font-weight: 650;
  letter-spacing: -.005em;
}

#view-room .turn-assignee {
  margin-top: 16px;
  min-height: 30px;
  display: flex;
  align-items: center;
  color: #8f8f97;
  font: 500 13px var(--font-mono);
}
#view-room .note-ready { color: #a8e6b0; font-weight: 600; }
#view-room .note-success { color: #9ee7aa; font-weight: 600; }
#view-room .claim-line-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  margin-left: 9px; padding: 6px 13px; border: 1px solid #3b3b42; border-radius: 8px;
  background: #f1f1f3; color: #09090b; font: 700 11px var(--font-sans); cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
#view-room .claim-line-btn:hover { transform: translateY(-1px); background: #fff; }

/* --- recording controls: normal document flow, generous sizing --- */
#view-room .record-zone { margin-top: 24px; padding-top: 24px; border-top: 1px solid #1e1e22; }
#view-room .mic-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#view-room .mic-status { display: flex; align-items: center; gap: 8px; color: #a3a3ab; font-size: 12px; }
#view-room .input-level { height: 4px; margin-top: 8px; }
#view-room .reference-btn {
  margin-top: 12px; padding: 9px 13px; border: 1px solid #29292e; border-radius: 9px;
  background: #111114; color: #b9b9bf; font-size: 11.5px;
}
#view-room .reference-btn:hover { border-color: #414147; color: #fff; }

#view-room .rec-mode-toggle { margin: 16px 0 12px; padding: 3px; border: 1px solid #242428; background: #0b0b0e; border-radius: 10px; gap: 3px; display: flex; }
#view-room .rmt-btn { flex: 1; padding: 9px 10px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: #9a9aa1; font-size: 11.5px; font-weight: 600; }
#view-room .rmt-btn.active { background: #1b1b1f; border-color: #303035; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }

#view-room .sync-track-wrap { margin-top: 4px; }
#view-room .sync-track { height: 40px; border-radius: 10px; }
#view-room .sync-zone { top: 6px; bottom: 6px; border-radius: 7px; }
#view-room .sync-caption { margin-top: 8px; font-size: 11px; }

#view-room .rec-controls-pro {
  display: flex; align-items: center; gap: 14px; margin-top: 18px !important;
  padding: 12px 14px; border: 1px solid #29292e; border-radius: 12px; background: rgba(255,255,255,.02);
}
#view-room .rec-btn { flex: 0 0 auto; min-width: 170px; height: 44px; padding: 0 18px; border-radius: 10px; justify-content: center; font-size: 13.5px; }
#view-room .waveform { flex: 1; min-width: 60px; height: 36px; }
#view-room .rec-time { font-size: 11.5px; min-width: 40px; text-align: right; }
#view-room .rec-btn:not(:disabled):hover { transform: translateY(-1px); border-color: #55555d; background: #1a1a1f; }
#view-room .rec-btn:disabled { opacity: .45; cursor: not-allowed; filter: saturate(.5); }

#view-room .sync-hint { margin-top: 10px; font-size: 11px; line-height: 1.5; }

#view-room .saved-state {
  margin-top: 16px; padding: 12px 15px; display: flex; align-items: center; gap: 11px;
  border: 1px solid rgba(40,200,64,.22); border-radius: 11px; background: rgba(40,200,64,.055);
}
.saved-icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(40,200,64,.13); color: #9be6a5; font-weight: 800; flex-shrink: 0; }
.saved-state > div:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.saved-state strong { font-size: 12.5px; }
.saved-state span { color: #73737b; font: 10.5px var(--font-mono); }

/* --- sidebar: sticks alongside the scrolling main column --- */
#view-room .room-side-pro {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.progress-card { padding: 17px; border: 1px solid #29292e; border-radius: 14px; background: linear-gradient(145deg,#151518,#0f0f12); }
.progress-big { margin: 9px 0 12px; display: flex; align-items: baseline; gap: 6px; }
.progress-big strong { font: 700 30px var(--font-mono); letter-spacing: -.04em; }
.progress-big span { color: #6d6d75; font: 11px var(--font-mono); }
.room-progress { height: 6px; border-radius: 99px; overflow: hidden; background: #252529; }
.room-progress > div { height: 100%; width: 0; background: #e8e8eb; border-radius: 99px; transition: width .35s var(--ease); }
.progress-caption { margin-top: 9px; color: #67676f; font: 10.5px var(--font-mono); }
#view-room .side-block { margin: 0; padding: 14px 15px; border: 1px solid #222226; border-radius: 13px; background: #101014; }
#view-room .side-title { margin-bottom: 10px; font-size: 10px; letter-spacing: .12em; color: #5f5f66; }
#view-room .cast-list, #view-room .players-list { max-height: 220px; overflow-y: auto; }
#view-room .cast-row, #view-room .player-row { min-height: 34px; padding: 5px 0; border-bottom: 1px solid #1c1c20; }
#view-room .cast-row:last-child, #view-room .player-row:last-child { border-bottom: 0; }
#view-room .avatar { width: 24px; height: 24px; font-size: 10px; }
.next-card { padding: 14px 15px; border: 1px dashed #2a2a2f; border-radius: 13px; background: rgba(255,255,255,.018); }
.next-card > span { display: block; color: #56565d; font-size: 9px; letter-spacing: .1em; margin-bottom: 7px; }
.next-card strong { display: block; font-size: 12px; margin-bottom: 5px; }
.next-card p { color: #66666e; font-size: 10.5px; line-height: 1.5; }
.finish-btn { flex: 0 0 auto; }

/* --- responsive --- */
@media (max-width: 1080px) {
  #view-room .room-body-pro { grid-template-columns: minmax(0,1fr) 280px; gap: 16px; padding: 20px 18px 60px; }
  #view-room .dub-char { font-size: 28px; }
  #view-room .line-copy { font-size: 24px; padding: 22px 24px 22px 28px; }
}
@media (max-width: 900px) {
  #view-room .room-header-pro { position: static; height: auto; padding: 14px 18px; }
  #view-room .room-body-pro { grid-template-columns: 1fr; padding: 18px 16px 50px; }
  #view-room .room-side-pro { position: static; }
  #view-room .video-frame-pro { max-height: none; }
  #view-room .turn-card { padding: 22px 20px 24px; }
  #view-room .dub-char { font-size: 24px; }
  #view-room .line-copy { font-size: 20px; padding: 18px 20px 18px 22px; margin-top: 16px; }
  #view-room .rec-controls-pro { flex-wrap: wrap; }
  #view-room .rec-btn { min-width: 140px; flex: 1 1 140px; }
}
@media (max-width: 520px) {
  #view-room .dub-char { font-size: 21px; }
  #view-room .line-copy { font-size: 18px; }
}

.presence-dot{width:8px;height:8px;border-radius:50%;background:#4a4a52;display:inline-block;flex:0 0 auto;box-shadow:0 0 0 2px rgba(255,255,255,.04)}
.presence-dot.online{background:#57e389;box-shadow:0 0 0 3px rgba(87,227,137,.10)}
.flowbar .btn:disabled{opacity:.45;cursor:not-allowed}
.side-title[data-online]::after{content:attr(data-online);float:right;font-weight:500;opacity:.65;letter-spacing:0}
.lobby-banner{display:flex;flex-direction:column;gap:5px;padding:14px 16px;margin:0 0 24px;border:1px solid rgba(255,255,255,.08);border-radius:12px;background:rgba(255,255,255,.025)}
.lobby-banner strong{font-size:13px;letter-spacing:.06em}.lobby-banner span{font-size:12px;opacity:.65;line-height:1.5}
