/* Laser timeline — knovcompile design system (tokens in kc.css): monotone surfaces, no box outlines,
   corners 2 / 4 / 6 px, light shadows, IBM Plex Mono text, Gilroy titles, Noto Sans KR for Korean. */
:root { --bg:var(--surface); --panel:var(--surface-raised); --line:var(--border); --txt:var(--ink); --dim:var(--ink-muted);
  --acc:var(--key-primary); --key:var(--fn-key); --bad:var(--fn-bad); --field:var(--surface); --hover:var(--gp-700); --sunk:#141416; }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--txt); font:400 12px/1.45 var(--font-mono); overflow:hidden; user-select:none; }
button, select, input { font:inherit; color:var(--txt); }
button { background:var(--gp-700); border:none; border-radius:var(--radius-4); padding:4px 9px; cursor:pointer; box-shadow:var(--shadow-sm); }
button:hover { background:var(--gp-600); }
button.tog.on, button.pri { background:var(--key-primary); color:var(--key-01); }
button.tog.on:hover, button.pri:hover { background:var(--white); }
button.danger { background:var(--fn-bad-face); color:var(--white); font-weight:400; letter-spacing:0.08em; }
button.danger:hover { background:#943030; }
:focus-visible { outline:1px solid var(--ink); outline-offset:1px; }
select, input[type=number], input[type=text] { background:var(--field); border:none; border-radius:var(--radius-4); padding:3px 6px; min-width:0; }
input[type=number] { width:64px; }
input[type=range] { accent-color:var(--key-02); min-width:0; }
input[type=checkbox] { accent-color:var(--key-02); border-radius:var(--radius-2); }
input[type=color] { width:30px; height:22px; padding:0; border:none; border-radius:var(--radius-2); background:none; cursor:pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding:0; }
input[type=color]::-webkit-color-swatch { border:none; border-radius:var(--radius-2); }
input[type=text] { user-select:text; }

#top { height:44px; display:flex; align-items:center; gap:8px; padding:0 12px; background:var(--panel); border-bottom:1px solid var(--line); }
#logo { height:20px; width:auto; flex:none; margin:0 8px 0 2px; }   /* knovcompile horizontal logo, KC gray on a clear ground (design system asset, as is) */
#bPlay { width:44px; font-size:15px; }
#bHome { width:36px; font-size:14px; }
#top button { white-space:nowrap; flex:none; }
#tc { font:400 20px/1 var(--font-mono); min-width:132px; cursor:pointer; letter-spacing:0.04em; }
#tcIn { font:400 12px/1 var(--font-mono); white-space:nowrap; padding:4px 8px; border-radius:var(--radius-2); background:var(--surface); }
#tcIn.tcrun, .tcinfo.tcrun { color:var(--ink); }
#tcIn.tcfree, .tcinfo.tcfree { color:var(--key); }
#tcIn.tcwarn, .tcinfo.tcwarn { color:var(--fn-warn); }
#tcIn.tcdim, .tcinfo.tcdim { color:var(--dim); }
.tcinfo { margin:8px 0 4px; font-variant-numeric:tabular-nums; white-space:pre-line; }
#rangeInfo { color:var(--dim); white-space:nowrap; }
#status { color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:38vw; }
#status.err { color:var(--bad); }
/* the right panel's tabs: 클립 | 프로젝트 | 마스터 밝기 (the show's page) | 설정 */
.ptabs { display:flex; gap:2px; margin:-2px 0 10px; border-bottom:1px solid var(--line); }
.ptabs button { background:none; box-shadow:none; border-radius:var(--radius-4) var(--radius-4) 0 0; padding:6px 12px 7px; color:var(--dim); margin-bottom:-1px; }
.ptabs button:hover { color:var(--txt); background:var(--gp-700); }
.ptabs button.on { background:var(--bg); color:var(--white); box-shadow:inset 0 2px 0 var(--key-02); }
/* master brightness (project panel tab): big number, the ceiling's ▼ handle (its own row), the level bar (yellow line =
   ceiling, hatched part above it out of reach); a margin on both sides so the ends can be grabbed */
#master .mbig { font:800 34px/1.1 var(--font-sans); margin:4px 0 6px; font-variant-numeric:tabular-nums; }
#master.low .mbig { color:var(--fn-warn); }
#master.fading .mbig { color:var(--fn-key); }
#mTop { position:relative; height:16px; margin:0 22px; cursor:pointer; touch-action:none; }
#mTop i, #mBar i { position:absolute; display:block; pointer-events:none; }
#mMax { top:2px; width:0; height:0; margin-left:-7px; border-left:7px solid transparent; border-right:7px solid transparent; border-top:12px solid var(--fn-warn); }
#mBar { position:relative; height:26px; margin:0 22px 12px; cursor:pointer; touch-action:none; }
#mBar::before { content:''; position:absolute; left:0; right:0; top:10px; height:6px; border-radius:3px; background:var(--gp-700); }
#mFill { left:0; top:9px; height:8px; border-radius:3px; background:var(--key-02); }
#mOver { right:0; top:10px; height:6px; background:repeating-linear-gradient(135deg, var(--gp-500) 0 2px, transparent 2px 6px); }
#mLine { top:3px; width:2px; height:20px; margin-left:-1px; background:var(--fn-warn); }
#mKnob { top:3px; width:10px; height:20px; margin-left:-5px; background:var(--white); border-radius:var(--radius-2); box-shadow:var(--shadow-sm); }
#master.fading #mFill { background:var(--fn-key); }
#master .mfade button.mnow { min-width:0; }
#master input[type=number] { width:58px; text-align:right; font-variant-numeric:tabular-nums; }
#master input.secs { width:58px; }
#master .unit { color:var(--dim); }
#master .frow button { min-width:86px; }
#mState { min-height:1.45em; }
#mBadge { color:var(--ink-muted); background:var(--surface); box-shadow:none; font-variant-numeric:tabular-nums; }
#mBadge.low { color:var(--fn-warn); }
#mBadge.fading { color:var(--fn-key); }
#status { flex:0 1 auto; min-width:0; }
.sp { flex:1; }

main { display:flex; height:calc(100% - 44px); }
#left { flex:1; display:flex; flex-direction:column; min-width:0; }
#stage { height:40%; min-height:170px; display:flex; gap:8px; padding:8px; border-bottom:1px solid var(--line); }
#videoBox { position:relative; height:100%; aspect-ratio:16/9; background:var(--black); border-radius:var(--radius-0); flex:none; max-width:55%; }
#vid, #ov { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
#ov { pointer-events:none; display:none; }
/* the timeline's top-left cell (left of the time ruler): y = SB .. SB + RUL, x < HEAD (app.js). 스냅 · 반복 on the first
   row; the sound buttons (only when needed) under them, sharing one row when both show */
#sndBar { position:absolute; left:4px; top:31px; width:122px; height:50px; display:flex; flex-wrap:wrap; align-content:center; gap:4px; pointer-events:none; }
#sndBar button { pointer-events:auto; flex:1 1 40%; min-width:0; height:20px; padding:0 6px; font-size:11px; line-height:20px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#sndBar #bSnd { color:var(--key); }
#previews { flex:1; display:flex; gap:6px; align-items:flex-start; flex-wrap:wrap; overflow:auto; align-content:flex-start; }
.pv { background:var(--black); border:none; border-top:3px solid var(--line); border-radius:var(--radius-2); overflow:hidden; box-shadow:var(--shadow-sm); width:calc((100% - 30px) / 5); max-width:230px; min-width:90px; }
.pv canvas { width:100%; aspect-ratio:1; display:block; }
.pvl { padding:2px 6px; color:var(--dim); background:var(--panel); display:flex; justify-content:space-between; }
.pvl.warn b { color:var(--bad); }
.pvl.under b { color:var(--key); }
button.qbtn { width:18px; height:18px; padding:0; margin-left:6px; border-radius:var(--radius-2); font:400 11px/18px var(--font-mono); color:var(--dim); vertical-align:middle; flex:none; box-shadow:none; background:var(--gp-700); }
button.qbtn.on { color:var(--key-01); background:var(--key-primary); }
.prow.auto input[type=range], .prow.auto input[type=number] { opacity:0.55; }
.ptinfo { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 8px; margin:2px 0 6px 24px; color:var(--dim); }
.ptinfo > span { width:100px; flex:none; }
.ptinfo b { color:var(--txt); font-weight:400; font-variant-numeric:tabular-nums; }
.ptinfo i { font-style:normal; }
.pvl { flex-wrap:wrap; column-gap:6px; }
.pvl b { font-weight:400; color:var(--txt); white-space:nowrap; }
.frow .unit { color:var(--dim); white-space:nowrap; }
.scansum { margin:6px 0 4px; color:var(--txt); }
.scansum b { color:var(--white); font-weight:400; }
label.scanfill { display:flex; align-items:center; gap:6px; margin:6px 0; cursor:pointer; }
.scanprog { color:var(--key); }
.scanstale { color:var(--key); margin:4px 0; }
table.scant td.bad { color:var(--bad); }
table.scant td.dimc { color:var(--dim); }
.scanlist { max-height:240px; overflow:auto; background:var(--sunk); border-radius:var(--radius-4); padding:3px 0; font-variant-numeric:tabular-nums; }
.scanlist div { padding:2px 8px; cursor:pointer; white-space:nowrap; }
.scanlist div:hover { background:var(--hover); }
.pvl i { font-style:normal; color:var(--key); }
#previews.raw .pv canvas { outline:1px solid var(--key); outline-offset:-1px; }
#tlBox { flex:1; min-height:0; position:relative; }
#tl { position:absolute; inset:0; width:100%; height:100%; display:block; }

#insp { width:400px; flex:none; background:var(--panel); border-left:1px solid var(--line); overflow-y:auto; padding:10px 12px 40px; }
#insp h3 { margin:4px 0 10px; font:800 15px/1.3 var(--font-sans); letter-spacing:0.01em; display:flex; align-items:center; }
#insp .hint { color:var(--dim); margin:4px 0 8px; }
.frow { display:flex; align-items:center; gap:6px; margin:4px 0; }
.frow > label { width:74px; color:var(--dim); flex:none; }
.frow > input[type=text], .frow > select { flex:1; }
.chips { display:flex; gap:4px; flex-wrap:wrap; }
.chips button { padding:3px 8px; }
.chips button.on { background:var(--key-primary); color:var(--key-01); }
details.grp { border-top:1px solid var(--line); margin-top:10px; padding-top:6px; }
details.grp > summary { cursor:pointer; padding:4px 0; font:800 13px/1.4 var(--font-sans); color:var(--ink); }
.prow { display:flex; gap:5px; align-items:center; margin:3px 0; }
.prow > label { width:124px; flex:none; color:var(--dim); line-height:1.25; max-height:2.5em; overflow:hidden; word-break:keep-all; }
.prow input[type=range] { flex:1; }
.prow input[type=number] { width:62px; flex:none; }
.prow select.pm { flex:1; }
.kf { padding:0; width:20px; height:20px; border:none; background:none; box-shadow:none; color:var(--gp-600); font-size:13px; }
.kf:hover { background:none; color:var(--white); }
.kf.anim { color:#9c8a45; }
.kf.on { color:var(--key); }
.modb { padding:0; width:22px; height:20px; color:var(--dim); }
.modb.on { background:var(--key-primary); color:var(--key-01); }
.modrow { display:flex; gap:4px; align-items:center; margin:0 0 6px 24px; padding:4px 6px; background:var(--sunk); border-radius:var(--radius-4); color:var(--dim); flex-wrap:wrap; }
.modrow input[type=number] { width:54px; }
.hidden { display:none !important; }
table.lz { border-collapse:collapse; width:100%; }
table.lz th { color:var(--dim); font-weight:400; text-align:left; padding:2px 3px; }
table.lz td { padding:2px 3px; }
table.lz input[type=text] { width:54px; }
table.lz input[type=number] { width:48px; }
.keys { color:var(--dim); line-height:1.75; }
.keys b { color:var(--txt); font-weight:400; display:inline-block; min-width:150px; }

#menu { position:fixed; z-index:50; background:var(--surface-raised); border:none; border-radius:var(--radius-6); padding:4px; min-width:170px; box-shadow:var(--shadow-lg); max-height:70vh; overflow:auto; }
#menu div { padding:5px 10px; border-radius:var(--radius-2); cursor:pointer; white-space:nowrap; }
#menu div:hover { background:var(--hover); }
#menu hr { border:none; border-top:1px solid var(--line); margin:4px 0; }
#menu.cols { columns:3; column-gap:4px; max-height:86vh; }
#menu div.mg { break-inside:avoid; padding:0 0 6px; cursor:default; }
#menu div.mg:hover { background:none; }
#menu div.mh { color:var(--dim); font-size:11px; padding:4px 10px 2px; cursor:default; }
#menu div.mh:hover { background:none; }
#menu label.mchk { display:block; padding:3px 10px; border-radius:var(--radius-2); cursor:pointer; white-space:nowrap; }
#menu label.mchk:hover { background:var(--hover); }
#menu label.mchk input { margin:0 6px 0 0; vertical-align:-2px; }
#menu div.mh.mgt { cursor:pointer; }
#menu div.mh.mgt:hover { color:var(--ink); text-decoration:underline; }
#menu div.macts { display:flex; gap:6px; padding:4px 10px 8px; cursor:default; }
#menu div.macts:hover { background:none; }

/* workspace badge, links, picked keys, effects */
#bWs { white-space:nowrap; max-width:300px; overflow:hidden; text-overflow:ellipsis; }
.projname { font-weight:600; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#bWs.wsx { background:var(--fn-warn); color:var(--key-01); }
.prow > label.linked { color:var(--gp-300); }
.prow.selk > label { color:var(--key); }
.prow input:disabled { opacity:0.45; }
.jb { padding:2px 7px; flex:none; }
.fxblk { border:none; border-radius:var(--radius-4); padding:6px 8px; margin:6px 0; background:var(--sunk); }
.fxhd { display:flex; align-items:center; gap:6px; margin-bottom:2px; }
.fxhd b { color:var(--ink); font-weight:400; }
.fxhd button { padding:1px 8px; }
button:disabled { opacity:0.45; cursor:default; }
body.offline main { pointer-events:none; opacity:0.55; }
/* windows over the page: media file, clip import */
.modal { position:fixed; inset:0; z-index:80; background:rgba(9, 9, 11, 0.6); display:flex; align-items:center; justify-content:center; }
.mwin { width:660px; max-width:calc(100vw - 24px); max-height:calc(100vh - 40px); display:flex; flex-direction:column; background:var(--surface-raised); border:none; border-radius:var(--radius-6); box-shadow:var(--shadow-lg); }
.mhd { display:flex; align-items:center; gap:8px; padding:10px 14px; border-bottom:1px solid var(--line); }
.mhd b { font:800 14px/1.3 var(--font-sans); }
.mbody { padding:10px 14px 14px; display:flex; flex-direction:column; gap:6px; min-height:0; overflow:hidden; }
.mbody .frow > label { width:64px; }
.fnav, .ffoot { display:flex; gap:6px; align-items:center; }
.fpath { color:var(--dim); font-family:var(--font-mono); word-break:break-all; user-select:text; }
.flist, .implist { min-height:240px; height:52vh; overflow:auto; background:var(--surface); border:none; border-radius:var(--radius-4); padding:3px; }
.fit { padding:4px 8px; border-radius:var(--radius-2); cursor:pointer; display:flex; justify-content:space-between; gap:10px; }
.fit:hover { background:var(--hover); }
.fit.cur { color:var(--white); }
.fit.on { background:var(--key-primary); color:var(--key-01); }
.fsz { color:var(--dim); flex:none; }
.fit.on .fsz { color:var(--gp-600); }
.improw { display:flex; gap:10px; align-items:center; padding:3px 6px; border-radius:var(--radius-2); cursor:pointer; }
.improw:hover { background:var(--hover); }
.improw .it { font-family:var(--font-mono); color:var(--dim); flex:none; }
.improw .itr { color:var(--dim); width:70px; flex:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.improw .inm { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* XML window: what a file would add (or why it is refused) */
.xmlbox { display:flex; flex-direction:column; gap:4px; overflow:auto; max-height:62vh; min-height:0; }
.xline { padding:1px 2px; }
.xline.xnew { color:var(--white); }
.xline.xchg { color:var(--key); }
.xsub { margin-top:6px; color:var(--dim); }
.xerr { color:var(--bad); }
.xnote { color:var(--key); }
.xmsgs { background:var(--surface); border:none; border-radius:var(--radius-4); padding:6px 8px; max-height:30vh; overflow:auto; user-select:text;
  font-family:var(--font-mono); font-size:11px; white-space:pre-wrap; word-break:break-all; flex:none; }
.xmsgs.bad { color:#ff8a8a; }
.xmsgs.warn { color:#e3c06b; }
.xmsgs.info { color:var(--dim); }
.xclips { margin-top:6px; background:var(--surface); border:none; border-radius:var(--radius-4); padding:3px; max-height:30vh; overflow:auto; flex:none; }
.xclips .improw { cursor:default; }
.xcopy { width:100%; height:50vh; resize:none; background:var(--surface); color:var(--txt); border:none; border-radius:var(--radius-4); font:11px var(--font-mono); user-select:text; }
/* scene picker (scenepick.js): a track's double-click / right-click */
.mwin.pickwin { width:1180px; height:calc(100vh - 60px); }
.pickwin .mbody { flex:1; }
.pbar { display:flex; align-items:center; gap:8px; }
.pbar input[type=text] { width:300px; }
.pbar input[type=range] { width:110px; }
.pbar label { color:var(--dim); }
.ptabs { display:flex; flex-wrap:wrap; gap:3px; padding-bottom:8px; border-bottom:1px solid var(--line); }
.ptabs button { padding:3px 9px; }
.ptabs button b { font-weight:400; font-size:11px; color:var(--dim); margin-left:5px; }
.ptabs button.on { background:var(--key-primary); color:var(--key-01); }
.ptabs button.on b { color:var(--gp-600); }
.pgrid { flex:1; min-height:0; overflow-y:auto; padding:2px 4px 10px 0; }
.pgrid h4 { margin:14px 0 6px; font:800 13px/1.3 var(--font-sans); color:var(--ink); }
.pgrid h4:first-child { margin-top:2px; }
.pgrid h4 b { font:400 12px var(--font-mono); color:var(--dim); margin-left:6px; }
.pg { display:grid; grid-template-columns:repeat(auto-fill, minmax(var(--pc, 150px), 1fr)); gap:8px; }
.pcard { display:block; text-align:left; padding:5px 5px 7px; background:var(--surface); border:none; border-radius:var(--radius-6); box-shadow:var(--shadow-sm); min-width:0; }
.pcard:hover { background:var(--gp-700); }
.pcard canvas { display:block; width:100%; aspect-ratio:1; background:var(--black); border-radius:var(--radius-2); }
.pcard .ct { margin:6px 2px 0; line-height:1.3; word-break:keep-all; overflow-wrap:anywhere; }
.pcard .cs { margin:1px 2px 0; color:var(--dim); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* wrist tracking (trk.js): header badge, the project panel's line, the 트래킹 screen's settings */
#tBadge { color:var(--ink-muted); background:var(--surface); box-shadow:none; }
#tBadge.warn { color:var(--fn-warn); }
#tBadge.bad { color:var(--fn-bad); }
#tBadge.recing { box-shadow:inset 0 -2px 0 var(--fn-bad); }
.trkstate { margin:2px 0 6px; color:var(--ink); font-variant-numeric:tabular-nums; }
.trkstate.warn { color:var(--fn-warn); }
.trkstate.bad { color:var(--fn-bad); }
table.lz.trk td { vertical-align:middle; }
table.lz.trk input[type=number] { width:52px; }
table.lz.trk input[type=text] { width:84px; }
.trkst { white-space:nowrap; font-variant-numeric:tabular-nums; color:var(--ink); }
.trkst.warn { color:var(--fn-warn); }
.trkst.bad { color:var(--dim); }
.trkchips { display:flex; flex-wrap:wrap; gap:3px; }
.trkchips button { padding:1px 6px; }
.trkax { font-variant-numeric:tabular-nums; min-height:1.45em; }
.trkuse { color:var(--white); text-decoration:underline; text-underline-offset:3px; }
/* the 트래킹 screen (trk.js, key T): every tracking setting on the left, the stage drawn large on the right; it covers the
   previews, timeline and inspector (they keep running underneath) */
.seg { display:inline-flex; flex:none; background:var(--surface); border-radius:var(--radius-4); padding:2px; gap:2px; }
#top .seg button { background:none; box-shadow:none; padding:3px 10px; color:var(--dim); }
#top .seg button:hover { color:var(--txt); background:var(--gp-700); }
#top .seg button.on { background:var(--key-primary); color:var(--key-01); }
#trkView { display:none; flex:1; min-width:0; }
body.trkview #left, body.trkview #insp { display:none; }
body.trkview #trkView { display:flex; }
#trkSide { width:470px; flex:none; background:var(--panel); border-right:1px solid var(--line); overflow-y:auto; padding:10px 12px 40px; }
#trkSide h3 { margin:4px 0 10px; font:800 15px/1.3 var(--font-sans); letter-spacing:0.01em; display:flex; align-items:center; }
#trkSide h3 .trkguide { margin-left:auto; font:500 12px/1.2 var(--font-kr); letter-spacing:0; white-space:nowrap; }
#trkSide .hint { color:var(--dim); margin:4px 0 8px; }
#trkMain { flex:1; display:flex; flex-direction:column; min-width:0; }
#trkBar { display:flex; align-items:center; gap:6px; padding:6px 10px; background:var(--panel); border-bottom:1px solid var(--line); }
#trkBar button { flex:none; padding:3px 9px; }
#trkBar .svgap { width:10px; flex:none; }
#trkInfo { color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; font-variant-numeric:tabular-nums; }
#trkInfo.warn { color:var(--fn-warn); }
#trkInfo.bad { color:var(--fn-bad); }
#trkWrap { flex:1; position:relative; min-height:0; }
#trkCv { position:absolute; inset:0; width:100%; height:100%; display:block; background:var(--black); }
.trklz { background:var(--surface); border-radius:var(--radius-4); padding:6px 8px 4px; margin:6px 0; box-shadow:var(--shadow-sm); }
.trklzh { display:flex; align-items:center; gap:6px; margin-bottom:2px; }
.trklzh i { width:10px; height:10px; border-radius:var(--radius-2); flex:none; }
.trklzh b { font-weight:400; color:var(--white); }
.trklzh button { padding:1px 8px; }
.trklz .frow > label { width:84px; }
.trklz .frow input[type=number] { width:58px; }
.trklz .hint { margin:2px 0 2px !important; }
button.link { background:none; box-shadow:none; padding:0; color:var(--white); text-decoration:underline; text-underline-offset:3px; text-align:left; }
button.link:hover { background:none; color:var(--key-02); }
.trkcl { white-space:pre-line; }
.trkcl.warn { color:var(--fn-warn); }
