:root {
  --panel: rgba(22, 26, 34, 0.9); --panel-solid: #161a22; --line: rgba(255, 255, 255, 0.09);
  --text: #e9ebf0; --muted: #8f96a8; --gold: #e2b65a; --gold-dim: rgba(226, 182, 90, 0.18);
  --cat: #1f3a37; --mat: #3a2a1f; --hover: rgba(255, 255, 255, 0.08); --ok: #86efac; --err: #fca5a5; --warn: #f59e0b;
  --field: rgba(255, 255, 255, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #15161a; color: var(--text); font: 13px/1.35 "Segoe UI", system-ui, sans-serif; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:disabled { opacity: 0.35; cursor: default; }
input, select { font: inherit; color: var(--text); }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.8; flex: none; }
.muted { color: var(--muted); }

#view { position: fixed; inset: 0; }
#view canvas { display: block; width: 100%; height: 100%; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; backdrop-filter: blur(8px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }

/* tooltips */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: #0b0e13; border: 1px solid var(--line); padding: 3px 7px; border-radius: 4px; font-size: 12px; z-index: 50; pointer-events: none; color: var(--text);
}
#dock [data-tip]:hover::after, #stack [data-tip]:hover::after { top: auto; bottom: calc(100% + 6px); }
#stack.tl [data-tip]:hover::after, #stack.tr [data-tip]:hover::after { bottom: auto; top: calc(100% + 6px); }

/* ---- top bar ---- */
#top { position: fixed; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; pointer-events: none; z-index: 10; }
#top > * { pointer-events: auto; }
.bar { display: flex; align-items: center; gap: 2px; padding: 4px; }
.ib { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; }
.ib:hover:not(:disabled) { background: var(--hover); }
.ib.on { background: var(--gold-dim); outline: 1px solid var(--gold); }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 5px; flex: none; }
.dd { height: 32px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.dd:hover:not(:disabled) { background: var(--hover); }
.dd.toggle:not(.on) { opacity: 0.5; }
/* Snapping: when on, the magnet turns white and pulls its ruler / rotate icon
   (gold, nudged towards it); when off, both grey out. Sizes stay changeable. */
.mag svg, .snapsize svg, .snapsize span { transition: color 0.2s, transform 0.2s, opacity 0.2s; }
.mag:not(.live) svg, .snapsize:not(.live) svg, .snapsize:not(.live) span { color: var(--muted); opacity: 0.6; }
.mag.live svg { color: #fff; }
.snapsize { padding-left: 2px; gap: 4px; }
.snapsize svg { width: 14px; height: 14px; }
.snapsize.live svg { color: var(--gold); transform: translateX(-3px); }
.spacer { flex: 1; }
.chip { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.dirty { background: var(--warn); }
/* Colour picker: swatch buttons that open it, and the picker itself */
.cswatch { width: 22px; height: 18px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.35); vertical-align: middle; margin: 0 6px; }
.cswatch.wide { width: 100%; height: 26px; margin: 0; display: flex; align-items: center; gap: 8px; padding: 3px; background: var(--field); border-color: var(--line); }
.cswatch.wide span { width: 34px; height: 100%; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.25); flex: none; }
.cswatch.wide:hover { border-color: var(--gold); }
.cswatch + code, .cswatch code { font: 12px ui-monospace, Consolas, monospace; color: var(--muted); }
#cpick { position: fixed; z-index: 65; width: 452px; padding: 10px; }
.cp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cp-head b { flex: 1; font-size: 13px; }
.cp-grip { display: flex; align-items: center; gap: 4px; cursor: move; user-select: none; align-self: stretch; }
.cp-grip svg { width: 14px; height: 14px; color: var(--muted); }
.cp-close { width: 26px; height: 26px; margin: -4px -4px -4px 0; }
.cp-tips { font-size: 11px; color: var(--muted); margin: -4px 0 10px; line-height: 1.4; }
.cp-tips b { color: var(--text); font-weight: 600; }
#cpick.floating { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.cp-old, .cp-new { width: 30px; height: 22px; border: 1px solid rgba(255, 255, 255, 0.3); }
.cp-old { border-radius: 4px 0 0 4px; cursor: pointer; margin-right: -8px; }
.cp-new { border-radius: 0 4px 4px 0; }
.cp-hex { width: 76px; background: var(--field); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; font: 12px ui-monospace, Consolas, monospace; }
.cp-hex:focus, .cp-rgb input:focus { border-color: var(--gold); outline: none; }
.cp-body { display: flex; gap: 12px; }
.cp-lists { width: 224px; max-height: 236px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.cp-label { font-size: 11px; color: var(--muted); margin: 6px 0 4px; }
.cp-label:first-child { margin-top: 0; }
.cp-grid { display: grid; grid-template-columns: repeat(8, 22px); gap: 4px; }
.sw-c { width: 22px; height: 22px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.15); }
.sw-c:hover { transform: scale(1.12); border-color: #fff; }
.sw-c.on { outline: 2px solid var(--gold); outline-offset: 1px; }
.cp-empty { font-size: 11px; color: var(--muted); line-height: 1.4; }
.cp-mix { flex: 1; display: grid; grid-template-columns: 1fr 16px; grid-template-rows: 180px auto; gap: 8px; }
.cp-sv { position: relative; border-radius: 6px; cursor: crosshair; touch-action: none; }
.cp-dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); transform: translate(-50%, -50%); pointer-events: none; }
.cp-hue { position: relative; border-radius: 6px; cursor: ns-resize; touch-action: none;
  background: linear-gradient(to bottom, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.cp-bar { position: absolute; left: -3px; right: -3px; height: 6px; border-radius: 3px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); transform: translateY(-50%); pointer-events: none; }
.cp-rgb { grid-column: 1 / 3; display: flex; gap: 6px; }
.cp-rgb label { flex: 1; display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.cp-rgb input { width: 100%; min-width: 0; background: var(--field); border: 1px solid var(--line); border-radius: 4px; padding: 3px 5px; font: 12px ui-monospace, Consolas, monospace; }
.cp-foot { display: flex; gap: 8px; margin-top: 10px; }
.cp-foot .act { flex: 1; }
.dot.none { background: var(--muted); opacity: 0.6; }
.dot.busy { background: #60a5fa; animation: aipulse 1s ease-in-out infinite; }
.dot.problem { background: var(--err); }/* AI button + panel: grey = no AI yet, green = active lately, pulsing = working now */
.aidot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: 0.6; flex: none; }
.aidot.live { background: var(--ok); opacity: 1; }
.aidot.busy { background: var(--ok); opacity: 1; animation: aipulse 1s ease-in-out infinite; }
@keyframes aipulse { 50% { opacity: 0.3; transform: scale(0.7); } }
#popup.ai { width: 260px; }
.aihead { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px; font-size: 12px; }
.ailist { display: flex; flex-direction: column; }
.aiitem { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 5px 8px; border-radius: 6px; text-align: left; font-size: 12px; }
.aiitem:hover:not(:disabled) { background: var(--hover); }
.aiitem span { flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.aiitem small { color: var(--muted); white-space: nowrap; font-size: 11px; }
.aiitem.bad span { color: var(--err); }
.aiitem:disabled { cursor: default; opacity: 1; color: inherit; }
.ainote { padding: 2px 8px 6px; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* popup menus (☰, dropdowns) */
#popup { position: fixed; z-index: 60; min-width: 180px; padding: 6px; max-height: 70vh; overflow: auto; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 6px; text-align: left; white-space: nowrap; }
.mi:hover:not(:disabled) { background: var(--hover); }
.mi.checked::after { content: "✓"; margin-left: auto; color: var(--gold); }
.mi kbd { margin-left: auto; color: var(--muted); font: 11px ui-monospace, Consolas, monospace; }
.mi.danger { color: var(--err); }
.msep { height: 1px; background: var(--line); margin: 5px 4px; }
/* weather panel: the game's coloured tiles, name, brightness */
#popup.wx { min-width: 0; }
.wxrow { display: flex; align-items: center; gap: 6px; padding: 2px; border-radius: 6px; }
.wxrow.on { outline: 2px solid var(--gold); }
.wxpick { width: 44px; height: 30px; border-radius: 4px; display: grid; place-items: center; color: #fff; }
.wxpick:hover { filter: brightness(1.2); }
.wxname { width: 64px; text-align: left; font-size: 12px; color: var(--text); }
.wxname:hover { color: var(--gold); }
.wxnum { width: 52px; background: #fff; color: #111; border: 1px solid transparent; border-radius: 3px; padding: 3px 6px; font: 12px ui-monospace, Consolas, monospace; }
/* the note wraps to the rows' width instead of widening the menu */
.wxnote { width: 0; min-width: 100%; margin: 6px 0 2px; padding: 0 4px; font-size: 11px; color: var(--muted); line-height: 1.35; }

/* ---- object list ---- */
#objlist { position: fixed; top: 62px; left: 10px; width: 300px; height: calc(100vh - 170px); display: flex; flex-direction: column; z-index: 5; }
#objlist.low { top: auto; bottom: 10px; height: calc(100vh - 380px); }
.ol-head { padding: 8px; border-bottom: 1px solid var(--line); }
.ol-head input { width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; }
#tree { flex: 1; overflow: auto; position: relative; }
#tree-inner { position: relative; }
.trow { position: absolute; left: 0; right: 0; height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 8px; cursor: pointer; white-space: nowrap; }
.trow:hover { background: var(--hover); }
.trow.sel { background: var(--gold-dim); }
.trow.in { padding-left: 28px; }
.trow .nm { overflow: hidden; text-overflow: ellipsis; }
.trow .e { margin-left: auto; display: flex; gap: 2px; }
.trow .e button { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; color: var(--muted); }
.trow .e button:hover { background: var(--hover); color: var(--text); }
.trow .e button.on { color: var(--warn); }
.trow svg.lucide { width: 14px; height: 14px; }
.trow .tw { width: 16px; display: grid; place-items: center; color: var(--muted); }
.ol-foot { padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12px; }

/* ---- selection panel ---- */
#selpanel { position: fixed; top: 62px; right: 10px; width: 300px; padding: 12px; z-index: 5; max-height: calc(100vh - 80px); overflow: auto; }
#selpanel.low { top: auto; bottom: 10px; }
#selpanel h3 { margin: 0 0 2px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
#selpanel .sub { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.row { display: grid; grid-template-columns: 70px 1fr 1fr 1fr; gap: 4px; align-items: center; margin-bottom: 5px; }
.row.one { grid-template-columns: 70px 1fr; }
.row > label { color: var(--muted); font-size: 12px; }
.row input:not([type=range]):not([type=color]), .row select {
  width: 100%; min-width: 0; background: var(--field); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; font: 12px ui-monospace, Consolas, monospace;
}
.row input[type=color] { width: 100%; height: 26px; padding: 0 2px; background: var(--field); border: 1px solid var(--line); border-radius: 4px; }
.slider { display: flex; align-items: center; gap: 8px; }
.slider input[type=range] { flex: 1; accent-color: var(--gold); }
.slider input:not([type=range]) { width: 60px !important; flex: none; }
.matrow { display: flex; gap: 6px; align-items: center; }
.matrow .sw { width: 26px; height: 26px; border-radius: 4px; border: 1px solid var(--line); background-size: cover; flex: none; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.act { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px; border-radius: 6px; background: var(--field); border: 1px solid var(--line); }
.act:hover:not(:disabled) { border-color: var(--gold); }
.act.primary { background: #1f5f4a; border-color: #2c7d62; }
.note { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* ---- corner stack ---- */
#stack { position: fixed; width: 320px; display: flex; flex-direction: column; gap: 6px; z-index: 4; }
#stack.br { right: 10px; bottom: 10px; } #stack.bl { left: 10px; bottom: 10px; }
#stack.tr { right: 10px; top: 62px; } #stack.tl { left: 10px; top: 62px; }
#stack.tl, #stack.tr { flex-direction: column-reverse; }
#stack > .panel { padding: 8px 10px; }
.log { max-height: 124px; overflow: auto; }
.log div { font-size: 12px; padding: 1px 0; color: #cfd4de; }
.log div b { color: var(--muted); font-weight: 400; margin-right: 6px; font-variant-numeric: tabular-nums; }
.log div.err { color: var(--err); }
.log div.ok { color: #d6f5df; }
.log:empty { display: none; }
.view { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.layer { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.layer input { flex: 1; accent-color: var(--gold); }
.layer svg.lucide { width: 15px; height: 15px; }
.alert { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; border-color: rgba(245, 158, 11, 0.5) !important; }
.alert button { text-decoration: underline; color: var(--gold); }
.fps { color: var(--muted); font: 11px ui-monospace, Consolas, monospace; padding: 0 4px; text-shadow: 0 1px 2px #000; }

/* ---- dock + picker ---- */
#dockwrap { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 6; }
#dock { display: flex; gap: 4px; padding: 5px; align-items: center; }
.cat { width: 50px; height: 50px; border-radius: 6px; background: var(--cat); display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.06); }
.cat.mat { background: var(--mat); }
.cat:hover { filter: brightness(1.25); }
.cat.on { outline: 2px solid var(--gold); }
.cat svg.lucide { width: 24px; height: 24px; }
#picker { width: min(820px, calc(100vw - 20px)); padding: 8px; }
.ptabs { display: flex; gap: 4px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.ptab { padding: 5px 10px; border-radius: 5px; color: var(--muted); }
.ptab.on { color: var(--text); background: var(--hover); }
.psearch { margin-left: auto; background: var(--field); border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; width: 200px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; max-height: 214px; overflow: auto; }
.card { aspect-ratio: 1; border-radius: 6px; background: linear-gradient(#2b3442, #1d232d); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; position: relative; overflow: hidden; }
.card:hover { border-color: var(--gold); }
.card.on { outline: 2px solid var(--gold); }
.card img { width: 76%; height: 66%; object-fit: contain; }
.card .ph { width: 76%; height: 66%; display: grid; place-items: center; color: #5d6a80; }
.card small { font-size: 10px; color: var(--muted); max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.mat { background-size: cover; background-position: center; justify-content: flex-end; padding-bottom: 4px; }
.card.mat small { color: #fff; text-shadow: 0 1px 3px #000; }
.cards .empty { grid-column: 1 / -1; color: var(--muted); padding: 20px; text-align: center; }

/* placing */
#place-hint { position: fixed; left: 50%; top: 62px; transform: translateX(-50%); padding: 6px 12px; font-size: 12px; z-index: 7; }
#place-hint b { color: var(--gold); }

/* ---- modal ---- */
#modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 70; }
#modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 80px); overflow: auto; padding: 16px; z-index: 71; }
#modal h3 { margin: 0 0 12px; font-size: 15px; }
#modal h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
#modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
#modal .foot .act { padding: 7px 14px; }
#modal input[type=text], #modal input[type=search], #modal select {
  background: var(--field); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; width: 100%;
}
.corner { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.corner button { padding: 10px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); }
.corner button.on { border-color: var(--gold); background: var(--gold-dim); }
.wlist { max-height: 50vh; overflow: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; }
.wlist .fold { padding: 6px 10px; color: var(--muted); font-size: 12px; background: rgba(255, 255, 255, 0.03); position: sticky; top: 0; }
.wlist button { display: flex; width: 100%; padding: 7px 12px; text-align: left; gap: 8px; }
.wlist button:hover { background: var(--hover); }
.wlist button.cur { color: var(--gold); }
.wlist button span:last-child { margin-left: auto; color: var(--muted); font-size: 12px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.keys kbd { font: 12px ui-monospace, Consolas, monospace; background: var(--field); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; justify-self: start; }

/* ---- settings window: sections left, page right ---- */
body.no-tips [data-tip]:hover::after { display: none; }
#set-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 72; }
#settings { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 73; width: min(840px, calc(100vw - 32px)); height: min(580px, calc(100vh - 60px));
  display: grid; grid-template-columns: 210px 1fr; grid-template-rows: 1fr auto; overflow: hidden; padding: 0; background: var(--panel-solid); }
.set-nav { grid-row: 1 / 3; border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; background: rgba(0, 0, 0, 0.14); overflow: auto; }
.set-nav h2 { font-size: 15px; margin: 2px 8px 10px; }
.set-search { display: flex; align-items: center; gap: 6px; background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; margin: 0 2px 8px; }
.set-search:focus-within { border-color: var(--gold); }
.set-search input { background: none; border: 0; outline: none; width: 100%; font-size: 12px; }
.set-search svg { width: 14px; height: 14px; color: var(--muted); }
.set-grp { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 10px 10px 4px; }
.set-nv { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; text-align: left; color: #cfd4de; }
.set-nv:hover { background: var(--hover); }
.set-nv.on { background: var(--gold-dim); color: var(--text); box-shadow: inset 2px 0 0 var(--gold); }
.set-nv svg { width: 16px; height: 16px; }
.set-badge { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.set-pane { overflow: auto; padding: 16px 20px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.set-pane h3 { margin: 0 0 2px; font-size: 16px; }
.set-pane .lead { color: var(--muted); font-size: 12px; margin: 0 0 14px; }
.set-foot { border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 8px; align-items: center; }
.set-foot .muted { font-size: 11px; flex: 1; }
.set-foot .act { padding: 7px 14px; }
.scard { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; background: rgba(255, 255, 255, 0.02); }
.scard h4 { margin: 0 0 10px; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.sopt { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, 0.04); }
.sopt:first-of-type { border-top: 0; }
.sopt .t { font-size: 13px; }
.sopt .d, .scard .d { font-size: 11px; color: var(--muted); margin-top: 1px; line-height: 1.4; }
.scard kbd { font: 11px ui-monospace, Consolas, monospace; background: var(--field); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: #cfd4de; }
.snum { display: flex; align-items: center; gap: 6px; }
.snum input { width: 72px; text-align: right; background: var(--field); border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; font: 12px ui-monospace, Consolas, monospace; }
.snum input:focus { border-color: var(--gold); outline: none; }
.snum input.bad { border-color: #b45454; }
.snum span { color: var(--muted); font-size: 11px; width: 26px; }
.sseg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.sseg button { padding: 5px 12px; font-size: 12px; border-left: 1px solid var(--line); }
.sseg button:first-child { border-left: 0; }
.sseg button.on { background: var(--gold-dim); color: var(--gold); }
.stog { width: 36px; height: 20px; border-radius: 10px; background: rgba(255, 255, 255, 0.15); position: relative; flex: none; }
.stog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.stog.on { background: #2c7d62; }
.stog.on::after { left: 19px; }
.stwo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.stwo > div > .sopt:first-child { border-top: 0; }
.spath { display: flex; gap: 6px; align-items: center; }
.spath code { flex: 1; min-width: 0; font: 11px ui-monospace, Consolas, monospace; background: var(--field); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cfd4de; }
.slink { color: var(--gold); font-size: 11px; text-decoration: underline; margin-top: 6px; }
.sok, .sbad { font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.sok { color: var(--ok); } .sbad { color: var(--err); }
.sok svg, .sbad svg { width: 13px; height: 13px; }
.act.small { padding: 5px 10px; font-size: 12px; }
.act.small svg { width: 14px; height: 14px; }
.scorner { display: grid; grid-template-columns: repeat(2, 60px); gap: 6px; }
.scorner button { height: 40px; border: 1px solid var(--line); border-radius: 6px; position: relative; background: rgba(255, 255, 255, 0.03); }
.scorner i { position: absolute; width: 18px; height: 10px; border-radius: 2px; background: var(--muted); }
.scorner i.tl { top: 5px; left: 5px; } .scorner i.tr { top: 5px; right: 5px; } .scorner i.bl { bottom: 5px; left: 5px; } .scorner i.br { bottom: 5px; right: 5px; }
.scorner button.on { border-color: var(--gold); } .scorner button.on i { background: var(--gold); }
.sapps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sapp { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; text-align: left; background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; gap: 1px; }
.sapp:hover { border-color: var(--gold); }
.sapp.on { border-color: var(--gold); background: var(--gold-dim); }
.sapp b { font-size: 13px; } .sapp small { color: var(--muted); font-size: 11px; }
.stag { align-self: flex-start; font-size: 10px; padding: 0 6px; border-radius: 8px; margin-top: 4px; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.stag.t { background: rgba(134, 239, 172, 0.15); color: var(--ok); }
.sdetail { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.srow { display: flex; gap: 8px; align-items: center; }
.ssnip { font: 11px ui-monospace, Consolas, monospace; background: #0b0e13; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; color: #cfd4de; margin: 8px 0; user-select: all; }
.sdetail code { font: 11px ui-monospace, Consolas, monospace; }
.sprompts { margin: 0; padding-left: 18px; color: #cfd4de; font-size: 12px; line-height: 1.6; }
.sbody { font-size: 12px; color: #cfd4de; line-height: 1.5; }
.shit { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; }
.shit:hover { background: var(--hover); }
.sflash { animation: sflash 1.6s ease-out; border-radius: 6px; }
@keyframes sflash { 0%, 30% { background: var(--gold-dim); } 100% { background: transparent; } }
/* room list: Worlds, folders opened before, other folder */
.rtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.rtab { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line); font-size: 12px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rtab:hover { border-color: var(--gold); }
.rtab.on { background: var(--gold-dim); border-color: var(--gold); }
.rtab svg { width: 14px; height: 14px; flex: none; }
#modal .foot .act svg { width: 15px; height: 15px; }
a.act { color: inherit; text-decoration: none; }
/* shown on the GitHub page until the helper on this PC answers */
#helper-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(10, 12, 16, 0.82); padding: 16px; }
#helper-screen .panel { width: min(520px, 100%); padding: 22px 24px; background: var(--panel-solid); }
#helper-screen h2 { margin: 0 0 8px; font-size: 20px; color: var(--gold); }
#helper-screen p { color: #cfd4de; line-height: 1.5; margin: 0 0 10px; }
#helper-screen ol { padding-left: 20px; margin: 0 0 14px; line-height: 1.7; }
#helper-screen a { color: var(--gold); }
.hs-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.hs-small { font-size: 12px !important; color: var(--muted) !important; }
