:root {
    --surface: #2b2927;
    --surface-soft: #252321;
    --surface-raised: #36312e;
    --surface-hover: #403934;
    --line: #ffffff20;
    --line-strong: #ffffff36;
    --text: #f9f5ee;
    --muted: #c1b8ae;
    --quiet: #91877d;
    --accent: #ffad25;
    --accent-bright: #ffc45a;
    --accent-ink: #231503;
    --header: #36120b;
    --notice: #5f250f;
    --notice-border: #a94b1c;
    --radius: 0.45rem;
    --radius-large: 0.75rem;
    --shadow: 0 1rem 2.5rem #0006;
}

* {
    box-sizing: border-box;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    color: var(--accent-bright);
    text-decoration: underline;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-bright);
    outline-offset: 3px;
}
button,
input,
textarea {
    font: inherit;
}

.live-map-selection {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 1rem;
}
.live-field {
    display: grid;
    gap: 0.4rem;
    flex: 1 1 12rem;
}
.live-map-field {
    flex-grow: 2;
}
.live-field label {
    color: var(--muted);
    font-size: 0.85rem;
}
.live-map-selection input,
.live-map-selection select,
.live-toolbar select {
    padding: 0.6rem 0.75rem;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    min-width: 0;
    font: inherit;
}
.live-map-selection button,
.live-toolbar button,
.live-actions button {
    padding: 0.6rem 0.75rem;
    background: var(--surface-raised);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    cursor: pointer;
}
.live-map-selection button:hover,
.live-toolbar button:hover,
.live-actions button:hover {
    color: var(--accent-bright);
    border-color: var(--accent);
}
.live-cache-controls {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.8rem;
}
.live-viewer {
    position: relative;
    width: 100%;
    height: calc(100dvh - var(--live-viewport-top, 7rem) - 1rem);
    min-height: 24rem;
    margin-block: 1rem;
    overflow: hidden;
    background: #181a1c;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow);
}
.live-viewer canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.live-welcome {
    position: absolute;
    inset: 35% 10%;
    text-align: center;
    pointer-events: none;
}
.live-welcome h2 {
    font-family: Jura, sans-serif;
    font-size: 2rem;
}
.live-welcome p {
    color: var(--muted);
}
.live-toolbar {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    right: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    padding: 0.3rem;
    background: #252321ed;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.75rem;
}
.live-toolbar strong {
    margin-right: auto;
}
.live-toolbar #server {
    max-width: min(28rem, 40vw);
}
.live-toolbar-separator {
    color: var(--muted);
}
.live-server-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.live-toolbar input {
    width: 5rem;
}
.live-keybinds summary {
    display: grid;
    place-items: center;
    padding: 0.6rem;
    color: var(--text);
    background: var(--surface-raised);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    cursor: pointer;
    list-style: none;
}
.live-keybinds summary::-webkit-details-marker {
    display: none;
}
.live-keybinds summary:hover,
.live-keybinds[open] summary {
    color: var(--accent-bright);
    border-color: var(--accent);
}
.live-keybinds summary:focus-visible {
    outline: 3px solid var(--accent-bright);
    outline-offset: 3px;
}
.live-keybinds-list {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0.6rem;
    width: min(18rem, calc(100vw - 4rem));
    max-height: var(--live-overlay-height, 60vh);
    overflow-y: auto;
    margin: 0;
    padding: 0.8rem;
    background: #252321fa;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.live-keybinds-list > div {
    display: grid;
    grid-template-columns: 7rem 1fr;
    align-items: center;
    gap: 0.6rem;
    padding-block: 0.3rem;
}
.live-keybinds-list dt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.live-keybinds-list dd {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    color: var(--muted);
}
.live-keybinds-equals {
    color: var(--quiet);
}
.live-keybinds-list kbd {
    display: inline-block;
    min-width: 1.8rem;
    padding: 0.3rem 0.4rem;
    text-align: center;
    font: inherit;
    color: var(--text);
    background: var(--surface-raised);
    border: 1px solid var(--line-strong);
    border-bottom-width: 3px;
    border-radius: 0.25rem;
}
.live-status {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    max-width: 70%;
    padding: 0.6rem;
    background: #252321ed;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.75rem;
}
.live-actions {
    position: absolute;
    bottom: 3.5rem;
    left: 0.75rem;
}
/* The shared diagnostics/debug panel leaves the fullscreen control clear. */
.live-diagnostics {
    position: absolute;
    z-index: 11;
    bottom: 3.75rem;
    right: .75rem;
    width: min(24rem, calc(100% - 1.5rem));
    max-height: min(calc(100% - 5rem), calc(var(--live-overlay-height, 60vh) - 2rem));
    overflow: auto;
    padding: .8rem;
    background: #252321fa;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: .75rem;
}
.live-diagnostics label { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; }
.live-diagnostics #diagnostics-close { float: right; color: var(--text); background: transparent; border: 0; cursor: pointer; font-size: 1.25rem; }
.live-diagnostics ul { overflow-wrap: anywhere; padding-left: 1rem; }
.live-diagnostics #diagnostic-count { color: var(--accent); }
[hidden] {
    display: none !important;
}

.live-main {
    width: calc(100% - 2rem);
    margin-inline: auto;
    min-height: 60vh;
    padding-block: 0.75rem;
}
.live-map-selection {
    display: grid;
    gap: 0.5rem;
}
.live-combobox {
    position: relative;
}
.live-combobox input {
    width: 100%;
    padding-right: 3rem;
}
#clear-map {
    position: absolute;
    inset: 1px 1px 1px auto;
    width: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: #171615;
    color: var(--muted);
}
#clear-map:hover {
    color: var(--accent-bright);
    background: #292522;
}

#maps {
    position: absolute;
    z-index: 10;
    width: 100%;
    max-height: 18rem;
    overflow-y: auto;
    margin: 0.25rem 0 0;
    padding: 0.25rem;
    list-style: none;
    background: var(--surface-soft);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
#maps [role="option"] {
    padding: 0.65rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
#maps [role="option"]:hover,
#maps [aria-selected="true"] {
    background: var(--surface-hover);
    color: var(--accent);
}
.live-search-status {
    color: var(--muted);
    font-size: 0.8rem;
}
@media (max-width: 600px) {
    .live-main {
        width: calc(100% - 1rem);
        padding-block: 1rem;
    }
    .live-toolbar #server {
        max-width: 100%;
    }
}

/* Shared cards clip their contents by default. The autocomplete must escape
   this card and stack above the canvas and its positioned toolbar. */
.live-selector-card {
    overflow: visible;
    position: relative;
    z-index: 100;
}
.live-viewer {
    z-index: 0;
}
.live-viewer canvas {
    touch-action: none;
    cursor: crosshair;
}
.live-viewer canvas:active {
    cursor: crosshair;
}

/* TF2 proportional scoreboard, laid out using Resource/UI/Scoreboard.res. */
.live-scoreboard[hidden] { display: none; }
.live-scoreboard { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.live-scoreboard-panel { position: absolute; top: 50%; left: 50%; transform-origin: center; background: #24211fee; color: #ece3cb; border: 2px solid #61594f; border-radius: 8px; box-shadow: 0 12px 40px #0008; font: 13px Arial, sans-serif; overflow: hidden; }
.live-scoreboard-team, .live-scoreboard-list, .live-scoreboard-spectators, .live-scoreboard-map, .live-scoreboard-time { position: absolute; box-sizing: border-box; }
.live-scoreboard-team { padding: 8px 16px; border-radius: 4px; }
.live-scoreboard-team.live-scoreboard-blue { background: #456477; }
.live-scoreboard-team.live-scoreboard-red { background: #883e35; }
.live-scoreboard-team h2 { margin: 0; color: inherit; font: bold 24px Arial, sans-serif; }
.live-scoreboard-team span { font-size: 12px; }
.live-scoreboard-list { overflow: auto; pointer-events: auto; scrollbar-width: thin; background: #302c28; }
.live-scoreboard-list table { width: 100%; border-collapse: collapse; table-layout: fixed; color: inherit; }
.live-scoreboard-list th { position: sticky; top: 0; background: #39332e; font-weight: normal; color: #c4b9a3; }
.live-scoreboard-list th, .live-scoreboard-list td { padding: 4px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; font-size: 11px; }
.live-scoreboard-list th:first-child, .live-scoreboard-list td:first-child { text-align: left; }
.live-scoreboard-list td:first-child { font-size: 13px; }
.live-scoreboard-list tr:nth-child(even) { background: #ffffff08; }
.live-scoreboard-blue td { color: #b5d0df; }
.live-scoreboard-red td { color: #edb3a9; }
.live-scoreboard-dead td { opacity: .6; }
.live-scoreboard-dead td:first-child::before { content: '† '; }
.live-scoreboard-spectators, .live-scoreboard-map, .live-scoreboard-time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.live-scoreboard-map { text-align: right; }
.live-scoreboard-server { position: absolute; left: 11px; bottom: 40px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-scoreboard-notice { position: absolute; left: 11px; right: 11px; bottom: 12px; color: #c4b9a3; font-size: 12px; }
.live-scoreboard-list tbody tr { height: var(--scoreboard-row-height, 23px); }
.live-scoreboard-compact .live-scoreboard-team { padding: 4px 12px; }
.live-scoreboard-compact .live-scoreboard-team h2 { font-size: 18px; }
.live-scoreboard-compact .live-scoreboard-server { max-width: calc(50% - 22px); font-size: 12px; }
.live-scoreboard-panel { line-height: 1.2; }

.live-audio summary {
    padding: 0.6rem 0.75rem;
    background: var(--surface-raised);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    cursor: pointer;
}
.live-audio-controls {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: #252321fa;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.live-toolbar { z-index: 10; }
.live-toolbar-link { padding: .6rem .75rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-raised); white-space: nowrap; }
.live-toolbar .live-map-selection { flex: 0 1 25rem; min-width: 0; }
.live-toolbar #search { width: 100%; padding: .6rem 3rem .6rem .75rem; color: var(--text); background: var(--surface-soft); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.live-toolbar #search-status:empty { display: none; }
.live-target-id { position: absolute; z-index: 7; bottom: 22%; left: 50%; transform: translateX(-50%); width: 280px; max-width: calc(100% - 2rem); min-height: 60px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .2rem .75rem; padding: .6rem .8rem; pointer-events: none; color: #ece3cb; background: #302c28ed; border: 2px solid #807362; border-radius: 5px; font: 14px Arial, sans-serif; }
.live-target-id strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-target-id > span:not(.live-target-health) { grid-column: 2; font-size: 12px; }
.live-target-health { grid-row: 1 / 3; font-size: 12px; font-weight: bold; background: #ece3cb; color: #3b3530; padding: .4rem; border-radius: 3px; }
.live-target-red { background: #883e35ed; }
.live-target-blue { background: #456477ed; }
.live-target-hurt { color: #b3261e; }
.live-target-overheal { color: #397397; }
.live-status-loading::before { content: ''; display: inline-block; width: .85em; height: .85em; margin-right: .5rem; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: live-spinner .8s linear infinite; }
@keyframes live-spinner { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .live-status-loading::before { animation: none; } }

.live-viewer:fullscreen { width: 100vw; height: 100dvh; min-height: 0; max-height: none; margin: 0; border: 0; border-radius: 0; background: #111; }
.live-fullscreen { position: absolute; bottom: 0.75rem; right: 0.75rem; z-index: 20; padding: .4rem .65rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #25232160; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.live-fullscreen[aria-pressed="false"] .live-fullscreen-exit, .live-fullscreen[aria-pressed="true"] .live-fullscreen-enter { display: none; }
.live-fullscreen:hover { color: var(--accent-bright); border-color: var(--accent); }
.live-status-centered { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); max-width: calc(100% - 2rem); text-align: center; font-size: 1.15rem; }
.live-chat { position: absolute; z-index: 6; bottom: 4rem; left: 1rem; width: min(36rem, calc(100% - 2rem)); max-width: calc(100% - 2rem); max-height: 28%; overflow: hidden; pointer-events: none; color: #ece3cb; font: 14px Arial, sans-serif; text-shadow: 1px 1px 2px #000, -1px -1px 2px #000; }
.live-chat-line { margin: .2rem 0; overflow-wrap: anywhere; }
.live-chat { padding-block: 2px; }
.live-center-text { position: absolute; z-index: 6; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(36rem, calc(100% - 2rem)); text-align: center; pointer-events: none; color: #ece3cb; font: 18px Arial, sans-serif; text-shadow: 1px 1px 2px #000; }

.live-voice-status { position: absolute; right: 20px; bottom: 28%; width: 160px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.live-voice-status[hidden] { display: none; }
.live-voice-row { min-height: var(--voice-row-height, 20px); padding: 2px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f1e5bc; background: #333b; border-radius: 3px; font-size: 13px; }
.live-voice-team-2 { background: #8a3934dd; }
.live-voice-team-3 { background: #355b75dd; }

/* Paint-contained, opaque diagnostics: no backdrop filter or per-frame layout. */
.live-performance-overlay {
    position: absolute; left: .75rem; right: .75rem; top: 8rem;
    height: max(260px, 32%); box-sizing: border-box; z-index: 9;
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1rem; padding: .6rem .75rem; border: 1px solid #46525e;
    border-radius: var(--radius); background: #10171ef5; color: #dce6ef;
    font: 11px/1.4 ui-monospace, monospace; font-variant-numeric: tabular-nums;
    contain: layout paint; pointer-events: none;
}
.live-performance-overlay[hidden] { display: none; }
.live-performance-readings { min-width: 0; overflow: hidden; }
.live-performance-metrics { display: flex; flex-wrap: wrap; gap: .15rem .9rem; }
.live-performance-metrics b { color: #fff; font-size: 15px; }
.live-performance-chart { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.live-viewer #performance-graph { width: 100%; height: 0; min-height: 0; flex: 1; cursor: default; }
.live-performance-frame-key { color: #62dfbc; }
.live-performance-cpu-key { color: #edba70; }
.live-performance-gpu-key { color: #a99bff; }
#performance-toggle[aria-pressed="true"] { border-color: #62dfbc; color: #62dfbc; }
@media (max-width: 700px) {
    .live-performance-overlay { gap: .4rem; padding: .4rem; font-size: 9px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
    .live-performance-metrics b { font-size: 12px; }
}

/* Keep identical text metrics and bottom anchoring when VGUI input opens.
   The history grows upward; short histories stay at the bottom of the panel. */
.live-chat { display: flex; flex-direction: column; overflow-y: hidden; scrollbar-gutter: stable; }
.live-chat-open { height: var(--live-chat-history-height); background: rgba(20, 20, 20, .8); box-shadow: inset 0 0 0 1px rgba(180, 180, 180, .45); pointer-events: auto; overflow-y: auto; }
.live-chat-open::before { content: ''; margin-top: auto; }
.live-chat-line { flex-shrink: 0; }
.live-chat-entry { position: absolute; z-index: 7; display: flex; align-items: center; gap: .3rem; padding: .2rem .4rem; border: 1px solid #777; background: rgba(20, 20, 20, .9); color: #fff; font: 14px Arial, sans-serif; }
.live-chat-entry label { flex: none; margin: 0; }
.live-chat-entry input { min-width: 0; flex: 1; padding: 0; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; box-shadow: none; }
.live-chat-entry[hidden] { display: none; }

/* Expanded diagnostics retain a bounded canvas backing store per sparkline. */
.live-performance-more { display: inline-flex; align-items: center; gap: .35rem; pointer-events: auto; cursor: pointer; margin: 0 0 .25rem; }
.live-performance-more input { margin: 0; }
.live-performance-overlay.is-expanded { height: auto; bottom: .75rem; grid-template-rows: 240px minmax(0, 1fr); pointer-events: auto; }
.live-performance-details { grid-column: 1 / -1; overflow: auto; min-height: 0; overscroll-behavior: contain; }
.live-performance-details[hidden] { display: none; }
.live-performance-details p { margin: .3rem 0; color: #b5c0ca; }
.live-performance-details table { width: 100%; border-collapse: collapse; table-layout: fixed; font: inherit; color: inherit; margin: 0; }
.live-performance-details th, .live-performance-details td { padding: .3rem .4rem; border-bottom: 1px solid #303c47; text-align: right; vertical-align: middle; }
.live-performance-details th:first-child, .live-performance-details td:first-child { width: 40%; text-align: left; }
.live-performance-details th:nth-child(2) { width: 19%; }
.live-performance-details th:nth-child(3), .live-performance-details th:nth-child(4) { width: 7%; }
.live-performance-details th:last-child { width: 20%; }
.live-performance-details td small { display: block; color: #9eafbf; font-size: .85em; overflow-wrap: anywhere; }
.live-viewer .live-performance-spark { display: block; width: 100%; height: 28px; cursor: default; }
@media (max-width: 700px) {
    .live-performance-overlay.is-expanded { grid-template-rows: 240px minmax(0, 1fr); }
    .live-performance-details th, .live-performance-details td { padding: .2rem; }
}

.live-performance-plot { position: relative; }
.live-performance-details .live-performance-scale { position: absolute; top: 2px; left: 5px; font-size: 9px; pointer-events: none; }
.live-performance-details th { position: sticky; top: 0; z-index: 1; background: #10171e; }

/* Compact toolbar controls retain the existing toolbar/button opacity. */
.live-toolbar > select { padding: .35rem .5rem; }
.live-toolbar > .live-icon-control,
.live-toolbar summary.live-icon-control { display: grid; place-items: center; width: 2rem; height: 2rem; padding: .3rem; list-style: none; color: var(--text); background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; }
.live-toolbar summary.live-icon-control::-webkit-details-marker { display: none; }
.live-toolbar .live-icon-control:hover,
.live-toolbar summary.live-icon-control:focus-visible { color: var(--accent-bright); border-color: var(--accent); }
.live-toolbar #map-name { min-width: 0; flex: 1 1 6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-toolbar-fps { flex: 0 0 auto; min-width: 4.5rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: .85rem; }
.live-settings-controls { position: absolute; top: calc(100% + .5rem); right: .3rem; width: min(20rem, calc(100% - .6rem)); max-height: var(--live-overlay-height, 60vh); overflow-y: auto; display: grid; grid-template-columns: 1fr 7rem; align-items: center; gap: .65rem; padding: .8rem; color: var(--text); background: #252321fa; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.live-settings-controls input { width: 100%; }
.live-settings-controls select { width: 100%; }
.live-toolbar #search { padding-block: .35rem; }
.live-audio-controls { max-width: calc(100% - .6rem); flex-wrap: wrap; }

.live-toolbar-link { display: inline-flex; align-items: center; gap: .4rem; height: 2rem; padding: .3rem .5rem; font-size: .85rem; line-height: 1; }
.live-death-notices { position: absolute; top: 5.5rem; right: 1rem; display: grid; justify-items: end; gap: .3rem; pointer-events: none; max-width: calc(100% - 2rem); }
.live-death-notice { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; background: #241c16df; color: #eee3cb; border-radius: .3rem; padding: .3rem .6rem; font-size: .85rem; }
.live-death-notice canvas { height: 22px; object-fit: contain; }

/* Asset inspection uses an orbit preview and the regular full page width. */
.asset-workbench { display: flex; align-items: stretch; gap: 1rem; padding: 0; min-height: 72vh; }
.asset-stage { flex: 1; min-width: 0; }
.asset-workbench .asset-inspector { min-width: 0; flex: 0 0 18rem; padding: 1rem; overflow: auto; max-height: 85vh; background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.asset-inspector[hidden] { display: none; }
.asset-workbench h1, .asset-workbench h2 { margin: 0 0 .75rem; }
.asset-workbench label { display: flex; flex-direction: column; gap: .25rem; margin: .6rem 0; font-size: .85rem; }
.asset-workbench input, .asset-workbench select, .asset-workbench button { color: inherit; background: var(--surface-soft); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .4rem .55rem; min-width: 0; }
.asset-workbench input[type=checkbox] { width: 1rem; }
.asset-workbench input[type=range] { padding: 0; width: 100%; accent-color: var(--accent); }
.asset-workbench button { cursor: pointer; }
.asset-workbench button:hover { background: var(--surface-raised); border-color: var(--accent); }
.asset-workbench :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.asset-workbench button[aria-current=true] { border-color: var(--accent); background: var(--surface-raised); }
#asset-entries { list-style: none; padding: 0; }
#asset-entries button { text-align: left; width: 100%; margin: .15rem 0; overflow-wrap: anywhere; display: flex; flex-direction: column; }
#asset-entries small, .asset-inspector output { color: var(--muted); }
#asset-breadcrumbs { display: flex; flex-wrap: wrap; gap: .25rem; }
.asset-stage header { display: flex; flex-direction: column; gap: .4rem; padding: .5rem 0; overflow-wrap: anywhere; }
#asset-status, #asset-catalog-status, #asset-metrics { font-size: .85rem; color: var(--muted); }
#asset-viewport { height: 70vh; min-height: 280px; position: relative; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
#asset-viewport[data-background=checker] { background: repeating-conic-gradient(#52606d 0% 25%,#253340 0% 50%) 0 0 / 24px 24px; }
#asset-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.asset-browser { position: absolute; z-index: 3; left: .75rem; top: .75rem; width: min(21rem, calc(100% - 1.5rem)); padding: .75rem; max-height: calc(100% - 1.5rem); overflow: auto; color: var(--text); background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.asset-browser:not([open]) { width: auto; }
.asset-browser summary { cursor: pointer; }
.asset-browser h1 { font-size: 1.2rem; margin-top: .75rem; }
.asset-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }
.asset-toolbar label { margin: 0; }
.asset-inspector details, .asset-diagnostics { border-top: 1px solid var(--line-strong); margin-top: .7rem; padding-top: .5rem; }
.asset-inspector summary { cursor: pointer; }
.asset-inspector fieldset { border: 1px solid var(--line-strong); margin: .6rem 0; min-width: 0; }
.asset-inspector legend { font-size: .8rem; overflow-wrap: anywhere; }
.asset-inspector output { font-size: .75rem; }
.asset-vector { display: flex; gap: .25rem; }
.asset-vector input { width: 100%; }
#asset-messages { max-height: 180px; overflow: auto; overflow-wrap: anywhere; }
@media(max-width:800px) { .asset-workbench { flex-direction: column; } .asset-workbench .asset-inspector { flex-basis: auto; max-height: none; } #asset-viewport { height: 65vh; } }

/* Welcome guides are usable before mouse capture and scroll within the canvas. */
.live-welcome { inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(58rem, calc(100% - 2rem)); box-sizing: border-box; max-height: calc(100% - 10rem); overflow: auto; padding: 1rem; background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); pointer-events: auto; }
.live-welcome { text-align: center; }
.live-server-card strong { display: flex; align-items: center; gap: .5rem; }
.live-server-card img { object-fit: contain; }
.live-welcome-servers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: .75rem; }
.live-server-card { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; text-align: left; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-soft); color: var(--text); cursor: pointer; }
.live-server-card:hover, .live-server-card:focus-visible { border-color: var(--accent); }
.live-server-card span { font-size: .85rem; color: var(--muted); }
.live-chat, .live-chat-entry { font-size: 13px; font-weight: 400; }
.live-center-text { font-size: 16px; font-weight: 400; }
.live-target-id strong { font-weight: 400; }
.live-welcome:not(:has(#welcome-servers)) { width: min(32rem, calc(100% - 2rem)); }

.live-annotations { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.live-annotation { position: absolute; left: 0; top: 0; max-width: min(22rem, calc(100% - 40px)); display: flex; flex-direction: column; align-items: center; padding: var(--annotation-padding, 8px) 12px; color: #ebe2ca; background: #34302bdd; border: 1px solid #92836e; border-radius: 5px; font: 13px/1.3 Arial, sans-serif; text-align: center; }
.live-annotation small { color: #c7bea6; font-size: 11px; }
.live-annotation::after { content: ''; position: absolute; border: 8px solid transparent; }
.live-annotation[data-arrow=down]::after { top: 100%; left: calc(50% - 8px); border-top-color: #92836e; }
.live-annotation[data-arrow=left]::after { right: 100%; top: calc(50% - 8px); border-right-color: #92836e; }
.live-annotation[data-arrow=right]::after { left: 100%; top: calc(50% - 8px); border-left-color: #92836e; }
.live-annotation[hidden] { display: none; }

.live-annotations[data-vgui-images=true] .live-annotation { border: 5px solid transparent; border-image: var(--annotation-panel) 23 fill / 5px; background: transparent; border-radius: 0; }
.live-annotations[data-vgui-images=true] .live-annotation::after { border: 0; background-size: 100% 100%; }
.live-annotations[data-vgui-images=true] .live-annotation[data-arrow=down]::after { width: 20px; height: 10px; left: calc(50% - 10px); background-image: var(--annotation-down); }
.live-annotations[data-vgui-images=true] .live-annotation[data-arrow=left]::after { width: 10px; height: 20px; top: calc(50% - 10px); background-image: var(--annotation-left); }
.live-annotations[data-vgui-images=true] .live-annotation[data-arrow=right]::after { width: 10px; height: 20px; top: calc(50% - 10px); background-image: var(--annotation-right); }

/* Persistent resource list, full-height canvas and properties. */
.asset-workbench { display: grid; grid-template-columns: minmax(12rem, 20rem) minmax(0, 1fr) minmax(15rem, 20rem); gap: .65rem; height: max(30rem, calc(100dvh - 12rem)); min-height: 0; }
.asset-workbench > .asset-browser { position: static; width: auto; min-height: 0; max-height: none; box-sizing: border-box; box-shadow: none; }
.asset-workbench > .asset-inspector { padding: .75rem; min-height: 0; max-height: none; box-sizing: border-box; }
.asset-stage { position: relative; min-height: 0; overflow: hidden; }
.asset-stage #asset-viewport { height: 100%; min-height: 0; box-sizing: border-box; background: #000; }
.asset-stage header, .asset-stage-footer { position: absolute; left: .5rem; right: .5rem; z-index: 2; padding: .4rem .55rem; border-radius: var(--radius); background: #181b20df; box-sizing: border-box; }
.asset-stage header { top: .5rem; gap: .15rem; max-height: 25%; overflow: auto; font-size: .8rem; }
.asset-stage-footer { bottom: .5rem; display: flex; align-items: end; gap: .6rem; justify-content: space-between; }
.asset-stage-footer p { margin: 0; font-size: .75rem; }
.asset-stage-footer .asset-diagnostics { margin: 0; padding: 0; border: 0; font-size: .75rem; }
.asset-diagnostics[open] { position: absolute; left: 0; right: 0; bottom: 0; padding: .5rem; background: var(--surface-raised); }
.asset-inspector .asset-toolbar { margin-bottom: 1rem; }
.asset-inspector pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .75rem; }
.asset-entry-head, #asset-entries button { display: grid; grid-template-columns: minmax(0, 1fr) 3.5rem 4.5rem; align-items: center; gap: .35rem; }
.asset-entry-head { padding: .35rem; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: .7rem; }
#asset-entries { margin: 0 0 .5rem; }
#asset-entries button { border: 0; border-radius: 0; margin: 0; padding: .35rem; background: transparent; font-size: .75rem; }
#asset-entries li:nth-child(even) { background: #ffffff04; }
#asset-entries button:hover, #asset-entries button[aria-current=true] { background: var(--surface-soft); color: var(--accent-bright); }
.asset-entry-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#asset-entries small { font-size: .65rem; text-align: right; }
#asset-breadcrumbs button { padding: .15rem .25rem; border: 0; background: transparent; font-size: .75rem; }
#asset-breadcrumbs button + button::before { content: '/'; margin-right: .35rem; color: var(--muted); }
.live-toolbar .live-icon-control[aria-expanded=true], .live-toolbar details[open] > .live-icon-control { color: var(--accent-bright); border-color: var(--accent); background: var(--surface-soft); box-shadow: inset 0 -2px var(--accent); }
@media(max-width:1000px) { .asset-workbench { grid-template-columns: minmax(0,1fr) minmax(15rem,18rem); height: auto; } .asset-workbench > .asset-browser { grid-column: 1 / -1; max-height: 18rem; } .asset-stage { height: 65vh; } .asset-workbench > .asset-inspector { max-height: 65vh; } }
@media(max-width:600px) { .asset-workbench { grid-template-columns: minmax(0,1fr); } .asset-workbench > .asset-inspector { max-height: none; } }

.live-embed { width: 100vw; height: 100dvh; overflow: hidden; }
.live-embed .live-viewer { width: 100%; height: 100%; min-height: 0; max-height: none; margin: 0; border: 0; border-radius: 0; }
.live-embed .live-status { max-width: calc(100% - 2rem); font-size: .8rem; }
