/* threedfish – dark studio theme. One canvas, DOM panels around it. */
:root {
  --bg: #1c1c1e; --bg2: #232326; --bg3: #2b2b2f; --bg4: #343438; --bg5: #3f3f45;
  --line: #121214; --line2: #3a3a40; --text: #e4e4e8; --text2: #a9a9b2; --text3: #77777f;
  --accent: #f2a93b; --accent2: #ffc46b; --sel: #e8862a; --blue: #4f8fd6; --red: #e0514f; --green: #6cbd5a; --axis-x: #e25a56; --axis-y: #86c35b; --axis-z: #5a86e2;
  --radius: 4px; --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; --mono: Consolas, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 12px/1.35 var(--font); overflow: hidden; -webkit-user-select: none; user-select: none; }
button, input, select, textarea { font: inherit; color: inherit; }
#app { display: flex; flex-direction: column; height: 100%; }
#app.novp #topbar, #app.novp #toolbar, #app.novp #sidebar, #app.novp #bottom, #app.novp #timeline-split, #app.novp #statusbar { display: none !important; }
#app.nosidebar #sidebar { display: none; }
#app.notoolbar #toolbar { display: none; }
#app.notimeline #bottom, #app.notimeline #timeline-split { display: none; }

/* ---------------------------------------------------------------- top bar */
#topbar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; min-height: 30px; padding: 1px 8px; background: var(--bg2); border-bottom: 1px solid var(--line); flex: none; }
#topright .tbtn:not(.store) { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 15px; }
@media (max-width: 1250px) { .tbtn.store span { display: none; } #topright .tbtn:not(.store) { max-width: 100px; } #toolopts .lbl { max-width: 90px; } }
#logo { display: flex; align-items: center; gap: 6px; margin-right: 8px; color: var(--accent2); }
#logo b { font-weight: 600; letter-spacing: .2px; }
#menubar { display: flex; gap: 1px; }
.menu-btn { background: none; border: 0; color: var(--text); padding: 4px 9px; border-radius: var(--radius); cursor: default; }
.menu-btn:hover, .menu-btn.open { background: var(--bg4); }
#modebar, #shadingbar, #toolopts, #topright { display: flex; align-items: center; gap: 4px; }
#modebar { margin-left: 10px; flex: none; }
#toolopts { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
#toolopts .num { flex: none; }
#toolopts .tbtn, #toolopts .lbl { flex: none; white-space: nowrap; }
#toolopts .lbl { color: var(--text3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
#shadingbar { margin-left: auto; flex: none; }
#topright { flex: none; }
.seg { display: inline-flex; background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { background: none; border: 0; border-right: 1px solid var(--line); padding: 3px 8px; color: var(--text2); display: inline-flex; align-items: center; gap: 4px; cursor: default; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--bg4); color: var(--text); }
.seg button.on { background: var(--bg5); color: var(--accent2); }
.seg button svg { width: 15px; height: 15px; }
select.sel { background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); padding: 2px 6px; }
.tbtn { background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px 8px; color: var(--text2); display: inline-flex; align-items: center; gap: 5px; cursor: default; }
.tbtn:hover { background: var(--bg4); color: var(--text); }
.tbtn.on { background: var(--bg5); color: var(--accent2); }
.tbtn svg { width: 15px; height: 15px; }
.tbtn.rec.on { color: #fff; background: var(--red); }

/* ---------------------------------------------------------------- dropdown menus */
.dropdown { position: fixed; z-index: 200; min-width: 200px; background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.5); padding: 4px; }
.dropdown .item { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border-radius: 4px; white-space: nowrap; color: var(--text); position: relative; }
.dropdown .item:hover, .dropdown .item.hover { background: var(--blue); color: #fff; }
.dropdown .item.disabled { color: var(--text3); pointer-events: none; }
.dropdown .item .key { margin-left: auto; color: var(--text3); font-size: 11px; padding-left: 20px; }
.dropdown .item:hover .key { color: rgba(255,255,255,.8); }
.dropdown .item .arrow { margin-left: auto; color: var(--text3); }
.dropdown .item .check { width: 12px; display: inline-block; color: var(--accent2); }
.dropdown .item svg { width: 14px; height: 14px; flex: none; opacity: .85; }
.dropdown .sep { height: 1px; background: var(--line2); margin: 4px 6px; }
.dropdown .title { padding: 4px 8px 2px; color: var(--text3); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }

/* ---------------------------------------------------------------- main */
#main { display: flex; flex: 1; min-height: 0; }
#toolbar { width: 40px; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 6px 0; gap: 2px; flex: none; overflow-y: auto; }
#toolbar .tool { width: 32px; height: 32px; border: 0; background: none; border-radius: 6px; color: var(--text2); display: flex; align-items: center; justify-content: center; position: relative; cursor: default; }
#toolbar .tool:hover { background: var(--bg4); color: var(--text); }
#toolbar .tool.on { background: var(--blue); color: #fff; }
#toolbar .tool svg { width: 20px; height: 20px; }
#toolbar .tgap { height: 8px; }
#toolbar .tool .kbd { position: absolute; right: 2px; bottom: 1px; font-size: 8px; color: var(--text3); }
#viewport { position: relative; flex: 1; min-width: 0; background: #3c3c40; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#vp-overlay { position: absolute; inset: 0; pointer-events: none; }
#vp-info { position: absolute; left: 10px; top: 8px; color: rgba(255,255,255,.75); text-shadow: 0 1px 2px rgba(0,0,0,.8); font-size: 12px; line-height: 1.4; white-space: pre; }
#vp-axes { position: absolute; right: 12px; top: 10px; width: 84px; height: 84px; pointer-events: auto; }
#vp-axes svg { width: 100%; height: 100%; }
#vp-axes circle.axis { cursor: pointer; }
#vp-axes text { font-size: 10px; font-weight: 700; fill: #111; pointer-events: none; }
#vp-camframe { position: absolute; border: 1px dashed rgba(255,255,255,.55); box-shadow: 0 0 0 4000px rgba(0,0,0,.5); }
#vp-camframe span { position: absolute; left: 0; top: -18px; color: rgba(255,255,255,.75); font-size: 11px; }
#vp-box { position: absolute; border: 1px dashed #fff; background: rgba(255,255,255,.08); }
#vp-brush { position: absolute; border: 1px solid rgba(255,160,60,.9); border-radius: 50%; transform: translate(-50%, -50%); }
#vp-modal { position: absolute; left: 10px; bottom: 36px; background: rgba(20,20,22,.9); border: 1px solid var(--line2); border-radius: 6px; padding: 6px 10px; font-family: var(--mono); font-size: 12px; color: var(--accent2); }
#vp-lastop { position: absolute; left: 10px; bottom: 10px; width: 250px; background: rgba(28,28,30,.96); border: 1px solid var(--line2); border-radius: 6px; pointer-events: auto; }
#vp-lastop .lo-head { padding: 5px 8px; border-bottom: 1px solid var(--line2); color: var(--text2); display: flex; justify-content: space-between; }
#vp-lastop .lo-body { padding: 4px 8px 6px; }
#vp-lastop.collapsed .lo-body { display: none; }
#vp-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: 11px; background: rgba(0,0,0,.35); padding: 2px 10px; border-radius: 10px; white-space: nowrap; }
#vp-hint:empty { display: none; }
.vp-label { position: absolute; transform: translate(-50%, -140%); color: #fff; font-size: 11px; text-shadow: 0 1px 2px #000; white-space: nowrap; }

/* ---------------------------------------------------------------- side bar */
#sidebar { width: 320px; min-width: 200px; max-width: 60vw; background: var(--bg2); border-left: 1px solid var(--line); display: flex; flex-direction: column; flex: none; }
#outliner { height: 32%; min-height: 60px; }
#properties { flex: 1; min-height: 60px; }
.panel { display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; background: var(--bg3); border-bottom: 1px solid var(--line); color: var(--text2); font-weight: 600; flex: none; }
.panel-tools { display: flex; gap: 2px; }
.panel-tools button { background: none; border: 0; color: var(--text2); padding: 2px; border-radius: 3px; display: flex; }
.panel-tools button:hover { background: var(--bg4); color: var(--text); }
.panel-tools button svg { width: 14px; height: 14px; }
.panel-body { flex: 1; overflow: auto; min-height: 0; }
.vsplit { height: 5px; background: var(--bg); cursor: row-resize; flex: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hsplit { height: 5px; background: var(--bg); cursor: row-resize; flex: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#sidebar-resize { position: absolute; left: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; }
#sidebar { position: relative; }

/* outliner */
.ol-row { display: flex; align-items: center; height: 22px; padding-right: 4px; white-space: nowrap; color: var(--text); }
.ol-row:hover { background: var(--bg3); }
.ol-row.sel { background: #3b3326; }
.ol-row.active { background: #4d3b1f; }
.ol-row .ol-arrow { width: 14px; text-align: center; color: var(--text3); font-size: 9px; flex: none; }
.ol-row .ol-icon { width: 16px; height: 16px; margin-right: 4px; flex: none; }
.ol-row .ol-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ol-row .ol-name input { width: 100%; background: var(--bg); border: 1px solid var(--blue); color: var(--text); padding: 0 3px; border-radius: 3px; }
.ol-row .ol-tog { width: 18px; height: 18px; border: 0; background: none; color: var(--text2); display: flex; align-items: center; justify-content: center; border-radius: 3px; opacity: .8; }
.ol-row .ol-tog svg { width: 13px; height: 13px; }
.ol-row .ol-tog.off { opacity: .3; }
.ol-row .ol-tog:hover { background: var(--bg4); opacity: 1; }
.ol-row.dragover { box-shadow: inset 0 0 0 1px var(--blue); }
.ol-row .ol-mod { color: var(--text3); font-size: 10px; margin-left: 6px; }
.ol-icon.i-mesh { color: #e6b35a; } .ol-icon.i-light { color: #f4e36b; } .ol-icon.i-camera { color: #8fc1f0; } .ol-icon.i-empty { color: #c7c7cf; } .ol-icon.i-mat { color: #d98fd6; } .ol-icon.i-tex { color: #8fd9a8; }

/* properties */
#prop-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 6px; background: var(--bg3); border-bottom: 1px solid var(--line); flex: none; }
#prop-tabs button { background: none; border: 0; border-radius: 4px; width: 26px; height: 24px; color: var(--text2); display: flex; align-items: center; justify-content: center; }
#prop-tabs button:hover { background: var(--bg4); color: var(--text); }
#prop-tabs button.on { background: var(--bg5); color: var(--accent2); }
#prop-tabs button svg { width: 16px; height: 16px; }
#prop-tabs button.disabled { opacity: .3; pointer-events: none; }
.sec { border-bottom: 1px solid var(--line); }
.sec-head { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: var(--bg3); color: var(--text); font-weight: 600; cursor: default; }
.sec-head .sec-arrow { color: var(--text3); font-size: 9px; width: 10px; }
.sec-head .sec-right { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.sec-body { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 4px; }
.sec.closed .sec-body { display: none; }
.row { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.row > label { width: 92px; flex: none; color: var(--text2); text-align: right; padding-right: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .fill { flex: 1; min-width: 0; display: flex; gap: 3px; align-items: center; }
.row .fill > * { flex: 1; min-width: 0; }
.row .keybtn { flex: none !important; width: 16px; height: 16px; border: 0; background: none; color: var(--text3); display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 3px; }
.row .keybtn:hover { color: var(--text); background: var(--bg4); }
.row .keybtn.keyed { color: var(--accent2); }
.row .keybtn.onkey { color: #ffd55a; }
.row .keybtn svg { width: 11px; height: 11px; }
.num { display: flex; align-items: center; height: 22px; background: var(--bg4); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; cursor: ew-resize; }
.num .num-label { position: absolute; left: 6px; color: var(--text3); pointer-events: none; font-size: 11px; }
.num .num-val { flex: 1; text-align: right; padding: 0 6px; font-family: var(--mono); font-size: 11.5px; pointer-events: none; white-space: nowrap; overflow: hidden; }
.num .num-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(79,143,214,.35); pointer-events: none; }
.num.editing { cursor: text; }
.num input { position: absolute; inset: 0; background: var(--bg); border: 1px solid var(--blue); color: var(--text); font-family: var(--mono); padding: 0 6px; text-align: right; outline: none; }
.num:hover { background: var(--bg5); }
.num.ax-x { border-left: 3px solid var(--axis-x); } .num.ax-y { border-left: 3px solid var(--axis-y); } .num.ax-z { border-left: 3px solid var(--axis-z); }
.chk { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.chk input { width: 14px; height: 14px; margin: 0; accent-color: var(--blue); }
.swatch { height: 22px; border-radius: var(--radius); border: 1px solid var(--line); position: relative; overflow: hidden; }
.swatch input[type=color] { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); border: 0; padding: 0; cursor: pointer; background: none; }
.txt { height: 22px; background: var(--bg4); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); padding: 0 6px; outline: none; width: 100%; }
.txt:focus { border-color: var(--blue); }
select.txt { padding: 0 4px; }
.btn { height: 22px; background: var(--bg4); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; cursor: default; }
.btn:hover { background: var(--bg5); }
.btn.primary { background: var(--blue); border-color: #3a6fae; color: #fff; }
.btn.primary:hover { background: #5d9be0; }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.small { height: 18px; padding: 0 6px; font-size: 11px; }
.btn svg { width: 13px; height: 13px; }
.btnrow { display: flex; gap: 4px; flex-wrap: wrap; }
.btnrow .btn { flex: 1; }
.card { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; }
.card-head { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.card-head .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-head .ic { width: 16px; height: 16px; color: var(--accent2); flex: none; }
.card-head button { background: none; border: 0; color: var(--text2); padding: 2px; border-radius: 3px; display: flex; }
.card-head button:hover { background: var(--bg5); color: var(--text); }
.card-head button.off { opacity: .35; }
.card-head button svg { width: 13px; height: 13px; }
.card-body { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.card.closed .card-body { display: none; }
.list { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); max-height: 140px; overflow: auto; }
.list .li { display: flex; align-items: center; gap: 6px; padding: 3px 6px; height: 22px; }
.list .li:hover { background: var(--bg3); }
.list .li.sel { background: #3b3326; }
.list .li .sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line2); flex: none; }
.list .li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .li .cnt { color: var(--text3); font-size: 10px; }
.texthumb { width: 100%; height: 64px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); object-fit: cover; image-rendering: auto; }
.muted { color: var(--text3); }
.small { font-size: 11px; }
.hint { color: var(--text3); font-size: 11px; padding: 6px 8px; line-height: 1.4; }
.slider-row { display: flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- timeline */
#bottom { height: 170px; min-height: 90px; background: var(--bg2); border-top: 1px solid var(--line); display: flex; flex-direction: column; flex: none; }
#bottom-tabs { display: flex; align-items: center; gap: 4px; padding: 2px 8px; border-bottom: 1px solid var(--line); flex: none; height: 28px; overflow: hidden; }
#bottom-tabs button[data-tab] { background: none; border: 0; color: var(--text2); padding: 3px 8px; border-radius: 4px; display: inline-flex; gap: 5px; align-items: center; }
#bottom-tabs button[data-tab]:hover { background: var(--bg4); color: var(--text); }
#bottom-tabs button[data-tab].on { background: var(--bg5); color: var(--accent2); }
#bottom-tabs button svg { width: 13px; height: 13px; }
#bottom-tabs .uv-tools { display: flex; gap: 3px; align-items: center; margin-left: 8px; min-width: 0; overflow: hidden; }
#bottom-tabs .uv-tools .tbtn { padding: 1px 7px; font-size: 11px; white-space: nowrap; }
#bottom-tabs .lbl { color: var(--text3); font-size: 11px; margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#timeline { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#uveditor { flex: 1; min-height: 0; position: relative; }
#uv-canvas { width: 100%; height: 100%; display: block; outline: none; }
#tl-controls { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-bottom: 1px solid var(--line); flex: none; }
#tl-controls .num { width: 70px; }
#tl-controls .gap { width: 10px; }
#tl-controls .tbtn { padding: 2px 6px; }
#tl-controls .lbl { color: var(--text3); margin-left: 4px; }
#tl-canvas { flex: 1; width: 100%; display: block; min-height: 0; }

/* ---------------------------------------------------------------- status bar */
#statusbar { height: 22px; background: var(--bg2); border-top: 1px solid var(--line); display: flex; align-items: center; padding: 0 10px; gap: 20px; color: var(--text2); font-size: 11px; flex: none; }
#st-hint { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#st-hint b { color: var(--text); font-weight: 600; background: var(--bg4); padding: 0 4px; border-radius: 3px; margin-right: 3px; }
#st-stats { font-family: var(--mono); white-space: nowrap; }
#st-links { display: flex; gap: 12px; flex: none; }
#st-links a { color: var(--text3); text-decoration: none; }
#st-links a:hover { color: var(--accent2); text-decoration: underline; }
#splash a, .dialog a { color: var(--accent2); }
.dialog p.links { margin-top: 4px; }
#historylist { max-height: 50vh; }
#historylist .hi { padding: 4px 8px; display: flex; gap: 8px; cursor: default; }
#historylist .hi:hover { background: var(--bg4); }
#historylist .hi.cur { background: var(--bg5); color: var(--accent2); }
#historylist .hi.redo { color: var(--text3); }
#historylist .hi .n { color: var(--text3); font-family: var(--mono); font-size: 10px; width: 28px; flex: none; }

/* ---------------------------------------------------------------- dialogs, toasts, menus */
#dialogs .overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 300; display: flex; align-items: center; justify-content: center; }
.dialog { background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; min-width: 360px; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.dialog .dlg-head { padding: 10px 14px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.dialog .dlg-body { padding: 12px 14px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.dialog .dlg-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 6px; }
.dialog .row > label { width: 120px; }
.dialog p { margin: 0; color: var(--text2); line-height: 1.5; }
.dialog .grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dialog .pcard { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.dialog .pcard:hover { border-color: var(--blue); background: var(--bg4); }
.dialog .pcard img { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; background: var(--bg); }
.dialog .pcard b { font-size: 12px; }
.dialog .pcard span { color: var(--text3); font-size: 11px; }
.dialog .pcard .pc-del { align-self: flex-end; }
.dialog textarea { width: 100%; min-height: 160px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font-family: var(--mono); font-size: 11px; padding: 6px; border-radius: 4px; }
.dialog .dropzone { border: 1px dashed var(--line2); border-radius: 6px; padding: 18px; text-align: center; color: var(--text2); }
.dialog .dropzone.over { border-color: var(--blue); background: rgba(79,143,214,.1); }
.progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--blue); width: 0; transition: width .1s; }
#toasts { position: fixed; left: 50%; top: 40px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 400; pointer-events: none; }
.toast { background: rgba(30,30,34,.96); border: 1px solid var(--line2); border-left: 3px solid var(--blue); color: var(--text); padding: 8px 14px; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.5); animation: toastin .2s ease-out; max-width: 70vw; }
.toast.error { border-left-color: var(--red); } .toast.ok { border-left-color: var(--green); } .toast.warn { border-left-color: var(--accent); }
@keyframes toastin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
#ctxmenu { position: fixed; z-index: 250; }
#palette { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); width: 480px; max-width: 90vw; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); z-index: 350; overflow: hidden; }
#palette input { width: 100%; background: var(--bg); border: 0; border-bottom: 1px solid var(--line); color: var(--text); padding: 10px 12px; font-size: 14px; outline: none; }
#palette .plist { max-height: 50vh; overflow: auto; padding: 4px; }
#palette .pitem { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 4px; }
#palette .pitem.on { background: var(--blue); color: #fff; }
#palette .pitem .pcat { color: var(--text3); font-size: 11px; }
#palette .pitem.on .pcat { color: rgba(255,255,255,.7); }
#palette .pitem .pkey { margin-left: auto; color: var(--text3); font-size: 11px; }
#renderwin { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 320; display: flex; flex-direction: column; }
#renderwin .rw-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--bg2); border-bottom: 1px solid var(--line); }
#renderwin .rw-head b { margin-right: auto; }
#renderwin .rw-body { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 16px; }
#renderwin canvas, #renderwin img, #renderwin video { max-width: 100%; max-height: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.6); background: repeating-conic-gradient(#555 0 25%, #444 0 50%) 0 0 / 16px 16px; }
#renderwin .rw-foot { padding: 6px 14px; background: var(--bg2); border-top: 1px solid var(--line); color: var(--text2); display: flex; gap: 10px; align-items: center; }
#keymap { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 330; display: flex; align-items: center; justify-content: center; }
#keymap .km { background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; width: 900px; max-width: 94vw; max-height: 90vh; overflow: auto; padding: 16px 20px; }
#keymap h2 { margin: 0 0 10px; font-size: 15px; }
#keymap .cols { columns: 3; column-gap: 24px; }
#keymap h3 { font-size: 12px; margin: 8px 0 4px; color: var(--accent2); break-after: avoid; }
#keymap .k { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; color: var(--text2); break-inside: avoid; }
#keymap .k b { color: var(--text); font-weight: 500; font-family: var(--mono); font-size: 11px; white-space: nowrap; }
#splash { position: fixed; inset: 0; background: var(--bg); z-index: 500; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: var(--text2); }
#splash .big { font-size: 28px; color: var(--accent2); font-weight: 600; }
kbd { font-family: var(--mono); background: var(--bg4); border: 1px solid var(--line2); border-radius: 3px; padding: 0 4px; font-size: 11px; }
::-webkit-scrollbar { width: 9px; height: 9px; } ::-webkit-scrollbar-thumb { background: var(--bg5); border-radius: 5px; border: 2px solid var(--bg2); } ::-webkit-scrollbar-track { background: transparent; }
