@font-face {
  font-family: "Liberation Sans";
  src: url("/assets/fonts/LiberationSans.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 14px/1.25 "Liberation Sans", Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}

button, input, textarea { font: inherit; color: inherit; }
button { border: 0; padding: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; }
input { border: 0; outline: 0; background: none; min-width: 0; }
img.icon { image-rendering: pixelated; display: block; flex: none; pointer-events: none; user-select: none; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }

#app {
  height: 100%;
  height: 100dvh;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--panel);
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x pan-y;
}

.work {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--left, 244px) 4px minmax(0, 1fr) 4px var(--right, 288px);
}
.work.left-shut { grid-template-columns: 36px 0 minmax(0, 1fr) 4px var(--right, 288px); }
.work.right-shut { grid-template-columns: var(--left, 244px) 4px minmax(0, 1fr) 0 36px; }
.work.left-shut.right-shut { grid-template-columns: 36px 0 minmax(0, 1fr) 0 36px; }

.center {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 4px var(--bottom, var(--bottom-default, 248px));
}
.center.bottom-shut { grid-template-rows: auto minmax(0, 1fr) 0 40px; }
.center > .tabs { grid-row: 1; }
.center > .stage { grid-row: 2; }
.center > .splitter { grid-row: 3; }
.center > .bottom { grid-row: 4; }

.splitter { background: var(--ground); position: relative; z-index: 2; touch-action: none; }
.splitter.v { cursor: col-resize; }
.splitter.h { cursor: row-resize; }
.splitter:hover, .splitter.dragging { background: var(--button); }
.work.left-shut > .splitter.left, .work.right-shut > .splitter.right, .center.bottom-shut > .splitter.h { pointer-events: none; }

.btn {
  height: 40px;
  min-width: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--button);
  color: var(--text);
  white-space: nowrap;
  flex: none;
}
.btn.has-icon { padding-left: 6px; }
.btn.icon-only { padding: 0 4px; }
.btn.small { height: 30px; min-width: 30px; padding: 0 10px; }
.btn.tile { background: var(--tile); }
.btn:hover:not(:disabled):not(.on) { background: #29323c; }
.btn.tile:hover:not(:disabled):not(.on) { background: var(--button); }
.btn.on, .btn.accent { background: var(--accent); }
.btn.create { background: var(--create); }
.btn.danger { background: var(--danger); }
.btn.team { background: var(--team); }
.btn:disabled { background: var(--disabled); color: var(--disabled-text); }
.btn:disabled img.icon { opacity: 0.55; }
.btn .count { color: var(--subtle-text); }
.btn.on .count { color: var(--text); }

.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  background: var(--panel);
  min-width: 0;
}
.topbar .group { display: flex; align-items: center; gap: 4px; flex: none; }
.topbar .gap { width: 10px; flex: none; }
.topbar .spring { flex: 1 1 0; min-width: 0; }
.topbar .map-name {
  flex: 0 1 240px;
  min-width: 72px;
  height: 40px;
  padding: 0 10px;
  font-size: 18px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
}
.topbar .map-name:hover { background: var(--tile); }
.topbar input.map-name { background: var(--tile); user-select: text; -webkit-user-select: text; cursor: text; }
.topbar .state { color: var(--subtle-text); padding: 0 8px; white-space: nowrap; flex: none; }
.topbar .state.notice { color: var(--notice); }
.topbar .state.problem { color: var(--problem); }

.dock { background: var(--panel); min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.dock-head {
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 0 12px;
}
.dock-head .title { font-size: 16px; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-head .fold { width: 32px; height: 32px; display: grid; place-items: center; }
.dock-head .fold:hover { background: var(--tile); }
.dock-body { flex: 1 1 auto; min-height: 0; position: relative; }
.dock.shut .dock-body, .dock.shut .dock-head .title { display: none; }
.dock.shut .dock-head { padding: 0 2px; flex-direction: column; height: auto; padding-top: 4px; }
.dock.shut .upright { writing-mode: vertical-rl; color: var(--subtle-text); padding: 10px 0; font-size: 14px; }
.dock:not(.shut) .upright { display: none; }

.tabs { display: flex; align-items: center; gap: 4px; height: 40px; padding: 5px 4px 5px 8px; background: var(--panel); min-width: 0; }
.tabs .btn { height: 30px; padding: 0 18px; background: var(--tile); }
.tabs .btn.on { background: var(--accent); }
.tabs .spring { flex: 1 1 auto; }
.tabs .fold { width: 32px; height: 32px; margin: -1px 0; display: grid; place-items: center; flex: none; }
.tabs .fold img.icon { transform: rotate(90deg); }
.tabs .fold:hover { background: var(--tile); }

.stage { position: relative; min-height: 0; min-width: 0; background: var(--map-preview); overflow: hidden; }
.stage > .pane { position: absolute; inset: 0; }
.bottom { background: var(--panel); min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.bottom .pane-host { flex: 1 1 auto; min-height: 0; position: relative; }
.bottom .pane-host > .pane { position: absolute; inset: 0; overflow: auto; }
.center.bottom-shut .bottom .pane-host { display: none; }

.viewport { position: absolute; inset: 0; outline: 0; touch-action: none; }
.viewport canvas { display: block; width: 100%; height: 100%; }
.viewport .marquee { position: absolute; border: 1px solid var(--text); background: rgba(20, 97, 219, 0.22); pointer-events: none; }
.viewport .line {
  position: absolute;
  left: 12px;
  bottom: 10px;
  right: 12px;
  color: var(--notice);
  font-size: 15px;
  pointer-events: none;
  text-shadow: none;
}
.viewport .line.problem { color: var(--problem); }
.viewport .skip {
  position: absolute;
  right: 12px;
  bottom: 12px;
}

.scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-track { background: var(--panel); }
.scroll::-webkit-scrollbar-thumb { background: var(--button); }
.pane::-webkit-scrollbar { width: 10px; height: 10px; }
.pane::-webkit-scrollbar-track { background: var(--panel); }
.pane::-webkit-scrollbar-thumb { background: var(--button); }

.section { padding: 4px 8px 10px; }
.section + .section { border-top: 4px solid var(--ground); padding-top: 8px; }
.section > .heading { color: var(--subtle-text); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 4px 6px; }

.row {
  min-height: 34px;
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
}
.row > .label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.wide { grid-template-columns: minmax(0, 1fr); }
.row .fields { display: flex; gap: 4px; min-width: 0; }
.row .value { color: var(--value); }
.row .plain { color: var(--subtle-text); }

.field {
  flex: 1 1 0;
  min-width: 0;
  height: 30px;
  display: flex;
  align-items: center;
  background: var(--tile);
  padding: 0 6px;
  gap: 5px;
}
.field > .axis { color: var(--subtle-text); flex: none; width: 9px; text-align: center; cursor: ew-resize; }
.field > .axis.x { color: var(--axis-x); }
.field > .axis.y { color: var(--axis-y); }
.field > .axis.z { color: var(--axis-z); }
.field > .unit { color: var(--subtle-text); flex: none; }
.field input { flex: 1 1 0; width: 100%; height: 100%; color: var(--value); user-select: text; -webkit-user-select: text; }
.field input.text { color: var(--text); }
.field.mixed input { color: var(--subtle-text); }
.field:focus-within { background: var(--button); }
.field.bad input { color: var(--problem); }

.choices { display: flex; flex-wrap: wrap; gap: 4px; }
.choices .btn { height: 30px; padding: 0 10px; background: var(--tile); flex: 1 1 auto; }
.choices .btn.on { background: var(--accent); }
.choices.two .btn { flex: 1 1 calc(50% - 2px); }

.swatch { width: 30px; height: 30px; flex: none; background: var(--tile); border: 0; padding: 0; image-rendering: pixelated; }
.grid16 { display: grid; grid-template-columns: repeat(16, minmax(0, 18px)); gap: 2px; }
.grid16 button { aspect-ratio: 1; width: auto; height: auto; min-width: 0; padding: 0; }
.grid16 button.on { outline: 2px solid var(--text); outline-offset: 0; position: relative; z-index: 1; }
.color-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.color-head .spring { flex: 1 1 auto; }
.wheel-toggle { flex: none; }
.btn.small.wheel-toggle { padding: 0 2px; }
.color-wheel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 4px 0; }
.wheel-disc { position: relative; width: 168px; height: 168px; flex: none; touch-action: none; cursor: crosshair; }
.wheel-face { display: block; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; user-select: none; }
.wheel-ring, .wheel-knob { position: absolute; width: 32px; height: 32px; transform: translate(-50%, -50%); image-rendering: pixelated; pointer-events: none; user-select: none; }
.wheel-side { display: flex; flex-direction: column; gap: 8px; flex: 1 1 120px; min-width: 120px; max-width: 200px; }
.wheel-swatch { height: 40px; background: #FFFFFF; }
.wheel-strip { position: relative; width: 100%; aspect-ratio: 256 / 80; touch-action: none; cursor: pointer; }
.wheel-bar { position: absolute; left: 5%; top: 17%; width: 90%; height: 66%; image-rendering: pixelated; }
.wheel-frame { position: absolute; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; user-select: none; }
.wheel-knob { top: 50%; }
.wheel-disc:focus-visible, .wheel-strip:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.group-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 0 6px; }
.group-chips .btn { max-width: 100%; }
.group-hint { color: var(--subtle-text); font-size: 12px; padding: 0 4px 6px; }
.sound-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 4px; padding: 2px 0 8px; max-height: 300px; overflow-y: auto; }
.sound-board .btn { justify-content: flex-start; min-width: 0; padding: 0 8px; }
.sound-board .btn .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu.script-pop.sounds { width: min(600px, calc(100vw - 16px)); }
.menu.script-pop.sounds .sound-board { padding: 2px; max-height: min(360px, calc(100vh - 80px)); }
.menu.script-pop.sounds .btn { padding-left: 8px; padding-right: 8px; height: 30px; }
.swatch.on { outline: 2px solid var(--text); outline-offset: -2px; }

.slider { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; }
.slider .track { position: relative; flex: 1 1 0; height: 30px; background: var(--tile); min-width: 40px; cursor: pointer; touch-action: none; }
.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--button); }
.slider .thumb { position: absolute; top: 0; bottom: 0; width: 8px; margin-left: -4px; background: var(--text); }
.slider .readout { position: absolute; inset: 0; display: grid; place-items: center; color: var(--value); pointer-events: none; }
.slider .btn { height: 30px; min-width: 30px; padding: 0; }

.note { color: var(--notice); padding: 4px; }
.note.problem { color: var(--problem); }
.subtle { color: var(--subtle-text); }

.search { height: 34px; margin: 0 8px 6px; display: flex; align-items: center; gap: 2px; background: var(--tile); padding: 0 6px 0 1px; }
.search input { flex: 1 1 0; height: 100%; user-select: text; -webkit-user-select: text; }
.search input::placeholder { color: var(--subtle-text); }
.tree-host { position: absolute; left: 0; right: 0; top: 40px; bottom: 0; }
.tree { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; outline: 0; }
.tree::-webkit-scrollbar { width: 10px; }
.tree::-webkit-scrollbar-track { background: var(--panel); }
.tree::-webkit-scrollbar-thumb { background: var(--button); }
.tree .sizer { position: relative; }
.tree .item {
  position: absolute;
  left: 0;
  right: 0;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-right: 8px;
  white-space: nowrap;
  cursor: default;
}
.tree .item:hover { background: var(--tile); }
.tree .item.on { background: var(--accent); }
.tree .item .twist { width: 16px; flex: none; text-align: center; color: var(--subtle-text); }
.tree .item.on .twist { color: var(--text); }
.tree .item .chip { width: 12px; height: 12px; flex: none; }
.tree .item .name { flex: 0 0 auto; max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
.tree .item .more { color: var(--subtle-text); margin-left: auto; padding-left: 8px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tree .item.on .more { color: var(--text); }
.tree .item.head { color: var(--text); }
.tree .item.head .more { color: var(--value); }
.tree .item.head.on .more { color: var(--text); }
.tree .none { position: absolute; left: 12px; top: 8px; color: var(--subtle-text); }

.build { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 8px 12px 10px; align-items: flex-start; }
.build .col { display: flex; flex-direction: column; gap: 6px; flex: none; }
.build .cap { color: var(--subtle-text); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; height: 16px; }
.build .looks + .cap { margin-top: 2px; }
.build .choices { flex-wrap: nowrap; }
.build-pane { container: build / inline-size; }
.build.looks-page { flex-wrap: nowrap; }
.build .col.next-col { width: min-content; }
.build .next-block, .build .next-finish { display: flex; flex-direction: column; gap: 6px; }
.build .next-finish .choices.two { flex-wrap: wrap; }
.build .next-finish .choices.two .btn { padding: 0 6px; }
.build .col.look-col { flex: 1 1 0; min-width: 0; }
.build .look-head { display: flex; align-items: center; gap: 8px; height: 30px; min-width: 0; }
.build .look-head .value { color: var(--value); font-size: 12px; }
.build .look-head .spring { flex: 1 1 auto; }
.build .look-tools { display: flex; gap: 4px; flex: none; }
.build .looks { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; height: 136px; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; }
.build .looks::-webkit-scrollbar { width: 10px; }
.build .looks::-webkit-scrollbar-track { background: var(--panel); }
.build .looks::-webkit-scrollbar-thumb { background: var(--button); }
.build .look { width: 60px; height: 66px; display: flex; flex-direction: column; align-items: center; background: var(--tile); padding: 2px 0 0; flex: none; scroll-snap-align: start; }
.build .look:hover:not(.on) { background: var(--button); }
.build .look canvas { width: 48px; height: 48px; flex: none; image-rendering: pixelated; display: block; pointer-events: none; }
.build .look.on { background: var(--accent); }
.build .look .tag { width: 100%; height: 16px; line-height: 16px; padding: 0 2px; font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.build .grid12 { display: grid; grid-template-columns: repeat(12, 18px); gap: 2px; }
.build .grid12 button { width: 18px; height: 18px; padding: 0; }
.build .grid12 button.on { outline: 2px solid var(--text); outline-offset: 0; position: relative; z-index: 1; }
.build .stepper { display: flex; align-items: center; gap: 4px; }
.build .stepper .size { min-width: 74px; height: 40px; display: grid; place-items: center; background: var(--tile); color: var(--value); font-size: 16px; }
.build .hex { width: 112px; }
.build .color-col .grid16 { grid-template-columns: repeat(16, minmax(0, 15px)); }
.build .color-col .color-head { height: 30px; }
.build .color-col .color-wheel { padding: 0; gap: 8px 12px; flex-wrap: nowrap; }
.build .color-col .wheel-disc { width: 112px; height: 112px; }
.build .color-col .wheel-side { min-width: 0; flex: 1 1 140px; gap: 6px; }
.build .color-col .wheel-swatch { height: 28px; }
.build .look, .build .grid12 button, .build .grid16 button, .build .asset-tile { touch-action: pan-y; }
@container build (max-width: 700px) {
  .build.looks-page { flex-wrap: wrap; }
  .build .col.next-col { display: contents; }
  .build .next-block { order: 1; flex: 1 1 100%; flex-direction: row; align-items: center; gap: 8px; }
  .build .col.look-col { order: 2; flex: 1 1 100%; }
  .build .next-finish { order: 3; flex: 1 1 100%; }
  .build .next-finish .choices.two { flex-wrap: nowrap; }
  .build .next-finish .choices.two .btn { flex: 1 1 0; }
  .build .col.color-col { order: 4; }
}
@container build (max-width: 860px) {
  #app.coarse .build.looks-page { flex-wrap: wrap; }
  #app.coarse .build .col.next-col { display: contents; }
  #app.coarse .build .next-block { order: 1; flex: 1 1 100%; flex-direction: row; align-items: center; gap: 8px; }
  #app.coarse .build .col.look-col { order: 2; flex: 1 1 100%; }
  #app.coarse .build .next-finish { order: 3; flex: 1 1 100%; }
  #app.coarse .build .next-finish .choices.two { flex-wrap: nowrap; }
  #app.coarse .build .next-finish .choices.two .btn { flex: 1 1 0; }
  #app.coarse .build .col.color-col { order: 4; }
}
@container build (max-width: 470px) {
  .build .look-tools .btn.has-icon { padding: 0 4px; }
  .build .look-tools .btn.has-icon .label { display: none; }
}

.drag-chip { position: fixed; left: 0; top: 0; z-index: 60; width: 26px; height: 26px; outline: 2px solid var(--text); image-rendering: pixelated; pointer-events: none; }
.drag-chip.lifted { width: 44px; height: 44px; }
body.dragging-in, body.dragging-in * { cursor: grabbing !important; }

.topbar .btn.space { min-width: 74px; color: var(--value); }

.menu {
  position: absolute;
  z-index: 30;
  min-width: 200px;
  background: var(--panel);
  outline: 4px solid var(--ground);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu { overflow-y: auto; overscroll-behavior: contain; }
.menu .btn { justify-content: flex-start; height: 36px; background: var(--tile); }
.menu .btn:not(.has-icon) { padding-left: 46px; }
.menu .btn .key { margin-left: auto; padding-left: 24px; color: var(--subtle-text); }

.sheet-back { position: absolute; inset: 0; z-index: 40; background: rgba(13, 13, 22, 0.82); display: grid; place-items: center; }
.sheet {
  width: min(880px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  background: var(--panel);
  outline: 4px solid var(--ground);
  display: flex;
  flex-direction: column;
}
.sheet .sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px; flex: none; }
.sheet .sheet-head .title { flex: 1 1 auto; text-align: center; font-size: 20px; padding-right: 110px; }
.sheet .sheet-body { overflow: auto; padding: 4px 18px 18px; }
.sheet.narrow { width: min(460px, calc(100vw - 48px)); }
.sheet.mid { width: min(620px, calc(100vw - 48px)); }
.sheet .words { padding: 6px 4px 14px; line-height: 1.45; }
.sheet .actions { display: flex; gap: 6px; justify-content: flex-end; padding: 0 0 2px; }

.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.controls .cap { grid-column: 1 / -1; color: var(--subtle-text); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; padding: 12px 0 2px; }
.controls .item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; min-height: 30px; align-items: center; background: var(--tile); padding: 5px 10px; line-height: 1.3; }
.controls .item .keys { color: var(--value); white-space: nowrap; }
.controls .plain { grid-column: 1 / -1; background: var(--tile); padding: 8px 10px; line-height: 1.45; }

@media (max-width: 1180px) {
  .topbar { gap: 4px; padding: 7px 6px; }
  .topbar .btn { padding: 0 9px; }
  .topbar .btn.has-icon { padding-left: 4px; }
  .topbar .btn.icon-only { padding: 0 2px; }
  .topbar .gap { width: 2px; }
  .topbar .state { padding: 0 4px; }
  .topbar .map-name { font-size: 16px; padding: 0 6px; }
  .work { --left: 208px; --right: 252px; }
}

#app.compact .work, #app.compact .work.left-shut, #app.compact .work.right-shut, #app.compact .work.left-shut.right-shut { grid-template-columns: minmax(0, 1fr); }
#app.compact .dock.left, #app.compact .dock.right, #app.compact .splitter.v { display: none; }
#app.compact .topbar .map-name { display: none; }
#app.compact .topbar .btn.has-icon .label { display: none; }
#app.compact .topbar .btn.has-icon { padding: 0 4px; }
#app.compact .topbar { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
#app.compact .topbar::-webkit-scrollbar { display: none; }
#app.compact .topbar .spring { flex: 1 0 0; }
#app.compact .topbar .group.pinned { position: sticky; right: -6px; z-index: 1; margin-right: -6px; padding: 0 6px 0 4px; background: var(--panel); }
@media (max-width: 360px) {
  #app.compact .topbar { gap: 4px; }
  #app.compact .topbar .btn:not(.icon-only):not(.exit) { padding: 0 6px; }
}
#app.compact .topbar .state { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#app.compact .center { --bottom-default: min(290px, 46dvh); grid-template-rows: auto minmax(0, 1fr) 4px min(var(--bottom, var(--bottom-default)), 62dvh); }
#app.compact .center.bottom-shut { grid-template-rows: auto minmax(0, 1fr) 0 40px; }
#app.compact .center > .tabs.lone { display: none; }
#app.compact .bottom .tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-right: 0; }
#app.compact .bottom .tabs::-webkit-scrollbar { display: none; }
#app.compact .bottom .tabs .btn { padding: 0 12px; }
#app.compact .bottom .tabs .spring { flex: 1 0 4px; }
#app.compact .bottom .tabs .fold { position: sticky; right: 0; z-index: 1; margin: 0; width: 40px; height: 40px; background: var(--panel); }
#app.compact .bottom .pane-host > .pane[data-panel="hierarchy"], #app.compact .bottom .pane-host > .pane[data-panel="inspector"] { overflow: hidden; }

#app.side { grid-template-rows: 48px minmax(0, 1fr); }
#app.side .topbar { padding-top: 4px; padding-bottom: 4px; }
#app.side .center, #app.side .center.bottom-shut { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) 4px min(var(--side, 44%), 70%); }
#app.side .center.bottom-shut { grid-template-columns: minmax(0, 1fr) 0 40px; }
#app.side .center > .stage { grid-row: 1; grid-column: 1; }
#app.side .center > .splitter { grid-row: 1; grid-column: 2; }
#app.side .center > .bottom { grid-row: 1; grid-column: 3; }
#app.side .splitter.h { cursor: col-resize; }
#app.side .tabs .fold img.icon { transform: none; }
#app.side .center.bottom-shut .bottom .tabs { padding: 0; }
#app.side .center.bottom-shut .bottom .tabs > :not(.fold) { display: none; }
.topbar .tabs { height: 40px; padding: 0; background: none; flex: none; }
.topbar .tabs .btn { height: 40px; padding: 0 12px; }
.topbar .tabs.lone { display: none; }

.scene-tools { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px 10px; pointer-events: none; }
.scene-tools:empty { display: none; }
.scene-tools .group { display: flex; gap: 4px; pointer-events: auto; }
.scene-tools .btn { padding: 0 10px; }
.scene-tools .btn.icon-only { padding: 0 4px; }
.scene-tools .btn.space { min-width: 62px; padding: 0 6px; color: var(--value); }
.scene-acts { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; flex-direction: column; gap: 6px; }
.scene-acts[hidden] { display: none; }
.scene-acts .btn { width: 48px; height: 48px; padding: 0; }
#app.fingers .menu .btn .key { display: none; }

@media (pointer: coarse) { input, textarea, select { font-size: 16px; } }
#app.coarse input, #app.coarse textarea, #app.coarse select { font-size: 16px; }
#app.coarse .btn.small { height: 38px; min-width: 38px; }
#app.coarse .tabs .btn { height: 34px; }
#app.coarse .topbar .tabs .btn { height: 40px; }
#app.coarse .scene-tools .btn { height: 44px; min-width: 44px; }
#app.coarse .dock-head .fold { width: 40px; height: 40px; }
#app.coarse .tabs .fold { width: 40px; height: 40px; margin: -3px 0; }
#app.coarse .row { min-height: 42px; }
#app.coarse .field { height: 38px; }
#app.coarse .field > .axis { width: 18px; align-self: stretch; display: grid; place-items: center; margin-left: -6px; touch-action: none; }
#app.coarse .work { --right: 320px; }
#app.coarse.compact .center { --bottom-default: min(316px, 46dvh); }
#app.coarse .choices .btn { height: 38px; }
#app.coarse .swatch { width: 38px; height: 38px; }
#app.coarse .slider .track { height: 38px; }
#app.coarse .slider .btn { height: 38px; min-width: 38px; }
#app.coarse .search { height: 40px; }
#app.coarse .tree-host { top: 46px; }
#app.coarse .menu .btn { height: 44px; }
#app.coarse .menu .btn .key { display: none; }
#app.coarse .build .grid12 { grid-template-columns: repeat(12, minmax(0, 26px)); }
#app.coarse .build .grid12 button { width: auto; height: auto; aspect-ratio: 1; }
#app.coarse .grid16 { grid-template-columns: repeat(16, minmax(0, 24px)); }
#app.coarse .build .look-head { height: 38px; }
#app.coarse .listing .item { min-height: 48px; }
#app.coarse .listing .item .does .btn { height: 38px; }
#app.coarse .controls .item { min-height: 38px; }
#app.coarse .splitter.h::after { content: ""; position: absolute; left: 0; right: 0; top: -12px; bottom: -4px; }
#app.coarse .splitter.v::after { content: ""; position: absolute; top: 0; bottom: 0; left: -10px; right: -10px; }
#app.coarse.side .splitter.h::after { top: 0; bottom: 0; left: -12px; right: -4px; }
#app.coarse .splitter.h::before { content: ""; position: absolute; left: calc(50% - 22px); top: 0; width: 44px; height: 4px; background: var(--button); }
#app.coarse.side .splitter.h::before { left: 0; top: calc(50% - 22px); width: 4px; height: 44px; }

.build .makes { display: flex; gap: 4px; }
.build .btn.make { width: 162px; justify-content: flex-start; touch-action: pan-y; }

.row.stack { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-top: 4px; padding-bottom: 6px; }
.row.stack > .label { color: var(--subtle-text); }

.viewport .slot-chooser { position: absolute; left: 12px; right: 12px; bottom: 22px; width: fit-content; margin: 0 auto; z-index: 3; display: grid; gap: 8px; justify-items: center; padding: 10px 12px 12px; background: var(--panel); }
.viewport .slot-chooser[hidden], .viewport.alone .slot-chooser { display: none; }
.viewport .slot-chooser .title { font-size: 18px; }
.viewport .slot-chooser { max-width: calc(100% - 24px); box-sizing: border-box; }
#app.side .viewport .slot-chooser, #app.compact .viewport .slot-chooser { bottom: 10px; }
.viewport .slot-chooser .slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.viewport .slot-chooser .btn { min-width: 92px; height: 44px; justify-content: center; }

.listing { display: grid; gap: 4px; }
.listing .cap { color: var(--subtle-text); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; padding: 12px 0 2px; display: flex; gap: 8px; }
.listing .cap:first-child { padding-top: 2px; }
.listing .cap .count { color: var(--value); letter-spacing: 0; text-transform: none; }
.listing .item { display: flex; align-items: stretch; min-height: 40px; background: var(--tile); }
.listing .item .pick { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 5px 10px; text-align: left; }
.listing .item button.pick:hover { background: var(--button); }
.listing .item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing .item .more { color: var(--subtle-text); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.listing .item .more .value { color: var(--value); }
.listing .item .does { flex: none; display: flex; align-items: center; padding: 0 5px; }
.listing .item .does .btn { height: 30px; padding: 0 12px; }
.listing .plain { color: var(--subtle-text); background: var(--tile); padding: 10px; line-height: 1.45; }
.listing .plain.problem { color: var(--problem); }
.listing .plain.notice { color: var(--notice); }
.listing .file { display: flex; padding-top: 2px; }
.listing .item .more.notice { color: var(--notice); }
.listing .item .more.problem { color: var(--problem); }
.listing .item.long .pick { grid-template-columns: minmax(0, 1fr); }
.listing .item.long .more { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.listing .item.gone .name { color: var(--disabled-text); }
.listing .item button.pick:disabled { cursor: default; background: none; }
.listing .says { margin-top: -4px; padding: 5px 10px 9px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.listing .says[hidden] { display: none; }
.listing .says .btn { margin-left: auto; }

.publish { display: grid; gap: 8px; }
.publish .picture { display: block; width: 100%; height: auto; aspect-ratio: 854 / 480; background: var(--map-preview); }
.publish .row { padding: 0; grid-template-columns: 92px minmax(0, 1fr); }
.publish .row .value { user-select: text; -webkit-user-select: text; }
.publish .field input:disabled { color: var(--disabled-text); }
.publish .says { min-height: 20px; line-height: 1.45; color: var(--notice); padding: 0 4px; }
.publish .says.problem { color: var(--problem); }
.publish .says.plain { color: var(--text); }
.publish .says .value { color: var(--value); user-select: text; -webkit-user-select: text; }
.publish .actions { padding-top: 2px; }
.publish .actions .btn { min-width: 132px; }
.publish .prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.publish .prices .btn { height: 48px; min-width: 0; flex-direction: column; gap: 1px; padding: 0 4px; }
.publish .prices .btn .gets { color: var(--subtle-text); font-size: 12px; }
.publish .prices .btn.on .gets { color: var(--text); }
.publish .prices .btn.on:disabled { background: var(--accent); color: var(--text); }
.publish .prices .btn:disabled:not(.on) .gets { color: var(--disabled-text); }

@media (max-width: 560px), (max-height: 560px) {
  .sheet, .sheet.narrow, .sheet.mid { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .sheet .sheet-head .title { padding-right: 0; text-align: left; font-size: 18px; }
}
@media (max-width: 560px) {
  .controls { grid-template-columns: minmax(0, 1fr); }
  .controls .item { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .controls .item .keys { white-space: normal; text-align: right; }
  .sheet .sheet-body { padding: 4px 10px 12px; }
  .listing .item .pick { grid-template-columns: minmax(0, 1fr); }
  .listing .item .more { white-space: normal; overflow-wrap: anywhere; }
  .publish .actions { flex-wrap: wrap; }
}
