:root{color-scheme:dark;--bg:#101219;--panel:#191d27;--edge:#303746;--muted:#a1aabc;--accent:#fcb603}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:#f3f5fa;font:14px system-ui,sans-serif;height:100dvh;display:flex;flex-direction:column}header{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;border-bottom:1px solid var(--edge);gap:12px;flex-wrap:wrap}h1{font-size:22px;margin:0 0 3px}h1 span{color:var(--accent)}h2{font-size:15px;margin:0}small,#saved{color:var(--muted);font-size:11px}main{flex:1;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) 190px;gap:10px;padding:10px;width:100%}.workspace{display:grid;grid-template-columns:minmax(235px,290px) minmax(280px,1fr) minmax(250px,340px);gap:10px;min-height:0}.panel{background:var(--panel);border:1px solid var(--edge);border-radius:12px;padding:14px;min-width:0;min-height:0}.settings,.captions{overflow:auto}.fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}label{display:block;color:var(--muted);font-size:12px;margin-top:10px}input,textarea,select,button{font:inherit}input:not([type=range]),textarea,select{display:block;width:100%;min-width:0;background:#11151e;color:#fff;border:1px solid var(--edge);border-radius:6px;padding:8px;margin-top:5px}input[type=color]{height:34px;padding:3px}input[type=range]{accent-color:var(--accent);min-width:0}textarea{resize:vertical;min-height:65px}button{border:1px solid var(--edge);background:#282f3e;color:white;border-radius:7px;padding:8px 12px;cursor:pointer;font-weight:600}button:hover{border-color:var(--accent)}button:disabled{opacity:.5;cursor:not-allowed}.primary{background:var(--accent);color:#151515;border-color:var(--accent)}.actions,.panelhead,.transport{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.panelhead{justify-content:space-between}.settings button{margin-top:8px}hr{border:0;border-top:1px solid var(--edge);margin:14px 0}.preview{display:flex;flex-direction:column;gap:10px;align-items:stretch}.stage{flex:1;min-height:0;display:grid;place-items:center;container-type:size;background:#0d1017;border-radius:8px;overflow:hidden}canvas{display:block;width:min(100cqw,56.25cqh);height:auto;max-width:100%;background:conic-gradient(#999 25%,#ccc 0 50%,#999 0 75%,#ccc 0) 0 0/20px 20px}.transport{justify-content:center}#clock{font-variant-numeric:tabular-nums}#status{min-height:28px}.cue{padding:10px;border:1px solid var(--edge);border-radius:8px;margin:10px 0;background:#121620}.cue.active{border-color:var(--accent)}.cue .times{display:grid;grid-template-columns:1fr 1fr;gap:8px}.cue textarea{font-size:15px}.cue button{padding:4px 8px}.timeline{display:flex;flex-direction:column;gap:8px}.timelineScroll{overflow:auto;flex:1;min-height:70px;background:#11151e;border-radius:6px;position:relative}#track{height:94px;position:relative;min-width:100%}#ruler{height:28px;position:relative;border-bottom:1px solid var(--edge);cursor:crosshair}.tick{position:absolute;height:28px;border-left:1px solid #414959;padding-left:4px;font-size:10px;color:var(--muted);white-space:nowrap}#blocks{position:relative;height:65px}.block{position:absolute;height:28px;background:#6252a3;border:1px solid #a89ce8;border-radius:5px;overflow:hidden;display:flex;align-items:center;cursor:grab;touch-action:none;user-select:none;padding:0 8px;white-space:nowrap;font-size:11px}.block.active{background:#8063c8;border-color:#ffda65}.handle{position:absolute;top:0;bottom:0;width:7px;background:#ffffff35;cursor:ew-resize}.handle.left{left:0}.handle.right{right:0}#head{position:absolute;top:0;bottom:0;width:2px;background:var(--accent);pointer-events:none;z-index:3}.inline{display:flex;align-items:center;gap:6px;margin:0}#zoom{width:100px}@media(max-width:950px){body{height:auto;min-height:100dvh}main{grid-template-rows:auto 190px}.workspace{grid-template-columns:250px minmax(0,1fr)}.captions{grid-column:1/-1;max-height:400px}.stage{height:460px;flex:auto}}@media(max-width:600px){.workspace{grid-template-columns:1fr}.preview{grid-row:1}.stage{height: min(65vh,540px)}.captions{grid-column:auto}header{padding:12px}main{padding:7px}.timeline{position:relative}}

[hidden]{display:none!important}html{height:100%;overflow:hidden}body{height:100dvh;min-width:0;overflow:hidden}header{flex-wrap:nowrap;padding:9px 16px;flex:0 0 auto}header .actions{flex-wrap:nowrap;white-space:nowrap;justify-content:flex-end}header h1{font-size:20px}main{grid-template-columns:minmax(0,1fr) minmax(260px,32%);grid-template-rows:minmax(0,1fr) 205px;gap:8px;padding:8px;overflow:hidden}.workspace{display:contents}.settings{grid-column:1;grid-row:1;width:calc(50% - 4px);justify-self:start}.captions{grid-column:1;grid-row:1;width:calc(50% - 4px);justify-self:end;display:flex;flex-direction:column;overflow:hidden}.captions #cueList{flex:1;min-height:0;overflow:auto}.preview{grid-column:2;grid-row:1 / 3;overflow:hidden;gap:6px}.timeline{grid-column:1;grid-row:2;overflow:hidden}.stage{height:auto;flex:1;min-height:0}.preview #status{min-height:15px}.panel{padding:10px}.fields{gap:6px}.settings label{margin-top:6px}.timeline .panelhead{gap:4px}.timeline .actions{gap:5px}#head{pointer-events:auto;cursor:ew-resize;touch-action:none;width:3px;transform:translateX(-1px)}#head:before{content:"";position:absolute;top:0;left:-7px;width:17px;height:15px;background:var(--accent);clip-path:polygon(0 0,100% 0,100% 55%,50% 100%,0 55%)}#head:after{content:"";position:absolute;inset:0 -6px}#ruler,.timelineScroll{touch-action:pan-x}.effect{position:absolute;height:22px;background:#9b5a22;border:1px solid #ffb45b;border-radius:4px;cursor:grab;touch-action:none;user-select:none;overflow:hidden;white-space:nowrap;font-size:10px;padding:3px 8px;color:#fff}.effect.active{background:#b96d25;border-color:#ffd39b}.effect .handle{width:7px}.timeline .panelhead small{font-size:10px}#seek{width:100%;margin:0}button{white-space:nowrap} @media(max-width:1050px){main{grid-template-columns:minmax(0,1fr) minmax(220px,34%)}.fields{grid-template-columns:1fr}.timeline .panelhead small{display:none}} @media(max-width:720px){html,body{height:auto;overflow:auto}header{flex-wrap:wrap}header .actions{flex-wrap:wrap;justify-content:flex-start}main{display:flex;flex-direction:column;overflow:visible}.preview{order:-1;min-height:440px;height:65dvh}.settings,.captions{width:100%;max-height:none}.captions #cueList{max-height:360px}.fields{grid-template-columns:1fr 1fr}.timeline{height:220px}.stage{height:auto;flex:1}}
/* V4 layout */
main{grid-template-rows:minmax(0,1fr) minmax(220px,34vh)} header>div:first-child{min-width:0}header .actions{flex-wrap:wrap} .stage{position:relative} .stage video,.stage canvas{grid-area:1/1;width:min(100cqw,56.25cqh);height:auto;aspect-ratio:9/16;object-fit:contain;max-height:100%}.stage video{background:#000;visibility:hidden}.stage video:visible{display:block}.stage:has(video[style*="visibility: visible"]) canvas{background:transparent}.stage canvas{z-index:1;pointer-events:none}.check{display:flex;align-items:center;gap:6px;margin:0}.check input,.inline input[type=checkbox]{width:auto;margin:0} #wave{height:42px;overflow:hidden}#waveCanvas{display:block;background:#14252b}#wordTrack{position:relative;height:34px;border-top:1px solid #394858;background:#17212e}.wordBlock{position:absolute;top:3px;height:27px;background:#28649a;border:1px solid #5494c8;border-radius:4px;white-space:nowrap;overflow:hidden;padding:4px 8px;font-size:11px;cursor:grab;touch-action:none;user-select:none}.wordBlock.chosen{border-color:#fcb603;background:#385e85}#wordEditor{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:11px}#wordEditor label{display:flex;align-items:center;gap:4px;margin:0}#wordEditor input{width:78px;margin:0;padding:3px} .timeline .panelhead button{padding:4px 7px;font-size:11px}.captions .actions select{width:auto;max-width:100%;margin:0}#ruler{touch-action:none}.settings input[type=file]{font-size:11px} @media(max-width:900px){header .actions{gap:4px}header .actions button{padding:6px;font-size:11px}header small{display:none} .timeline .panelhead{flex-wrap:wrap}}@media(max-width:720px){main{display:flex}.timeline{height:320px}header{flex-wrap:wrap}.settings,.captions{width:100%}.preview{height:65dvh;min-height:320px}}
#magnet[aria-pressed=true]{background:#fcb603;color:#151515;border-color:#fcb603}#selectionCount{white-space:nowrap}#blocks{touch-action:none;user-select:none}.marquee{position:absolute;border:1px solid #67b6ff;background:#67b6ff30;z-index:9;pointer-events:none}.block.active{outline:1px solid #fcb603;outline-offset:-2px}.timeline .actions{max-width:100%}.timelineScroll{overscroll-behavior:contain}
/* V6: horizontal-only timeline; adjoining word blocks share a seam. */
main{grid-template-rows:minmax(0,1fr) auto}.timeline{overflow:visible;gap:5px}.timelineScroll{overflow-x:auto;overflow-y:hidden;flex:none;height:auto;scrollbar-width:thin}.timeline .panelhead{flex-wrap:wrap}.timeline .actions{flex-wrap:wrap}#blocks{min-height:34px}#wordTrack{height:34px}.wordBlock{border-radius:0;border:0;border-top:1px solid #5494c8;border-bottom:1px solid #5494c8;cursor:pointer;padding:4px 5px;min-width:0;text-overflow:ellipsis}.wordBlock.chosen{background:#397cae;box-shadow:inset 0 0 0 1px #fcb603}.wordSeam{position:absolute;top:3px;height:27px;width:12px;transform:translateX(-50%);z-index:2;cursor:ew-resize;touch-action:none}.wordSeam:before{content:'';position:absolute;left:5px;top:0;bottom:0;border-left:2px solid #9cdbff}.wordSeam:after{content:'';position:absolute;left:2px;top:9px;width:8px;height:9px;background:#b9e8ff;border-radius:2px}.wordSeam:hover:after,.wordSeam:active:after{background:#fcb603}.wordSeam:hover:before{border-color:#fcb603}#wordEditor{min-height:24px}.effect{display:none!important}@media(max-width:720px){.timeline{height:auto;min-height:0}.timelineScroll{flex:none}}

.stage.has-video canvas{background:transparent}.stage video{object-fit:contain}.previewMediaControls{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}.previewMediaControls button{font-size:11px;padding:4px 7px}#mediaInfo{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* V8 */ header .presetActions{justify-content:flex-start;margin-top:6px;flex-wrap:wrap}button i{margin-right:3px}dialog{color:#f3f5fa;background:var(--panel);border:1px solid var(--edge);border-radius:12px;padding:20px;width:min(440px,92vw);box-shadow:0 18px 80px #0009}dialog::backdrop{background:#0009;backdrop-filter:blur(3px)}dialog .primary{margin-top:16px}#cancelExport:disabled{display:none}#exportSettings{border-color:#697387}dialog .actions{margin-top:12px}header>div:first-child{flex-shrink:0}@media(max-width:950px){header>div:first-child{flex-shrink:1}}

.cue textarea,.block,.wordBlock,#bulk{font-family:"Noto Sans Sinhala","Iskoola Pota","Nirmala UI",sans-serif}.custom-font .cue textarea,.custom-font .block,.custom-font .wordBlock,.custom-font #bulk{font-family:CustomSinhala,"Noto Sans Sinhala","Iskoola Pota","Nirmala UI",sans-serif;font-weight:400}
