/* Desktop editing uses a stable viewport; narrow windows can scroll horizontally. */
body{min-width:1344px}
header,.mode-bar,main{width:1344px;margin-left:auto;margin-right:auto}
header{min-height:52px;padding:8px 12px;gap:12px}
header h1{font-size:22px;margin:0;letter-spacing:2px}
header span{font-size:10px}
button{padding:5px 9px;border-radius:7px;font-size:12px}
.actions{gap:6px}
.overview-link{padding:5px 4px}
.mode-bar{min-height:40px;padding:6px 12px;gap:12px}
.mode-bar label{font-size:11px}
.mode-bar select{padding:4px 8px}
.mode-bar input[type=number]{padding:4px}
main{grid-template-columns:984px 360px;min-height:0;align-items:start}
.workspace{width:984px;padding:10px 12px;min-width:984px}
.viewbar{width:960px;height:24px;margin:0 0 6px;font-size:11px}
.viewbar button{padding:3px 10px}
#stage{width:960px!important;height:540px!important;min-width:960px;max-width:960px;aspect-ratio:auto!important;border-radius:12px;background:#17291f}
#scene{position:absolute;inset:0;margin:auto;max-width:none;max-height:none}
#hint{left:12px;bottom:10px;font-size:10px}
.transport{width:960px;margin-top:7px;gap:9px;height:30px}
.transport button{padding:4px 9px}
#status{font-size:10px;line-height:1.4;min-height:14px;margin:7px 0 0;max-width:960px}
aside{display:block;width:360px;padding:8px 10px;max-height:calc(100vh - 92px);min-height:0;overflow-y:auto;overscroll-behavior:contain;border-left:1px solid #b6b39b;scrollbar-gutter:stable}
aside section{margin:0}
#freePanel,#templatePanel{margin:0}
.sidebar-group,#freePanel details,#windCycleControls details,.fade-controls{margin:0 0 6px;padding:0;border:1px solid #b6b39b;border-radius:7px;background:#e5dac5}
.sidebar-group>summary{font-size:12px;line-height:1.4;font-weight:600;padding:7px 9px;cursor:pointer;min-height:30px}
.sidebar-group[open]>summary{border-bottom:1px solid #c8c3ad}
.panel-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px 8px;padding:8px}
aside label,.fade-controls label{display:block;font-size:11px;line-height:1.4;min-width:0;margin:0}
aside label input[type=number],aside input[type=color],aside select{margin-top:3px}
aside input[type=number],.free-pose-fields input,#freeFocus,#freeBlur{height:27px;padding:4px 6px;border-radius:5px;font-size:12px;min-width:0}
aside select{padding:5px 6px;border-radius:6px;min-height:27px;font-size:11px}
aside input[type=range]{margin:5px 0 0;height:15px}
aside input[type=color]{height:25px;width:60px}
aside output{font-size:10px;line-height:1.4}
.panel-fields>.row,.panel-fields>p,.panel-fields>details,.panel-fields>.free-pose-fields,.panel-fields>#freeGlyphs,.panel-fields>#freeStrokes,.panel-fields>#freeSelection{grid-column:1/-1}
.panel-fields>.animated-field{margin:0}
.animated-field label{font-size:11px}
.animated-field button{font-size:10px;padding:2px 4px;margin-left:4px}
.free-pose-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px 8px}
.free-pose-fields label{margin:0;font-size:11px}
aside .row{gap:5px;margin:0;align-items:center}
aside .row button{padding:4px 7px;font-size:11px}
#freeGlyphs{gap:4px;margin:0;max-height:84px}
#freeGlyphs button{padding:3px 7px;border-radius:5px;font-size:12px}
#freeStrokes{height:72px;padding:4px}
#freeSelection,#freeClipStatus,#selected{margin:0;font-size:10px;line-height:1.4}
#effectDescription{min-height:0;margin:0;font-size:10px;line-height:1.45}
.panel-fields>#template,.panel-fields>#example{grid-column:1/-1}
#example{padding:5px;font-size:11px}
#windCycleTiming,.wind-note,.fade-controls p{font-size:10px;line-height:1.4;margin:0}
#windCycleControls .sidebar-group{background:#e0d5bf}
.timeline-dock{width:960px;margin-top:8px}
.timeline-tabs{display:flex;gap:5px;height:28px;align-items:flex-start}
.timeline-tabs button{padding:4px 10px;font-size:11px}
.timeline-tabs .active{background:#606c38;color:#fff}
#freeTimeline.timeline-pane,#layoutTimeline.timeline-pane{height:180px;margin:0;padding:9px 11px;overflow:auto;border:1px solid #8b9d83;border-radius:7px;overscroll-behavior:contain}
.free-timeline-heading,.timeline-heading{gap:10px}
.free-timeline-heading h2,.timeline-heading h2{font-size:12px}
.free-timeline-heading label,.timeline-heading output{font-size:10px}
.free-timeline-heading select{padding:3px 8px}
#freeTimeline p{margin:5px 0;font-size:10px}
#freeTracks{max-height:none;overflow:visible}
.free-track-row{margin:7px 0;grid-template-columns:85px minmax(0,1fr)}
.free-track-label{font-size:11px}
.timeline-actions{margin:6px 0;gap:6px;font-size:10px}
.timeline-actions button{padding:3px 7px;font-size:10px}
.timeline-actions select{padding:3px 6px;font-size:10px}
.key-row{min-height:31px;grid-template-columns:145px minmax(0,1fr)}
.key-ruler{margin-left:155px;margin-bottom:4px}
.key-lane{height:22px}
#timelineStatus{margin-top:5px;font-size:10px}
#keyEditor{margin-top:6px;gap:7px}
body.clean{display:grid;place-items:center;min-height:100vh}
body.clean main{display:block;width:984px;margin:0}
body.clean .workspace{width:984px;padding:12px}
body.clean #stage{width:960px!important;height:540px!important;border-radius:12px}
body.clean .timeline-dock{display:none}
#curvePanel{margin:8px 0;border:1px solid #b4b99a;border-radius:8px;padding:8px}
#curvePanel summary{font-weight:600;cursor:pointer}
#curvePanel p{font-size:10px;margin:6px 0}
.curve-block{margin-top:8px}
.curve-block svg{display:block;width:100%;height:auto;touch-action:none}
.curve-block rect{fill:#f4eedf;stroke:#b4b99a}
.curve-block path{fill:none;stroke:#425d39;stroke-width:3}
.curve-guide{stroke:#9a7d46;stroke-width:1.5}
.curve-diagonal{stroke:#c9cbbd;stroke-dasharray:4 4}
.curve-block circle{fill:#ba883f;stroke:#fff;stroke-width:2;cursor:grab}
.curve-points{display:grid;grid-template-columns:1fr 1fr;gap:4px 8px}
.curve-toggle{display:flex;align-items:center;gap:5px}
#curvePanel .curve-points label{display:grid;gap:2px;min-width:0}
#curvePanel .curve-points input{width:100%;min-width:0;padding:4px 6px;border:1px solid #a9b18c;border-radius:5px;background:#d9d8bd;color:#253b33;font:inherit}
#poseGroup input[type=range]{width:100%;margin:5px 0 0;accent-color:#606c38}
.free-track-label{align-self:start;min-height:23px;padding-right:24px}
.free-clip-eye{position:absolute;left:-30px;width:24px;height:21px;padding:2px;border:0;background:transparent;color:#435c37;cursor:pointer}
.free-clip-eye svg{display:block;width:18px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8}
.free-clip-eye[aria-pressed=false]{color:#8b887a}
.free-clip.muted{opacity:.4;background:#a3a393}
#freeCopyAll{grid-column:1/-1}
#freeDirectionControl{grid-column:1/-1;font-size:11px}
.free-direction-buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-top:4px}
.free-direction-buttons .active{background:#606c38;color:#fff}
#freeDirectionHint{font-size:10px;margin:4px 0}
#colorTemplate{grid-column:1/-1;width:100%}
#curveLayerLabel{margin:5px 0}
#motionStart,#motionEnd,#colorStart,#colorEnd{display:block;width:100%;font:inherit;background:#d6d1b7;border:1px solid #8b9d83;color:#283b30}
/* V5.9 editing hierarchy */
header span{font-size:11px}.mode-bar label{font-size:12px}.mode-bar small{font-size:11px;color:#606c38}
aside label,.free-pose-fields label,.animated-field label{font-size:12px}aside input[type=number],aside select{font-size:13px}
.sidebar-group>summary{font-size:13px}.free-clip{font-size:11px}#freeClipStatus,#freeSelection,#selected{font-size:11px}
.editor-sidebar-header{position:sticky;top:-8px;z-index:4;padding:8px 0;background:#e8dcc7;border-bottom:1px solid #b6b39b;margin-bottom:7px}
#editorContext{font-size:12px;font-weight:600;white-space:pre-line;line-height:1.6;min-height:38px}
.editor-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin:6px 0}
.editor-tabs button[aria-selected=true],button.primary{background:#606c38;color:#fff;border-color:#606c38}
#historyActions{display:flex;gap:6px}#historyActions button{padding:3px 10px}
#editorNotice{font-size:11px;color:#943c2c;margin:5px 0}
aside[data-editor-tab=object] [data-editor-context=animation],aside[data-editor-tab=object] [data-editor-context=scene],aside[data-editor-tab=animation] [data-editor-context=object],aside[data-editor-tab=animation] [data-editor-context=scene],aside[data-editor-tab=scene] [data-editor-context=object],aside[data-editor-tab=scene] [data-editor-context=animation]{display:none!important}
#activeLayers{font-size:11px;color:#435c37;max-width:570px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#selectionOutline{position:absolute;border:1px dashed #e9b95f;pointer-events:none;box-shadow:0 0 0 1px #253b3370}
.segment-preview{display:flex;align-items:center;gap:8px;grid-column:1/-1}.segment-preview label{display:flex;gap:4px;align-items:center}
.transport .preview-mode{flex:0;white-space:nowrap;font-size:11px}.preview-mode select{font-size:11px;max-width:125px}
#clock{font-size:12px;white-space:nowrap;cursor:text;min-width:116px;padding:3px;border-bottom:1px dashed #8b9d83}
#seekTime{width:100px;background:#d6d1b7;border:1px solid #8b9d83;border-radius:5px;padding:4px}
#previousFrame,#nextFrame{padding:3px 8px;font-size:17px;line-height:1}
#freeTimeline.timeline-pane,#layoutTimeline.timeline-pane{height:var(--timeline-height,180px)}
.timeline-dock.collapsed .timeline-pane,.timeline-dock.collapsed .timeline-resizer{display:none!important}
.timeline-resizer{height:8px;cursor:ns-resize;touch-action:none;border-top:1px solid #b6b39b;margin-top:3px}.timeline-resizer:hover{background:#c9d0b3}
#collapseTimeline{margin-left:auto}.free-ruler{display:flex;justify-content:space-between;margin:6px 0 3px 95px;font-size:10px;cursor:crosshair}
.key-ruler,.key-lane,.free-track-lane{cursor:crosshair}.window-title{font-size:11px;align-self:center}
.window-bar{position:absolute;top:1px;bottom:1px;padding:2px 9px;min-width:4px;overflow:hidden;border-radius:4px;font-size:10px;background:#8b9d83;white-space:nowrap;cursor:grab;touch-action:none}
.window-bar.inactive{opacity:.45}.window-bar-text{pointer-events:none}.window-row{min-height:26px;margin:5px 0}
.inline-help{grid-column:1/-1!important;border:0!important;background:transparent!important;margin:0!important;font-size:11px}
.inline-help summary{font-size:11px!important;font-weight:400!important;padding:0!important}.inline-help p{margin:4px 0!important}
.curve-actions{display:flex;flex-wrap:wrap;gap:4px;margin:6px 0}.curve-actions button{padding:3px 5px;font-size:11px}
#curveZoom{width:680px}#curveZoomBody svg{max-height:none}#curveZoomBody .curve-points input{width:100%;background:#d6d1b7;border:1px solid #8b9d83;border-radius:5px;padding:5px;color:#283b30}
#projectState{max-width:180px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:12px;align-self:center}
#textCount{font-size:12px;color:#606c38;line-height:1.6}#missing,[id$=WindowStatus]{color:#943c2c}
#presetsDialog .preset-section{display:grid;gap:10px}#presetsDialog .preset-section label{margin:0}#saveCurrentPreset,#savePreset{width:100%}
.quick-export summary{font-size:12px;cursor:pointer}#restoreReset{border-color:#b46c3f}#resetProject,#deleteKey,#clearKeys,#freeDelete{color:#805332}
.transport .preview-mode{flex:0 0 152px;display:flex;gap:4px;align-items:center}
.preview-mode select{width:100px;min-width:100px;max-width:100px;height:27px;padding:3px;border:1px solid #8b9d83;border-radius:5px;background:#d6d1b7;color:#283b30}

/* V5.9.1 shared timeline ruler and transport */
.timeline-dock{--track-label-width:145px}
.timeline-dock .free-track-row,.timeline-dock .key-row{grid-template-columns:var(--track-label-width) minmax(0,1fr);gap:10px}
.timeline-ruler{position:relative;height:34px;margin:5px 12px 0 167px;touch-action:none;cursor:crosshair;font-size:11px;color:#606c38;background:repeating-linear-gradient(90deg,#8b9d8380 0 1px,transparent 1px 5%);background-size:100% 6px;background-repeat:no-repeat;background-position:bottom}
.timeline-ruler>[data-time-fraction]{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}
#timelineCursor{position:absolute;top:17px;width:18px;height:17px;transform:translateX(-50%);padding:0;border:0;border-radius:0;background:transparent;cursor:ew-resize;touch-action:none;z-index:3}
#timelineCursor::before{content:'';position:absolute;left:2px;top:0;border-left:7px solid transparent;border-right:7px solid transparent;border-top:10px solid #b46c3f}
#timelineCursor::after{content:'';position:absolute;left:8.5px;top:10px;width:1px;height:calc(var(--timeline-height,180px) + 8px);background:#b46c3f;pointer-events:none}
#timelineCursor:focus-visible{outline:2px solid #606c38;outline-offset:2px}
.timeline-dock .transport{margin-top:6px}
.timeline-dock .preview-mode{margin-left:auto}
.timeline-dock.collapsed .timeline-ruler{display:none}
.timeline-dock.collapsed #collapseTimeline{margin-left:auto}
#autosaveStatus{max-width:180px;font-size:11px;color:#435c37;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;align-self:center}
#autosaveStatus.save-error{color:#943c2c}
#presetsDialog .autosave-help{font-size:12px;line-height:1.6;margin:0 0 8px;color:#606c38}
