
:root {
  --bg: #12151c; --panel: #1a1f29; --panel2: #222936; --line: #2e3646; --ink: #e8ecf3; --muted: #93a0b6;
  --gold: #e3b54a; --gold2: #c9a96e; --navy: #1f3a5f; --pink: #ff4d8f; --ok: #3ccf91; --warn: #ffb547; --bad: #ff6b6b; --blue: #5aa2ff; --purple: #9b7bff;
  --scene: #2a3344; --frox: #3ccf91; --voice: #5aa2ff;
  --top: 50px; --foot: 24px; --right: 340px; --tl: 224px;
  --h-over: 13px; --h-ruler: 17px; --h-scenes: 26px; --row: 20px; --rows: 3; --h-frox: 22px; --h-voice: 34px; --h-dirty: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: "Yu Gothic UI", "Yu Gothic", "游ゴシック", Meiryo, sans-serif; font-size: 13px; }
button, select, input, textarea { font: inherit; color: inherit; }
button { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
button:hover { border-color: var(--gold2); }
button:disabled { opacity: .42; cursor: default; }
button:disabled:hover { border-color: var(--line); }
button.pri { background: #2b5ea8; border-color: #4479c4; }
button.gold, button.pri2 { background: #c99a2e; border-color: #e7c060; color: #1b1405; font-weight: 700; }
button.bad { background: #5a2020; border-color: #8a3030; }
button.on, button.sel { background: #3a3220; border-color: var(--gold); color: var(--gold); }
select, input[type=text], input[type=number], textarea { background: #0e1117; border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; }
input[type=range] { accent-color: var(--gold); }
.sp { flex: 1; }
.hide { display: none !important; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 12px; line-height: 1.55; }
.ok { color: var(--ok); } .ng { color: var(--bad); } .wn { color: var(--warn); }
.chk { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); white-space: nowrap; }
.tag { background: #262d3b; border: 1px solid var(--line); border-radius: 10px; padding: 2px 9px; color: var(--muted); }
.icon { padding: 3px 6px; line-height: 0; }
.icon svg { width: 20px; height: 20px; }
.icon.sm svg { width: 15px; height: 15px; }
.icon.sm { padding: 1px 3px; border-color: transparent; background: transparent; }

#app { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--right);
  grid-template-rows: var(--top) minmax(0, 1fr) var(--tl) var(--foot); grid-template-areas: "top top" "center right" "tl tl" "foot foot"; }


#top { grid-area: top; display: flex; align-items: center; gap: 7px; padding: 0 12px; background: #0d1016; border-bottom: 1px solid var(--line); min-width: 0; }
.brand { font-weight: 800; letter-spacing: .04em; color: var(--gold); margin-right: 4px; white-space: nowrap; }
.proj-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.who { color: var(--muted); font-size: 12px; white-space: nowrap; }
.chip { padding: 4px 10px; border-radius: 14px; font-size: 12.5px; }
.chip b { color: var(--ink); font-weight: 700; }
#warnBtn.has { border-color: var(--warn); color: var(--warn); }
#warnBtn.has b { color: var(--warn); }
#warnBtn.run { border-color: var(--blue); color: #a9cbff; }
#verBtn .req { background: var(--warn); color: #1b1405; border-radius: 8px; padding: 0 6px; margin-left: 6px; font-size: 11px; font-weight: 700; }
.big { padding: 7px 14px; font-size: 13.5px; }
.round { width: 32px; height: 32px; border-radius: 16px; padding: 0; font-weight: 800; }
.savetag { font-size: 12px; white-space: nowrap; color: var(--muted); }
.savetag.dirty { color: var(--warn); }
.savetag.saved { color: var(--ok); }
.savetag.bad { color: var(--bad); font-weight: 700; }
#detailBtn.on { color: var(--gold); }


#center { grid-area: center; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
#viewer { flex: 1; min-height: 0; container-type: size; display: flex; align-items: center; justify-content: center; padding: 6px 12px 2px; }
#stageBox { width: min(100cqw, calc(100cqh * 16 / 9)); aspect-ratio: 16 / 9; position: relative; }
#stage { position: relative; width: 100%; height: 100%; background: #000; border-radius: 4px; overflow: hidden; outline: 1px solid #000; box-shadow: 0 0 0 1px var(--line); }

#stage { user-select: none; -webkit-user-select: none; }
#frames { position: absolute; inset: 0; }
#frames iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; background: #dff1ff; }
#frames iframe.cached { visibility: hidden; }
#probes { position: fixed; left: -4000px; top: 0; width: 1920px; height: 1080px; overflow: hidden; visibility: hidden; pointer-events: none; }
#probes iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; }
#ovl { position: absolute; inset: 0; width: 100%; height: 100%; cursor: default; touch-action: none; z-index: 2; }
#ovl.grab { cursor: move; }
#ovl.hand { cursor: pointer; }
#ovl * { pointer-events: none; }
#loading { position: absolute; right: 10px; top: 10px; background: rgba(0,0,0,.65); padding: 4px 10px; border-radius: 12px; color: var(--gold); z-index: 8; pointer-events: none; }
#stageMsg { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(10,12,18,.88); border: 1px solid var(--warn); color: var(--warn); padding: 6px 14px; border-radius: 14px; z-index: 9; font-size: 13px; cursor: pointer; }
#cover { position: absolute; inset: 0; background: rgba(13,16,22,.82); display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 15px; pointer-events: none; z-index: 3; }
#coverPic, #pv { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .8; }
#pv { display: none; object-fit: fill; }
#pv.live { display: block; }
#coverMsg { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: rgba(0,0,0,.7); padding: 4px 12px; border-radius: 12px; font-size: 13px; white-space: nowrap; max-width: 96%; overflow: hidden; text-overflow: ellipsis; }
#cover:not(:has(#coverPic:not(.hide))):not(:has(#pv.live)) #coverMsg { position: static; transform: none; background: none; font-size: 15px; }


#floatbar { position: absolute; z-index: 6; display: flex; gap: 2px; align-items: center; background: rgba(15,18,25,.95); border: 1px solid var(--gold2); border-radius: 9px; padding: 3px; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
#floatbar button { padding: 4px 9px; font-size: 12.5px; border-color: transparent; background: transparent; }
#floatbar button:hover { background: #2a3142; border-color: var(--line); }
#floatbar button.del { color: #ffb0b0; }
#floatbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
#floatbar .lbl { color: var(--muted); font-size: 11.5px; padding: 0 2px; }

#floatbar button.icon { padding: 4px 6px; line-height: 0; }
#floatbar button.icon svg { width: 17px; height: 17px; }
#floatbar button.inkbtn { padding: 4px 6px; line-height: 0; }
.inkbtn .sw { display: inline-block; width: 17px; height: 17px; border-radius: 50%; border: 2px solid #f4f6fb; box-shadow: 0 0 0 1px #0b0e14; box-sizing: border-box; }
.sw.rainbow, .dot.custom { background: conic-gradient(#ef3b55, #ff8a1f, #ffd23f, #1f8a4c, #3fd0ff, #2f7bf5, #9b7bff, #ff3d8b, #ef3b55); }
.dot.custom { position: relative; display: inline-block; overflow: hidden; cursor: pointer; box-sizing: border-box; }
.dot.custom input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
#inkPick .colors { gap: 6px; flex-wrap: nowrap; }
#inkPick .dot { width: 23px; height: 23px; flex: none; }
#inkPick .dot.none { width: auto; height: 23px; padding: 0 8px; }
.delbtn { display: inline-flex; align-items: center; gap: 6px; }
.delbtn svg { width: 16px; height: 16px; }


.te-warn { color: var(--warn); font-size: 12px; margin-top: 4px; }
.note.bad { color: var(--bad); }
.chips { margin-top: 6px; line-height: 1.9; }
.chips b { display: inline-block; background: #2b3346; border: 1px solid #3b465e; border-radius: 6px; padding: 0 6px; margin: 0 3px 3px 0; cursor: pointer; font-weight: 600; color: #ffe2a0; }
.chips b:hover { border-color: var(--gold); }
.chips b.small { font-weight: 400; color: #c9d3e3; background: #232a38; border-color: #333d52; padding: 0 4px; }
.chips .sepc { color: var(--muted); margin-right: 3px; }


#pip { position: absolute; right: 10px; bottom: 10px; width: 30%; z-index: 5; border: 2px solid var(--gold2); border-radius: 6px; background: #000; overflow: hidden; cursor: move; box-shadow: 0 4px 16px rgba(0,0,0,.6); }
#pip video { display: block; width: 100%; aspect-ratio: 16 / 9; pointer-events: none; }
.pip-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; background: rgba(0,0,0,.6); font-size: 11.5px; color: var(--gold); }
.pip-bar button { padding: 0 6px; font-size: 13px; line-height: 18px; }


#transport { height: 44px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 0 14px; }
.tp-left { min-width: 0; }
.tc { font-variant-numeric: tabular-nums; font-size: 14px; letter-spacing: .02em; white-space: nowrap; }
.tc .fr { color: var(--muted); font-size: 12px; margin-left: 6px; }
.tp-mid { display: flex; gap: 5px; align-items: center; }
.tp-mid button { padding: 6px 11px; }
.playbtn { min-width: 112px; font-weight: 800; font-size: 14px; background: #2b5ea8 !important; border-color: #4f86d4 !important; color: #fff !important; }
.playbtn.prep { background: #33405a !important; }
.tp-right { justify-self: end; display: flex; align-items: center; gap: 6px; }
#vol { width: 96px; }


#right { grid-area: right; border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; overflow-x: hidden; min-height: 0; }
#panel { padding: 12px 14px 28px; }
.sel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-width: 0; }
.sel-head b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb { flex: none; font-size: 11.5px; font-weight: 800; border-radius: 5px; padding: 2px 7px; color: #1b1405; background: var(--gold); }
.kb.img { background: var(--purple); color: #fff; } .kb.frox { background: var(--frox); color: #062016; } .kb.other { background: #8592a8; color: #10141c; } .kb.scene { background: #51607c; color: #fff; }
.sec { margin: 0 0 14px; }
.sec > h4 { margin: 0 0 6px; font-size: 12px; color: var(--gold2); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.sec > h4 .muted { font-weight: 400; }
.row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.row > .lab { color: var(--muted); min-width: 44px; }
.txtrow { display: flex; gap: 6px; align-items: flex-start; }
.txtrow textarea { flex: 1; font-size: 15px; resize: vertical; min-height: 34px; }
.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.stylechip { padding: 5px 2px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); }
.stylechip .pv { display: inline-block; font-size: 13px; font-weight: 800; padding: 1px 6px; border-radius: 3px; line-height: 1.3; }
.pv.print { background: #fff; color: #1e2a44; } .pv.foil { background: linear-gradient(180deg, #fff2b8, #d8a83a); color: #4b3300; }
.pv.card { background: #fff; color: #222; box-shadow: 0 0 0 2px #ff7aa8 inset; } .pv.neon { background: #10142a; color: #ffe6ff; text-shadow: 0 0 4px #ff4df0, 0 0 8px #ff4df0; }
.pv.big { color: #fff; font-size: 16px; -webkit-text-stroke: 1px #000; } .pv.hand { color: #fff; font-family: "Yu Mincho", serif; font-style: italic; }
.pv.slip { background: #f6edd7; color: #3a2c12; transform: rotate(-3deg); }
.colors { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.dot { width: 26px; height: 26px; border-radius: 13px; padding: 0; border: 2px solid #0e1117; box-shadow: 0 0 0 1px var(--line); }
.dot.sel { box-shadow: 0 0 0 2px var(--gold); }
.dot.none { width: auto; border-radius: 13px; padding: 0 9px; font-size: 11.5px; background: var(--panel2); color: var(--muted); }
.sizerow { display: flex; align-items: center; gap: 6px; }
.sizerow .pct { min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.timerow { display: flex; align-items: center; gap: 5px; margin: 3px 0; }
.timerow .lab { color: var(--muted); width: 40px; }
.timerow .t { font-variant-numeric: tabular-nums; min-width: 58px; }
.faces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.faces button { display: flex; flex-direction: column; align-items: center; padding: 3px; gap: 1px; font-size: 11px; }
.faces img { width: 64px; height: 64px; object-fit: contain; background: #dff1ff; border-radius: 5px; }
.gal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; max-height: 300px; overflow-y: auto; padding: 2px; }
.gal .g { grid-column: 1 / -1; color: var(--gold2); font-size: 11.5px; margin: 4px 0 0; }
.gal button { padding: 3px; display: flex; flex-direction: column; gap: 2px; align-items: center; font-size: 10px; color: var(--muted); overflow: hidden; white-space: normal; }
.gal button span { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; text-align: center; min-height: 0; }
.gal img { width: 100%; height: 62px; object-fit: contain; background: repeating-conic-gradient(#2a3142 0 25%, #222836 0 50%) 0 0 / 14px 14px; border-radius: 3px; }
.curimg { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.curimg img { width: 64px; height: 44px; object-fit: contain; background: repeating-conic-gradient(#2a3142 0 25%, #222836 0 50%) 0 0 / 14px 14px; border-radius: 3px; }
.scene-time { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.scene-say { font-size: 16px; line-height: 1.55; background: #10141c; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; border-left: 3px solid var(--gold2); padding-left: 8px; margin: 10px 0; }
.addform { background: #141922; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 8px 0; }
details.more { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
details.more > summary { cursor: pointer; color: var(--gold2); font-weight: 700; font-size: 12.5px; list-style: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
.kv { display: grid; grid-template-columns: 70px 1fr; gap: 2px 8px; margin: 4px 0 8px; font-size: 12px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.warnbox { border: 1px solid var(--warn); border-left: 4px solid var(--warn); border-radius: 5px; padding: 7px 9px; margin: 6px 0; line-height: 1.55; background: rgba(230,160,60,.08); font-size: 12.5px; }
.camwarn { border: 1px solid var(--warn); border-left: 4px solid var(--warn); border-radius: 5px; padding: 8px 10px; margin: 8px 0; line-height: 1.55; background: rgba(230,160,60,.08); }
textarea.cmd { width: 100%; min-height: 96px; font-family: Consolas, monospace; font-size: 11px; background: #0e1117; color: #d8dfeb; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }

.list { display: flex; flex-direction: column; gap: 3px; }
.li { display: flex; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.li:hover { background: #222a38; }
.li.sel, .li.cur { border-color: var(--gold); background: #2c2818; }
.li .dot2 { width: 7px; height: 7px; border-radius: 4px; background: #3a4458; flex: none; }
.li.vis .dot2 { background: var(--ok); }
.li .k { color: var(--muted); font-size: 11px; min-width: 40px; }
.li .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.li .tm { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 46px; }
.li.off .t { text-decoration: line-through; color: var(--muted); }
.li.chart .t { color: #c9d3e3; }
.li.chart .dot2 { background: #8592a8; }
.li button { padding: 1px 7px; font-size: 11.5px; }
.li img { width: 34px; height: 24px; object-fit: contain; }


#timeline { grid-area: tl; position: relative; background: var(--panel); border-top: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; user-select: none; }
#tlResize { position: absolute; top: -4px; left: 0; right: 0; height: 8px; cursor: ns-resize; z-index: 6; }
.tl-tools { height: 32px; flex: none; display: flex; align-items: center; gap: 7px; padding: 0 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.tl-tools button { padding: 3px 9px; font-size: 12px; }
.tl-tools .sq { width: 26px; padding: 2px 0; font-weight: 800; }
#zoom { width: 150px; }
.tl-search { position: relative; display: flex; align-items: center; }
.ico-search { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; pointer-events: none; }
.ico-search::before { content: ""; position: absolute; left: 0; top: 0; width: 8px; height: 8px; border: 2px solid var(--muted); border-radius: 50%; }
.ico-search::after { content: ""; position: absolute; left: 9px; top: 9px; width: 6px; height: 2px; background: var(--muted); transform: rotate(45deg); transform-origin: 0 0; }
#jumpTo { width: 250px; padding-left: 27px; border-radius: 14px; }
#searchList { position: absolute; left: 0; bottom: 34px; width: 460px; max-height: 300px; overflow-y: auto; background: var(--panel); border: 1px solid var(--gold2); border-radius: 8px; z-index: 40; padding: 4px; box-shadow: 0 -6px 18px rgba(0,0,0,.45); }
#detailOpts { display: flex; gap: 10px; margin-left: 6px; font-size: 12px; }
.tl-main { flex: 1; min-height: 0; display: flex; }
.tl-heads { width: 78px; flex: none; border-right: 1px solid var(--line); padding-top: 3px; }
.th { display: flex; align-items: center; gap: 2px; padding: 0 6px 0 9px; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; overflow: hidden; white-space: nowrap; }
.th-top { height: calc(var(--h-over) + var(--h-ruler) + 2px); }
.th[data-lane=scenes] { height: var(--h-scenes); border-left: 3px solid #51607c; }
.th[data-lane=items] { height: calc(var(--row) * var(--rows)); border-left: 3px solid var(--gold); }
.th[data-lane=frox] { height: var(--h-frox); border-left: 3px solid var(--frox); }
.th[data-lane=voice] { height: var(--h-voice); border-left: 3px solid var(--voice); }
.th[data-lane=dirty] { height: var(--h-dirty); border-left: 3px solid var(--pink); font-size: 8px; line-height: var(--h-dirty); }
#tlLanes { flex: 1; min-width: 0; position: relative; padding: 3px 14px 0 8px; overflow: hidden; }
.lane { position: relative; overflow: hidden; margin-bottom: 2px; }
#tlOver { height: var(--h-over); margin-bottom: 0; background: #10141c; border-radius: 3px; cursor: pointer; }
#tlRuler { height: var(--h-ruler); cursor: text; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
#tlScenes { height: var(--h-scenes); cursor: pointer; }
#tlItems { height: calc(var(--row) * var(--rows)); background: #141922; border-radius: 3px; }
#tlFrox { height: var(--h-frox); background: #131a1a; border-radius: 3px; }
#tlVoice { height: var(--h-voice); background: #11161f; border-radius: 3px; cursor: text; }
#tlDirty { height: var(--h-dirty); }
body:not(.detail) .detail-only { display: none !important; }

.tl-ov-part { position: absolute; top: 1px; height: calc(var(--h-over) - 2px); border-right: 1px solid #0d1016; font-size: 9px; line-height: calc(var(--h-over) - 2px); color: #9fb0c9; overflow: hidden; white-space: nowrap; padding-left: 3px; }
.tl-ov-part:nth-child(odd) { background: #24314a; } .tl-ov-part:nth-child(even) { background: #2d3d58; }
.tl-ov-ed { position: absolute; top: 0; width: 2px; height: 4px; background: var(--gold); }
.tl-ov-win { position: absolute; top: 0; height: var(--h-over); border: 1px solid var(--gold); background: rgba(227,181,74,.14); border-radius: 3px; cursor: grab; }
.tl-ov-load { position: absolute; bottom: 0; height: 2px; background: var(--ok); opacity: .8; pointer-events: none; }
.tl-ov-head { position: absolute; top: 0; width: 2px; height: var(--h-over); background: #fff; pointer-events: none; }

.tick { position: absolute; bottom: 0; width: 1px; height: 5px; background: #47526a; pointer-events: none; }
.tick.major { height: 9px; background: #7c88a0; }
.tick-l { position: absolute; top: 0; font-size: 10px; color: #9aa6bb; transform: translateX(3px); white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.rul-part { position: absolute; top: 0; height: 4px; opacity: .8; pointer-events: none; }

.tl-sc { position: absolute; top: 0; height: 100%; border-right: 1px solid #0d1016; background: var(--scene); color: #c9d3e3; font-size: 11px; overflow: hidden; padding: 0 5px; white-space: nowrap; text-overflow: ellipsis; line-height: var(--h-scenes); }
.tl-sc:nth-child(even) { background: #2f394c; }
.tl-sc.cur { box-shadow: inset 0 0 0 2px var(--gold); color: #fff; z-index: 1; }
.tl-sc .ed { position: absolute; right: 2px; top: 2px; width: 7px; height: 7px; border-radius: 4px; background: var(--gold); }
.tl-bar { position: absolute; height: calc(var(--row) - 3px); border-radius: 4px; font-size: 11px; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: calc(var(--row) - 5px); cursor: grab; }
.tl-bar.text { background: rgba(227,181,74,.30); border: 1px solid #b98e2c; color: #ffe7a6; }
.tl-bar.img { background: rgba(155,123,255,.30); border: 1px solid #7a5ee0; color: #e2d9ff; }
.tl-bar.other { background: rgba(140,150,170,.28); border: 1px solid #7b869c; color: #e2e7ef; }
.tl-bar.sel { border-width: 2px; border-color: #fff; z-index: 2; box-shadow: 0 0 0 1px #000; }
.tl-bar.warn { border-color: var(--warn); }
.tl-bar .bang { display: inline-block; background: var(--warn); color: #1b1405; border-radius: 6px; padding: 0 4px; margin-right: 4px; font-weight: 800; font-size: 10px; line-height: 13px; }
.tl-h { position: absolute; top: 0; width: 8px; height: 100%; background: rgba(255,255,255,.85); pointer-events: none; display: none; }
.tl-bar.sel .tl-h { display: block; }
.tl-h.l { left: 0; border-radius: 3px 0 0 3px; } .tl-h.r { right: 0; border-radius: 0 3px 3px 0; }
.tl-lim { position: absolute; top: 0; bottom: 0; background: rgba(227,181,74,.08); border-left: 1px dashed rgba(227,181,74,.6); border-right: 1px dashed rgba(227,181,74,.6); pointer-events: none; z-index: 1; }
.tl-fx { position: absolute; top: 2px; height: calc(var(--h-frox) - 4px); border-radius: 4px; border: 1px solid #2b9a6c; background: rgba(60,207,145,.16); overflow: hidden; cursor: grab; display: flex; }
.tl-fx.sel { border: 2px solid #fff; z-index: 2; }
.tl-fx.warn { border-color: var(--warn); }
.tl-seg { position: relative; height: 100%; border-right: 1px solid #2b9a6c; display: flex; align-items: center; gap: 3px; padding: 0 4px; font-size: 10.5px; color: #c9f5e2; overflow: hidden; white-space: nowrap; cursor: pointer; flex: none; }
.tl-seg:last-child { border-right: 0; }
.tl-seg:hover { background: rgba(60,207,145,.25); }
.tl-seg img { height: calc(var(--h-frox) - 8px); width: auto; background: #dff1ff; border-radius: 3px; }
.tl-fx .tl-h { display: none; }
.tl-fx.sel .tl-h { display: block; }
#wave { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#tlSubs { position: absolute; inset: 0; pointer-events: none; }
.tl-sub { position: absolute; top: 0; height: 100%; font-size: 10.5px; color: #e4eeff; text-shadow: 0 1px 2px #000, 0 0 3px #000; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 2px 4px 0; border-left: 1px solid rgba(90,162,255,.35); }
.tl-dr { position: absolute; top: 1px; height: calc(var(--h-dirty) - 2px); background: var(--pink); border-radius: 3px; opacity: .8; }
#tlHead { position: absolute; top: calc(3px + var(--h-over)); bottom: 0; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; z-index: 4; box-shadow: 0 0 4px rgba(255,255,255,.7); }
#tlHead .knob { position: absolute; left: -6px; top: 0; width: 14px; height: 12px; background: #fff; clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); pointer-events: auto; cursor: ew-resize; }
#tlTip { position: absolute; z-index: 8; background: #0b0e14; border: 1px solid var(--gold); color: var(--gold); border-radius: 6px; padding: 2px 8px; font-size: 12px; white-space: nowrap; pointer-events: none; }
#tlTip.stop { border-color: var(--warn); color: var(--warn); }


#foot { grid-area: foot; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #0d1016; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; min-width: 0; }
#status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#status.ok { color: var(--ok); } #status.ng { color: var(--bad); } #status.wn { color: var(--warn); }
#jobBar { display: flex; align-items: center; gap: 8px; flex: none; }
.bar { width: 200px; height: 8px; background: #263043; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold2), var(--gold)); }


#pop { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--gold2); border-radius: 10px; box-shadow: 0 8px 26px rgba(0,0,0,.55); max-height: 72vh; overflow-y: auto; padding: 10px 12px; width: 400px; line-height: 1.5; }
#pop h3 { margin: 2px 0 8px; font-size: 13.5px; color: var(--gold); }
#pop h4 { margin: 10px 0 4px; font-size: 12px; color: var(--gold2); }
.ver { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; margin: 5px 0; }
.ver.cur { border-color: var(--gold); }
.ver .acts { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.ver .acts button { padding: 2px 8px; font-size: 12px; }
.warnItem { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 5px; padding: 6px 8px; margin: 5px 0; line-height: 1.5; }
.warnItem.err { border-left-color: var(--bad); }
.warnItem.old { opacity: .55; }
.warnItem .src { color: var(--muted); font-size: 11px; }
.warnItem .src .cnt { margin-left: 6px; background: #3a3220; color: var(--warn); border-radius: 8px; padding: 0 6px; font-weight: 700; }
.warnItem .wtext { white-space: pre-line; }
.warnItem .where { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
details.oldwarn { margin-top: 8px; }
details.oldwarn .warnItem { opacity: .7; }
.warnItem .acts { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.warnItem .acts button { padding: 2px 8px; font-size: 12px; }
.keys { display: grid; grid-template-columns: 150px 1fr; gap: 3px 10px; font-size: 12.5px; }
.keys kbd { background: #0e1117; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-family: inherit; font-size: 11.5px; }
.report { font-size: 12px; line-height: 1.55; }
.report img { width: 100%; border-radius: 4px; margin-top: 6px; }
#dlg { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 90; }
.dlg-in { background: var(--panel); border: 1px solid var(--gold2); border-radius: 10px; padding: 16px 18px; width: min(560px, 92vw); max-height: 86vh; overflow: auto; line-height: 1.6; }
.dlg-in input[type=text] { width: 100%; }
.dlg-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.dlg-btns button { padding: 7px 16px; }
#tour { position: fixed; inset: 0; z-index: 85; background: rgba(5,7,12,.45); }
.tour-card { position: absolute; width: 380px; background: var(--panel); border: 2px solid var(--gold); border-radius: 12px; padding: 16px 16px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.6); line-height: 1.7; font-size: 14px; }
.tour-card b { color: var(--gold); }
.tour-btns { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
#tourArrow { position: absolute; width: 0; height: 0; border: 14px solid transparent; pointer-events: none; }
#tourArrow.down { border-top-color: var(--gold); border-bottom-width: 0; }
#tourArrow.up { border-bottom-color: var(--gold); border-top-width: 0; }
#tourArrow.left { border-right-color: var(--gold); border-left-width: 0; }
#tourArrow.right { border-left-color: var(--gold); border-right-width: 0; }
.tour-hi { outline: 3px solid var(--gold) !important; outline-offset: 2px; position: relative; z-index: 86; }


body.compact { --top: 46px; --right: 300px; --tl: 148px; --h-over: 0px; --h-ruler: 15px; --h-scenes: 19px; --row: 14px; --rows: 2; --h-frox: 17px; --h-voice: 22px; --h-dirty: 5px; }
body.detail { --tl: 236px; --h-dirty: 9px; }
body.detail.compact { --tl: 155px; }
body.compact #tlOver { display: none; }
body.compact .tl-tools { height: 28px; }
body.compact #transport { height: 40px; }
body.compact .big { padding: 5px 10px; font-size: 12.5px; }
body.compact .brand { display: none; }
body.compact #vol { width: 70px; }
body.compact #zoom { width: 100px; }
body.compact #jumpTo { width: 190px; }
body.compact .tp-mid button { padding: 5px 8px; }
body.compact .tl-sc, body.compact .tl-bar, body.compact .tl-seg { font-size: 10px; }
body.compact .faces img { width: 52px; height: 52px; }
body.compact .gal { max-height: 200px; }
body.compact .gal img { height: 48px; }
body.compact .scene-say { font-size: 14px; }


#ovl.textcur { cursor: text; }
#stageTip { position: absolute; z-index: 9; max-width: 380px; background: rgba(10,12,18,.92); color: var(--warn); border: 1px solid var(--warn); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; line-height: 1.5; pointer-events: none; }
