#builder {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 8, 0.55);
    --st-bg: #0e0f12;
    --st-panel: #14161a;
    --st-raised: #1b1e23;
    --st-hover: #22262c;
    --st-line: #262a31;
    --st-line-2: #30353d;
    --st-ink: #e8eaed;
    --st-dim: #9aa0a8;
    --st-faint: #5f656e;
    --st-acc: #ffb020;
    --st-acc-rgb: 255, 176, 32;
    --st-acc-ink: #1a1203;
    --st-cp: #ffb020;
    --st-alt: #78dcff;
    --st-grid: #4ea1ff;
    --st-prop: #c58cff;
    --st-pit: #ff7a3c;
    --st-ok: #3fd16b;
    --st-bad: #ff4d4d;
    --st-sans: 'Segoe UI', 'Inter', system-ui, sans-serif;
}

.st-stage {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1600px;
    height: 900px;
    transform: translate(-50%, -50%) scale(var(--s));
    display: grid;
    grid-template-columns: 60px 300px minmax(0, 1fr) 300px;
    grid-template-rows: 52px minmax(0, 1fr);
    background: var(--st-bg);
    border: 1px solid var(--st-line);
    border-radius: 12px;
    overflow: hidden;
    color: var(--st-ink);
    font: 400 13px/1.4 var(--st-sans);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65);
}

.st-top {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 0 0;
    background: var(--st-panel);
    border-bottom: 1px solid var(--st-line);
}

.st-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 360px;
    height: 100%;
    padding: 0 16px;
    border-right: 1px solid var(--st-line);
}

.st-logo {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--st-acc);
    display: grid;
    place-items: center;
}

.st-logo svg { width: 18px; height: 18px; fill: none; stroke: var(--st-acc-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.st-brand b {
    font: 700 17px/1 var(--type);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.st-brand span {
    display: block;
    font: 600 11px/1.3 var(--type);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--st-faint);
}

.st-name {
    width: 260px;
    height: 34px;
    padding: 0 12px;
    background: var(--st-raised);
    border: 1px solid var(--st-line);
    border-radius: 8px;
    color: var(--st-ink);
    font: 600 15px var(--st-sans);
    outline: none;
}

.st-name:focus { border-color: var(--st-acc); }

.st-seg {
    display: flex;
    padding: 3px;
    gap: 2px;
    background: var(--st-raised);
    border: 1px solid var(--st-line);
    border-radius: 9px;
}

.st-seg button {
    height: 26px;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--st-dim);
    font: 600 12px var(--st-sans);
}

.st-seg button:hover { color: var(--st-ink); }
.st-seg button.on { background: var(--st-hover); color: var(--st-ink); box-shadow: inset 0 0 0 1px var(--st-line-2); }

.st-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--st-dim);
    font: 600 11px var(--type);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.st-mini input, .st-mini select {
    height: 30px;
    padding: 0 8px;
    background: var(--st-raised);
    border: 1px solid var(--st-line);
    border-radius: 7px;
    color: var(--st-ink);
    font: 600 13px var(--st-sans);
    outline: none;
}

.st-mini input { width: 54px; }
.st-grow { flex: 1; }

.st-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--st-raised);
    border: 1px solid var(--st-line);
    color: var(--st-ink);
    font: 600 12.5px var(--st-sans);
    white-space: nowrap;
}

.st-btn:hover { background: var(--st-hover); border-color: var(--st-line-2); }
.st-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.st-btn.icon { width: 32px; padding: 0; }
.st-btn.go { background: var(--st-acc); border-color: var(--st-acc); color: var(--st-acc-ink); }
.st-btn.go:hover { filter: brightness(1.08); }
.st-btn.live { background: rgba(63, 209, 107, 0.14); border-color: rgba(63, 209, 107, 0.5); color: #8ff0ae; }
.st-btn.danger { color: #ff9a9a; }
.st-btn.danger:hover { background: rgba(255, 77, 77, 0.12); border-color: rgba(255, 77, 77, 0.45); }
.st-btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.st-btn.wide { width: 100%; }
.st-btn[disabled] { opacity: 0.35; pointer-events: none; }

.st-count {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--st-line-2);
    color: var(--st-dim);
    font: 700 10px/16px var(--st-sans);
}

.st-rail {
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 0;
    background: var(--st-panel);
    border-right: 1px solid var(--st-line);
}

.st-rail button {
    position: relative;
    width: 44px;
    height: 48px;
    border-radius: 9px;
    color: var(--st-faint);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font: 700 9px/1 var(--type);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.st-rail button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st-rail button:hover { color: var(--st-ink); background: var(--st-raised); }
.st-rail button.on { color: var(--st-acc); background: rgba(var(--st-acc-rgb), 0.1); }
.st-rail button.on::before { content: ''; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--st-acc); }
.st-rail .st-rail-end { margin-top: auto; }

.st-panel, .st-inspect {
    grid-row: 2;
    min-height: 0;
    overflow-y: auto;
    background: var(--st-panel);
    scrollbar-width: thin;
}

.st-panel { border-right: 1px solid var(--st-line); }
.st-inspect { border-left: 1px solid var(--st-line); }

.st-panel::-webkit-scrollbar, .st-inspect::-webkit-scrollbar, .st-list::-webkit-scrollbar, .st-palette-wrap::-webkit-scrollbar { width: 6px; }
.st-panel::-webkit-scrollbar-thumb, .st-inspect::-webkit-scrollbar-thumb, .st-list::-webkit-scrollbar-thumb, .st-palette-wrap::-webkit-scrollbar-thumb { background: var(--st-line-2); border-radius: 3px; }

.st-head {
    padding: 16px 16px 10px;
}

.st-head h2 {
    font: 700 19px/1.1 var(--type);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.st-head p {
    margin-top: 4px;
    color: var(--st-dim);
    font-size: 12.5px;
}

.st-sec {
    margin: 0 12px 12px;
    padding: 12px;
    background: var(--st-raised);
    border: 1px solid var(--st-line);
    border-radius: 10px;
}

.st-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.st-sec-head b {
    display: flex;
    align-items: center;
    gap: 8px;
    font: 700 13px var(--type);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.st-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--st-cp); }
.st-dot.grid { background: var(--st-grid); border-radius: 2px; }
.st-dot.gate { background: #fff; }
.st-dot.alt { background: var(--st-alt); }
.st-dot.prop { background: var(--st-prop); }
.st-dot.pit { background: var(--st-pit); }

.st-sec-head span { color: var(--st-faint); font: 600 12px var(--st-sans); }
.st-sec p { color: var(--st-dim); font-size: 12px; margin-bottom: 10px; }
.st-row { display: flex; flex-wrap: wrap; gap: 6px; }
.st-row + .st-row { margin-top: 6px; }

.st-list {
    margin-top: 10px;
    max-height: 210px;
    overflow-y: auto;
    border-top: 1px solid var(--st-line);
}

.st-li {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 6px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--st-dim);
}

.st-li:hover { background: var(--st-hover); color: var(--st-ink); }
.st-li.on { background: rgba(var(--st-acc-rgb), 0.14); color: var(--st-ink); box-shadow: inset 2px 0 0 var(--st-acc); }
.st-li .num { min-width: 22px; font: 700 12px var(--mono); color: var(--st-faint); }
.st-li .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.st-li .tag { padding: 1px 6px; border-radius: 4px; background: rgba(120, 220, 255, 0.14); color: var(--st-alt); font: 700 10px var(--st-sans); }
.st-li .meta { color: var(--st-faint); font: 600 11px var(--mono); }

.st-empty-line { padding: 10px 6px; color: var(--st-faint); font-size: 12px; }

.st-field { display: grid; gap: 5px; margin-bottom: 10px; }
.st-field > span { color: var(--st-faint); font: 700 10.5px var(--type); letter-spacing: 0.14em; text-transform: uppercase; }

.st-input, .st-select, .st-text {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    background: var(--st-bg);
    border: 1px solid var(--st-line);
    border-radius: 7px;
    color: var(--st-ink);
    font: 500 13px var(--st-sans);
    outline: none;
}

.st-text { height: 76px; padding: 8px 10px; resize: none; line-height: 1.4; }
.st-input:focus, .st-select:focus, .st-text:focus { border-color: var(--st-acc); }

.st-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-split3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.st-search {
    position: relative;
    margin: 0 12px 10px;
}

.st-search input { padding-left: 32px; }
.st-search svg { position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; fill: none; stroke: var(--st-faint); stroke-width: 2; stroke-linecap: round; }

.st-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 12px 10px; }
.st-chip {
    height: 26px;
    padding: 0 10px;
    border-radius: 13px;
    background: var(--st-raised);
    border: 1px solid var(--st-line);
    color: var(--st-dim);
    font: 600 11.5px var(--st-sans);
}

.st-chip:hover { color: var(--st-ink); }
.st-chip.on { background: rgba(var(--st-acc-rgb), 0.16); border-color: rgba(var(--st-acc-rgb), 0.55); color: var(--st-ink); }

.st-palette-wrap { padding: 0 12px 12px; }
.st-group { margin: 12px 0 6px; color: var(--st-faint); font: 700 11px var(--type); letter-spacing: 0.16em; text-transform: uppercase; }

.st-palette {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.st-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 6px 8px;
    text-align: left;
    background: var(--st-raised);
    border: 1px solid var(--st-line);
    border-radius: 8px;
    color: var(--st-ink);
    font: 500 12px/1.2 var(--st-sans);
}

.st-tile:hover { border-color: rgba(var(--st-acc-rgb), 0.6); background: var(--st-hover); }
.st-tile i { flex: none; width: 26px; height: 26px; border-radius: 6px; background: var(--st-bg); display: grid; place-items: center; }
.st-tile i svg { width: 16px; height: 16px; fill: none; stroke: var(--st-prop); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st-tile .n { position: absolute; right: 6px; top: 4px; color: var(--st-faint); font: 700 10px var(--mono); }

.st-kit {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--st-raised);
    border: 1px solid var(--st-line);
    border-radius: 10px;
    text-align: left;
}

.st-kit:hover { border-color: rgba(var(--st-acc-rgb), 0.6); }
.st-kit i { width: 40px; height: 40px; border-radius: 9px; background: rgba(var(--st-acc-rgb), 0.12); display: grid; place-items: center; }
.st-kit i svg { width: 22px; height: 22px; fill: none; stroke: var(--st-acc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st-kit b { display: block; font: 700 15px var(--type); letter-spacing: 0.04em; text-transform: uppercase; }
.st-kit span { color: var(--st-dim); font-size: 12px; }

.st-track {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px;
    width: 100%;
    padding: 8px;
    margin-bottom: 6px;
    background: var(--st-raised);
    border: 1px solid var(--st-line);
    border-radius: 10px;
    text-align: left;
}

.st-track:hover { border-color: var(--st-line-2); background: var(--st-hover); }
.st-track.on { border-color: var(--st-acc); }
.st-track .thumb { position: relative; width: 64px; height: 48px; border-radius: 6px; overflow: hidden; background: #0a0c0f; }
.st-track b { display: block; font: 600 13px var(--st-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-track span { color: var(--st-faint); font-size: 11.5px; }
.st-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.st-track .thumb svg { width: 22px; height: 22px; fill: none; stroke: var(--st-faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.st-pill {
    padding: 1px 7px;
    border-radius: 4px;
    background: var(--st-line);
    color: var(--st-dim);
    font: 700 10px/16px var(--st-sans);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.st-pill.live { background: rgba(63, 209, 107, 0.16); color: #8ff0ae; }
.st-pill.draft { background: rgba(var(--st-acc-rgb), 0.16); color: var(--st-acc); }
.st-pill.off { background: rgba(255, 255, 255, 0.08); color: #fff; }

.st-new { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 12px 12px; }

.st-main {
    grid-row: 2;
    display: grid;
    grid-template-rows: minmax(0, 1fr) 132px;
    min-width: 0;
    min-height: 0;
}

.st-wrap {
    position: relative;
    min-height: 0;
    background: #0a0c0f;
    overflow: hidden;
}

.st-map, #st-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#st-canvas { display: none; }
.st-wrap.plan #st-canvas { display: block; }
.st-wrap.plan .st-map { visibility: hidden; }
.st-map .leaflet-container, .st-map.leaflet-container { background: #0a0c0f; }

.st-float {
    position: absolute;
    z-index: 600;
    display: flex;
    gap: 6px;
}

.st-float.tl { left: 12px; top: 12px; }
.st-float.tr { right: 12px; top: 12px; }
.st-float.bl { left: 12px; bottom: 12px; }

.st-glass {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(14, 15, 18, 0.88);
    border: 1px solid var(--st-line-2);
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.st-glass button {
    height: 28px;
    padding: 0 11px;
    border-radius: 6px;
    color: var(--st-dim);
    font: 600 12px var(--st-sans);
}

.st-glass button:hover { color: var(--st-ink); }
.st-glass button.on { background: var(--st-hover); color: var(--st-ink); }

.st-legend {
    display: flex;
    gap: 12px;
    padding: 6px 10px;
    background: rgba(14, 15, 18, 0.88);
    border: 1px solid var(--st-line-2);
    border-radius: 9px;
    color: var(--st-dim);
    font: 600 11px var(--st-sans);
}

.st-legend span { display: flex; align-items: center; gap: 5px; }

.st-problems {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 520px;
}

.st-problems span {
    padding: 5px 10px;
    border-radius: 7px;
    background: rgba(14, 15, 18, 0.9);
    border: 1px solid rgba(255, 77, 77, 0.45);
    color: #ffb4b4;
    font: 600 12px var(--st-sans);
}

.st-problems span.ok { border-color: rgba(63, 209, 107, 0.5); color: #9df3b8; }

.st-empty {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: grid;
    place-items: center;
    pointer-events: none;
    color: var(--st-faint);
    font: 600 15px var(--st-sans);
}

.st-mk {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #111;
    border: 2px solid var(--st-cp);
    color: #fff;
    font: 700 10px var(--st-sans);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.st-mk.white { border-color: #fff; }
.st-mk.alt { border-color: var(--st-alt); border-style: dashed; }
.st-mk.blue { border-color: var(--st-grid); border-radius: 5px; }
.st-mk.pit { border-color: var(--st-pit); border-radius: 5px; }
.st-mk.sel { background: var(--st-acc); color: var(--st-acc-ink); border-color: #fff; transform: scale(1.18); }

.st-me {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(78, 161, 255, 0.55), 0 0 12px rgba(78, 161, 255, 0.9);
}

.st-profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    border-top: 1px solid var(--st-line);
    background: var(--st-panel);
    min-width: 0;
}

.st-elev { position: relative; padding: 10px 14px 8px; min-width: 0; }
.st-elev-head { display: flex; justify-content: space-between; color: var(--st-faint); font: 700 10.5px var(--type); letter-spacing: 0.14em; text-transform: uppercase; }
.st-elev svg { display: block; width: 100%; height: 90px; margin-top: 4px; }

.st-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
    align-content: center;
    padding: 10px 16px;
    border-left: 1px solid var(--st-line);
}

.st-stats div { display: flex; flex-direction: column; }
.st-stats b { font: 700 18px/1.15 var(--type); letter-spacing: 0.02em; }
.st-stats span { color: var(--st-faint); font: 700 9.5px var(--type); letter-spacing: 0.16em; text-transform: uppercase; }

.st-insp-empty { padding: 18px 16px; color: var(--st-dim); }

.st-kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12.5px; }
.st-kv span { color: var(--st-faint); }
.st-kv b { font: 600 12.5px var(--mono); color: var(--st-ink); text-align: right; }

.st-pad {
    display: grid;
    grid-template-columns: repeat(3, 34px) 1fr;
    grid-template-rows: repeat(3, 30px);
    gap: 4px;
    align-items: center;
}

.st-pad button {
    height: 30px;
    border-radius: 7px;
    background: var(--st-bg);
    border: 1px solid var(--st-line);
    color: var(--st-dim);
    font: 700 13px var(--st-sans);
}

.st-pad button:hover { color: var(--st-ink); border-color: var(--st-line-2); }
.st-pad .side { grid-column: 4; display: flex; gap: 4px; }
.st-pad .side button { flex: 1; }

.st-steps { display: flex; gap: 4px; margin-top: 8px; }
.st-steps button { flex: 1; height: 24px; border-radius: 6px; background: var(--st-bg); border: 1px solid var(--st-line); color: var(--st-faint); font: 600 11px var(--st-sans); }
.st-steps button.on { color: var(--st-ink); border-color: var(--st-acc); }

.st-range { display: grid; grid-template-columns: 1fr 52px; gap: 8px; align-items: center; }
.st-range input[type=range] { width: 100%; accent-color: var(--st-acc); }
.st-range .st-input { height: 28px; padding: 0 6px; text-align: right; font-family: var(--mono); }

.st-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    color: var(--st-dim);
    font-size: 12.5px;
}

.st-toggle i {
    position: relative;
    flex: none;
    width: 34px;
    height: 20px;
    border-radius: 10px;
    background: var(--st-line-2);
    transition: background 0.15s;
}

.st-toggle i::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s;
}

.st-toggle.on i { background: var(--st-acc); }
.st-toggle.on i::after { transform: translateX(14px); }

.st-check { display: grid; gap: 6px; }
.st-check div { display: flex; align-items: center; gap: 8px; color: var(--st-dim); font-size: 12.5px; }
.st-check div::before { content: ''; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--st-bad); flex: none; }
.st-check div.ok::before { border-color: var(--st-ok); background: var(--st-ok); box-shadow: inset 0 0 0 2px var(--st-raised); }

.st-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #0a0c0f center / cover no-repeat;
    border: 1px solid var(--st-line);
    display: grid;
    place-items: center;
    color: var(--st-faint);
    font-size: 12px;
    margin-bottom: 8px;
}

.st-modal {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: rgba(5, 6, 8, 0.7);
}

.st-dialog {
    width: 720px;
    padding: 18px;
    background: var(--st-panel);
    border: 1px solid var(--st-line-2);
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.st-dialog h3 { font: 700 20px var(--type); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 4px; }
.st-dialog p { color: var(--st-dim); margin-bottom: 12px; }
.st-dialog img { display: block; width: 100%; border-radius: 9px; margin-bottom: 14px; }
.st-dialog .st-row { justify-content: flex-end; }

.st-toasts {
    position: absolute;
    right: 316px;
    bottom: 146px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.st-toasts .xr-toast { border-radius: 8px; font-family: var(--st-sans); font-size: 13px; font-weight: 600; }
.st-sel-count { padding: 2px 8px; border-radius: 10px; background: rgba(var(--st-acc-rgb), 0.16); color: var(--st-acc); font: 700 11px var(--st-sans); }
.st-note { margin: 0 12px 12px; padding: 10px 12px; border-radius: 9px; background: rgba(var(--st-acc-rgb), 0.08); border: 1px solid rgba(var(--st-acc-rgb), 0.3); color: var(--st-dim); font-size: 12px; }
