  
                                                  
  
                                                                                               
                                                                                                 
                                                                                              
                                                                                             
                                                                                                
                                 
   

:root {
    --void: #02070d;
    --face: rgba(0, 0, 0, 0.46);
    --face-deep: rgba(0, 0, 0, 0.62);
    --face-solid: rgba(3, 12, 18, 0.92);
    --white: #ffffff;
    --soft: #f4e4bd;
    --dim: rgba(244, 228, 189, 0.64);
    --cyan: #abffff;
    --teal: #136b77;
    --teal-deep: rgba(19, 107, 119, 0.55);
    --bad: #ff9f83;
    --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body {
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    color: var(--white);
    background: var(--void) url("../background.png") center / cover fixed no-repeat;
    font-family: var(--serif);
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: rgba(2, 7, 13, 0.6);
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

button {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    background: var(--face);
    color: var(--white);
    padding: 7px 14px;
    font-family: var(--serif);
    font-size: 12px;
    letter-spacing: 0.02em;
    cursor: pointer;
}

button:hover:not(:disabled) { color: var(--cyan); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 1px;
}

button.lba-plated { background: transparent; }

.lba-plasma {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
    image-rendering: pixelated;
}

input,
select {
    width: 100%;
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    border-radius: 0;
    background: rgba(2, 7, 13, 0.72);
    color: var(--white);
    padding: 6px 8px;
    font-family: var(--serif);
    font-size: 12px;
}

input:hover,
select:hover { border-color: var(--cyan); }
select option { background: var(--void); color: var(--white); }

button.wide {
    width: 100%;
    margin-top: 8px;
}

button.small {
    padding: 3px 9px;
    font-size: 10px;
}

button.danger { color: var(--bad); }
button.danger:hover:not(:disabled) { color: #ff9f83; }

#app {
    --drawer-height: 274px;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 100px minmax(0, 1fr) var(--drawer-height);
    height: 100vh;
}

                                                                                  

.topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
    padding: 0 22px;
    background: rgba(0, 0, 0, 0.52);
    border-bottom: 1px solid var(--teal);
    box-shadow: inset 0 -1px 0 rgba(171, 255, 255, 0.18);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.brandLogo {
    display: block;
    width: auto;
    height: 82px;
}

.titleField {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    flex: 0 1 360px;
    min-width: 0;
    padding-left: 22px;
    border-left: 1px solid var(--teal);
}

.titleLine {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.newMapButton {
    align-self: flex-start;
    padding: 5px 12px;
    font-size: 11px;
}

.titleField label {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    white-space: nowrap;
}

.titleField input {
    flex: 1 1 auto;
    width: auto;
    min-width: 140px;
    border: 0;
    border-bottom: 1px solid var(--teal);
    background: transparent;
    color: var(--white);
    font-size: 20px;
    letter-spacing: 0.01em;
    padding: 6px 2px;
}

.titleField input:hover,
.titleField input:focus { border-bottom-color: var(--cyan); }

.topActions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    min-width: 0;
}

.topActionGrid {
    display: grid;
    grid-template-columns: repeat(3, auto);
    align-items: center;
    gap: 6px 8px;
}

.topActionGrid button {
    white-space: nowrap;
}

#importLba1 { grid-area: 1 / 1; }
#openSavedContent { grid-area: 1 / 2; }
#importMap { grid-area: 1 / 3; }
#openDialogue { grid-area: 2 / 2; }
#exportMap { grid-area: 2 / 3; }

.sourceBadge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 250px;
    overflow: hidden;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sourceBadge::before {
    content: "";
    width: 5px;
    height: 5px;
    flex: none;
    background: var(--cyan);
    box-shadow: 0 0 0 1px var(--teal);
}

                                                                                  

.workspace {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 282px;
    gap: 8px;
    min-height: 0;
    padding: 8px 10px;
}

.workspace.inspectorCollapsed {
    grid-template-columns: 54px minmax(0, 1fr);
}

.toolrail,
.stage,
.inspector .panel,
.drawer {
    background: var(--face);
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
}

.toolrail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.56);
}

.railGroup {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--teal);
}

.railGroup:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.railButton {
    display: grid;
    place-items: center;
    width: 100%;
    height: 38px;
    padding: 0;
    color: var(--white);
    font-family: var(--serif);
    font-size: 17px;
}

.railButton svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
}

#roomCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

#roomCanvas[data-tool="move"] { cursor: grab; }
#roomCanvas[data-tool="move"]:active { cursor: grabbing; }
#roomCanvas[data-tool="actor"] { cursor: copy; }
#roomCanvas[data-tool="build"] { cursor: cell; }
#roomCanvas[data-tool="erase"] { cursor: crosshair; }
#roomCanvas[data-level-pick="true"] { cursor: crosshair; }

.stageTop,
.stageFoot {
    position: absolute;
    left: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    font-family: var(--serif);
    text-shadow: none;
}

.stageTop {
    top: 7px;
    padding: 4px 7px;
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    background: rgba(0, 0, 0, 0.54);
    color: var(--soft);
    font-size: 10px;
    letter-spacing: 0.04em;
}

                                                                                                 
                                                                                    
.mapTabs {
    position: absolute;
    top: 7px;
    left: 8px;
    right: 8px;
    z-index: 3;
    display: flex;
    align-items: stretch;
    gap: 3px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    pointer-events: auto;
    scrollbar-width: thin;
}

.mapTabs[hidden] { display: none; }

.mapTab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    padding: 4px 7px 4px 10px;
    border: 1px solid var(--teal);
    border-bottom-color: transparent;
    background: rgba(0, 0, 0, 0.62);
    color: var(--dim);
    font-size: 10px;
    white-space: nowrap;
    cursor: pointer;
}

.mapTab[aria-selected="true"] {
    border-color: var(--cyan);
    border-bottom-color: var(--void);
    color: var(--white);
    background: rgba(19, 107, 119, 0.42);
}

.mapTabLabel {
    overflow: hidden;
    text-overflow: ellipsis;
}

.mapTabDirty { color: var(--soft); }

.mapTabClose {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 12px;
    line-height: 1;
}

.mapTabClose:hover { color: var(--bad); }

.mapTabs:not([hidden]) + .stageTop { top: 41px; }

#status {
    margin-left: auto;
    max-width: 62%;
    overflow: hidden;
    color: var(--dim);
    font-size: 10px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#status.isError { color: var(--bad); }

.stageFoot {
    bottom: 7px;
    justify-content: space-between;
    gap: 8px;
    color: var(--dim);
    font-size: 10px;
}

#hint {
    min-width: 0;
    max-width: 46%;
    overflow: hidden;
    padding: 3px 7px;
    background: rgba(0, 0, 0, 0.54);
    border: 1px solid var(--teal);
    border-bottom-color: var(--cyan);
    border-right-color: var(--cyan);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stageTools {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    pointer-events: auto;
}

.layerBar,
.brushBar {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.54);
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.layerBar b {
    min-width: 14px;
    color: var(--white);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0;
    text-align: center;
}

#layerValue {
    color: var(--cyan);
    font-size: 13px;
}

.layerLabel { white-space: nowrap; }

#pickLevel {
    width: auto;
    padding: 0 6px;
}

#pickLevel[aria-pressed="true"] {
    background: var(--cyan);
    color: var(--void);
}

.layerMax {
    margin-right: 2px;
    font-size: 8px;
    letter-spacing: 0;
}

.layerBar button,
.brushBar button {
    width: 28px;
    height: 22px;
    padding: 0;
    font-size: 10px;
}

.brushBar {
    position: relative;
    padding: 0;
    border: 0;
    background: transparent;
}

.brushBar .brushSettingsButton {
    width: auto;
    height: 26px;
    padding: 0 8px;
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    background: rgba(0, 0, 0, 0.54);
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.04em;
    text-transform: none;
    white-space: nowrap;
}

.brushBar .brushSettingsButton[aria-expanded="true"] {
    color: var(--cyan);
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.42);
}

.brushSettingsHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--cyan);
    text-transform: uppercase;
}

.brushSettingsActions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.brushBar #brushPatternView,
.brushBar #brushPatternReset {
    width: auto;
    height: 20px;
    padding: 0 6px;
    font-size: 9px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brushBar #brushPatternView[aria-pressed="true"] {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(19, 107, 119, 0.42);
}

.brushPatternGrid {
    position: relative;
    width: 142px;
    height: 142px;
    margin: 8px auto 7px;
}

.brushPatternGrid.isometric {
    width: 154px;
    height: 100px;
}

.brushBar .brushPatternCell {
    position: absolute;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--teal);
    background: var(--void);
    cursor: pointer;
}

.brushBar .brushPatternCell:hover {
    border-color: var(--cyan);
}

.brushBar .brushPatternCell[aria-pressed="true"] {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.65);
    box-shadow: inset 0 0 0 1px rgba(171, 255, 255, 0.28);
}

.brushPatternGrid.isometric .brushPatternCell {
    width: 28px;
    height: 16px;
    border: 0;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    box-shadow: inset 0 0 0 1px var(--teal);
    background: var(--void);
}

.brushPatternGrid.isometric .brushPatternCell:hover {
    box-shadow: inset 0 0 0 2px var(--cyan);
}

.brushPatternGrid.isometric .brushPatternCell[aria-pressed="true"] {
    box-shadow: inset 0 0 0 2px rgba(171, 255, 255, 0.92), 0 0 7px rgba(171, 255, 255, 0.4);
    background: rgba(19, 107, 119, 0.58);
}

.brushPatternGrid.isometric .brushPatternCell[aria-pressed="true"]::before {
    inset: 3px;
    border: 0;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    background: rgba(19, 107, 119, 0.62);
    box-shadow: none;
}

.brushPatternGrid.isometric .brushPatternCell.isCentre::after {
    inset: 5px 10px;
}

                                                                                                
                                                                           
.brushBar .brushPatternCell[aria-pressed="true"]::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(171, 255, 255, 0.92);
    background: rgba(19, 107, 119, 0.6);
    box-shadow: 0 0 6px rgba(171, 255, 255, 0.45);
    pointer-events: none;
}

.brushBar .brushPatternCell.isCentre {
    cursor: default;
}

.brushBar .brushPatternCell.isCentre::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 0 6px var(--cyan);
}

.brushSettingsHint {
    margin: 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    line-height: 1.45;
    letter-spacing: 0.02em;
    text-transform: none;
}

.pathPlay {
    height: 26px;
    padding: 0 9px;
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pathPlay[aria-pressed="true"] {
    color: var(--cyan);
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.42);
}

.pathSpeed {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 5px;
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    background: rgba(0, 0, 0, 0.54);
    color: var(--dim);
    font-size: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pathSpeed select {
    width: auto;
    height: 22px;
    padding: 0 16px 0 4px;
    border: 0;
    background: transparent;
    font-size: 10px;
    letter-spacing: 0;
    text-transform: none;
}

#gridToggle,
#zoneToggle,
#hideAboveToggle {
    width: auto;
    padding: 0 6px;
    font-size: 9px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#gridToggle[aria-pressed="true"],
#zoneToggle[aria-pressed="true"],
#hideAboveToggle[aria-pressed="true"] {
    color: var(--cyan);
    background: rgba(19, 107, 119, 0.35);
}

                                                                                  

.inspector {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 1px;
}

.inspectorHead {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 2px 4px 2px 8px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.inspectorHead span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inspectorCloseAll {
    height: 24px;
    padding: 0 6px;
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    background: transparent;
    color: var(--cyan);
    font-size: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.inspectorCloseAll:hover:not(:disabled) {
    border-color: var(--cyan);
    color: var(--white);
}

.inspectorCollapse {
    width: 28px;
    height: 24px;
    padding: 0;
    color: var(--cyan);
    font-size: 15px;
    line-height: 1;
}

.inspectorOpen {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 4;
    padding: 10px 5px;
    border: 1px solid var(--teal);
    border-right: 0;
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    background: rgba(0, 0, 0, 0.78);
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
}

.inspectorOpen:hover:not(:disabled) { color: var(--white); }
.inspectorOpen:active:not(:disabled) { transform: translateY(calc(-50% + 1px)); }

.panel {
    flex: none;
    min-width: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.56);
}

.panelHead {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.panelHead::-webkit-details-marker { display: none; }
.panelHead::marker { content: ""; }

.panelHead::after {
    content: "▾";
    color: var(--cyan);
    font-size: 10px;
    line-height: 1;
    transition: transform 0.12s ease;
}

.panel[open] > .panelHead::after { transform: rotate(180deg); }

.panelHead:focus-visible {
    outline: 1px solid var(--cyan);
    outline-offset: -1px;
}

.panel .panelHead h2 { flex: 1; margin: 0; }

.panel[open] > .panelHead {
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(19, 107, 119, 0.45);
}

.panelBody {
    min-width: 0;
    padding: 0 10px 10px;
}

.panel h2,
.dialogHead h2 {
    margin: 0 0 8px;
    color: var(--white);
    font-family: var(--serif);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.headingIndex {
    float: right;
    color: var(--cyan);
    font-size: 13px;
    letter-spacing: 0.03em;
}

.facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 9px;
    margin: 0 0 2px;
}

.facts div {
    min-width: 0;
    border-bottom: 1px solid var(--teal-deep);
    padding-bottom: 2px;
}

.facts dt,
.label {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.facts dd {
    margin: 1px 0 0;
    overflow: hidden;
    color: var(--white);
    font-family: var(--serif);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.field {
    display: block;
    margin: 6px 0 4px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field input,
.field select { margin-top: 4px; }

.note {
    margin: 6px 0 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    line-height: 1.45;
}

.selTitle {
    margin: 0 0 4px;
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 12px;
    letter-spacing: 0.03em;
}

.miniFacts {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
    margin: 6px 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    line-height: 1.4;
}

.miniFacts span {
    padding: 1px 0;
    border-bottom: 1px solid var(--teal-deep);
}

.prefabBar {
    flex-wrap: wrap;
    gap: 7px;
}

.prefabSubTabs {
    display: flex;
    flex: none;
    gap: 4px;
    padding: 5px 10px;
    border-bottom: 1px solid var(--teal);
    background: rgba(0, 0, 0, 0.24);
}

.prefabSubTabs button {
    padding: 4px 12px;
    font-size: 10px;
    letter-spacing: 0.05em;
}

.prefabSubTabs button[aria-pressed="true"] {
    color: var(--cyan);
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.35);
}

.prefabFilter {
    flex: 1 1 150px;
    min-width: 120px;
    max-width: 260px;
    margin-left: auto;
    padding: 4px 6px;
    border: 1px solid var(--teal-deep);
    background: var(--void);
    color: var(--white);
    font-family: var(--serif);
    font-size: 10px;
}

.prefabBar .assetBarInfo {
    flex: 1 1 220px;
    min-width: 0;
}

.prefabCount {
    flex: none;
    min-width: 18px;
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 11px;
    text-align: right;
}

.prefabRangeBar {
    flex: none;
    padding: 4px 10px;
    border-bottom: 1px solid var(--teal-deep);
}

.prefabRangeLabel {
    color: var(--soft);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.prefabRangeInput {
    width: 42px;
    padding: 3px 4px;
    border: 1px solid var(--teal-deep);
    background: var(--void);
    color: var(--white);
    font-family: var(--serif);
    font-size: 10px;
    text-align: center;
}

.prefabRangeInput:disabled {
    opacity: 0.45;
}

.prefabRangeDash {
    color: var(--dim);
    font-size: 9px;
}

#prefabRangeAuto {
    padding: 3px 7px;
    font-size: 9px;
}

.prefabRangeBar #prefabRangeHint {
    flex: 1 1 220px;
    min-width: 0;
}

.prefabPlacementBar {
    flex: none;
    padding: 5px 10px;
    border-bottom: 1px solid var(--teal-deep);
    background: rgba(19, 107, 119, 0.18);
}

.prefabPlacementBar .assetBarInfo {
    flex: 1 1 180px;
    min-width: 0;
}

#prefabOrientation {
    min-width: 70px;
    color: var(--cyan);
    text-align: left;
}

#prefabMirrorX[aria-pressed="true"],
#prefabMirrorZ[aria-pressed="true"] {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.35);
    color: var(--cyan);
}

.prefabBody {
    flex: 1;
    min-height: 0;
    padding: 9px 10px 12px;
    overflow-y: auto;
}

.prefabGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
    gap: 9px;
    align-content: start;
}

.prefabRoomGroup {
    margin-bottom: 7px;
    border: 1px solid var(--teal-deep);
    background: rgba(0, 0, 0, 0.16);
}

.prefabRoomToggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 9px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: rgba(19, 107, 119, 0.12);
    color: var(--white);
    text-align: left;
}

.prefabRoomToggle:hover,
.prefabRoomToggle[aria-expanded="true"] {
    border-bottom-color: var(--teal);
    background: rgba(19, 107, 119, 0.28);
}

.prefabRoomName {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 10px;
    letter-spacing: 0.05em;
}

.prefabRoomMeta {
    flex: 1;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
}

.prefabRoomChevron {
    color: var(--cyan);
    font-size: 11px;
}

.prefabRoomGrid {
    padding: 8px;
}

.prefabGroupHint {
    margin: 0 0 8px;
    padding: 0;
}

.prefabCard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 6px;
    border: 1px solid var(--teal-deep);
    background: rgba(19, 107, 119, 0.08);
}

.prefabCard.isPlacing {
    border-color: var(--cyan);
    box-shadow: inset 0 0 0 1px rgba(171, 255, 255, 0.18);
}

.prefabThumb {
    display: block;
    width: 100%;
    height: 92px;
    border: 1px solid rgba(19, 107, 119, 0.55);
    background: var(--void);
}

.prefabCardTitle {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.prefabCardTitle b {
    flex: 1;
    overflow: hidden;
    color: var(--white);
    font-family: var(--serif);
    font-size: 10px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prefabDelete {
    flex: none;
    width: 18px;
    height: 18px;
    padding: 0;
    border-color: transparent;
    color: var(--dim);
    font-size: 13px;
    line-height: 1;
}

.prefabDelete:hover {
    border-color: var(--bad);
    color: var(--white);
}

.prefabFavorite {
    flex: none;
    width: 18px;
    height: 18px;
    padding: 0;
    border-color: transparent;
    color: var(--cyan);
    font-size: 13px;
    line-height: 1;
}

.prefabFavorite:hover {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.28);
}

.prefabFavMark {
    flex: none;
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 11px;
}

.prefabMeta {
    overflow: hidden;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prefabActions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 1px;
}

.prefabEmpty {
    padding: 8px 0;
}

.spawnLine {
    margin: 7px 0 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
}

.spawnLine strong { color: var(--white); font-weight: 400; }

                                                                                 

.stateActorList {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 190px;
    margin: 6px 0 2px;
    padding: 3px 0;
    overflow-y: auto;
    border-top: 1px solid var(--teal-deep);
    border-bottom: 1px solid var(--teal-deep);
}

.stateActorRow {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 2px 3px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    cursor: pointer;
}

.stateActorRow:hover {
    background: rgba(19, 107, 119, 0.22);
    color: var(--white);
}

.stateActorRow.isHidden { opacity: 0.55; }

.stateActorRow input {
    width: auto;
    margin: 0;
    accent-color: var(--cyan);
}

.stateActorSlot {
    min-width: 38px;
    color: var(--cyan);
}

.stateActorBody { color: var(--white); }
.stateActorPos { margin-left: auto; }

.checkRow {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    cursor: pointer;
}

.checkRow input {
    width: auto;
    margin: 0;
    accent-color: var(--cyan);
}

                                                                                  

.drawer {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0 10px 10px;
    background: rgba(0, 0, 0, 0.68);
}

.drawerResize {
    position: relative;
    flex: none;
    height: 12px;
    outline: none;
    cursor: ns-resize;
    touch-action: none;
}

.drawerResize::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 54px;
    height: 3px;
    transform: translate(-50%, -50%);
    background: var(--teal);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.drawerResize:hover::before,
.drawerResize:focus-visible::before,
body.isResizingDrawer .drawerResize::before {
    width: 74px;
    background: var(--cyan);
}

.drawerResize:focus-visible { box-shadow: inset 0 0 0 1px var(--cyan); }

body.isResizingDrawer,
body.isResizingDrawer * { cursor: ns-resize !important; user-select: none !important; }

.drawerTop {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: none;
    padding: 5px 9px;
    border-bottom: 1px solid var(--teal);
    background: rgba(0, 0, 0, 0.4);
}

.tabs {
    display: flex;
    flex: 1 1 auto;
    gap: 4px;
    min-width: 0;
}

.tabs button {
    padding: 5px 13px;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.tabs button.projectTab {
    margin-left: auto;
}

.drawerNote {
    margin-left: auto;
    overflow: hidden;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.05em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawerPanels {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.assetPanel {
    height: 100%;
    overflow-y: auto;
}

.projectBody {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 9px 10px 14px;
}

.projectSection {
    margin: 0 0 12px;
    padding: 9px 10px;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.36);
}

.projectSection h3 {
    margin: 0 0 7px;
    color: var(--soft);
    font-size: 11px;
    font-weight: normal;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.projectRow {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 4px 0;
    border-top: 1px solid rgba(19, 107, 119, 0.4);
    font-size: 11px;
}

.projectRow:first-of-type { border-top: 0; }

.projectRowName {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.projectRowMeta {
    flex: none;
    color: var(--dim);
    font-size: 9px;
}

.projectActions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.projectField {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    color: var(--dim);
    font-size: 10px;
}

.projectTransitionTarget { min-width: 0; }

.projectHint {
    margin: 7px 0 0;
    color: var(--dim);
    font-size: 10px;
    line-height: 1.45;
}

.projectEmpty {
    margin: 0;
    color: var(--dim);
    font-size: 11px;
    line-height: 1.5;
}

.stackPanel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.assetBar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    min-height: 42px;
    padding: 5px 10px;
    border-bottom: 1px solid var(--teal);
    background: rgba(0, 0, 0, 0.34);
    font-family: var(--serif);
    font-size: 10px;
}

#roomBodiesOnly[aria-pressed="true"] {
    color: var(--cyan);
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.35);
}

button.bodyStudioLink {
    display: grid;
    place-items: center;
    padding: 2px 4px;
    border-color: transparent;
    background: transparent;
}

.bodyStudioLink img {
    display: block;
    width: auto;
    height: 26px;
}

.bodyStudioLink:hover {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.22);
}

.assetBarInfo {
    margin-left: auto;
    overflow: hidden;
    color: var(--dim);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assetSourceBar {
    min-height: 34px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.assetSourceLabel {
    flex: none;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.assetSourceSwitch {
    display: flex;
    flex: none;
}

.assetSourceSwitch button {
    min-width: 46px;
}

.assetSourceSwitch button + button {
    margin-left: -1px;
}

.assetSourceSwitch button[aria-pressed="true"] {
    color: var(--cyan);
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.35);
}

.itemsVisible {
    flex: none;
    margin: 0;
    white-space: nowrap;
}

.brickBar {
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 6px;
    padding-bottom: 6px;
}

.brickBankBar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    flex-wrap: wrap;
    padding: 5px 10px;
    border-bottom: 1px solid var(--teal-deep);
    background: rgba(0, 0, 0, 0.22);
    font-family: var(--serif);
    font-size: 10px;
}

.brickBankInfo {
    flex: 1 1 220px;
    min-width: 0;
    overflow: hidden;
    color: var(--dim);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brickBankBar button { flex: none; }

.inlineField {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 190px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.inlineField select {
    padding: 3px 6px;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
}

.brickSlots {
    display: flex;
    gap: 5px;
}

.brickSlot {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 7px;
    font-size: 10px;
}

.slotLabel {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brickSlot b {
    color: var(--white);
    font-family: var(--serif);
    font-size: 11px;
    font-weight: 400;
}

.slotArt {
    display: block;
    width: 52px;
    height: 34px;
    image-rendering: pixelated;
}

.assetGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
    align-content: start;
    gap: 5px;
    padding: 7px 10px 10px;
}

.bodyGrid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
}

.roomGrid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.brickGrid {
    display: grid;
    flex: 1;
    min-height: 0;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    align-content: start;
    gap: 5px;
    padding: 7px 10px 10px;
    overflow-y: auto;
}

.assetCard {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1px;
    min-width: 0;
    padding: 3px;
    border: 1px solid var(--teal);
    border-top-color: rgba(171, 255, 255, 0.6);
    border-left-color: rgba(171, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    text-align: left;
    cursor: pointer;
}

.assetCard:hover:not(:disabled) {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.24);
}

.assetCard.current {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.34);
    box-shadow: inset 0 0 0 1px var(--cyan);
}

.roomThumb {
    display: block;
    width: 100%;
    height: 52px;
    background: #02070d;
    image-rendering: pixelated;
}

.spriteCard { min-height: 78px; }

.itemGrid {
    display: grid;
    flex: 1;
    min-height: 0;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    align-content: start;
    gap: 5px;
    padding: 7px 10px 10px;
    overflow-y: auto;
}

.itemThumb {
    display: block;
    width: 84px;
    height: 54px;
    margin: 0 auto;
    image-rendering: pixelated;
}

.itemGlyph {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    border: 1px dashed rgba(171, 255, 255, 0.22);
    color: var(--dim);
    font-family: var(--serif);
    font-size: 12px;
}

.itemGrid .assetMeta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sceneItemList {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 210px;
    margin: 8px 0 4px;
    padding-right: 2px;
    overflow-y: auto;
}

.sceneItemRow {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 5px 6px;
    border: 1px solid rgba(171, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.28);
    color: var(--white);
    text-align: left;
    cursor: pointer;
}

.sceneItemRow:hover {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.2);
}

.sceneItemRow.current {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.3);
    box-shadow: inset 0 0 0 1px var(--cyan);
}

.sceneItemSlot {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 10px;
}

.sceneItemKind {
    overflow: hidden;
    color: var(--white);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sceneItemScripts {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    white-space: nowrap;
}

.spriteThumb {
    display: block;
    max-width: 100%;
    height: 52px;
    margin: 0 auto;
    object-fit: contain;
    image-rendering: pixelated;
}

.bodyCard {
    align-items: center;
    text-align: center;
}

.bodyThumb {
    display: block;
    width: 84px;
    height: 62px;
    image-rendering: pixelated;
}

.assetCard.isEmpty { opacity: 0.35; }

.assetLabel {
    overflow: hidden;
    color: var(--white);
    font-family: var(--serif);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assetMeta {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
}

.brickCard {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: 0;
    padding: 4px 3px 3px;
    border: 1px solid var(--teal);
    border-top-color: rgba(171, 255, 255, 0.55);
    border-left-color: rgba(171, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.48);
    color: var(--white);
    font-family: var(--serif);
    cursor: pointer;
}

.brickCard:hover:not(:disabled) {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.24);
}

.brickCard.isCustom {
    border-color: rgba(244, 228, 189, 0.65);
    background: rgba(19, 107, 119, 0.16);
}

.brickCard.isSurface,
.brickCard.isFill {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.36);
    box-shadow: inset 0 0 0 1px var(--cyan);
}

.brickThumb {
    display: block;
    width: 74px;
    height: 44px;
    image-rendering: pixelated;
}

.brickRole {
    position: absolute;
    top: 2px;
    left: 4px;
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 7px;
    letter-spacing: 0.08em;
    text-shadow: 0 1px 0 #000, 0 0 2px #000;
}

.brickRole:empty { display: none; }

                                                                                  

.gate {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: 24px;
    background: var(--void) url("../background.png") center / cover no-repeat;
}

.gate::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(2, 7, 13, 0.62);
    pointer-events: none;
}

.gateCard {
    position: relative;
    z-index: 1;
    width: min(1080px, 94vw);
    padding: 48px 56px 30px;
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    background: rgba(0, 0, 0, 0.78);
    box-shadow: inset 1px 1px 0 rgba(171, 255, 255, 0.35), inset -1px -1px 0 rgba(19, 107, 119, 0.5),
        0 24px 80px rgba(0, 0, 0, 0.55);
    text-align: center;
}

.gateLogo {
    display: block;
    width: min(560px, 76%);
    height: auto;
    margin: 0 auto 16px;
}

.gateLede {
    margin: 0 0 22px;
    color: var(--soft);
    font-family: var(--serif);
    font-size: 19px;
}

.gateCopy {
    max-width: 620px;
    margin: 0 auto 22px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.7;
}

.gateCopy b {
    color: var(--soft);
    font-weight: 600;
}

.gateCopy code {
    color: var(--white);
    font-family: var(--serif);
    font-size: 13px;
}

.gateButton {
    min-width: 430px;
    min-height: 54px;
    padding: 12px 26px;
    font-size: 18px;
}

.gateStatus {
    min-height: 16px;
    margin: 12px 0 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 11px;
    line-height: 1.4;
}

.gateStatus.isError { color: var(--bad); }

.gateList {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 30px;
    margin: 28px auto 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--teal);
    list-style: none;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 11px;
    text-align: left;
}

.gateList li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.gateList span {
    color: var(--white);
    font-family: var(--serif);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

                                                                                  

.dialog {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 7, 13, 0.78);
}

.dialogCard {
    width: min(860px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    padding: 16px;
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    background: rgba(0, 0, 0, 0.76);
    box-shadow: inset 1px 1px 0 rgba(171, 255, 255, 0.3), 0 18px 60px rgba(0, 0, 0, 0.7);
}

.newMapCard { width: min(460px, 96vw); }

.newMapTypeChoices {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.newMapTypeChoices button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    text-align: left;
}

.newMapTypeChoices b {
    font-size: 13px;
    letter-spacing: 0.03em;
}

.newMapTypeChoices span {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    line-height: 1.4;
}

.newMapChoices { margin-top: 14px; }

.newMapChoices button { flex: 1 1 0; padding: 14px 10px; }

.newMapChoices button.newMapBack {
    flex: 0 0 auto;
    margin-right: auto;
    padding: 14px 16px;
}

.dialogHead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--teal);
}

.dialogHead h2 {
    margin: 0;
    font-size: 18px;
    text-transform: none;
}

.dialogKicker {
    margin: 0 0 4px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.meta {
    margin: 3px 0 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
}

.spriteWork {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 14px;
    padding: 12px 0;
}

.checker {
    display: grid;
    place-items: center;
    min-height: 280px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--teal);
    background: #02070d;
}

#spriteCanvas {
    display: block;
    cursor: crosshair;
    image-rendering: pixelated;
    box-shadow: 0 0 0 1px var(--teal);
}

.spriteSide { min-width: 0; }

.labelRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.labelRow button { padding: 3px 9px; font-size: 10px; }

.dialogFoot {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    padding-top: 10px;
    border-top: 1px solid var(--teal);
}

.bigViewButton {
    flex: none;
}

.bigViewCard {
    display: flex;
    flex-direction: column;
    width: min(1480px, 96vw);
    height: min(92vh, 920px);
    max-height: 92vh;
    overflow: hidden;
}

.bigViewCard .dialogHead {
    flex: none;
}

.bigViewBody {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding-top: 10px;
}

.bigViewBody > .assetPanel {
    height: 100%;
    min-height: 0;
}

.bigViewBody .assetGrid,
.bigViewBody .brickGrid,
.bigViewBody .itemGrid {
    gap: 7px;
    padding: 10px 12px 12px;
}

.bigViewBody .assetGrid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.bigViewBody .bodyGrid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
.bigViewBody .itemGrid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
.bigViewBody .brickGrid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.bigViewBody .roomThumb { height: 68px; }
.bigViewBody .bigViewButton { display: none; }

.paletteGrid {
    display: grid;
    grid-template-columns: repeat(16, minmax(0, 1fr));
    gap: 2px;
    margin-top: 4px;
}

.paletteSwatch {
    width: 100%;
    min-width: 0;
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.5);
    background: transparent;
}

.paletteSwatch:hover { outline: 1px solid var(--cyan); outline-offset: 0; }
.paletteSwatch.selected { outline: 2px solid var(--cyan); outline-offset: 0; }

.paletteGrid.small {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    max-height: 262px;
    overflow-y: auto;
    padding-right: 3px;
}

                                                                                  

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.4); }
::-webkit-scrollbar-thumb { background: var(--teal); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); background-clip: padding-box; }

@media (max-width: 1120px) {
    .workspace { grid-template-columns: 50px minmax(0, 1fr) 252px; }
    .workspace.inspectorCollapsed { grid-template-columns: 50px minmax(0, 1fr); }
    .brandLogo { height: 72px; }
    .topbar { gap: 12px; padding: 0 14px; }
    .titleField { flex-basis: 260px; padding-left: 14px; }
    .titleField input { font-size: 18px; }
    .topActions .sourceBadge { display: none; }
    .topActionGrid { gap: 4px 6px; }
    .topActionGrid button { padding: 5px 10px; font-size: 11px; }
    .assetGrid { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
    .brickGrid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
}

@media (max-width: 900px) {
    #app {
        --drawer-height: 246px;
        grid-template-rows: 78px minmax(0, 1fr) var(--drawer-height);
    }
    .brandLogo { height: 52px; }
    .titleField { padding-left: 12px; }
    .titleField label { display: none; }
    .titleField input { min-width: 100px; font-size: 16px; }
    .newMapButton { padding: 4px 9px; font-size: 10px; }
    .workspace { grid-template-columns: 46px minmax(0, 1fr) 218px; gap: 6px; padding: 6px 7px; }
    .workspace.inspectorCollapsed { grid-template-columns: 46px minmax(0, 1fr); }
    .drawer { margin: 0 7px 7px; }
    .facts { grid-template-columns: 1fr; }
    .roomThumb { height: 44px; }
    .assetGrid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); padding: 6px 7px 9px; }
    .brickGrid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
    .spriteWork { grid-template-columns: 1fr; }
    .brickBar { align-items: flex-start; }
    .inlineField { min-width: 150px; }
    .stageFoot { flex-wrap: wrap; align-items: flex-end; }
    #hint { flex: 1 1 100%; max-width: 100%; }
    .stageTools { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 760px) {
    .brandLogo { height: 42px; }
    .titleField { flex-basis: 180px; padding-left: 10px; }
    .titleField input { min-width: 80px; }
    .newMapButton { padding: 3px 8px; font-size: 9px; }
    .topActions { gap: 4px; }
    .topActionGrid { gap: 3px 4px; }
    .topActionGrid button { padding: 5px 7px; font-size: 10px; }
}

                                                                                  

.buttonRow {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.buttonRow button {
    flex: 1 1 auto;
    min-width: 72px;
    padding: 6px 8px;
    font-size: 10px;
}

.advanced {
    margin-top: 9px;
    border-top: 1px solid var(--teal-deep);
    padding-top: 6px;
}

.advanced > summary {
    color: var(--cyan);
    cursor: pointer;
    font-family: var(--serif);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.advanced[open] > summary { margin-bottom: 6px; }

.fieldGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 6px;
    margin-top: 6px;
}

.gameField {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gameField input,
.gameField select {
    width: 100%;
    min-width: 0;
    margin-top: 1px;
    padding: 3px 5px;
    font-size: 10px;
    letter-spacing: 0;
    text-transform: none;
}

.sceneGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

textarea {
    display: block;
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    border-radius: 0;
    background: rgba(2, 7, 13, 0.72);
    color: var(--white);
    padding: 5px 6px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 9px;
    line-height: 1.4;
    resize: vertical;
}

textarea:focus {
    outline: 2px solid var(--cyan);
    outline-offset: 1px;
}

.advanced code {
    color: var(--cyan);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 9px;
}

.stopList {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.stopList li {
    display: flex;
    gap: 3px;
}

.stopList .stopName {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 5px;
    font-size: 9px;
    text-align: left;
}

.stopList li.isSelected .stopName {
    border-color: var(--cyan);
    color: var(--cyan);
}

.stopList li button:not(.stopName) {
    flex: 0 0 auto;
    min-width: 22px;
    padding: 4px;
    font-size: 10px;
}

                                                                                  

.simpleCard {
    margin: 8px 0 10px;
    padding: 8px;
    border: 1px solid var(--teal);
    border-left: 2px solid rgba(171, 255, 255, 0.55);
    background: linear-gradient(180deg, rgba(19, 107, 119, 0.16), rgba(2, 7, 13, 0.42));
}

.simpleHead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.simpleHead b {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.simpleHead span {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    line-height: 1.3;
    text-align: right;
}

.simpleField {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 7px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.simpleField select {
    width: 100%;
    min-width: 0;
    padding: 5px 6px;
    color: var(--white);
    font-size: 10px;
}

.simpleDoorRow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.simpleDoorRow select {
    flex: 1 1 124px;
    width: auto;
}

.simpleDestinationSummary {
    flex: 0 1 auto;
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 9px;
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-transform: none;
    white-space: nowrap;
}

.simpleSummary {
    margin: 7px 0 0;
    color: var(--soft);
    font-family: var(--serif);
    font-size: 9px;
    line-height: 1.45;
}

.simpleCard .buttonRow {
    margin-top: 7px;
}

.simpleCard button[aria-pressed="true"] {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(19, 107, 119, 0.3);
}

.simpleCard .note {
    margin: 6px 0 0;
    font-size: 9px;
    line-height: 1.4;
}

                                                                                   

.logicLaunch {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    margin: 8px 0 4px;
    padding: 8px;
    border: 1px solid var(--teal);
    border-left: 3px solid var(--cyan);
    background: linear-gradient(180deg, rgba(19, 107, 119, 0.2), rgba(2, 7, 13, 0.48));
    color: var(--white);
    text-align: left;
}

.logicLaunch:hover {
    border-color: var(--cyan);
    background: linear-gradient(180deg, rgba(19, 107, 119, 0.32), rgba(2, 7, 13, 0.54));
}

.logicLaunchIcon {
    display: grid;
    flex: none;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 1px solid rgba(171, 255, 255, 0.45);
    color: var(--cyan);
    font-size: 16px;
    line-height: 1;
}

.logicLaunchCopy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.logicLaunchCopy b {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.logicLaunchCopy small {
    overflow: hidden;
    color: var(--soft);
    font-family: var(--serif);
    font-size: 9px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logicLaunchOpen {
    flex: none;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.logicLaunchHint {
    margin: 0 0 8px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    line-height: 1.35;
}

.logicDialog {
    padding: 12px;
}

.logicCard {
    display: flex;
    flex-direction: column;
    width: min(1280px, 96vw);
    height: min(92vh, 900px);
    max-height: 92vh;
    overflow: hidden;
}

.logicHead { flex: none; }

.logicQuickBar {
    flex: none;
    padding: 9px 0;
    border-bottom: 1px solid var(--teal);
}

.logicQuickHead {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-bottom: 6px;
}

.logicQuickHead b {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.logicQuickHead span {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
}

.logicTemplates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 5px;
}

.logicTemplate {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 6px 7px;
    border: 1px solid rgba(19, 107, 119, 0.75);
    background: rgba(2, 7, 13, 0.48);
    color: var(--soft);
    text-align: left;
}

.logicTemplate:hover,
.logicTemplate.isActive {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.24);
}

.logicTemplate b {
    overflow: hidden;
    color: var(--white);
    font-family: var(--serif);
    font-size: 10px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logicTemplate span {
    overflow: hidden;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logicWorkspace {
    display: grid;
    flex: 1;
    grid-template-columns: 166px minmax(0, 1fr) 260px;
    gap: 9px;
    min-height: 0;
    padding-top: 9px;
}

.logicPalettePane,
.logicInspectorPane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.5);
}

.logicGraphPane {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.logicPaneHead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 7px;
    flex: none;
    padding: 7px 8px;
    border-bottom: 1px solid var(--teal);
}

.logicPaneHead b {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.logicPaneHead span {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
}

.logicPalette,
.logicInspector {
    min-height: 0;
    padding: 7px;
    overflow-y: auto;
}

.logicPaletteGroup {
    margin-bottom: 8px;
}

.logicPaletteGroup h3 {
    margin: 0 0 4px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.logicBlockButton {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    margin-bottom: 4px;
    padding: 6px 7px;
    border: 1px solid rgba(19, 107, 119, 0.7);
    background: rgba(2, 7, 13, 0.5);
    text-align: left;
}

.logicBlockButton:hover,
.logicBlockButton.isActive {
    border-color: var(--cyan);
    background: rgba(19, 107, 119, 0.25);
}

.logicBlockButton b {
    color: var(--white);
    font-family: var(--serif);
    font-size: 10px;
    font-weight: 400;
}

.logicBlockButton span {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    line-height: 1.25;
}

.logicPaletteNote {
    flex: none;
    margin: 0;
    padding: 7px;
    border-top: 1px solid var(--teal);
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    line-height: 1.35;
}

.logicGraphBar {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex: none;
    padding-bottom: 6px;
}

.logicGraphLabel {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.logicGraphHelp {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
}

.logicCanvasViewport {
    display: flex;
    flex: 1;
    align-items: flex-start;
    justify-content: center;
    min-height: 0;
    padding: 12px;
    overflow: auto;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.55);
}

.logicCanvas {
    position: relative;
    flex: none;
    width: 720px;
    height: 380px;
    overflow: hidden;
    border: 1px solid rgba(19, 107, 119, 0.6);
    background-color: #030a11;
    background-image: radial-gradient(rgba(171, 255, 255, 0.14) 0.8px, transparent 0.8px);
    background-size: 18px 18px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.55);
}

.logicEdges {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.logicEdgePath {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 2;
    opacity: 0.72;
}

.logicEdgeLabel {
    fill: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.logicNodes {
    position: absolute;
    inset: 0;
}

.logicNode {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 280px;
    height: 152px;
    padding: 11px 13px;
    overflow: hidden;
    border: 1px solid var(--teal);
    border-left: 3px solid var(--cyan);
    background: linear-gradient(180deg, rgba(8, 37, 44, 0.95), rgba(2, 8, 13, 0.98));
    box-shadow: inset 1px 1px 0 rgba(171, 255, 255, 0.12), 0 8px 24px rgba(0, 0, 0, 0.38);
    cursor: grab;
    user-select: none;
}

.logicNode:hover {
    border-color: var(--cyan);
}

.logicNode.isSelected {
    border-color: var(--cyan);
    box-shadow: inset 1px 1px 0 rgba(171, 255, 255, 0.2), 0 0 0 1px rgba(171, 255, 255, 0.18), 0 10px 28px rgba(0, 0, 0, 0.48);
}

.logicNode.isDragging {
    cursor: grabbing;
    opacity: 0.9;
}

.logicNodeHead {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.logicNodeKicker {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.logicNodeHead b {
    overflow: hidden;
    color: var(--white);
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logicNode p {
    margin: 0;
    overflow: hidden;
    color: var(--soft);
    font-family: var(--serif);
    font-size: 10px;
    line-height: 1.4;
}

.logicNodeFoot {
    margin-top: auto;
    overflow: hidden;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.07em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.logicPort {
    position: absolute;
    top: calc(50% - 7px);
    width: 14px;
    height: 14px;
    border: 2px solid var(--cyan);
    border-radius: 50%;
    background: #030a11;
}

.logicPortOut { right: -8px; }
.logicPortIn { left: -8px; }

.logicInspectKicker {
    margin: 0 0 3px;
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.logicInspector h3 {
    margin: 0 0 6px;
    color: var(--white);
    font-family: var(--serif);
    font-size: 15px;
    font-weight: 400;
}

.logicInspectText {
    margin: 0 0 8px;
    color: var(--soft);
    font-family: var(--serif);
    font-size: 10px;
    line-height: 1.45;
}

.logicFact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 7px 0;
    padding: 6px 7px;
    border-left: 2px solid var(--teal);
    background: rgba(19, 107, 119, 0.12);
}

.logicFact span,
.logicRulePreview span {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logicFact b {
    color: var(--soft);
    font-family: var(--serif);
    font-size: 10px;
    font-weight: 400;
}

.logicField {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logicField select {
    width: 100%;
    min-width: 0;
    padding: 5px 6px;
    color: var(--white);
    font-size: 10px;
}

.logicDestinationSummary {
    margin: 5px 0 0;
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 9px;
    line-height: 1.3;
}

.logicRulePreview {
    margin-top: 10px;
    padding: 7px;
    border: 1px solid rgba(19, 107, 119, 0.65);
    background: rgba(2, 7, 13, 0.5);
}

.logicRulePreview p {
    margin: 4px 0 0;
    color: var(--soft);
    font-family: var(--serif);
    font-size: 10px;
    line-height: 1.4;
}

.logicValidation {
    flex: none;
    margin-top: 6px;
    padding: 6px 8px;
    border: 1px solid rgba(19, 107, 119, 0.65);
    color: var(--soft);
    font-family: var(--serif);
    font-size: 9px;
    line-height: 1.35;
}

.logicValidation.isError {
    border-color: var(--bad);
    color: var(--bad);
}

.logicFoot {
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    flex: none;
}

.logicFootNote {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    line-height: 1.35;
}

.logicFootActions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.note.isWarning { color: var(--warn, #e4c46b); }

@media (max-width: 1200px) {
    .logicWorkspace {
        grid-template-columns: 140px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) 184px;
    }
    .logicPalettePane { grid-column: 1; grid-row: 1; }
    .logicGraphPane { grid-column: 2; grid-row: 1; }
    .logicInspectorPane { grid-column: 1 / -1; grid-row: 2; }
    .logicTemplates { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
}

@media (max-width: 880px) {
    .logicCard { height: auto; max-height: 92vh; overflow-y: auto; }
    .logicWorkspace { display: flex; flex-direction: column; overflow: visible; }
    .logicPalettePane, .logicInspectorPane { max-height: 190px; }
    .logicGraphPane { min-height: 420px; }
    .logicCanvasViewport { min-height: 400px; }
}

.contextMenu {
    position: fixed;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 196px;
    padding: 4px;
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    border-left-color: var(--cyan);
    background: rgba(0, 0, 0, 0.86);
    box-shadow: inset 1px 1px 0 rgba(171, 255, 255, 0.3), 0 10px 30px rgba(0, 0, 0, 0.7);
}

.contextMenu button {
    padding: 6px 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--white);
    font-family: var(--serif);
    font-size: 11px;
    text-align: left;
}

.contextMenu button:hover:not(:disabled),
.contextMenu button:focus-visible {
    border-color: var(--cyan);
    color: var(--cyan);
    outline: none;
}

.contextMenu button:disabled { color: var(--dim); }
.contextMenu button.danger { color: var(--bad); }

.movePickMenu { min-width: 174px; }

.movePickHead {
    margin: 4px 8px 5px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.contextMenu .checkItem {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 5px;
    align-items: center;
}

.contextMenu .checkItem::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 1px solid var(--teal);
    color: var(--cyan);
    font-size: 10px;
    line-height: 12px;
    text-align: center;
}

.contextMenu .checkItem[aria-checked="true"]::before {
    content: "✓";
    border-color: var(--cyan);
}

.libraryBar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.libraryBar input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 8px;
}

.libraryBody {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 12px;
    min-height: 320px;
}

.libraryList {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 54vh;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.6);
}

.libraryRow {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 7px;
    border: 0;
    background: transparent;
    color: var(--white);
    font-family: var(--serif);
    font-size: 10px;
    text-align: left;
}

.libraryRow span { color: var(--dim); }

.libraryRow:hover,
.libraryRow[aria-current="true"] {
    background: rgba(19, 107, 119, 0.38);
    color: var(--cyan);
}

.libraryDetail {
    max-height: 54vh;
    overflow-y: auto;
    padding: 8px 9px;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.6);
    font-size: 10px;
}

.libraryDetail pre {
    margin: 5px 0 0;
    color: var(--dim);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 9px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
}

                                                                                   

.dialogueCard {
    display: flex;
    flex-direction: column;
    width: min(1180px, 96vw);
    max-height: 92vh;
    overflow: hidden;
}

.dialogueCard > .dialogHead,
.dialogueCard > .dialogueTabs,
.dialogueCard > .dialogFoot {
    flex: none;
}

.dialogueTabs {
    display: flex;
    gap: 4px;
    margin-top: 10px;
    border-bottom: 1px solid var(--teal);
}

.dialogueTabs button {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--dim);
    padding: 7px 12px;
}

.dialogueTabs button[aria-pressed="true"] {
    border-bottom-color: var(--cyan);
    color: var(--cyan);
    background: rgba(19, 107, 119, 0.2);
}

.dialoguePane {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding-top: 10px;
    overflow: hidden;
}

.dialoguePane[hidden] { display: none; }

.dialogueBar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
}

.dialogueBar .field { flex-direction: row; align-items: center; gap: 6px; }

.dialogueConversations {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 12px;
    min-height: 360px;
    overflow: hidden;
}

.dialogueSide {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dialogueList {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-height: 180px;
    max-height: 56vh;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.6);
}

.dialogueRow {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    border: 0;
    border-left: 2px solid transparent;
    background: transparent;
    color: var(--white);
    font-family: var(--serif);
    font-size: 10px;
    text-align: left;
}

.dialogueRow span { color: var(--dim); font-size: 9px; }

.dialogueRow .dialogueTriggerFlag {
    color: var(--bad);
    font-weight: normal;
}

.dialogueWarning {
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid var(--bad);
    background: rgba(255, 159, 131, 0.08);
    color: var(--dim);
    font-size: 10px;
    line-height: 1.5;
}

.dialogueWarning b { color: var(--bad); }
.dialogueWarning p { margin: 4px 0 0; }
.dialogueWarning code { color: var(--cyan); font-family: ui-monospace, Consolas, monospace; }
.dialogueWarning .dialogueBar { margin: 7px 0 0; }

.dialogueRow:hover,
.dialogueRow[aria-current="true"] {
    border-left-color: var(--cyan);
    background: rgba(19, 107, 119, 0.3);
    color: var(--cyan);
}

.dialogueEditor {
    min-width: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.dialogueFields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.dialogueFields label {
    display: flex;
    flex: 1 1 180px;
    flex-direction: column;
    gap: 3px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dialogueFields input,
.dialogueFields select,
.dialogueLine select,
.dialogueReply select,
.dialogueLine textarea,
.dialogueReply textarea {
    width: 100%;
    min-width: 0;
    padding: 5px 6px;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.85);
    color: var(--white);
    font-family: var(--serif);
    font-size: 10px;
}

.dialogueLine textarea,
.dialogueReply textarea { resize: vertical; line-height: 1.4; }

.dialogueLines {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 8px;
}

.dialogueLine {
    padding: 8px;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.5);
}

.dialogueLineHead,
.dialogueLineFoot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.dialogueLineFoot { margin: 6px 0 0; }

.dialogueLineHead select { width: auto; min-width: 92px; }

.dialogueLineHead .dialogueId { color: var(--dim); font-size: 9px; }

.dialogueVoice {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.dialogueVoice select { width: auto; min-width: 116px; max-width: 210px; }

.dialogueLineFoot label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--dim);
    font-size: 9px;
}

.dialogueLineFoot select { width: auto; max-width: 250px; }

.dialogueReplies {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 7px;
    padding-left: 12px;
    border-left: 1px solid var(--teal);
}

.dialogueReply {
    padding: 6px;
    background: rgba(19, 107, 119, 0.1);
}

.dialogueBadge {
    color: var(--cyan);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dialogueHint {
    margin: 7px 0 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    line-height: 1.5;
}

.dialogueVanilla {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 12px;
    min-height: 340px;
}

.dialogueVanillaList { max-height: 52vh; }
.dialogueVanillaDetail { max-height: 52vh; }
.dialogueVanillaDetail .dialogueText { margin: 8px 0; font-size: 11px; line-height: 1.6; }
.dialogueRadio { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 10px; }
.dialogueVanillaBar #dialogueVanillaSearch { flex: 1 1 180px; min-width: 120px; padding: 5px 7px; }

.dialogueMusicCard {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 620px;
    padding: 14px;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.55);
}

.dialogueMusicCard b { color: var(--cyan); }
.dialogueMusicCard .dialogueBar { margin: 0; }
#dialogueAudio { width: 100%; max-width: 620px; margin-top: 10px; }

@media (max-width: 820px) {
    .dialogueCard { width: 100vw; max-height: 100vh; }
    .dialogueConversations,
    .dialogueVanilla { grid-template-columns: minmax(0, 1fr); }
    .dialogueConversations { min-height: 0; }
    .dialogueList { max-height: 30vh; }
    .dialogueVanillaList,
    .dialogueVanillaDetail { max-height: 34vh; }
    .dialogueLineHead,
    .dialogueLineFoot { align-items: flex-start; }
    .dialogueVoice { flex-wrap: wrap; }
    .dialogueVoice select { max-width: 100%; }
}

.writerCard { width: min(1060px, 96vw); }

.writerHelp {
    margin: 8px 0 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    line-height: 1.5;
}

.writerGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.writerGrid textarea { min-height: 120px; }

.writerGrid textarea.writerCode {
    min-height: 230px;
    max-height: 340px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 10px;
    line-height: 1.5;
    white-space: pre;
}

.writerCode.isError { border-color: var(--bad); }

.writerPane {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.writerPaneHead {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 8px;
}

.writerPaneHead .field {
    flex: 1 1 auto;
    margin: 0;
}

.writerPaneHead select { width: auto; min-width: 132px; }

.writerPreviewWrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.writerPreviewLabel {
    margin: 0;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.writerPreview {
    margin: 0;
    padding: 8px 10px;
    min-height: 110px;
    max-height: 230px;
    overflow: auto;
    border: 1px solid var(--teal);
    background: rgba(0, 0, 0, 0.3);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 10px;
    line-height: 1.5;
    white-space: pre;
}

.scriptPreview {
    margin: 0;
    padding: 7px 9px;
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--teal);
    background: rgba(0, 0, 0, 0.3);
    color: var(--soft);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 9px;
    line-height: 1.5;
    white-space: pre;
}

.writerHelp code {
    color: var(--cyan);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 9px;
}

.writerNames {
    margin-top: 8px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
}

.writerNames summary { cursor: pointer; }

.writerNames .note {
    margin: 5px 0 0;
    color: var(--soft);
    font-size: 9px;
    line-height: 1.45;
}

.note.isError { color: var(--bad); }

                                                                                               
                                                         
.arrivalPanel {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--teal-deep);
    background: var(--face);
}

.arrivalPanelHead {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.arrivalPanelHead b {
    color: var(--cyan);
    font-weight: normal;
    letter-spacing: 0.04em;
}

.arrivalPanelHead span {
    color: var(--dim);
    font-size: 11px;
}

.arrivalPanel button.wide { margin-top: 6px; }

                                                                                            
.projectSubHead {
    margin-top: 18px;
    color: var(--dim);
    font-size: 12px;
    font-weight: normal;
}

.projectGraph {
    display: block;
    width: 100%;
    height: auto;
    margin: 6px 0 8px;
}

.graphEdge {
    stroke: rgba(171, 255, 255, 0.55);
    stroke-width: 1.4;
    fill: none;
}

#graphArrow path { fill: var(--cyan); }

.graphEdgeLabel {
    fill: var(--soft);
    font-size: 10px;
    text-anchor: middle;
}

.graphNode rect {
    fill: var(--face-solid);
    stroke: var(--cyan);
    stroke-width: 1.3;
}

.graphNode.isStart rect {
    stroke: var(--soft);
    stroke-width: 2;
}

.graphNode.isOrphan rect {
    stroke: var(--bad);
    stroke-width: 1.4;
    stroke-dasharray: 4 3;
}

.graphName {
    fill: var(--white);
    font-size: 11px;
    text-anchor: middle;
}

.graphScene {
    fill: var(--dim);
    font-size: 10px;
    text-anchor: middle;
}

.graphBadge {
    fill: var(--bad);
    font-size: 9px;
    letter-spacing: 0.05em;
    text-anchor: middle;
}

.graphMissing {
    stroke: var(--bad);
    stroke-width: 1.3;
    stroke-dasharray: 3 3;
}

.graphMissingDot { fill: var(--bad); }

.graphMissingLabel {
    fill: var(--bad);
    font-size: 9px;
}

.projectProblems {
    margin: 6px 0 0;
    padding-left: 18px;
    color: var(--bad);
    font-size: 11px;
    line-height: 1.5;
}

                                                                                  

.bodyCard.isCustom {
    border-color: var(--teal);
    background: rgba(19, 107, 119, 0.16);
}

                                                                                  

.brickStudioCard {
    width: min(1060px, 96vw);
    max-height: 92vh;
}

.brickStudioBody {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 286px;
    gap: 12px;
    min-height: 360px;
    margin-top: 10px;
}

.brickStudioStage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 360px;
    max-height: 58vh;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--teal);
    background-color: var(--void);
    background-image: linear-gradient(45deg, rgba(171, 255, 255, 0.06) 25%, transparent 25%, transparent 75%, rgba(171, 255, 255, 0.06) 75%), linear-gradient(45deg, rgba(171, 255, 255, 0.06) 25%, transparent 25%, transparent 75%, rgba(171, 255, 255, 0.06) 75%);
    background-position: 0 0, 8px 8px;
    background-size: 16px 16px;
}

#brickStudioCanvas {
    display: block;
    flex: none;
    cursor: crosshair;
    image-rendering: pixelated;
    box-shadow: 0 0 0 1px var(--teal), 0 0 24px rgba(0, 0, 0, 0.5);
    touch-action: none;
}

.brickStudioSide {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    max-height: 58vh;
    overflow-y: auto;
    padding-right: 2px;
}

.brickStudioDimensions {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 6px;
}

.brickStudioDimensions .field { width: 66px; }
.brickStudioDimensions .field input { width: 100%; padding: 4px 5px; }
.brickStudioDimensions button { padding: 5px 8px; font-size: 10px; }
.brickStudioZoomField { flex: 1 1 120px; width: auto !important; }
.brickStudioZoomField input { accent-color: var(--cyan); }

.brickToolRow {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.brickToolRow button {
    padding: 5px 8px;
    font-size: 10px;
}

.brickToolRow button[aria-pressed="true"] {
    color: var(--cyan);
    outline: 1px solid var(--cyan);
    background: rgba(19, 107, 119, 0.46);
}

.brickColourRow {
    display: flex;
    align-items: center;
    gap: 7px;
}

.brickColourChip {
    width: 26px;
    height: 19px;
    border: 1px solid rgba(171, 255, 255, 0.55);
}

.brickPalette {
    max-height: 168px;
    overflow-y: auto;
    padding-right: 3px;
}

.brickStudioHotspot {
    display: flex;
    gap: 8px;
}

.brickStudioHotspot .field { width: 92px; }
.brickStudioHotspot input { padding: 4px 5px; }

.brickStudioHelp {
    margin: 0;
    color: var(--dim);
    font-size: 9px;
    line-height: 1.45;
}

.brickStudioCard .dialogFoot { flex-wrap: wrap; }

@media (max-width: 760px) {
    .brickStudioBody { grid-template-columns: 1fr; }
    .brickStudioStage { min-height: 240px; max-height: 44vh; }
    .brickStudioSide { max-height: none; }
}

.facingRow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 7px 0;
    font-size: 12px;
    letter-spacing: .02em;
}

.facingRow > span {
    flex: 0 0 auto;
    color: var(--dim);
}

.facingRow > input {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: #abffff;
}

.facingRow > b {
    flex: 0 0 auto;
    font-weight: 500;
    color: #abffff;
    font-variant-numeric: tabular-nums;
}

                                                                                  

.savedContentCard { width: min(760px, 96vw); }

.savedContentList {
    display: grid;
    gap: 12px;
    max-height: min(52vh, 480px);
    overflow-y: auto;
    padding: 14px 0;
}

.savedContentGroup {
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.5);
}

.savedContentGroupHead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 11px;
    border-bottom: 1px solid var(--teal);
    background: rgba(19, 107, 119, 0.16);
}

.savedContentGroupHead h3 {
    margin: 0;
    color: var(--cyan);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.savedContentGroupHead span {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    text-align: right;
}

.savedContentRows { display: grid; }

.savedContentRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 11px;
    border-top: 1px solid rgba(19, 107, 119, 0.35);
}

.savedContentRow:first-child { border-top: 0; }

.savedContentRowMain {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.savedContentRowMain b {
    overflow: hidden;
    color: var(--white);
    font-family: var(--serif);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.savedContentRowMain .meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.savedContentHistory {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.savedContentRowActions {
    display: flex;
    align-items: center;
    flex: none;
    gap: 8px;
}

.savedContentRowSize {
    flex: none;
    color: var(--cyan);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.savedContentDelete,
.savedContentPrune { flex: none; }
.savedContentDelete:disabled,
.savedContentPrune:disabled { opacity: 0.5; cursor: not-allowed; }

.savedContentEmpty {
    margin: 0;
    padding: 12px 11px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    font-style: italic;
}

.savedContentFoot {
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.savedContentCard .note { margin: 0 0 2px; }

.savedContentRestore {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 0 0 10px;
    padding: 10px 11px;
    border: 1px solid rgba(19, 107, 119, 0.55);
    background: rgba(19, 107, 119, 0.1);
}

.savedContentRestoreCopy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.savedContentRestoreCopy b {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 11px;
    font-weight: 500;
}

.savedContentRestoreCopy span {
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    line-height: 1.45;
}

.savedContentRestoreActions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: none;
    margin-left: auto;
}

.savedContentRestoreActions > button { flex: none; }

                                                                                 

.backupRestoreCard { width: min(640px, 96vw); }

.backupRestoreCounts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 0 8px;
}

.backupRestoreFact {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid var(--teal);
    background: rgba(19, 107, 119, 0.15);
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
}

.backupRestoreFact b {
    color: var(--cyan);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.backupConflictOptions {
    display: grid;
    gap: 7px;
    margin: 4px 0 10px;
    padding: 10px;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.5);
}

.backupConflictOptions[hidden] { display: none; }

.backupConflictOptions legend {
    padding: 0 5px;
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backupConflictOptions label {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    color: var(--white);
    font-family: var(--serif);
    font-size: 11px;
    line-height: 1.4;
}

.backupConflictOptions input[type="radio"] {
    width: 14px;
    height: 14px;
    margin: 1px 0 0;
    accent-color: var(--cyan);
}

.backupConflictOptions label span { min-width: 0; }
.backupConflictOptions label b { color: var(--cyan); font-weight: 500; }

.backupRestorePreviewWrap {
    margin: 0 0 10px;
    border: 1px solid var(--teal);
    background: rgba(2, 7, 13, 0.5);
}

.backupRestorePreviewHead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--teal);
}

.backupRestorePreviewHead b {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.backupRestorePreviewHead .meta {
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backupRestorePreview {
    max-height: 230px;
    overflow: auto;
}

.backupRestorePreviewEmpty,
.backupRestorePreviewNote {
    margin: 0;
    padding: 9px 10px;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 10px;
    line-height: 1.45;
}

.backupRestorePreviewGroup { border-top: 1px solid rgba(19, 107, 119, 0.45); }
.backupRestorePreviewGroup:first-child { border-top: 0; }

.backupRestorePreviewAction {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px 4px;
    font-family: var(--serif);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.backupRestoreActionBadge {
    display: inline-flex;
    align-items: center;
    min-width: 62px;
    justify-content: center;
    padding: 2px 6px;
    border: 1px solid var(--teal);
    font-size: 9px;
}

.backupRestoreActionBadge.isAdd { color: var(--cyan); border-color: var(--cyan); }
.backupRestoreActionBadge.isKeep { color: var(--soft); border-color: var(--soft); }
.backupRestoreActionBadge.isReplace { color: var(--bad); border-color: var(--bad); }
.backupRestoreActionBadge.isSkip { color: var(--dim); }

.backupRestorePreviewBank {
    padding: 3px 10px 2px 18px;
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 10px;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backupRestorePreviewBank.isIncoming { color: var(--dim); }

.backupRestorePreviewItem {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;
    padding: 4px 10px 5px 24px;
    border-top: 1px solid rgba(19, 107, 119, 0.22);
}

.backupRestorePreviewName {
    overflow: hidden;
    color: var(--white);
    font-family: var(--serif);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backupRestorePreviewId {
    color: var(--cyan);
    font-family: var(--serif);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.backupRestorePreviewMeta {
    grid-column: 1 / -1;
    color: var(--dim);
    font-family: var(--serif);
    font-size: 9px;
    line-height: 1.35;
}

.backupRestorePreviewMeta.isSkip { color: var(--bad); }

.backupRestoreCard .note { margin: 0 0 10px; }

                                                                                                  
                                                                                                   
                                                                                                 
                                                                                                 
                                                                  
.exteriorCanvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: grab;
    touch-action: none;
}

.exteriorCanvas:active {
    cursor: grabbing;
}

.exteriorCanvas[hidden] {
    display: none;
}

body.exterior3d #roomCanvas {
    visibility: hidden;
}

.exteriorHud {
    position: absolute;
    left: 50%;
    bottom: 38px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 10px;
    transform: translateX(-50%);
    background: rgba(9, 22, 27, 0.82);
    border: 1px solid var(--teal);
    border-top-color: var(--cyan);
    color: var(--parchment);
    font-size: 12px;
    pointer-events: auto;
}

.exteriorHud[hidden] {
    display: none;
}

.exteriorKeys {
    white-space: nowrap;
}

                                                                                             
                                                                                                 
                                                   
body.exterior3d .layerLabel,
body.exterior3d #layerValue,
body.exterior3d .layerMax,
body.exterior3d #layerDown,
body.exterior3d #layerUp,
body.exterior3d #pickLevel,
body.exterior3d #hideAboveToggle {
    display: none;
}

                                                                                                 
                                                                                              
                                                                                               
            
.islandList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    align-content: start;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 80px;
    width: 100%;
    padding: 8px 10px;
    overflow: auto;
}

.islandCard {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 0;
    padding: 4px;
    border: 1px solid rgba(19, 107, 119, 0.55);
    background: rgba(19, 107, 119, 0.22);
    color: var(--parchment);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.islandCard:hover {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.18);
}

.islandCard.current {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.28);
    color: #071417;
}

.islandThumb {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #02070d;
    image-rendering: pixelated;
}

.islandCardLabel {
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.islandCardScene {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(244, 228, 189, 0.72);
    font-size: 10px;
}

.islandCard.current .islandCardScene {
    color: rgba(7, 20, 23, 0.78);
}

.islandRow {
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(19, 107, 119, 0.55);
    background: rgba(19, 107, 119, 0.22);
    color: var(--parchment);
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.islandRow:hover {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.18);
}

.islandRow.current {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.28);
    color: #071417;
}

.islandCoord {
    min-width: 48px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.islandScene {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(244, 228, 189, 0.72);
}

.islandRow.current .islandScene {
    color: rgba(7, 20, 23, 0.78);
}

.islandHint {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 10px 10px;
    color: rgba(244, 228, 189, 0.72);
    font-size: 12px;
}

.exteriorHud .small {
    white-space: nowrap;
}


                                                                                                
                                                                                               
                                                                        
.islandActions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.propsList {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 80px;
    width: 100%;
    padding: 8px 10px;
    overflow: auto;
}

.propRow {
    display: grid;
    grid-template-columns: minmax(76px, 0.9fr) minmax(0, 1.4fr) auto;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid rgba(19, 107, 119, 0.55);
    background: rgba(19, 107, 119, 0.22);
    font-size: 12px;
}

.propRow.current {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.24);
}

.propName {
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.propRow.current .propName {
    color: #071417;
}

.propMeta {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(244, 228, 189, 0.72);
    font-variant-numeric: tabular-nums;
}

.propRow.current .propMeta {
    color: rgba(7, 20, 23, 0.78);
}

.propActions {
    display: flex;
    gap: 4px;
}

.propActions .small {
    padding: 2px 6px;
    font-size: 11px;
}

                                                                                                
                                                                                     
button.islandRow.lba-plated {
    background: rgba(19, 107, 119, 0.22);
    color: var(--parchment);
}

button.islandRow.current.lba-plated {
    background: rgba(171, 255, 255, 0.28);
    color: #071417;
}

                                                                                                  
                                                                                          
.islandTerrainBar,
.propLibraryBar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 10px 4px;
    border-top: 1px solid rgba(19, 107, 119, 0.45);
}

#islandDecal[aria-pressed="true"] {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.24);
    color: #071417;
}

.islandTerrainLabel,
.propLibraryBar > span:first-child {
    font-family: Palatino, Georgia, serif;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cyan);
}

.textureGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 60px));
    justify-content: start;
    flex: 0 0 auto;
    gap: 4px;
    padding: 4px 10px 10px;
}

.textureSwatch {
    position: relative;
    display: block;
    padding: 0;
    border: 1px solid rgba(19, 107, 119, 0.65);
    background: #071417;
    cursor: pointer;
    line-height: 0;
}

.textureSlotLabel {
    position: absolute;
    right: 2px;
    bottom: 2px;
    padding: 0 3px;
    border-radius: 2px;
    background: rgba(2, 7, 13, 0.72);
    color: var(--parchment);
    font-size: 9px;
    line-height: 1.35;
}

.textureLibraryBar {
    border-top: 0;
    padding-top: 0;
}

                                                                                               
                                                         
.texturePageBar {
    border-top: 0;
    padding-top: 0;
    padding-bottom: 2px;
}

.groundPageBrowser {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    padding: 2px 10px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.groundPageCard {
    display: flex;
    flex: 0 0 118px;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    min-width: 0;
    padding: 4px;
    border: 1px solid rgba(19, 107, 119, 0.55);
    background: rgba(19, 107, 119, 0.14);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.groundPageCard:hover {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.16);
}

.groundPageCard[aria-pressed="true"] {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.22);
    box-shadow: 0 0 0 1px var(--cyan) inset;
}

.groundPageCard:focus-visible {
    outline: 1px solid var(--cyan);
    outline-offset: 1px;
}

.groundPageThumb,
.groundPageAllBadge {
    display: block;
    align-self: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(19, 107, 119, 0.65);
    background: #071417;
    image-rendering: pixelated;
}

.groundPageAllBadge {
    display: grid;
    place-items: center;
    color: var(--cyan);
    font-family: Palatino, Georgia, serif;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.groundPageCardLabel {
    overflow: hidden;
    color: var(--parchment);
    font-size: 11px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.groundPageCardMeta,
.groundPageTiles {
    overflow: hidden;
    color: rgba(244, 228, 189, 0.72);
    font-size: 9px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.groundPageMeter {
    display: block;
    height: 4px;
    overflow: hidden;
    background: rgba(2, 7, 13, 0.7);
}

.groundPageMeter > span {
    display: block;
    height: 100%;
    background: var(--cyan);
}

.groundPageTextureStrip {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 24px;
    overflow: hidden;
}

.groundPageTexture {
    display: block;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(19, 107, 119, 0.55);
    background: #071417;
    image-rendering: pixelated;
}

.groundPageMore {
    color: rgba(244, 228, 189, 0.65);
    font-size: 9px;
    line-height: 1.2;
}

.textureLibraryEmpty {
    grid-column: 1 / -1;
    margin: 4px 0;
    color: rgba(244, 228, 189, 0.72);
    font-size: 11px;
    line-height: 1.35;
}

.environmentGrid {
    display: grid;
    grid-template-columns: 74px 74px repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 8px;
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(19, 107, 119, 0.32);
}

.environmentPreview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: rgba(244, 228, 189, 0.72);
    font-size: 9px;
    line-height: 1.3;
}

.environmentThumb {
    display: block;
    width: 74px;
    height: 74px;
    image-rendering: pixelated;
    border: 1px solid rgba(19, 107, 119, 0.65);
    background: #071417;
}

.environmentGrid .field {
    margin: 0;
}

.environmentFogToggle {
    grid-column: 1 / -1;
    margin: 0;
}

                                                                                                  
                                                       
.weatherNewButton {
    align-self: end;
    margin-bottom: 2px;
    white-space: nowrap;
}

.weatherEditor {
    padding: 0 10px 10px;
    border-top: 1px solid rgba(19, 107, 119, 0.32);
}

                                                                                                  
                     
.weatherEditor[hidden],
.weatherEditorGrid label[hidden] {
    display: none;
}

.weatherEditorBar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 6px;
}

.weatherName {
    flex: 1 1 auto;
    min-width: 0;
}

.weatherEditorGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 8px;
}

.weatherEditorGrid .field {
    margin: 0;
}

.weatherColourRow {
    display: flex;
    align-items: center;
    gap: 6px;
}

.weatherColourRow input[type="color"] {
    width: 46px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(19, 107, 119, 0.5);
    background: none;
    cursor: pointer;
}

.weatherIndex {
    font-size: 9px;
    line-height: 1.2;
    color: rgba(244, 228, 189, 0.72);
}

.weatherSettleToggle {
    grid-column: 1 / -1;
    margin: 0;
}

.weatherSpritePreview {
    justify-self: start;
}

.weatherHint {
    margin: 8px 0 0;
}

.textureLibrary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 64px));
    align-content: start;
    gap: 4px;
    flex: 0 0 auto;
    max-height: 190px;
    padding: 4px 10px 10px;
    overflow: auto;
}

.textureLibraryCard {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 0;
    padding: 3px;
    border: 1px solid rgba(19, 107, 119, 0.5);
    background: rgba(19, 107, 119, 0.14);
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.textureLibraryCard:hover:not(:disabled) {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.16);
}
.textureLibraryCard[aria-pressed="true"] {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.24);
    box-shadow: inset 0 0 0 1px rgba(171, 255, 255, 0.42);
}

.textureLibraryCard:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.textureLibraryCard canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    image-rendering: pixelated;
}

.textureLibraryLabel {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(244, 228, 189, 0.72);
    font-size: 9px;
    line-height: 1.3;
}

.textureSwatch canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    image-rendering: pixelated;
}

.textureSwatch[aria-pressed="true"] {
    border-color: var(--cyan);
    box-shadow: 0 0 0 1px var(--cyan) inset;
}

.textureSwatch:focus-visible {
    outline: 1px solid var(--cyan);
    outline-offset: 1px;
}

                                                                                            
.recolourDetail {
    margin: -4px 0 8px;
    color: var(--dim);
    font-size: 11px;
    line-height: 1.35;
}

.recolourStrip {
    display: block;
    width: 100%;
    height: 26px;
    border: 1px solid rgba(19, 107, 119, 0.65);
    background: #071417;
    image-rendering: pixelated;
}

.recolourSlider {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 46px;
    align-items: center;
    gap: 8px;
    margin: 9px 0 0;
    color: var(--white);
    font-size: 11px;
}

.recolourSlider label {
    color: var(--dim);
    letter-spacing: 0.03em;
}

.recolourSlider input[type="range"] {
    width: 100%;
    accent-color: var(--cyan);
}

.recolourSlider b {
    color: var(--soft);
    font-weight: 400;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.recolourScope {
    margin-top: 9px;
}

body.recolourTool #roomCanvas {
    cursor: crosshair;
}

#islandPanel,
#propsPanel {
    overflow-y: auto;
}

.propsCatalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    align-content: start;
    gap: 5px;
    flex: 0 0 auto;
    width: 100%;
    max-height: 330px;
    padding: 4px 10px 8px;
    overflow: auto;
}

.propCard {
    position: relative;
    min-width: 0;
    border: 1px solid rgba(19, 107, 119, 0.4);
    background: rgba(19, 107, 119, 0.12);
}

.propCard:hover {
    border-color: var(--cyan);
    background: rgba(171, 255, 255, 0.14);
}

.propCard.isEmpty {
    opacity: 0.55;
}

.propCardPick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
    padding: 6px 4px 5px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.propCardPick:disabled {
    cursor: not-allowed;
}

.propThumb {
    display: block;
    max-width: 100%;
    image-rendering: pixelated;
}

.propCardLabel {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.propCardMeta {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(244, 228, 189, 0.72);
    font-size: 9px;
}

.propCardFind {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 1px 4px;
    font-size: 10px;
    opacity: 0.78;
}

.propEditor {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-top: 1px solid rgba(19, 107, 119, 0.45);
}

.propEditorHead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}

.propEditorHead span {
    color: rgba(244, 228, 189, 0.72);
}

.propEditor .note {
    margin: 0 0 6px;
}

.propCatalogRow {
    display: grid;
    grid-template-columns: minmax(70px, 0.7fr) minmax(0, 1.5fr) auto;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border: 1px solid rgba(19, 107, 119, 0.38);
    background: rgba(19, 107, 119, 0.12);
    font-size: 12px;
}

.propCatalogName {
    font-weight: 700;
    white-space: nowrap;
}

.propCatalogMeta {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(244, 228, 189, 0.72);
}

.propCatalogActions {
    display: flex;
    gap: 4px;
}

.propCatalogActions .small {
    padding: 2px 6px;
    font-size: 11px;
}

                                                                                
.bigViewBody .islandList {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
}

.bigViewBody .propsCatalog {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    max-height: none;
}

.bigViewBody .textureGrid {
    grid-template-columns: repeat(auto-fill, minmax(56px, 76px));
}

.bigViewBody .textureLibrary {
    grid-template-columns: repeat(auto-fill, minmax(56px, 76px));
    max-height: 40vh;
}

.bigViewBody #islandPanel,
.bigViewBody #propsPanel {
    overflow-y: auto;
}

                                                                              
.islandTerrainBar .terrainField {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(244, 228, 189, 0.82);
    font-size: 11px;
    white-space: nowrap;
}

.terrainField select {
    max-width: 128px;
}

.terrainField input[type="range"] {
    width: 68px;
}

.terrainField input[type="number"] {
    width: 52px;
}

.heightmapPanel {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(19, 107, 119, 0.45);
}

.heightmapBar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.heightmapCanvas {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    border: 1px solid rgba(19, 107, 119, 0.55);
    border-radius: 3px;
    background: #161b22;
    cursor: crosshair;
    touch-action: none;
}

.heightmapHint {
    padding: 0;
}

                                                                                        
                                                                                  
body:not(.exterior3d) .inspector > .panel.exteriorOnly {
    display: none;
}

.terrainBrushGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 2px 0 8px;
}

.terrainBrushGrid .field {
    margin: 0;
}

.terrainSizeRow {
    display: flex;
    align-items: center;
    gap: 6px;
}

.terrainSizeRow input[type="range"] {
    flex: 1 1 auto;
    width: 100%;
}

.terrainSizeRow b {
    min-width: 12px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 400;
    text-align: right;
}

.inspector .heightmapPanel {
    padding: 8px 0 0;
    border-top: 1px solid rgba(19, 107, 119, 0.32);
}

.inspector .heightmapCanvas {
    max-width: 100%;
}

.inspector .islandTerrainBar {
    padding: 0 0 6px;
    border-top: 0;
}

.inspector .environmentGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px 0 0;
    border-top: 0;
}

.inspector .environmentGrid .environmentFogToggle {
    grid-column: 1 / -1;
}

.inspector .weatherEditor {
    padding: 8px 0 0;
    border-top: 1px solid rgba(19, 107, 119, 0.32);
}

.inspector .brushPatternPanel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 0 10px 10px;
    border: 0;
    background: transparent;
}

.inspector .brushPatternPanel .brushPatternGrid {
    margin: 4px auto 2px;
}
