.editor-page main { width: auto; }
.editor-shell { position: relative; display: flex; flex-direction: column; height: 100dvh; min-height: 0; }
.editor-mobile-message { display: none; }
.editor-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 24px; padding: 28px clamp(20px, 3vw, 52px); border-bottom: 1px solid var(--line); background: radial-gradient(circle at right top, #3a2e20, #171510 62%); }
.editor-stage-tools, .editor-id { font: 600 11px "Source Code Pro", monospace; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-bright); }
.editor-header h1, .editor-code-dialog h2 { font: 700 clamp(28px, 3vw, 44px) Cinzel, serif; margin: 4px 0; }
.editor-output-head p { margin: 3px 0; max-width: 690px; color: var(--muted); font-size: 13px; }
.editor-actions, .inspector-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.editor-page button:not(.header-toggle), .editor-page select { cursor: pointer; }
.editor-actions button, .inspector-actions button, #copy-lua, #download-lua, #close-lua { border: 1px solid #876839; background: #28231c; color: var(--cream); padding: 10px 14px; font: 600 11px "Source Code Pro", monospace; text-transform: uppercase; letter-spacing: .04em; }
.editor-page button:hover { border-color: var(--gold-bright); color: var(--gold-bright); }
.editor-page button:focus-visible, .editor-page input:focus-visible, .editor-page textarea:focus-visible, .editor-page select:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.editor-actions .editor-primary { background: linear-gradient(#66502e, #392d20); border-color: var(--gold-bright); }
.editor-actions button:disabled { opacity: .55; cursor: not-allowed; }
.editor-workspace { display: grid; flex: 1; grid-template-columns: 230px minmax(0, 1fr) 236px; grid-template-rows: minmax(0, 1fr); min-height: 0; border-bottom: 1px solid var(--line); }
.editor-palette, .editor-inspector { background: #1a1713; padding: 18px 14px; min-width: 0; min-height: 0; overflow-y: auto; }
.editor-palette { border-right: 1px solid #564126; }
.editor-inspector { border-left: 1px solid #564126; }
.editor-sidebar-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: -4px 0 18px; border-bottom: 1px solid #5b4831; }
.editor-sidebar-tabs button { min-width: 0; padding: 9px 3px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #b69d76; font: 600 10px "Source Code Pro", monospace; text-transform: uppercase; }
.editor-sidebar-tabs button[aria-selected="true"] { border-bottom-color: var(--gold-bright); color: var(--gold-bright); }
.editor-tree-list { list-style: none; margin: 0; padding: 0; }
.editor-tree-list .editor-tree-list { margin-left: 11px; border-left: 1px solid #564126; padding-left: 5px; }
.editor-tree-list[hidden] { display: none; }
.editor-tree-item { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; min-width: 0; margin: 2px 0; }
.editor-tree-item > .editor-tree-list { flex: 0 0 calc(100% - 11px); }
.editor-tree-toggle { flex: none; width: 17px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--gold-bright); font-size: 12px; }
.editor-tree-toggle::before { content: '▾'; }
.editor-tree-toggle[aria-expanded="false"]::before { content: '▸'; }
.editor-tree-node { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 28px; padding: 5px 6px; border: 1px solid transparent; background: transparent; color: var(--cream); text-align: left; font: 11px/1.3 "Noto Sans", sans-serif; }
.editor-tree-node:hover { background: #30291f; }
.editor-tree-node[aria-current="true"] { border-color: #876839; background: #483623; color: #fff0d4; }
.editor-tree-type { color: var(--gold-bright); font: 600 10px "Source Code Pro", monospace; }
.editor-tree-name, .editor-tree-id { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-tree-id { color: #a89b89; font: 10px "Source Code Pro", monospace; }
.editor-layer-controls { display: grid; gap: 6px; margin-bottom: 14px; }
.editor-layer-controls button { width: 100%; text-align: left; }
.editor-component-list details + details { margin-top: 10px; }
.editor-component-list summary { padding: 7px 0; color: #b69d76; font: 600 11px "Source Code Pro", monospace; text-transform: uppercase; letter-spacing: .12em; cursor: pointer; }
.editor-component-list summary:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.editor-component-list summary::marker { color: var(--gold-bright); }
.editor-category-items { padding-top: 2px; }
.editor-palette-item { display: block; width: 100%; margin: 3px 0; padding: 8px 10px; text-align: left; background: linear-gradient(#34302a, #26221d); color: #e1d7c7; border: 1px solid #5b4831; font: 12px "Noto Sans", sans-serif; cursor: grab !important; }
.editor-palette-item::before { content: '+'; margin-right: 9px; color: var(--gold-bright); font: 16px "Source Code Pro", monospace; }
.editor-hint { color: #958b7c; font-size: 12px; line-height: 1.65; }
.editor-palette .editor-hint { margin: 0 0 18px; }
.editor-stage-pane { position: relative; min-width: 0; background: #13120f; display: flex; flex-direction: column; }
.editor-stage-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 20px; color: #9a8a73; letter-spacing: 0; text-transform: none; border-bottom: 1px solid #342c21; }
.editor-stage-tools label { display: flex; align-items: center; gap: 6px; }
.editor-stage-tools input, .editor-stage-tools select { width: 76px; height: 30px; padding: 4px 7px; color: var(--cream); border: 1px solid #5e492e; background: #231e18; font: 12px "Source Code Pro", monospace; }
.editor-stage-tools .editor-snap-toggle input { width: 16px; height: 16px; padding: 0; accent-color: #c49450; }
#toggle-fullscreen { display: grid; place-items: center; flex: none; width: 32px; height: 30px; padding: 4px; border: 1px solid #876839; background: #28231c; color: var(--cream); }
#toggle-fullscreen svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#toggle-fullscreen .icon-collapse { display: none; }
#toggle-fullscreen[aria-pressed="true"] { color: var(--gold-bright); background: #392d20; border-color: var(--gold-bright); }
#toggle-fullscreen[aria-pressed="true"] .icon-expand { display: none; }
#toggle-fullscreen[aria-pressed="true"] .icon-collapse { display: inline; }
#toggle-settings-layer, #toggle-content-layer { padding: 7px 9px; border: 1px solid #876839; background: #28231c; color: var(--cream); font: 600 11px "Source Code Pro", monospace; }
#toggle-settings-layer[aria-pressed="true"], #toggle-content-layer[aria-pressed="true"] { border-color: var(--gold-bright); background: #483623; color: var(--gold-bright); }
.editor-stage-scroll { position: relative; flex: 1; min-height: 0; width: 100%; overflow: auto; padding: 16px; background: #141310; }
#stage-frame { position: relative; box-shadow: 0 16px 38px #0009; margin: 0 auto; }
#stage { position: absolute; top: 0; left: 0; transform-origin: top left; overflow: hidden; background-color: #20201c; border: 2px solid #83704c; }
#stage.show-background { background: #20201c url('../assets/editor/game-area-backdrop.webp') center / cover no-repeat; }
#stage::before { content: ''; position: absolute; top: 0; left: 0; width: var(--stage-screen-width); height: var(--stage-screen-height); transform: scale(var(--stage-inverse-scale)); transform-origin: top left; pointer-events: none; }
#stage.show-background::before { background-color: rgba(8, 8, 11, .5); }
#stage.show-grid::before { background-image: repeating-linear-gradient(to right, transparent 0 calc(var(--grid-step) - 1px), rgba(215, 201, 171, .3) calc(var(--grid-step) - 1px) var(--grid-step)), repeating-linear-gradient(to bottom, transparent 0 calc(var(--grid-step) - 1px), rgba(215, 201, 171, .3) calc(var(--grid-step) - 1px) var(--grid-step)); }
#stage.drag-over { border-color: #e4b368; }
#stage > .preview-window, #stage > .preview-view { isolation: isolate; }
.preview-window { position: absolute; min-width: 220px; min-height: 140px; box-shadow: 0 16px 30px #000b; color: #e7d7b0; font: 15px/1.2 "Noto Sans", sans-serif; }
.preview-window.selected { box-shadow: 0 0 18px 6px rgba(226, 179, 110, .58), 0 16px 30px #000b; }
.preview-window::before { content: ''; position: absolute; top: 32px; bottom: 8px; left: 8px; right: 8px; background: url('../assets/editor/RS3_MODAL_WINDOW_CONTENT_TILE.png') repeat; pointer-events: none; }
.preview-window.untitled::before { top: 8px; }
.preview-window-head { position: absolute; z-index: 1; top: 0; left: 0; right: 0; height: 32px; cursor: move; touch-action: none; }
.preview-window-title { position: absolute; z-index: 2; inset: 2px 36px 2px 12px; display: flex; align-items: center; justify-content: center; color: #f4e4b8; font: 700 13px Cinzel, serif; text-shadow: 1px 1px #000; pointer-events: none; }
.preview-window-head > span:not(.preview-window-title) { position: absolute; top: 0; height: 32px; pointer-events: none; }
.preview-title-left { left: 0; width: 28px; background: url('../assets/editor/RS3_MODAL_WINDOW_1_TITLE_CORNER.png'); }
.preview-title-inner-left { left: 28px; width: 64px; background: url('../assets/editor/RS3_MODAL_WINDOW_1_TITLE_TILE.png'); }
.preview-title-centre { left: 92px; right: 128px; background: url('../assets/editor/RS3_MODAL_WINDOW_1_TITLE_END.png') repeat-x; }
.preview-title-inner-right { right: 64px; width: 64px; background: url('../assets/editor/RS3_MODAL_WINDOW_1_TOP_TILE.png'); }
.preview-title-right { right: 0; width: 64px; background: url('../assets/editor/RS3_MODAL_WINDOW_1_CLOSE_CORNER.png'); }
.preview-window.untitled .preview-window-head { height: 16px; }
.preview-window.untitled .preview-window-head > span:not(.preview-title-left):not(.preview-title-centre):not(.preview-title-right) { display: none; }
.preview-window.untitled .preview-title-centre { left: 16px; right: 16px; height: 8px; background-image: url('../assets/editor/RS3_MODAL_WINDOW_1_BOTTOM_TILE.png'); transform: scaleY(-1); }
.preview-window.untitled .preview-title-left, .preview-window.untitled .preview-title-right { width: 16px; height: 16px; background-image: url('../assets/editor/RS3_MODAL_WINDOW_1_BOTTOM_CORNER.png'); }
.preview-window.untitled .preview-title-left { transform: scaleY(-1); }
.preview-window.untitled .preview-title-right { transform: scale(-1, -1); }
.preview-close { position: absolute; z-index: 3; right: 8px; top: 7px; width: 20px; height: 20px; background: url('../assets/editor/RS3_BTN_MODAL_WINDOW_1_CLOSE_NML.png') center / 20px 20px; pointer-events: none; }
.preview-window-body { position: absolute; top: 32px; bottom: 8px; left: 8px; right: 8px; overflow: auto; scrollbar-width: none; padding: 12px 14px 14px; }
.preview-window.untitled .preview-window-body { top: 8px; }
.preview-window.has-scrollbar .preview-window-body { right: 26px; }
.preview-scrollbar { position: absolute; z-index: 2; top: 32px; bottom: 8px; right: 8px; width: 16px; pointer-events: none; background: url('../assets/editor/SCROLLBAR_DRAGGER_V2_3.png') repeat-y; }
.preview-window.untitled .preview-scrollbar { top: 8px; }
.preview-panel .preview-scrollbar { top: 4px; bottom: 4px; right: 4px; }
.preview-scroll-arrow { position: absolute; left: 0; width: 16px; height: 16px; background: url('../assets/editor/SCROLLBAR_V2_0.png') center no-repeat; }
.preview-scroll-arrow.up { top: 0; }
.preview-scroll-arrow.down { bottom: 0; background-image: url('../assets/editor/SCROLLBAR_V2_1.png'); }
.preview-scroll-rail { position: absolute; top: 16px; bottom: 16px; left: 0; width: 16px; background: url('../assets/editor/SCROLLBAR_DRAGGER_V2_3.png') repeat-y; }
.preview-scroll-thumb { position: absolute; top: 22%; left: 0; width: 16px; height: 34px; background: url('../assets/editor/SCROLLBAR_DRAGGER_V2_1.png') repeat-y; }
.preview-scroll-thumb::before, .preview-scroll-thumb::after { content: ''; position: absolute; left: 0; width: 16px; height: 5px; background: url('../assets/editor/SCROLLBAR_DRAGGER_V2_0.png'); }
.preview-scroll-thumb::before { top: 0; }
.preview-scroll-thumb::after { bottom: 0; background-image: url('../assets/editor/SCROLLBAR_DRAGGER_V2_2.png'); }
.preview-window-body:empty::after, .preview-children:empty::after { content: 'Drop components here'; display: block; padding: 20px; text-align: center; color: #c2a875; background: rgba(194, 168, 117, .05); font: 12px "Source Code Pro", monospace; }
.preview-window > [class^="preview-frame-"] { position: absolute; pointer-events: none; }
.preview-frame-side-left, .preview-frame-side-right { top: 32px; bottom: 16px; width: 8px; background: url('../assets/editor/RS3_MODAL_WINDOW_1_SIDE_TILE.png') repeat-y; }
.preview-window.untitled .preview-frame-side-left, .preview-window.untitled .preview-frame-side-right { top: 16px; }
.preview-frame-side-left { left: 0; }
.preview-frame-side-right { right: 0; transform: scaleX(-1); }
.preview-frame-bottom { left: 16px; right: 16px; bottom: 0; height: 8px; background: url('../assets/editor/RS3_MODAL_WINDOW_1_BOTTOM_TILE.png') repeat-x; }
.preview-frame-corner-left, .preview-frame-corner-right { bottom: 0; width: 16px; height: 16px; background: url('../assets/editor/RS3_MODAL_WINDOW_1_BOTTOM_CORNER.png'); }
.preview-frame-corner-left { left: 0; }
.preview-frame-corner-right { right: 0; transform: scaleX(-1); }
.preview-flow-row { display: flex; align-items: flex-start; width: 100%; min-width: 0; margin: 0 0 8px; }
.preview-row { position: relative; min-height: 0; cursor: grab; overflow-wrap: anywhere; }
.preview-flow-row > .preview-row { flex: 0 1 auto; min-width: 0; }
.preview-flow-row > .preview-row:only-child { width: 100%; }
.preview-flow-row > .preview-row.is-inline:not(:first-child) { margin-left: 12px; }
.preview-row:hover { filter: drop-shadow(0 0 5px rgba(226, 179, 110, .38)); }
.preview-row.selected, .preview-row:focus-visible { outline: none; filter: drop-shadow(0 0 7px rgba(226, 179, 110, .85)); }
.preview-row:active { cursor: grabbing; }
.preview-row.is-inline { display: inline-flex; vertical-align: middle; }
.preview-checkbox.is-inline, .preview-radio.is-inline { gap: 12px; }
.preview-title { display: flex; align-items: center; height: 28px; color: #f2c66d; font: 700 13px Cinzel, serif; text-shadow: 1px 1px #000; }
.preview-text { display: flex; align-items: center; min-height: 24px; color: #e7d7b0; font: 15px/18px "Noto Sans", sans-serif; text-shadow: 1px 1px #000; white-space: pre-wrap; }
.preview-flow-row:not(:first-child) > .preview-title-row:first-child { margin-top: 16px; }
.preview-flow-row:not(.continues-background):has(> .preview-text-row:first-child) { margin-bottom: 2px; }
.preview-flow-row.continues-background { margin-bottom: 0; padding-bottom: 8px; }
.preview-divider { height: 60px; }
.preview-divider-surface { display: block; width: 100%; height: 60px; background: url('../assets/editor/RS3_PARENT_FRAME_TOP_TILE.png') repeat-x; }
.preview-button { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 75px; height: 27px; padding: 0 25px; color: #c8f1ff; background: url('../assets/editor/RS3_BTN_MAIN_NEUTRAL_1.png') center / auto 27px repeat-x; font: 700 13px Cinzel, serif; white-space: nowrap; }
.preview-button::before, .preview-button::after { content: ''; position: absolute; top: 0; bottom: 0; width: 25px; background: url('../assets/editor/RS3_BTN_MAIN_NEUTRAL_0.png') left center no-repeat; }
.preview-button::before { left: 0; }
.preview-button::after { right: 0; background-image: url('../assets/editor/RS3_BTN_MAIN_NEUTRAL_2.png'); background-position: right center; }
.preview-button.variant-positive { color: #372d1e; background-image: url('../assets/editor/RS3_BTN_MAIN_POSITIVE_1.png'); }
.preview-button.variant-positive::before { background-image: url('../assets/editor/RS3_BTN_MAIN_POSITIVE_0.png'); }
.preview-button.variant-positive::after { background-image: url('../assets/editor/RS3_BTN_MAIN_POSITIVE_2.png'); }
.preview-button.variant-negative { color: #dcb58d; background-image: url('../assets/editor/RS3_BTN_MAIN_NEGATIVE_1.png'); }
.preview-button.variant-negative::before { background-image: url('../assets/editor/RS3_BTN_MAIN_NEGATIVE_0.png'); }
.preview-button.variant-negative::after { background-image: url('../assets/editor/RS3_BTN_MAIN_NEGATIVE_2.png'); }
.preview-button.variant-positive.is-disabled { background-image: url('../assets/editor/RS3_BTN_MAIN_POSITIVE_13.png'); }
.preview-button.variant-positive.is-disabled::before { background-image: url('../assets/editor/RS3_BTN_MAIN_POSITIVE_12.png'); }
.preview-button.variant-positive.is-disabled::after { background-image: url('../assets/editor/RS3_BTN_MAIN_POSITIVE_14.png'); }
.preview-button.variant-neutral.is-disabled { background-image: url('../assets/editor/RS3_BTN_MAIN_NEUTRAL_13.png'); }
.preview-button.variant-neutral.is-disabled::before { background-image: url('../assets/editor/RS3_BTN_MAIN_NEUTRAL_12.png'); }
.preview-button.variant-neutral.is-disabled::after { background-image: url('../assets/editor/RS3_BTN_MAIN_NEUTRAL_14.png'); }
.preview-button.variant-negative.is-disabled { background-image: url('../assets/editor/RS3_BTN_MAIN_NEGATIVE_13.png'); }
.preview-button.variant-negative.is-disabled::before { background-image: url('../assets/editor/RS3_BTN_MAIN_NEGATIVE_12.png'); }
.preview-button.variant-negative.is-disabled::after { background-image: url('../assets/editor/RS3_BTN_MAIN_NEGATIVE_14.png'); }
.preview-button.simple-button { min-width: 24px; height: 24px; border: 8px solid transparent; border-image: url('../assets/editor/simple-neutral.png') 8 fill / 8px / 0 repeat; padding: 0 8px; color: #fff; font: 15px "Noto Sans", sans-serif; text-shadow: 1px 1px #000; }
.preview-button.simple-button::before, .preview-button.simple-button::after { display: none; }
.preview-button.simple-button.is-active:not(.is-disabled) { border-image-source: url('../assets/editor/simple-active.png'); }
.preview-button.simple-button.is-disabled { border-image-source: url('../assets/editor/simple-disabled.png'); color: #777; }
.preview-row > .preview-field { display: flex; align-items: center; min-height: 30px; border: 8px solid transparent; border-image: url('../assets/editor/input-frame.png') 8 fill / 8px / 0 stretch; padding: 0; color: #e9e5dd; font: 15px/14px "Noto Sans", sans-serif; text-shadow: 1px 1px #000; }
.preview-row > .preview-field.is-placeholder { color: #99958d; }
.preview-row > .preview-field.preview-combo::after { content: ''; width: 6px; height: 6px; border-right: 1px solid #bca774; border-bottom: 1px solid #bca774; transform: rotate(45deg); margin-left: auto; }
.preview-slider { display: flex; align-items: center; gap: 4px; }
.preview-slider-button { flex: none; width: 23px; height: 23px; background: url('../assets/editor/RS3_BTN_DECREASE_ACTIVE.png') center no-repeat; }
.preview-slider-button.increase { background-image: url('../assets/editor/RS3_BTN_INCREASE_ACTIVE.png'); }
.preview-slider-button.decrease.at-limit { background-image: url('../assets/editor/RS3_BTN_DECREASE_DISABLED.png'); }
.preview-slider-button.increase.at-limit { background-image: url('../assets/editor/RS3_BTN_INCREASE_DISABLED.png'); }
.preview-track { position: relative; flex: 1; height: 12px; background: url('../assets/editor/RS3_SLIDER_BAR_BACKING_TILE.png') repeat-x; }
.preview-track::before, .preview-track::after { content: ''; position: absolute; top: 0; width: 6px; height: 12px; background: url('../assets/editor/RS3_SLIDER_BAR_BACKING_END.png') no-repeat; }
.preview-track::before { left: 0; }
.preview-track::after { right: 0; transform: scaleX(-1); }
.preview-slider-fill { position: absolute; left: 0; top: 3px; width: var(--progress); height: 5px; background: url('../assets/editor/RS3_SLIDER_BAR_TILE.png') repeat-x; }
.preview-slider-fill::before, .preview-slider-fill::after { content: ''; position: absolute; top: 0; width: 5px; height: 5px; background: url('../assets/editor/RS3_SLIDER_BAR_END.png') no-repeat; }
.preview-slider-fill::before { left: 0; }
.preview-slider-fill::after { right: 0; transform: scaleX(-1); }
.preview-slider-thumb { position: absolute; z-index: 1; top: -4px; left: clamp(0px, calc(var(--progress) - 6px), calc(100% - 11px)); width: 11px; height: 19px; background: url('../assets/editor/RS3_BTN_ADJUST_SLIDER_0.png') no-repeat; }
.preview-choice { display: flex; align-items: center; gap: 8px; height: 22px; color: #e7d7b0; font: 15px "Noto Sans", sans-serif; text-shadow: 1px 1px #000; }
.preview-marker { width: 14px; height: 14px; flex: none; background: url('../assets/editor/RS3_BTN_CHECKBOX_SMALL_0.png'); }
.preview-marker.checkbox.checked { background-image: url('../assets/editor/RS3_BTN_CHECKBOX_SMALL_2.png'); }
.preview-choice:hover .preview-marker:not(.checked) { background-image: url('../assets/editor/RS3_BTN_CHECKBOX_SMALL_1.png'); }
.preview-choice:hover .preview-marker.radio.checked { background-image: url('../assets/editor/RS3_BTN_CHECKBOX_SMALL_5.png'); }
.preview-marker.radio.checked { background-image: url('../assets/editor/RS3_BTN_CHECKBOX_SMALL_4.png'); }
.preview-panel { height: 140px; border: 4px solid transparent; border-image: url('../assets/editor/panel-frame.png') 4 fill / 4px / 0 stretch; background: url('../assets/editor/RS3_HUD_WINDOW_CONTENT_TILE.png') repeat; }
.preview-panel::before { content: ''; position: absolute; inset: 0; background: #111; opacity: calc(1 - var(--panel-alpha, 1)); pointer-events: none; }
.preview-children { position: relative; height: 100%; overflow: auto; scrollbar-width: none; padding: 12px 14px 14px; }
.preview-popout { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; background: url('../assets/editor/RS3_BTN_MINIMISE_16PX_3.png') center / 20px 20px no-repeat; pointer-events: none; }
.preview-panel.has-scrollbar .preview-children { padding-right: 32px; }
.preview-row.is-disabled { opacity: .55; }
/* Client frames where bundled; unsupported resource expressions retain a placeholder. */
.preview-tabs, .preview-collapse, .preview-list, .preview-graph { min-width: 0; }
.preview-tabs { background: url('../assets/editor/RS3_HUD_WINDOW_CONTENT_TILE.png') repeat; }
.preview-tab-nav { position: relative; z-index: 1; display: flex; align-items: flex-start; flex-wrap: wrap; height: 42px; background: url('../assets/editor/RS3_PARENT_FRAME_TOP_TILE.png') repeat-x; }
.preview-tab { position: relative; flex: none; height: 60px; color: #f2e2bc; font: 15px "Noto Sans", sans-serif; text-shadow: 1px 1px #000; cursor: pointer; }
.preview-tab.current { z-index: 1; }
.preview-tab.text-tab { display: inline-flex; align-items: flex-start; justify-content: center; min-width: 90px; padding: 7px 12px 0; box-sizing: border-box; background-position: left top, right top; background-repeat: no-repeat; }
.preview-tab.text-tab::before { content: ''; position: absolute; inset: 0 30px 0 60px; background: var(--tab-tile) left top repeat-x; pointer-events: none; }
.preview-tab.text-tab.current { background-image: url('../assets/editor/RS3_PARENT_TAB_CURRENT_LEFT.png'), url('../assets/editor/RS3_PARENT_TAB_CURRENT_RIGHT.png'); --tab-tile: url('../assets/editor/RS3_PARENT_TAB_CURRENT_TILE.png'); }
.preview-tab.text-tab.unselected { background-image: url('../assets/editor/RS3_PARENT_TAB_UNSELECTED_LEFT.png'), url('../assets/editor/RS3_PARENT_TAB_UNSELECTED_RIGHT.png'); --tab-tile: url('../assets/editor/RS3_PARENT_TAB_UNSELECTED_TILE.png'); }
.preview-tab.text-tab.locked { background-image: url('../assets/editor/RS3_PARENT_TAB_LOCKED_LEFT.png'), url('../assets/editor/RS3_PARENT_TAB_LOCKED_RIGHT.png'); --tab-tile: url('../assets/editor/RS3_PARENT_TAB_LOCKED_TILE.png'); }
.preview-tab-label { height: 32px; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.preview-tab.unselected .preview-tab-label { opacity: .65; }
.preview-tab.locked .preview-tab-label { opacity: .4; }
.preview-tab.text-tab.locked { padding-left: 30px; padding-right: 16px; }
.preview-tab.icon-tab { width: 48px; height: 38px; margin-top: 3px; display: grid; place-items: center; background: url('../assets/editor/BANK_TABS_HORIZONTAL_0.png') center no-repeat; }
.preview-tab.icon-tab.current { background-image: url('../assets/editor/BANK_TABS_HORIZONTAL_1.png'); }
.preview-tab.icon-tab:hover:not(.locked):not(.current) { background-image: url('../assets/editor/BANK_TABS_HORIZONTAL_2.png'); }
.preview-tab.icon-tab.locked { background-image: url('../assets/editor/BANK_TABS_HORIZONTAL_3.png'); }
.preview-tab-icon { width: 22px; height: 22px; display: grid; place-items: center; }
.preview-tab-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.preview-tab.locked .preview-tab-icon { opacity: .4; }
.preview-tab-page { position: relative; box-sizing: border-box; min-width: 0; min-height: 56px; height: calc(100% - 42px); padding: 12px 14px; background: url('../assets/editor/RS3_HUD_WINDOW_CONTENT_TILE.png') repeat; }
.preview-tab-page:empty::after { content: 'Drop components here'; display: block; padding: 12px; border: 1px dashed #776341; color: #d2b785; text-align: center; font: 12px "Source Code Pro", monospace; }
.preview-tab-page .preview-children { height: auto; min-height: 48px; overflow: visible; padding: 0; }
.preview-collapse { width: 100%; }
.preview-collapse-head { position: relative; display: flex; align-items: center; height: 20px; min-width: 60px; padding: 0 28px 0 12px; box-sizing: border-box; color: #e7d7b0; font: 15px "Noto Sans", sans-serif; text-shadow: 1px 1px #000; white-space: nowrap; background-position: left top, right top, 20px top; background-repeat: no-repeat, no-repeat, repeat-x; background-image: url('../assets/editor/RS3_BTN_ACCORDION_6.png'), url('../assets/editor/RS3_BTN_ACCORDION_8.png'), url('../assets/editor/RS3_BTN_ACCORDION_7.png'); }
.preview-collapse-head:hover:not(.disabled):not(.active) { background-image: url('../assets/editor/RS3_BTN_ACCORDION_3.png'), url('../assets/editor/RS3_BTN_ACCORDION_5.png'), url('../assets/editor/RS3_BTN_ACCORDION_4.png'); }
.preview-collapse-head.active { background-image: url('../assets/editor/RS3_BTN_ACCORDION_12.png'), url('../assets/editor/RS3_BTN_ACCORDION_14.png'), url('../assets/editor/RS3_BTN_ACCORDION_13.png'); }
.preview-collapse-head.disabled { color: #777; background-image: url('../assets/editor/RS3_BTN_ACCORDION_18.png'), url('../assets/editor/RS3_BTN_ACCORDION_20.png'), url('../assets/editor/RS3_BTN_ACCORDION_19.png'); }
.preview-collapse .preview-children { height: auto; min-height: 0; overflow: visible; margin-top: 4px; padding: 0 0 0 20px; }
.preview-list { padding: 3px; border: 1px solid #66543a; background: #1b1d1a; }
.preview-list-entry { display: block; min-width: 0; min-height: 28px; padding: 5px 9px; color: #e4d9c4; overflow-wrap: anywhere; }
.preview-list-entry + .preview-list-entry { border-top: 1px solid #514633; }
.preview-list-entry.selected { color: #fff0c7; background: #5c492d; box-shadow: inset 3px 0 #e4b368; }
.preview-sprite-button { display: inline-block; width: 24px; height: 24px; flex: none; background: var(--sprite-neutral) center / 100% 100% no-repeat; }
.preview-sprite-button:not(.is-disabled):hover { background-image: var(--sprite-active); }
.preview-sprite-button.is-disabled { background-image: var(--sprite-disabled); }
.preview-sprite-button.is-disabled.is-toggleable:hover { background-image: var(--sprite-disabled-hover); }
.preview-missing-sprite { display: inline-flex; min-height: 24px; align-items: center; color: #dcb58d; font: 12px "Source Code Pro", monospace; }
.preview-ribbon-button { display: grid; place-items: center; width: 32px; height: 32px; flex: none; background: url('../assets/editor/RS3_BTN_MENU_7_2.png') center no-repeat; }
.preview-ribbon-button:hover:not(.is-disabled):not(.is-active) { background-image: url('../assets/editor/RS3_BTN_MENU_7_1.png'); }
.preview-ribbon-button.is-active { background-image: url('../assets/editor/RS3_BTN_MENU_7_3.png'); }
.preview-ribbon-button.is-disabled { background-image: url('../assets/editor/RS3_BTN_MENU_7_4.png'); }
.preview-ribbon-icon { display: grid; place-items: center; width: 20px; height: 20px; color: #e7d7b0; }
.preview-ribbon-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.preview-sprite { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; padding: 2px; border: 1px dashed #aa916b; color: #e7c991; background: repeating-linear-gradient(45deg, #28271f, #28271f 6px, #343125 6px, #343125 12px); font: 12px "Source Code Pro", monospace; overflow-wrap: anywhere; }
.preview-sprite:empty::before { content: '◇'; font-size: 22px; line-height: 1; }
.preview-slot, .preview-grid-cell { display: flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; border: 2px solid #716047; box-shadow: inset 0 0 0 1px #211f19, inset 0 3px 9px #0009; background: #302e27 url('../assets/editor/RS3_HUD_WINDOW_CONTENT_TILE.png') repeat; color: #e8d8b8; overflow-wrap: anywhere; }
.preview-slot { width: 46px; height: 46px; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 46px)); gap: 3px; min-width: 0; max-width: 100%; }
.preview-grid-cell { min-width: 0; aspect-ratio: 1; }
.preview-grid-cell .preview-slot { width: 100%; height: 100%; border: 0; box-shadow: none; background: transparent; }
.preview-spinner-icon { display: inline-block; position: relative; flex: none; background: url('../assets/editor/RS3_LOADING_SPINNER_PARENT_BACKING.png') center / 100% 100% no-repeat; }
.preview-spinner-child { position: absolute; inset: 0; background: url('../assets/editor/RS3_LOADING_SPINNER_CHILD.png') center / 100% 100% no-repeat; transform: rotate(var(--rotation)); }
.preview-spinner-icon.is-playing .preview-spinner-child { animation: preview-spinner-rotate var(--duration) linear infinite var(--direction); }
@keyframes preview-spinner-rotate { from { transform: rotate(var(--rotation)); } to { transform: rotate(calc(var(--rotation) + 360deg)); } }
@media (prefers-reduced-motion: reduce) { .preview-spinner-icon.is-playing .preview-spinner-child { animation: none; } }
.preview-graph { display: flex; align-items: flex-end; gap: 3px; position: relative; min-height: 72px; padding: 32px 7px 5px; border: 1px solid #796445; border-bottom: 2px solid #c09655; background: linear-gradient(#282720, #1a1d1b); }
.preview-graph-label { position: absolute; top: 6px; left: 7px; right: 7px; color: #e7d7b0; font: 12px Cinzel, serif; }
.preview-graph-bar { flex: 1 1 6px; min-width: 3px; min-height: 2px; background: linear-gradient(90deg, #8a672f, #ebbd6c 48%, #8a672f); }
.preview-colour-swatch { display: inline-block; width: 32px; height: 28px; max-width: 100%; vertical-align: middle; border: 3px solid #716048; box-shadow: inset 0 0 0 1px #171511; background: #b4874c; }
.preview-row > .preview-keybind { position: relative; justify-content: center; padding: 0 24px; min-height: 30px; max-width: 100%; color: #e9e5dd; font: 15px/18px "Noto Sans", sans-serif; overflow-wrap: anywhere; }
.preview-keybind-clear { display: none; position: absolute; right: 8px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); background: url('../assets/editor/RS3_CONTEXTUAL_INPUT_ERROR.png') center no-repeat; }
.preview-keybind:hover .preview-keybind-clear { display: block; }
.preview-keybind:hover { outline: 1px solid #b28751; outline-offset: -1px; }
.preview-spriteButton.is-disabled, .preview-ribbonButton.is-disabled, .preview-collapse.is-disabled { opacity: 1; }
#stage > .preview-view { position: absolute; min-width: 100px; min-height: 56px; max-width: 100%; color: #e7d7b0; font: 15px/1.2 "Noto Sans", sans-serif; box-shadow: 0 12px 26px #000a; }
.preview-view { background: #282922 url('../assets/editor/RS3_HUD_WINDOW_CONTENT_TILE.png') repeat; border: 2px solid #88724f; }
.preview-view > .preview-children { min-height: 52px; padding: 12px; }
#stage > .preview-view.selected { box-shadow: 0 0 18px 6px rgba(226, 179, 110, .58), 0 12px 26px #000a; }
#stage > .preview-root-panel { box-sizing: border-box; min-width: 80px; border: 4px solid transparent; border-image: url('../assets/editor/panel-frame.png') 4 fill / 4px / 0 stretch; background: url('../assets/editor/RS3_HUD_WINDOW_CONTENT_TILE.png') repeat; }
#stage.alt-drag > .preview-root-panel { cursor: move; }
#stage > .preview-view.preview-layer { border-color: #d2a560; }
.preview-layer::before { content: 'Layer'; position: absolute; z-index: 2; top: -24px; left: -2px; padding: 3px 8px; background: #483623; border: 1px solid #d2a560; color: #f2e8d8; font: 11px "Source Code Pro", monospace; pointer-events: none; }
.preview-settings-layer::before { content: 'SettingsLayer'; }
#stage > .preview-layer { box-sizing: border-box; }
.preview-content-layer::before { content: 'ContentLayer'; }
.editor-field { min-width: 0; overflow-wrap: anywhere; }
.editor-field input, .editor-field textarea, .editor-field select { min-width: 0; }
.editor-inspector h2 { font: 700 18px Cinzel, serif; margin: 20px 0 0; color: var(--cream); }
.editor-id { display: block; margin: 0 0 17px; color: #8f806c; text-transform: none; letter-spacing: 0; }
.editor-field { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; color: #c9baa4; font: 12px "Noto Sans", sans-serif; }
.editor-field input, .editor-field textarea, .editor-field select { width: 100%; border: 1px solid #5c4931; border-radius: 0; padding: 8px; color: #f2e8d8; background: #12110f; font: 12px "Source Code Pro", monospace; }
.editor-field textarea { min-height: 80px; resize: vertical; }
.editor-field small { color: #988a78; line-height: 1.5; }
.editor-colour-text { display: flex; flex-direction: column; gap: 4px; }
.editor-colour-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.editor-colour-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.editor-colour-row input[type="color"] { width: 42px; height: 34px; padding: 2px; cursor: pointer; }
.editor-colour-row label { display: flex; align-items: center; gap: 4px; font: 11px "Noto Sans", sans-serif; }
.editor-colour-row input[type="number"] { width: 53px; padding: 6px 2px; text-align: center; appearance: textfield; }
.editor-colour-row input[type="number"]::-webkit-inner-spin-button { appearance: none; }
.editor-colour-controls button { padding: 6px 8px; border: 1px solid #876839; background: #28231c; color: var(--cream); font: 11px "Source Code Pro", monospace; }
.editor-sprite-picker { min-width: 0; }
.editor-sprite-picker summary { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 5px 9px; border: 1px solid #876839; color: var(--cream); background: #28231c; cursor: pointer; font: 12px "Source Code Pro", monospace; }
.editor-sprite-picker summary::after { content: '▾'; margin-left: auto; color: var(--gold-bright); }
.editor-sprite-picker summary img, .editor-sprite-option img { display: block; flex: none; width: 24px; height: 24px; object-fit: contain; }
.editor-sprite-picker > input[type="search"] { margin: 8px 0; }
.editor-sprite-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; max-height: 270px; overflow-y: auto; }
.editor-sprite-option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 57px; padding: 5px 2px; border: 1px solid #5c4931; background: #28231c; color: var(--cream); font: 10px "Source Code Pro", monospace; overflow-wrap: anywhere; }
.editor-sprite-option[aria-pressed="true"] { border-color: var(--gold-bright); background: #483623; }
.editor-sprite-option[hidden], .editor-sprite-empty[hidden] { display: none; }
.editor-advanced { border-top: 1px solid #483625; margin-top: 16px; padding-top: 10px; }
.editor-advanced summary { cursor: pointer; font: 600 11px "Source Code Pro", monospace; color: var(--gold-bright); }
.editor-field input[type="checkbox"] { width: 18px; height: 18px; accent-color: #c49450; }
.inspector-actions { margin-top: 20px; }
.inspector-actions button { padding: 8px 10px; }
.inspector-actions .editor-danger { border-color: #8f5248; }
.editor-name-warning { width: min(520px, calc(100vw - 32px)); max-height: min(85vh, 760px); padding: 28px; border: 1px solid #bd8453; color: var(--cream); background: #211a15; box-shadow: 0 24px 80px #000c; }
.editor-name-warning::backdrop { background: #070605d9; }
.editor-name-warning h2 { margin: 0 0 12px; color: #f2c66d; font: 700 23px Cinzel, serif; }
.editor-name-warning p { margin: 0; line-height: 1.6; color: #e6d7c4; }
.editor-name-warning code { color: #f2c66d; }
.editor-name-warning ul { max-height: 190px; overflow-y: auto; margin: 16px 0 24px; padding: 12px 12px 12px 32px; border: 1px solid #58422e; color: #eed3a4; font: 12px/1.8 "Source Code Pro", monospace; }
.editor-name-warning-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.editor-name-warning-actions button { padding: 12px; font: 600 11px "Source Code Pro", monospace; text-transform: uppercase; }
#name-references-first { border: 1px solid #f2c66d; background: #64492a; color: #fff3d7; }
#continue-unnamed { align-self: center; border: 0; background: transparent; color: #a99c8b; text-decoration: underline; text-underline-offset: 3px; }
.editor-code-dialog { width: min(960px, calc(100vw - 32px)); max-height: min(85vh, 900px); padding: 24px clamp(20px, 3vw, 44px); border: 1px solid #876839; color: var(--cream); background: #1a1713; box-shadow: 0 24px 80px #000c; }
.editor-code-dialog[open] { display: flex; flex-direction: column; gap: 16px; }
.editor-code-dialog::backdrop { background: #070605c9; }
.editor-output-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; align-items: center; }
.editor-code-dialog pre { min-height: 0; overflow: auto; margin: 0; padding: 16px; border: 1px solid #564126; background: #12110f; white-space: pre; }
.editor-output-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.editor-output-actions button, #close-jumpstart { border: 1px solid #876839; background: #28231c; color: var(--cream); padding: 10px 14px; font: 600 11px "Source Code Pro", monospace; text-transform: uppercase; }
.editor-save-dialog { width: min(480px, calc(100vw - 32px)); }
.editor-save-dialog h2 { font-size: clamp(22px, 2.5vw, 29px); }
#save-project-form { display: grid; gap: 10px; }
#save-project-form label { font-size: 13px; }
#save-project-form input { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #876839; background: #12110f; color: var(--cream); font: 14px "Noto Sans", sans-serif; }
#save-project-form p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.editor-jumpstart-dialog { width: min(550px, calc(100vw - 32px)); }
.editor-jumpstart-dialog .editor-output-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.editor-jumpstart-dialog h2 { font-size: clamp(22px, 2.5vw, 29px); }
#jumpstart-form { display: grid; gap: 14px; }
#jumpstart-form label { display: grid; gap: 6px; color: var(--cream); font-size: 13px; }
#jumpstart-form input:not([type="checkbox"]) { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #876839; background: #12110f; color: var(--cream); font: 14px "Noto Sans", sans-serif; }
#jumpstart-form .editor-jumpstart-toggle { display: flex; align-items: center; gap: 8px; }
#jumpstart-form input[type="checkbox"] { width: 18px; height: 18px; accent-color: #c49450; }
#jumpstart-hint { min-height: 1.4em; margin: 0; color: var(--gold-bright); font-size: 12px; }
#download-project { border-color: var(--gold-bright); background: linear-gradient(#66502e, #392d20); }
#download-project:disabled { opacity: .45; cursor: not-allowed; border-color: #876839; background: #28231c; }
#editor-status { position: absolute; z-index: 4; top: 20px; left: 50%; transform: translateX(-50%); box-sizing: border-box; width: max-content; max-width: calc(100% - 24px); margin: 0; padding: 11px 16px; border: 1px solid #f2c66d; border-radius: 4px; background: #17120f; box-shadow: 0 10px 28px #000e; color: #ffe0a0; font: 12px/1.5 "Source Code Pro", monospace; text-align: center; pointer-events: none; animation: editor-toast-in 240ms ease-out both; }
#editor-status:empty { display: none; }
@keyframes editor-toast-in { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { #editor-status { animation: none; } }
@media (max-width: 1250px) { .editor-workspace { grid-template-columns: 200px minmax(0, 1fr) 200px; } }
@media (max-width: 1150px) { .editor-header { grid-template-columns: 1fr; } }
@media (max-width: 1050px) { .editor-workspace { grid-template-columns: 175px minmax(0, 1fr) 190px; } }
@media (max-width: 640px) { .editor-workspace { display: flex; flex-direction: column; } .editor-palette { max-height: none; overflow: visible; border-right: 0; border-bottom: 1px solid #564126; } .editor-category-items { display: flex; flex-wrap: wrap; gap: 5px; } .editor-palette-item { width: auto; } .editor-stage-pane { height: 520px; flex: none; } .editor-field { flex: 1 1 140px; } }
.editor-page.editor-fullscreen-active { overflow: hidden; }
.editor-shell.is-fullscreen { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; width: 100%; height: 100dvh; min-height: 0; overflow: hidden; background: #141310; }
.editor-shell.is-fullscreen .editor-header { flex: none; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; padding: 10px 20px; }
.editor-shell.is-fullscreen .editor-header h1 { font-size: 22px; line-height: 1.2; }
.editor-shell.is-fullscreen .editor-palette .editor-hint { display: none; }
.editor-shell.is-fullscreen .editor-workspace { flex: 1; display: grid; grid-template-columns: 210px minmax(0, 1fr) 224px; grid-template-rows: minmax(0, 1fr); min-height: 0; overflow: hidden; }
.editor-shell.is-fullscreen .editor-palette, .editor-shell.is-fullscreen .editor-inspector { max-height: none; overflow-y: auto; }
.editor-shell.is-fullscreen .editor-inspector { grid-column: auto; border-top: 0; border-left: 1px solid #564126; }
.editor-shell.is-fullscreen #inspector { display: block; }
.editor-shell.is-fullscreen .editor-field { width: auto; }
.editor-shell.is-fullscreen .editor-stage-pane { height: auto; min-height: 0; }
.editor-shell.is-fullscreen .editor-stage-tools { padding: 8px 14px; }
@media (max-width: 850px) {
  .editor-shell { display: grid; place-items: center; height: auto; min-height: calc(100svh - 75px); padding: 32px 20px; }
  .editor-shell.is-fullscreen { position: relative; inset: auto; display: grid; height: auto; min-height: calc(100svh - 75px); overflow: visible; }
  .editor-shell .editor-header, .editor-shell .editor-workspace, .editor-shell.is-fullscreen .editor-header, .editor-shell.is-fullscreen .editor-workspace { display: none; }
  .editor-mobile-message { display: block; width: min(520px, 100%); padding: clamp(24px, 6vw, 40px); border: 1px solid #6b5438; background: radial-gradient(circle at right top, #332a1e, #1a1713 65%); }
  .editor-mobile-message h1 { margin: 0 0 10px; color: var(--cream); font: 700 clamp(24px, 6vw, 34px)/1.25 Cinzel, serif; }
  .editor-mobile-message p { margin: 0; color: var(--muted); font-size: 14px; }
}
