:root{--label:250px;--pink:#ff376f;--gold:#ffe174;--row:76px}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#15161b;color:#fff;font-family:Arial,sans-serif}body{overflow:auto}button,input,select{font:inherit}#trackRoom{min-width:980px;padding:18px 22px 30px}#headerBar,#projectBar,#transportBar{position:relative;width:100%;border:1px solid #ffffff2e;background:linear-gradient(#ffffff17,#ffffff09);border-radius:22px;box-shadow:inset 0 1px #ffffff1f}#headerBar{height:72px}#logo{position:absolute;left:26px;top:18px;font-size:29px;font-weight:800}#roomTitle{position:absolute;left:50%;top:16px;transform:translateX(-50%);font-size:31px;font-weight:800}#frontPageLink{position:absolute;right:27px;top:25px;color:#e6ecff;text-decoration:none;font-size:19px;font-weight:700}#projectBar{height:62px;margin-top:14px;padding:9px 16px;white-space:nowrap}#projectBar label{font-size:19px;margin-right:16px}#projectBar input,#projectBar select{height:42px;margin-left:6px;padding:0 12px;color:#fff;background:#3b3d45;border:1px solid #686b75;border-radius:14px;font-size:19px}#storyTitle{width:310px}#sceneTitle{width:280px}
#theaterArea{position:relative;width:min(1100px,72vw);height:390px;margin:28px auto 20px;overflow:hidden;border:2px solid #ffffff21;border-radius:34px;background-color:#101216;background-image:linear-gradient(#ffffff06 1px,transparent 1px),linear-gradient(90deg,#ffffff06 1px,transparent 1px);background-size:24px 24px;box-shadow:0 0 42px #0008,inset 0 0 50px #ffffff08}#stage{position:absolute;inset:0;overflow:hidden}.stageAsset{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none}.stageAudio{display:none}#theaterMessage{position:absolute;left:0;right:0;top:46%;text-align:center;color:#8c919d;font-size:19px}#stageTime{position:absolute;left:20px;bottom:16px;font-size:27px;font-weight:700;text-shadow:0 2px 5px #000}
.glassSelect{height:39px;padding:0 14px;border-radius:20px;color:#fff;background:#34363e;border:1px solid #ffffff45;font-weight:700}#backupIndicator{margin:10px 0 2px;padding:10px 18px;border-radius:16px;border:1px solid #67d99b88;background:#173c2a;color:#baffd4;font-size:18px;font-weight:800;text-align:center}#backupIndicator.backupDue{border-color:#ffd45c;background:#4a3512;color:#ffe797;animation:backupPulse 1.7s ease-in-out infinite}@keyframes backupPulse{50%{box-shadow:0 0 18px #ffd45c77}}
#transportBar{min-height:64px;padding:12px 14px;display:flex;align-items:center;gap:9px;flex-wrap:wrap}.glassButton{height:39px;padding:0 18px;border-radius:20px;color:#fff;font-weight:750;border:1px solid #ffffff45;background:linear-gradient(#ffffff30,#ffffff0e);box-shadow:0 5px 15px #0006,inset 0 1px #ffffff55;cursor:pointer}.glassButton:hover{transform:translateY(-1px);background:linear-gradient(#ffffff40,#ffffff18)}#currentTime{width:210px;height:42px;margin-left:auto;border-radius:17px;text-align:center;color:#fff;background:#292b32;border:1px solid #ffffff36;font-size:25px}
#editorShell{display:grid;grid-template-columns:var(--label) minmax(700px,1fr);height:420px;margin-top:16px;border:1px solid #ffffff22;border-radius:22px;overflow:hidden;background:#111318}#trackLabels{z-index:5;background:#191b21;border-right:1px solid #ffffff24}.rulerCorner{height:62px;padding:22px 16px;color:var(--gold);font-weight:800;letter-spacing:1px;border-bottom:1px solid #ffffff1f}#labelRows{overflow:hidden}.trackLabel{height:var(--row);padding:8px 10px;border-bottom:1px solid #ffffff19;background:linear-gradient(90deg,#23262d,#191b20)}.labelTop{display:flex;align-items:center;gap:6px}.expandButton,.moveButton,.miniButton{border:1px solid #ffffff28;background:#ffffff0d;color:#fff;border-radius:10px;cursor:pointer}.expandButton{width:30px;height:30px}.trackName{width:126px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}.moveButton{width:27px;height:27px}.labelTools{display:none;margin-top:6px;gap:5px}.trackLabel.expanded,.trackLane.expanded{height:142px}.trackLabel.expanded .labelTools{display:flex}.miniButton{padding:5px 8px;color:#ddd}
#timelineScroll{overflow:auto;overscroll-behavior:contain;scrollbar-color:#959aa5 #22252b}#timelineWorld{position:relative;width:60000px;min-height:100%}#timelineRuler{position:sticky;top:0;z-index:4;height:62px;background:#23262d;border-bottom:1px solid #ffffff28}.second{position:absolute;top:0;width:100px;height:62px;border-left:1px solid #9aa0aa}.secondLabel{position:absolute;top:8px;left:6px;color:var(--gold);font-weight:750}.minorTick{position:absolute;bottom:0;width:1px;height:14px;background:#777d86}.majorTick{position:absolute;bottom:0;width:1px;height:28px;background:#eef1f5}.trackLane{position:relative;height:var(--row);border-bottom:1px solid #ffffff19;background:repeating-linear-gradient(90deg,#17191e 0,#17191e 99px,#292c33 100px)}.trackClip{position:absolute;top:13px;height:50px;min-width:20px;border:1px solid #ffffff66;border-radius:12px;overflow:hidden;cursor:grab;touch-action:none;box-shadow:0 4px 12px #0008;background:linear-gradient(90deg,#5d91ff,#70c8ff);user-select:none}.trackClip.video{background:linear-gradient(90deg,#7749d6,#b068e6)}.trackClip.audio{background:linear-gradient(90deg,#d84778,#fa7c9d)}.trackClip.selected{outline:3px solid var(--pink);outline-offset:1px}.clipTitle{height:100%;padding:14px 22px 0 13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:750;text-shadow:0 1px 2px #000}.trimHandle{position:absolute;top:0;width:12px;height:100%;background:#ffffff31;cursor:ew-resize}.trimHandle.left{left:0}.trimHandle.right{right:0}.clipControls{position:absolute;display:none;left:8px;right:8px;top:78px;height:52px;padding:7px 10px;background:#20232a;border:1px solid #ffffff20;border-radius:12px;align-items:center;gap:12px}.trackLane.expanded .clipControls{display:flex}.clipControls label{font-size:14px;white-space:nowrap}.clipControls input{width:105px}.clipControls button{padding:6px 10px;border-radius:10px;border:1px solid #ffffff33;color:#fff;background:#ffffff10}#playhead{position:absolute;z-index:8;left:0;top:0;width:2px;min-height:100%;background:#ff315f;pointer-events:none}#playhead span{position:absolute;top:0;left:-7px;width:16px;height:16px;background:#ff315f;border-radius:50%}#statusBar{min-height:28px;padding:13px 3px 0;color:#bfc3cd;font-size:17px}@media(max-width:1100px){#trackRoom{min-width:760px;padding:10px}.glassButton{padding:0 12px}#theaterArea{width:86vw}:root{--label:220px}}

/* 06 IPAD AND LARGE TABLET */
@media (max-width:1180px){:root{--label:210px}#trackRoom{min-width:0;width:100%;padding:12px}#headerBar{height:66px}#logo{left:18px;top:18px;font-size:23px}#roomTitle{top:17px;font-size:25px}#frontPageLink{right:18px;top:22px;font-size:17px}#projectBar{height:auto;min-height:62px;white-space:normal}#projectBar label{display:inline-block;margin:3px 9px 3px 0}#storyTitle{width:250px}#sceneTitle{width:220px}#theaterArea{width:min(94vw,1000px);height:46vw;min-height:330px;max-height:470px;margin-top:18px}#transportBar{justify-content:center}.glassButton{padding:0 13px;font-size:16px}#currentTime{width:190px;margin-left:0}#editorShell{grid-template-columns:var(--label) minmax(560px,1fr);height:430px}}

/* 07 KINDLE AND SMALL TABLET */
@media (max-width:820px){:root{--label:176px;--row:82px}#trackRoom{min-width:0;padding:8px}#headerBar{height:92px}#logo{left:14px;top:13px;font-size:21px}#roomTitle{left:14px;top:49px;transform:none;font-size:24px}#frontPageLink{right:14px;top:52px;font-size:17px}#projectBar{padding:8px 10px}#projectBar label{display:block;font-size:17px;margin:4px 0}#projectBar input,#projectBar select{height:40px;font-size:17px}#storyTitle,#sceneTitle{width:calc(100% - 75px)}#theaterArea{width:100%;height:56vw;min-height:290px;margin:12px auto}#stageTime{font-size:23px}#transportBar{padding:10px 8px;gap:7px}.glassButton,.glassSelect{min-height:44px;height:44px;font-size:16px}#currentTime{height:44px;font-size:21px}#backupIndicator{font-size:16px;padding:10px}#editorShell{grid-template-columns:var(--label) minmax(520px,1fr);height:440px;margin-top:10px}.trackName{width:86px;font-size:15px}.moveButton{width:25px}}

/* 08 PHONE — ONLY THE PRECISION TIMELINE SCROLLS SIDEWAYS */
@media (max-width:599px){:root{--label:132px;--row:88px}body{overflow-x:hidden}#trackRoom{width:100%;min-width:0;padding:5px}#headerBar{height:88px;border-radius:17px}#logo{left:12px;top:12px;font-size:18px}#roomTitle{left:12px;top:45px;font-size:22px}#frontPageLink{right:12px;top:49px;font-size:15px}#projectBar{margin-top:7px;border-radius:17px}#projectBar label{font-size:16px}#projectBar input,#projectBar select{margin-left:4px;font-size:16px}#storyTitle,#sceneTitle{width:calc(100% - 63px)}#theaterArea{height:68vw;min-height:235px;max-height:360px;border-radius:22px}#theaterMessage{padding:0 25px;font-size:16px}#stageTime{left:12px;bottom:10px;font-size:20px}#transportBar{display:block;text-align:center;border-radius:17px;padding:7px}.glassButton,.glassSelect{display:inline-block;width:47%;min-height:46px;height:auto;margin:3px 1%;padding:8px 4px;font-size:15px;vertical-align:top}#currentTime{display:block;width:96%;height:45px;margin:5px auto;font-size:21px}#backupIndicator{margin:7px 0;font-size:15px}#editorShell{grid-template-columns:var(--label) minmax(480px,1fr);height:430px;border-radius:16px}.rulerCorner{height:62px;padding:22px 9px;font-size:14px}.trackLabel{padding:7px 4px}.labelTop{gap:2px;flex-wrap:wrap}.trackName{order:-1;width:100%;font-size:14px;padding-left:3px}.expandButton{width:36px;height:34px}.moveButton{width:34px;height:34px}.trackLabel.expanded,.trackLane.expanded{height:160px}.labelTools{flex-wrap:wrap}.clipControls{top:78px;height:70px;overflow-x:auto}#statusBar{font-size:15px;padding:10px 5px}}

/* 09 PHONE LANDSCAPE */
@media (max-height:520px) and (orientation:landscape){#theaterArea{height:62vh;min-height:220px}#editorShell{height:76vh}}

/* 10 FINAL ASSEMBLY EDITING */
#editBar{margin:10px 0;padding:10px;border:1px solid #ffffff2e;border-radius:20px;background:linear-gradient(#ffffff14,#ffffff08);display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
#editBar .glassButton,#editBar .glassSelect{min-height:42px}.trackPick,.groupPick{width:18px;height:18px;accent-color:#ff376f}.trackName{cursor:text;border-radius:7px}.trackName:hover{background:#ffffff12}.trackSelected{box-shadow:inset 4px 0 #ff376f;background:linear-gradient(90deg,#4c2635,#191b20)}
.groupBanner{height:25px;margin:-5px -5px 3px;padding:2px 5px;border-radius:8px;background:#664d16;color:#ffe174;font-size:12px;white-space:nowrap;overflow:hidden}.groupCollapse{width:24px;border:0;border-radius:6px;background:#ffffff20;color:#fff}.trackLabel:has(.groupBanner){padding-top:7px}.trackLabel:has(.groupBanner) .labelTop{transform:scale(.94);transform-origin:left center}
.groupActions{float:right}.groupActions button{width:22px;height:20px;margin-left:2px;padding:0;border:1px solid #ffffff35;border-radius:5px;background:#ffffff19;color:#fff;font-size:10px}
.trackLane.dropTarget{outline:4px solid #6ef2b1;outline-offset:-4px;background-color:#183b2b}.trackLane.locked{background-color:#2c292d}.trackClip.clipGrouped:after{content:"GROUP";position:absolute;right:15px;bottom:2px;font-size:9px;color:#fff9}.trackClip.dragging{opacity:.75;outline:4px solid #6ef2b1;z-index:20}
.trackClip.selected{outline:3px solid #6ef2b1;outline-offset:1px;z-index:30;box-shadow:0 0 0 2px #102a20,0 7px 20px #000b}.trackClip.dragging{z-index:40}

/* BUILD 12 — precision trim lines. The visible line is narrow and exact,
   while the handle remains wide enough to grab with a trackpad or finger. */
.trimHandle{width:18px;background:transparent;z-index:6}
.trimHandle.left{left:0}.trimHandle.right{right:0}
.trimHandle::after{content:"";position:absolute;top:4px;bottom:4px;width:3px;border-radius:3px;background:#fff7b0;box-shadow:0 0 5px #ffe174,0 0 1px #000}
.trimHandle.left::after{left:2px}.trimHandle.right::after{right:2px}
.trackClip.selected .trimHandle::after{background:#ffffff;box-shadow:0 0 7px #6ef2b1,0 0 2px #000}
.trimHandle:hover::after{width:4px;background:#ffdf63;box-shadow:0 0 9px #ffe174}
@media(max-width:599px){#editBar{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:7px}#editBar .glassButton,#editBar .glassSelect{width:100%;margin:0;font-size:14px}.groupBanner{font-size:11px}.trackLabel:has(.groupBanner) .labelTop{transform:scale(.9)}}
.glassButton.modeActive{border-color:#ffe174;background:linear-gradient(#7a5b18,#46320d);color:#fff3ad;box-shadow:0 0 18px #ffe17488,inset 0 1px #fff6}

/* 11 GROWING TIMELINE — NO FIXED TIME LIMIT */
#timelineGrowthBar{margin:10px 0;padding:10px 14px;border:1px solid #ffffff2e;border-radius:20px;background:linear-gradient(180deg,#21342a,#151c19);display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}.growthSummary{display:flex;gap:8px 12px;align-items:center;flex-wrap:wrap;color:#e9fff1;font-size:17px}.growthSummary strong{color:#8ff0b6}.growthButtons{display:flex;gap:7px;flex-wrap:wrap}.growthButtons .glassButton{min-height:40px}#deviceCapacityNotice{flex-basis:100%;padding:7px 10px;border-radius:12px;text-align:center;color:#d7e7dd;background:#ffffff0b;font-size:15px}#deviceCapacityNotice.capacityWarning{color:#ffe797;background:#4a3512;border:1px solid #ffd45c77}#timelineRuler{background-color:#23262d;background-image:repeating-linear-gradient(90deg,transparent 0,transparent 9px,#777d86 9px,#777d86 10px);background-size:100px 14px;background-repeat:repeat-x;background-position:left bottom}.virtualSecond{pointer-events:none}.virtualSecond .secondLabel{min-width:92px}
@media(max-width:599px){#timelineGrowthBar{display:block;padding:8px}.growthSummary{justify-content:center;font-size:15px}.growthButtons{display:grid;grid-template-columns:1fr 1fr;margin-top:7px}.growthButtons .glassButton{width:100%;margin:0;font-size:14px}.growthButtons .glassButton:last-child{grid-column:1/-1}#deviceCapacityNotice{margin-top:7px;font-size:14px}}

/* BUILD 8 — synchronized full-height track scrolling */
#trackLabels{height:100%;min-height:0;overflow:hidden}
#labelRows{height:calc(100% - 62px);min-height:0;overflow:hidden}
#timelineScroll{min-width:0;min-height:0;overflow:scroll;scrollbar-gutter:stable}
#timelineWorld{padding-bottom:18px}

/* BUILD 9 — draggable finished end and Procreate Dreams-style Fill Track */
#timelineEndHandle{position:absolute;z-index:12;top:0;bottom:0;width:5px;margin-left:-2px;background:#ffe174;box-shadow:0 0 12px #ffe174aa;cursor:ew-resize;touch-action:none}
#timelineEndHandle:before{content:"";position:absolute;top:0;left:-9px;width:23px;height:23px;border-radius:50%;background:#ffe174;box-shadow:0 0 12px #ffe174aa}
#timelineEndHandle span{position:absolute;top:25px;left:9px;padding:3px 7px;border-radius:8px;background:#5a4312;color:#fff4b0;font-size:12px;font-weight:800;white-space:nowrap}
#timelineEndHandle.dragging{background:#ff376f;box-shadow:0 0 18px #ff376f}
.fillTrackButton{border-color:#ffe174!important;color:#fff3ad!important}
