:root { --bg: #1b1e24; --panel: #232730; --line: #333945; --accent: #4a9eff; --text: #d6dae0; --muted: #8a929e; --warn: #e2b34a; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 system-ui, sans-serif; overflow: hidden; }
button { font: inherit; color: var(--text); background: #242832; border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; cursor: pointer; }
button:hover { background: #2c313d; }
button.primary { background: var(--accent); border-color: var(--accent); color: #04101f; font-weight: 600; }
button.primary:hover { background: #5aa8ff; }
button.active { outline: 2px solid var(--accent); }
button:disabled { opacity: 0.4; cursor: default; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=search], input[type=text], select { font: inherit; color: var(--text); background: #242832; border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#main { flex: 1; display: flex; min-height: 0; }
.panel { background: var(--panel); overflow-y: auto; scrollbar-gutter: stable; }
#topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 12px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 5; }
#brand { display: flex; align-items: center; gap: 8px; margin-right: 2px; user-select: none; color: inherit; text-decoration: none; }
#brand img { height: 32px; width: 32px; border-radius: 6px; display: block; }
#brand .brand-sub { font-weight: 400; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
#topbar #helpBtn { font-weight: 700; min-width: 30px; }
#vehiclebar { position: relative; display: flex; align-items: center; gap: 6px; margin: 0 auto; }
#vehiclebar button { padding: 4px 10px; }
#vehpick { min-width: 200px; max-width: 340px; text-align: left; background: #242832; border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#vehpick::after { content: ' \25BE'; color: var(--muted); }
#vehpanel { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 40; width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); padding: 6px; }
#vehpanel input[type=search] { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
#vehlist { max-height: 55vh; overflow-y: auto; }
#vehlist .veh-head { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin: 8px 4px 3px; }
#vehlist .veh-opt { padding: 4px 8px; border-radius: 4px; font-size: 13px; cursor: pointer; }
#vehlist .veh-opt:hover, #vehlist .veh-opt.active { background: #232833; }
#vehlist .veh-opt.current { color: var(--accent); }
#vehlist .veh-badge { float: right; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 8px; line-height: 15px; }
#vehlist .veh-empty { color: var(--muted); padding: 6px 8px; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
#importPanel, #exportPanel { position: absolute; top: 50px; right: 12px; z-index: 30; width: 360px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; box-shadow: 0 10px 34px #0009; }
#importPanel[hidden], #exportPanel[hidden] { display: none; }
#importPanel textarea, #exportPanel textarea { width: 100%; height: 76px; background: #0e1116; color: #9fb4c8; border: 1px solid var(--line); border-radius: 5px; font: 11px/1.3 Consolas, monospace; padding: 6px; resize: vertical; }
.panel-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
#left { width: 300px; flex: none; border-right: 1px solid var(--line); position: relative; display: flex; flex-direction: column; overflow: hidden; }
#left.collapsed { width: 36px; scrollbar-gutter: auto; }
#left.collapsed .left-body { display: none; }
#leftToggle { flex: none; align-self: center; width: 26px; height: 26px; border-radius: 50%; padding: 0; font-size: 15px; line-height: 1; }
#left.collapsed #ltabs { padding: 8px 0; justify-content: center; }
#left.collapsed #ltabs button[data-tab] { display: none; }
.left-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#ltabs { display: flex; gap: 4px; padding: 10px 10px 6px; flex: none; }
#ltabs button[data-tab] { flex: 1; padding: 5px 0; font-size: 12px; }
#ltabs button.active { outline: 2px solid var(--accent); color: #fff; }
#decalsView { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#decalsView[hidden], #groupsView[hidden] { display: none; }
#catTabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 4px 10px; flex: none; }
#catTabs button { padding: 3px 4px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#catTabs button.active { outline: 2px solid var(--accent); }
.cat-sep { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.cat-sep::before, .cat-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
#palette { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px; padding: 6px 10px; align-content: start; }
.pal-sec { grid-column: 1 / -1; margin: 4px 0 0; padding-bottom: 2px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
#palette .cell { aspect-ratio: 1; background: #3a3f48 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Crect width='6' height='6' fill='%23474d57'/%3E%3Crect x='6' y='6' width='6' height='6' fill='%23474d57'/%3E%3C/svg%3E"); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; padding: 3px; }
#palette .cell img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 1px #000); }
#palette .cell.sel { outline: 2px solid var(--accent); }
#groupsView { flex: 1; overflow-y: auto; }
#groupSaveRow { display: flex; gap: 6px; padding: 8px 10px 6px; border-bottom: 1px solid var(--line); }
#groupSaveRow input { flex: 1; min-width: 0; }
#groupSaveRow button { flex: none; }
#groupFilterRow { display: flex; gap: 6px; padding: 6px 10px 0; }
#groupFilterRow input { flex: 1; min-width: 0; }
#groupFilterRow button { flex: none; }
#groupFolders { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
#groupFolders .gf-chip { padding: 2px 8px; font-size: 11px; border: 1px solid var(--line); border-radius: 10px; background: #242832; color: var(--muted); cursor: pointer; }
#groupFolders .gf-chip:hover { color: var(--text); }
#groupFolders .gf-chip.active { color: var(--text); border-color: var(--accent); background: #2b3646; }
#groupFolders .gf-tool { padding: 2px 6px; }
#groupFolders .gf-new { border-style: dashed; }
#groupFolders .gf-vehicle { border-color: var(--accent); }
#sceneWrap { flex: 1; min-width: 280px; display: flex; flex-direction: column; }
#scene { flex: 1; position: relative; overflow: hidden; }
#scene.placing { cursor: crosshair; }
#scene canvas { display: block; }
.stage-unsupported { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: 420px; display: flex; flex-direction: column; gap: 8px; padding: 18px 22px; background: rgba(24, 27, 34, .92); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; line-height: 1.5; color: var(--text); text-align: center; }
#perfmode { position: absolute; top: 8px; right: 8px; z-index: 5; padding: 3px 8px; background: rgba(24, 27, 34, .85); border: 1px solid #d9a514; border-radius: 6px; color: #f2c744; font-size: 11px; line-height: 1.4; cursor: pointer; user-select: none; }
#perfmode:hover { background: rgba(36, 40, 50, .95); color: #ffd75e; }
.stage-unsupported b { font-size: 15px; }
#viewBar { position: absolute; right: 12px; bottom: 12px; z-index: 4; display: flex; gap: 4px; opacity: 0.62; transition: opacity 0.15s; }
#viewBar:hover, #viewBar:focus-within { opacity: 1; }
#viewBar button { padding: 3px 9px; font-size: 12px; }
#viewBar #viewReset { font-size: 14px; line-height: 1; padding: 3px 8px; }
#wheelviewBar:not([hidden]) { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: rgba(24, 27, 34, .88); border: 1px solid var(--line); border-radius: 8px; }
#wheelviewBar button { padding: 3px 9px; font-size: 12px; }
#wheelviewBar #wvLabel { font-size: 12px; color: var(--text); min-width: 80px; text-align: center; }
#bottombar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 12px; background: var(--panel); border-top: 1px solid var(--line); flex: none; position: relative; }
#bottombar .clr-field { flex: none; width: 106px; }
#bottombar .clr-field input { width: 100%; height: 24px; padding: 1px 26px 1px 6px; font-size: 11px; }
#bottombar .bar-sep { width: 2px; height: 26px; background: #4b5260; border-radius: 1px; margin: 0 4px; flex: none; }
#guidesLabel { display: flex; align-items: center; gap: 4px; cursor: pointer; }
#gridrow { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
#gridrow[hidden] { display: none; }
#gridrow input[type=range] { width: 92px; }
.bar-group { position: relative; display: flex; align-items: center; gap: 2px; flex: none; }
.bar-trigger, .bar-caret { display: flex; align-items: center; gap: 5px; padding: 4px 8px; font-size: 12px; white-space: nowrap; }
.bar-caret { padding: 4px 5px; }
.bar-trigger[aria-expanded=true], .bar-caret[aria-expanded=true] { background: #2c313d; border-color: var(--accent); }
.bar-trigger .caret, .bar-caret .caret { color: var(--muted); font-size: 10px; line-height: 1; }
.bar-trigger .chip { width: 12px; height: 12px; border: 1px solid var(--line); border-radius: 3px; background: #f0c020; flex: none; }
.bar-trigger .dot, .bar-caret .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }
.bar-trigger .dot[hidden], .bar-caret .dot[hidden] { display: none; }
.bar-pop { position: absolute; bottom: calc(100% + 12px); left: 0; z-index: 30; display: flex; flex-direction: column; gap: 7px; min-width: 190px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 34px #0009; font-size: 12px; }
.bar-pop[hidden] { display: none; }
.bar-pop label { display: flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.bar-pop .pop-row { display: flex; align-items: center; gap: 8px; }
.bar-pop .pop-row[hidden] { display: none; }
.bar-pop .pop-row > label { width: 74px; flex: none; cursor: default; }
.pop-reset { flex: none; padding: 3px 8px; font-size: 13px; line-height: 1; }
.bar-pop .pop-note { margin: 0; color: var(--muted); font-size: 11px; max-width: 210px; }
.bar-pop .pop-note[hidden] { display: none; }
#clr-picker { z-index: 60; }
#gridrow #guidespaceVal { min-width: 42px; font-size: 11px; color: var(--text); text-align: right; }
.bar-spacer { flex: 1; }
#bottombar label { white-space: nowrap; flex: none; }
#bottombar select { flex: none; }
#guidespace { width: 90px; }
#sceneWrap { container-type: inline-size; }
#hint { position: absolute; left: 12px; bottom: 12px; z-index: 4; max-width: min(46%, 540px); background: rgba(16, 21, 29, .85); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12px; line-height: 1.45; color: var(--text); pointer-events: none; }
#shortcutsPop { position: absolute; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; box-shadow: 0 10px 34px #0009; font-size: 12px; cursor: grab; user-select: none; touch-action: none; }
#shortcutsPop.dragging { cursor: grabbing; }
#shortcutsPop[hidden] { display: none; }
#shortcutsPop div { margin: 4px 0; }
#shortcutsPop kbd { background: #0e1116; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font: 11px/1.5 Consolas, monospace; }
#right { width: 300px; flex: none; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
#layersBlock { display: flex; flex-direction: column; min-height: 0; flex: none; height: var(--layersH, 300px); }
#layersBlock.folded { height: auto !important; }
#layersHead { display: flex; align-items: center; gap: 6px; padding: 12px 12px 4px; cursor: pointer; user-select: none; flex: none; }
#layersHead h2 { flex: none; }
#layersHead .sub { font-size: 12px; }
#selAllWrap { display: flex; align-items: center; flex: none; cursor: default; }
#selAllWrap input { margin: 0; cursor: pointer; }
#selAllWrap input:disabled { cursor: default; }
#layersHead .count { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
#layersHead .count.over { color: var(--warn); }
#layersHead #clearAll { margin-left: auto; white-space: nowrap; }
#layersHead .fold { color: var(--muted); font-size: 14px; line-height: 1; flex: none; }
.link-btn { background: none; border: none; color: var(--muted); padding: 0 4px; font-size: 12px; cursor: pointer; }
.link-btn:hover { color: var(--text); background: none; }
#layers { flex: 1; overflow-y: auto; padding: 2px 8px 8px; min-height: 0; }
#layersBlock.folded #layers { display: none; }
#layers .item { display: flex; align-items: center; gap: 6px; padding: 3px 5px; border-radius: 4px; cursor: pointer; position: relative; }
#layers .item:hover { background: #232833; }
#layers .item .grip { flex: none; width: 9px; height: 15px; cursor: grab; color: var(--muted); background-image: radial-gradient(currentColor 1.1px, transparent 1.4px); background-size: 5px 5px; background-position: 0 1px; }
#layers .item:hover .grip { color: var(--text); }
#layers .item.dragging { opacity: 0.4; }
#layers .item.dragging .grip { cursor: grabbing; }
#layers .item.drop-above::after, #layers .item.drop-below::after { content: ''; position: absolute; left: 2px; right: 2px; height: 2px; border-radius: 1px; background: var(--accent); pointer-events: none; }
#layers .item.drop-above::after { top: -1px; }
#layers .item.drop-below::after { bottom: -1px; }
#layers .item.sel { background: #2b3646; }
#layers .item.primary { box-shadow: inset 0 0 0 1px var(--accent); }
#layers .item.hover { background: #0f3b46; box-shadow: inset 0 0 0 1px var(--accent); }
#layers .item input[type=checkbox] { flex: none; margin: 0; cursor: pointer; }
#layers .item .thumb { width: 26px; height: 26px; flex: none; border: 1px solid var(--line); border-radius: 4px; background: #3a3f48 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Crect width='5' height='5' fill='%23474d57'/%3E%3Crect x='5' y='5' width='5' height='5' fill='%23474d57'/%3E%3C/svg%3E"); display: flex; align-items: center; justify-content: center; }
#layers .item .thumb img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 1px #000); }
#layers .item .sw { width: 12px; height: 12px; border-radius: 3px; border: 1px solid #0006; flex: none; }
#layers .item .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--muted); }
#layers .item .sp { flex: 1; }
#layers .item .btn { color: var(--muted); width: 16px; height: 16px; position: relative; flex: none; background: none; border: none; padding: 0; cursor: pointer; }
#layers .item .btn:hover { color: var(--text); background: none; }
#layers .item .lock { font-size: 10px; line-height: 1; filter: grayscale(1) opacity(0.4); }
#layers .item .lock[aria-pressed="true"] { filter: none; }
#layers .item .eye { font-size: 10px; line-height: 1; filter: grayscale(1) opacity(0.4); }
#layers .item .eye[aria-pressed="true"] { filter: none; }
#layers .item.ghost { opacity: 0.55; }
#layers .item .del:disabled { opacity: 0.25; cursor: not-allowed; }
#layers .item .pos { width: 34px; flex: none; padding: 1px 4px; font: 11px/1.4 inherit; font-size: 11px; text-align: right; color: var(--text); background: #242832; border: 1px solid var(--line); border-radius: 4px; }
#layers .item .pos::-webkit-outer-spin-button, #layers .item .pos::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#layers .item .pos { appearance: textfield; -moz-appearance: textfield; }
#layers .item.over .pos { color: var(--warn); }
#props.locked > *:not(#propsTitle):not(#lockedNote) { opacity: 0.45; pointer-events: none; }
.locked-note { margin: 0 12px 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 11px; line-height: 1.4; }
#layers .item .top::before, #layers .item .bot::before { content: ''; position: absolute; top: 50%; left: 50%; border: 4px solid transparent; }
#layers .item .top::before { border-bottom-color: currentColor; transform: translate(-50%, -30%); }
#layers .item .bot::before { border-top-color: currentColor; transform: translate(-50%, -70%); }
#layers .item .top::after, #layers .item .bot::after { content: ''; position: absolute; left: 50%; width: 9px; height: 2px; background: currentColor; transform: translateX(-50%); }
#layers .item .top::after { top: 2px; }
#layers .item .bot::after { bottom: 2px; }
#layers .item .del::before, #layers .item .del::after { content: ''; position: absolute; top: 50%; left: 50%; width: 11px; height: 2px; background: currentColor; }
#layers .item .del::before { transform: translate(-50%, -50%) rotate(45deg); }
#layers .item .del::after { transform: translate(-50%, -50%) rotate(-45deg); }
#layers .empty { color: var(--muted); padding: 6px; }
#layers .item.missing .nm { text-decoration: underline dotted; text-underline-offset: 2px; }
#layers .item .unk { flex: none; width: 14px; text-align: center; color: var(--warn); font-weight: 600; cursor: help; }
#layers .item.over { opacity: 0.5; }
#layers .item .overbadge { flex: none; font-size: 9px; color: var(--warn); border: 1px solid var(--warn); border-radius: 3px; padding: 0 3px; letter-spacing: .02em; }
#layers .limitrule { display: flex; align-items: center; gap: 8px; color: var(--warn); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; margin: 6px 4px 4px; }
#layers .limitrule::before, #layers .limitrule::after { content: ''; flex: 1; height: 1px; background: var(--warn); opacity: .5; }
#layers .grphead { display: flex; align-items: center; gap: 6px; padding: 3px 5px; border-radius: 4px; cursor: pointer; position: relative; user-select: none; }
#layers .grphead:hover { background: #232833; }
#layers .grphead.sel { background: #2b3646; }
#layers .grphead.dragging { opacity: 0.4; }
#layers .grphead .btn { color: var(--muted); width: 16px; height: 16px; flex: none; background: none; border: none; padding: 0; cursor: pointer; }
#layers .grphead .btn:hover { color: var(--text); background: none; }
#layers .grphead .caret { font-size: 11px; line-height: 1; }
#layers .grphead .gname { min-width: 0; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#layers .grphead .gname-edit { flex: 1; min-width: 0; font-size: 12px; padding: 0 4px; color: var(--text); background: #242832; border: 1px solid var(--accent); border-radius: 4px; }
#layers .grphead .gcount { flex: none; font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 0 5px; font-variant-numeric: tabular-nums; }
#layers .grphead .sp { flex: 1; }
#layers .grphead .gsave, #layers .grphead .gungroup { font-size: 10px; line-height: 1; filter: grayscale(1) opacity(0.6); }
#layers .grphead .gsave:hover, #layers .grphead .gungroup:hover { filter: none; }
#layers .item.ingroup { padding-left: 19px; }
#layers .item.ingroup::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 1px; background: var(--line); }
#layers .item.drop-into { box-shadow: inset 0 0 0 2px var(--accent); background: #2b3646; }
#splitter { flex: none; height: 13px; cursor: row-resize; position: relative; display: flex; align-items: center; justify-content: center; }
#splitter::before { content: ''; position: absolute; left: 12px; right: 12px; top: 6px; height: 1px; background: var(--line); }
#splitter::after { content: ''; position: relative; width: 46px; height: 5px; border-radius: 3px; background: #3f4654; border: 1px solid var(--line); }
#splitter:hover::after, #splitter.dragging::after { background: var(--accent); border-color: var(--accent); }
#propsScroll { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 12px; }
#propsScroll h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 12px 6px; }
#emptyState .tip { color: var(--muted); padding: 4px 12px 8px; line-height: 1.5; margin: 0; }
#emptyState .tip b { color: var(--text); }
.row { padding: 4px 12px; }
.row label { display: block; color: var(--muted); margin-bottom: 2px; }
.row input[type=range] { width: 100%; }
.row .val { float: right; color: var(--text); }
.row input.val { width: 78px; background: #0e1116; border: 1px solid var(--line); border-radius: 4px; font: inherit; padding: 0 5px; text-align: right; }
.row input.val:focus { outline: 1px solid var(--accent); }
.row input.val::-webkit-outer-spin-button, .row input.val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.row input.val[type=number] { appearance: textfield; -moz-appearance: textfield; }
.propgrp { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; padding: 12px 12px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
#props > .propgrp:first-of-type { border-top: none; margin-top: 0; }
.stepblock { border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.stepbar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; user-select: none; }
.stepbar .steplbl { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.stepbar .chev { color: var(--muted); font-size: 14px; line-height: 1; transition: transform .15s; }
.stepblock.open .stepbar .chev { transform: rotate(90deg); }
.stepbar .summary { margin-left: auto; font: 11px/1 Consolas, monospace; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepblock.open .stepbar .summary { display: none; }
.stepbody { display: none; padding: 0 12px 10px; }
.stepblock.open .stepbody { display: block; }
.steprow { display: grid; grid-template-columns: 58px 1fr 58px; align-items: center; gap: 7px; padding: 4px 0; }
.steprow .cat { color: var(--text); font-size: 12px; cursor: help; border-bottom: 1px dotted var(--line); justify-self: start; }
.seg { display: flex; width: 100%; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { flex: 1; background: #242832; color: var(--muted); border: none; border-right: 1px solid var(--line); padding: 4px 0; font: 11px/1 system-ui, sans-serif; cursor: pointer; }
.seg button:last-child { border-right: none; }
.seg button:hover { color: var(--text); background: #2c313d; }
.seg button.on { background: var(--accent); color: #04101f; font-weight: 700; }
.stepnum { width: 58px; background: var(--field, #0e1116); border: 1px solid var(--line); border-radius: 4px; text-align: right; padding: 3px 5px; font: 12px/1.2 Consolas, monospace; color: var(--text); font-variant-numeric: tabular-nums; }
.stepnum:focus { outline: 1px solid var(--accent); }
.stepnum::-webkit-outer-spin-button, .stepnum::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepnum { appearance: textfield; -moz-appearance: textfield; }
.stepnum.custom { border-color: var(--accent); color: var(--accent); }
.save-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); letter-spacing: .02em; margin-right: 2px; user-select: none; }
.save-state .dot { width: 7px; height: 7px; border-radius: 50%; background: #3ecf6a; transition: background .3s; }
.save-state.saving .dot { background: var(--warn); }
.save-state.failed .dot { background: #dc4d4d; }
.sctrl { display: flex; align-items: center; gap: 5px; }
.sctrl input[type=range] { flex: 1; min-width: 34px; }
.sctrl .stepbtn { padding: 1px 8px; font-size: 15px; line-height: 1.1; min-width: 26px; }
.sctrl .snapbtn { padding: 1px 5px; font-size: 11px; line-height: 1.1; min-width: 24px; }
.sctrl .lockbtn { padding: 1px 4px; font-size: 12px; line-height: 1.1; min-width: 22px; filter: grayscale(1) opacity(0.55); }
.sctrl .lockbtn.on { filter: none; outline: 2px solid var(--accent); }
.flags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; padding: 4px 12px; }
.flags label { color: var(--text); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack { display: flex; gap: 6px; padding: 4px 12px; }
.stack button { flex: 1; }
#usedColors { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0; }
#usedColors .uc { width: 18px; height: 18px; border-radius: 4px; border: 1px solid #0006; padding: 0; min-width: 0; }
#usedColors .uc:hover { outline: 2px solid var(--accent); }
.tool-row { display: flex; align-items: center; gap: 6px; }
.tool-row .clr-field { flex: 1; min-width: 0; }
.tool-row .clr-field input { width: 100%; height: 26px; padding: 1px 26px 1px 6px; font-size: 11px; }
.tool-row input[type=number], .tool-row input[type=text] { flex: 1; min-width: 0; background: #0e1116; border: 1px solid var(--line); border-radius: 4px; font: inherit; color: var(--text); padding: 3px 6px; }
.tool-row button { padding: 3px 10px; white-space: nowrap; }
#groupTools { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 2px; }
#groupTools[hidden] { display: none; }
.grouponly-tag { color: var(--accent); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 12px 2px; }
#groupList { padding: 6px 10px 8px; }
#groupList .empty { color: var(--muted); padding: 4px 6px; font-size: 12px; }
#groupList .grp { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 4px; }
#groupList .grp:hover { background: #232833; }
#groupList .grp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#groupList .grp-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#groupList .grp-meta { color: var(--muted); font-size: 11px; }
#groupList .grp-thumbs { display: flex; gap: 2px; flex: none; }
#groupList .grp-thumbs img { width: 16px; height: 16px; object-fit: contain; filter: drop-shadow(0 0 1px #000); }
#groupList .grp-load { padding: 2px 8px; font-size: 12px; flex: none; }
#groupList .grp-share { padding: 2px 7px; font-size: 12px; flex: none; color: var(--muted); }
#groupList .grp-share:hover { color: var(--text); }
#groupList .grp-del { padding: 2px 7px; font-size: 12px; flex: none; color: var(--muted); }
#groupList .grp-del:hover { color: var(--text); }
#groupList .grp-tagrow { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
#groupList .grp-tag { padding: 0 6px; font-size: 10px; border: 1px solid var(--line); border-radius: 8px; background: #242832; color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
#groupList .grp-tag:hover { color: var(--text); border-color: var(--accent); }
#groupList .grp-folder { font-size: 10px; padding: 0 2px; max-width: 90px; color: var(--muted); background: #242832; border: 1px solid var(--line); border-radius: 4px; }
#toast { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); z-index: 60; background: #10151d; border: 1px solid var(--accent); color: var(--text); border-radius: 7px; padding: 8px 16px; box-shadow: 0 8px 30px #000a; opacity: 0; transition: opacity .18s; pointer-events: none; max-width: 70vw; text-align: center; }
#toast.show { opacity: 1; }
#toast.warn { border-color: var(--warn); }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
#modal, #confirm { position: fixed; inset: 0; z-index: 50; background: #000a; display: flex; align-items: center; justify-content: center; }
#modal[hidden], #confirm[hidden] { display: none; }
.confirm-box { width: min(440px, 92vw); }
.confirm-box h3 { margin: 0 0 10px; font-size: 15px; }
.confirm-box p { margin: 0 0 16px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-box { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: min(600px, 92vw); max-height: 82vh; overflow-y: auto; padding: 22px 26px; }
.modal-x { position: absolute; top: 8px; right: 10px; min-width: 30px; font-size: 18px; line-height: 1; }
.modal-body h3 { margin: 0 30px 12px 0; font-size: 16px; }
.modal-body h4 { margin: 16px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.modal-body ul { margin: 4px 0 8px; padding-left: 18px; }
.modal-body li { margin: 3px 0; line-height: 1.5; }
.modal-body b { color: var(--text); }
.modal-body kbd { background: #0e1116; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font: 11px/1.4 Consolas, monospace; }
.modal-body .disclaimer { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 4px 0 0; }
.modal-body .credit { color: var(--muted); font-style: italic; }
.modal-body .who { color: var(--accent); font-weight: 600; font-style: normal; }
.modal-body a { color: var(--accent); }
@media (max-width: 1120px) { #left { width: 250px; } #right { width: 264px; } #layersHead .sub { display: none; } }
@media (max-width: 940px)  { #left { width: 212px; } #right { width: 236px; } }
.coach { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; animation: coachpulse 1.6s ease-in-out infinite; }
@keyframes coachpulse { 0%, 100% { outline-color: var(--accent); } 50% { outline-color: color-mix(in srgb, var(--accent) 35%, transparent); } }
#hint.fresh { animation: hintfade .45s ease; }
@keyframes hintfade { from { opacity: .15; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .coach { animation: none; }
  #hint.fresh { animation: none; }
}
.muted { color: var(--muted); }
.sub { font-weight: 400; text-transform: none; color: var(--muted); }
.val.note { font-weight: 400; }
.wide { width: 100%; }
.clr-field { display: block; }
.clr-field input { font: 12px/1.4 Consolas, monospace; text-transform: lowercase; }
.row.colorrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.row.colorrow > label { display: block; width: 100%; margin-bottom: 2px; }
.row.colorrow .clr-field { flex: 1; min-width: 0; }
.row.colorrow .clr-field input { width: 100%; padding-right: 28px; }
.eyedrop { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; padding: 0; background: #242832; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); cursor: pointer; }
.eyedrop:hover { color: var(--text); }
#bottombar .eyedrop { width: 24px; height: 24px; }
#partsView { flex: 1; padding: 6px 10px 8px; overflow-y: auto; }
.parts-note { color: var(--muted); font-size: 12px; margin: 4px 2px 8px; }
#partsActions { display: flex; gap: 6px; margin-bottom: 8px; }
#partsActions button { flex: 1; padding: 4px 0; font-size: 12px; }
.parts-head { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin: 8px 2px 3px; }
.parts-row { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.parts-row:hover { background: #232833; }
.parts-row input { flex: none; }
.parts-row-wheel span { flex: none; }
.parts-row-wheel select { flex: 1; min-width: 0; font-size: 12px; padding: 2px 4px; }
.parts-wheelview { margin: 8px 2px; }
.parts-wheelview button { width: 100%; padding: 4px 0; font-size: 12px; }
#app.photo #topbar, #app.photo #left, #app.photo #right, #app.photo #bottombar,
#app.photo #viewBar, #app.photo #wheelviewBar, #app.photo #hint, #app.photo #perfmode,
#app.photo #refPanel, #app.photo #shortcutsPop, #app.photo #importPanel, #app.photo #exportPanel { display: none; }
#photobar:not([hidden]) { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; max-width: calc(100% - 24px); padding: 8px 12px; background: rgba(24, 27, 34, .92); border: 1px solid var(--line); border-radius: 10px; }
#photobar[hidden] { display: none; }
#photobar .photo-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
#photobar button { white-space: nowrap; }
#photoBadge:not([hidden]) { position: absolute; left: 14px; bottom: 14px; z-index: 5; display: flex; flex-direction: column; gap: 4px; padding: 6px 11px 6px 6px; background: rgba(13, 17, 23, .66); border-radius: 8px; pointer-events: none; user-select: none; font-size: 12px; font-weight: 600; color: #d6dae0; }
#photoBadge[hidden] { display: none; }
#photoBadge .badge-row { display: flex; align-items: center; gap: 7px; }
#photoBadge .badge-row img { width: 21px; height: 21px; border-radius: 5px; display: block; }
#photoBadge .badge-sub { font-size: 11px; font-weight: 500; color: #aab3bf; }
#photoBadge .badge-sub img { width: 16px; height: 16px; border-radius: 0; margin: 0 2.5px; }
#refPanel:not([hidden]) { position: absolute; z-index: 7; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 34px #0009; overflow: hidden; }
#refPanel[hidden] { display: none; }
#refPanel.seethrough { background: transparent; box-shadow: none; }
#refPanel.seethrough #refImgWrap { background: none; }
#refPanel.dropping { outline: 2px dashed var(--accent); outline-offset: -2px; }
#refHead { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; background: var(--panel); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; flex: none; }
#refHead .ref-title { flex: 1; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
#refHead button { padding: 2px 8px; font-size: 12px; flex: none; }
#refHead #refClose { min-width: 26px; padding: 2px 6px; font-size: 14px; line-height: 1; }
#refBody { flex: 1; min-height: 0; display: flex; }
#refEmpty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; color: var(--muted); font-size: 12px; }
#refEmpty[hidden] { display: none; }
#refEmpty p { margin: 0; line-height: 1.5; }
#refEmpty kbd { background: #0e1116; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font: 11px/1.5 Consolas, monospace; }
#refEmpty .ref-note { font-size: 11px; }
#refImgWrap { flex: 1; position: relative; overflow: hidden; cursor: grab; touch-action: none; background: #22262e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23292e37'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23292e37'/%3E%3C/svg%3E"); }
#refImgWrap[hidden] { display: none; }
#refImgWrap.panning { cursor: grabbing; }
#refImg { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; }
#refFoot { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); border-top: 1px solid var(--line); flex: none; }
#refFoot label { font-size: 11px; flex: none; }
#refFoot input[type=range] { flex: 1; min-width: 60px; }
#refResize { flex: none; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; background: var(--muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 3h5v5'/%3E%3Cpath d='M17 21h2a2 2 0 0 0 2-2'/%3E%3Cpath d='M21 12v3'/%3E%3Cpath d='m21 3-5 5'/%3E%3Cpath d='M3 7V5a2 2 0 0 1 2-2'/%3E%3Cpath d='m5 21 4.144-4.144a1.21 1.21 0 0 1 1.712 0L13 19'/%3E%3Cpath d='M9 3h3'/%3E%3Crect x='3' y='11' width='10' height='10' rx='1'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 3h5v5'/%3E%3Cpath d='M17 21h2a2 2 0 0 0 2-2'/%3E%3Cpath d='M21 12v3'/%3E%3Cpath d='m21 3-5 5'/%3E%3Cpath d='M3 7V5a2 2 0 0 1 2-2'/%3E%3Cpath d='m5 21 4.144-4.144a1.21 1.21 0 0 1 1.712 0L13 19'/%3E%3Cpath d='M9 3h3'/%3E%3Crect x='3' y='11' width='10' height='10' rx='1'/%3E%3C/svg%3E") center / contain no-repeat; }
#refResize:hover { background: var(--accent); }
#sceneLoading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(24, 27, 34, .88); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text); pointer-events: none; }
#sceneLoading .spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: scene-spin .8s linear infinite; }
@keyframes scene-spin { to { transform: rotate(360deg); } }
#sceneLoading[hidden] { display: none; }
