/* Brighter Data (/data, src/main.ts and its views): its own styles, loaded only while its page shows
   (the site's shared ones are css/app.css). */
.search-group {
  padding: 0.375rem 0.5rem 0.125rem;
  color: var(--fg2);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.search-item {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.3125rem 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
}
.search-item .si-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-item .si-meta {
  color: var(--fg2);
  font-size: 0.6875rem;
  white-space: nowrap;
}
/* ---------- collapsible side panels (panels.ts) ---------- */
/* expanded: a slim chevron pull-tab straddling the panel's inner border,
   vertically centered; sits in the viewer gutter so it never covers panel
   content. Collapsed: the panel is a 32px rail and the whole rail is the
   expand button. */
.panel-toggle {
  position: absolute;
  z-index: 27;
  top: 50%;
  transform: translateY(-50%);
  width: 0.9375rem;
  height: 4rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg1);
  border: 1px solid var(--line);
  color: var(--fg2);
  font-size: 0.8125rem;
  line-height: 1;
  cursor: pointer;
}
.panel-toggle:hover {
  background: var(--bg3);
  color: var(--fg0);
}
.panel-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* the row is the highlighted pill; it holds the tab button + a sibling "?" so
   neither control is nested inside the other (valid markup, clean a11y) */
.cat-tab-row {
  display: flex;
  align-items: center;
  border-radius: 0.375rem;
}
.cat-tab-row:hover {
  background: var(--bg2);
}
.cat-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  color: var(--fg1);
  border: none;
  background: none;
  text-align: left;
  flex: 1;
  min-width: 0;
  border-radius: 0.375rem;
}
.cat-tab .ct-icon {
  width: 1rem;
  text-align: center;
  color: var(--accent);
  opacity: 0.85;
}
.cat-tab .ct-name {
  flex: 1;
}
.cat-tab .ct-count {
  color: var(--fg2);
  font-size: 0.6875rem;
  font-family: var(--mono);
}
.cat-tab .ct-count.partial {
  color: var(--warn);
}
.ct-help {
  flex: none;
  width: 0.9375rem;
  height: 0.9375rem;
  margin-right: 0.5rem;
  padding: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  color: var(--fg2);
  background: var(--bg3);
  opacity: 0.5;
  cursor: pointer;
  user-select: none;
  transition:
    opacity 0.12s,
    color 0.12s,
    background 0.12s,
    border-color 0.12s;
}
.cat-tab-row:hover .ct-help {
  opacity: 0.75;
}
.ct-help:hover {
  opacity: 1;
  color: var(--bg0);
  background: var(--accent);
  border-color: var(--accent);
}
.ct-help:focus-visible {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.filter-dd {
  position: relative;
  font-size: 0.75rem;
}
.filter-dd > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 0.25rem 0.5625rem;
  border-radius: 0.375rem;
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--fg1);
}
.filter-dd > summary::-webkit-details-marker {
  display: none;
}
.filter-dd > summary::after {
  content: ' ▾';
  color: var(--fg2);
}
.filter-dd[open] > summary {
  border-color: var(--accent-dim);
}
.filter-panel {
  position: absolute;
  z-index: 20;
  margin-top: 0.25rem;
  min-width: 10rem;
  padding: 0.3125rem;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.filter-opt {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.25rem 0.375rem;
  border-radius: 0.3125rem;
  cursor: pointer;
}
.filter-opt:hover {
  background: var(--bg3);
}
.filter-opt input {
  accent-color: var(--accent);
}
.filter-clear {
  margin-top: 0.1875rem;
  padding: 0.1875rem 0.375rem;
  font-size: 0.6875rem;
  border-radius: 0.3125rem;
  cursor: pointer;
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--fg2);
}
.filter-clear:hover {
  color: var(--fg0);
  border-color: var(--accent-dim);
}
.vlist {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  outline: none;
}
.vlist-sizer {
  position: relative;
  width: 100%;
}
.vrow {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.625rem;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  white-space: nowrap;
}
.vrow:hover {
  background: var(--bg2);
}
.vrow .r-id {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--fg2);
  width: 4rem;
  flex: none;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vrow .r-model-id {
  width: 1.5rem;
}
.vrow .r-main {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vrow .r-meta {
  color: var(--fg2);
  font-size: 0.6875rem;
  font-family: var(--mono);
  flex: none;
}
.vrow .r-thumb {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: 0.25rem;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.vrow .r-thumb img {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}
/* model card pictures (372:255) */
.vrow .r-thumb.r-card {
  width: 3.625rem;
  background: #1c1b1d;
}
.vrow .r-thumb.r-card img {
  image-rendering: auto;
}
.vrow .r-thumb.r-card-none {
  background: var(--bg3);
  opacity: 0.35;
}
/* the World list's pinned "All" entry (merged whole-world): accent tint so it
   reads as navigation, not another room */
.vrow.vrow-all {
  background: rgba(120, 183, 255, 0.08);
  border-bottom: 1px solid var(--line);
}
.vrow.vrow-all:hover {
  background: rgba(120, 183, 255, 0.15);
}
.vrow.vrow-all .r-id,
.vrow.vrow-all .r-main {
  color: var(--accent);
}
.vrow.vrow-all .r-main {
  font-weight: 600;
}
.vlist-empty {
  padding: 1.5rem 0.875rem;
  color: var(--fg2);
  text-align: center;
}
.banner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4375rem 0.875rem;
  border-bottom: 1px solid var(--line);
  background: #3a1f22;
  color: #f2c6c6;
  font-size: 0.75rem;
}
.banner.b-info {
  background: #1d2a3a;
  color: #bcd7f5;
}
.banner .bn-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}
.banner .bn-close:hover {
  opacity: 1;
}
/* ---------- viewer shared ---------- */
.viewer-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg1);
  flex: none;
}
.viewer-toolbar .sep {
  width: 1px;
  height: 1.125rem;
  background: var(--line);
  margin: 0 0.25rem;
}
/* texture variants strip (multiple assigned textures, one active) */
.tex-variants {
  display: inline-flex;
  gap: 0.1875rem;
  align-items: center;
}
.tex-variants[hidden] {
  display: none;
}
.tv-chip {
  position: relative;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 0.3125rem;
  cursor: pointer;
  flex: none;
  border: 1px solid var(--line);
  background: var(--bg2);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tv-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.tv-chip .tv-id {
  font-size: 0.5rem;
  color: var(--fg2);
}
.tv-chip .tv-origin {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0 0.125rem;
  border-radius: 0 0.1875rem 0 0.25rem;
  font-size: 0.4375rem;
  line-height: 0.625rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.68);
  pointer-events: none;
}
.tv-chip.tv-system {
  border-color: color-mix(in srgb, var(--good) 55%, var(--line));
}
.tv-chip .tv-x {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.6875rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 0 0.25rem 0 0.25rem;
  padding: 0 0.125rem;
  opacity: 0;
}
.tv-chip:hover .tv-x {
  opacity: 1;
}
.tv-chip.tv-none {
  font-size: 0.875rem;
  color: var(--fg2);
}
/* a variant whose texture (by content hash) isn't present in the current bundle build */
.tv-chip.tv-missing {
  border-color: var(--warn, #c8922e);
  border-style: dashed;
  color: var(--warn, #c8922e);
}
/* dyeable regions: one colour swatch per recolour-mask channel */
.tex-dyes {
  display: inline-flex;
  gap: 0.1875rem;
  align-items: center;
  margin-left: 0.25rem;
}
.tex-dyes[hidden] {
  display: none;
}
.dye-swatch {
  width: 1.625rem;
  height: 1.625rem;
  padding: 0;
  flex: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 0.3125rem;
  background: var(--bg2);
}
.dye-swatch::-webkit-color-swatch-wrapper {
  padding: 0.125rem;
}
.dye-swatch::-webkit-color-swatch {
  border: none;
  border-radius: 0.1875rem;
}
.dye-swatch::-moz-color-swatch {
  border: none;
  border-radius: 0.1875rem;
}
.tv-chip.tv-missing .tv-id {
  font-size: 0.8125rem;
  color: var(--warn, #c8922e);
}
.viewer-title {
  font-weight: 650;
  font-size: 0.875rem;
  margin-right: 0.375rem;
}
.canvas-host {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: radial-gradient(75rem 43.75rem at 50% 30%, #171b23, #0c0e12);
}
.canvas-host canvas {
  display: block;
}
/* the room's loading ring while the game's frame is built (the shared .load-card, in the middle of the view) */
.canvas-host .world-curtain {
  top: 50%;
}
/* All rooms: rooms in view still being shaded (the shared .load-card, small, at the foot of the view) */
.canvas-host .world-shading-ring {
  top: auto;
  bottom: 4.5rem;
  transform: translateX(-50%);
}
.canvas-host .world-shading-ring svg {
  width: 1.75rem;
  height: 1.75rem;
}
/* Immersive mode (U toggle, src/viewers/view-chrome.ts): hide all chrome so
   only the renderer shows. F fullscreen uses the browser :fullscreen state. */
.viewer-pane.ui-hidden .viewer-toolbar,
.viewer-pane.ui-hidden .world-panel,
.viewer-pane.ui-hidden .world-hud,
.viewer-pane.ui-hidden .cam-hint {
  display: none;
}
.viewer-pane:fullscreen {
  background: #0c0e12;
}
.uv-overlay {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  border: 1px solid var(--line);
  background: rgba(10, 12, 16, 0.88);
  border-radius: 0.375rem;
  z-index: 5;
}
/* camera-controls hint (src/viewers/view-chrome.ts): card ⇄ ? chip */
.cam-hint {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 5;
  font-size: 0.6875rem;
}
.cam-hint-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.3125rem 0.625rem;
  background: rgba(10, 12, 16, 0.82);
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  color: var(--fg2);
  white-space: nowrap;
  /* the all-rooms fly-cam hint carries five rows: wrap instead of overflowing */
  flex-wrap: wrap;
  max-width: min(92vw, 38.75rem);
}
.cam-hint-card b {
  color: var(--fg1);
  font-weight: 600;
}
.cam-hint [hidden] {
  display: none;
}
.stats-row {
  display: flex;
  gap: 1.125rem;
  padding: 0.375rem 0.875rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  background: var(--bg1);
  flex: none;
  color: var(--fg2);
  font-size: 0.6875rem;
}
.stats-row b {
  color: var(--fg1);
  font-weight: 600;
}
.anim-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.75rem;
  border-top: 1px solid var(--line-soft);
  background: var(--bg1);
  flex: none;
  flex-wrap: wrap;
  overflow: auto; /* height is drag-resizable; content scrolls when shrunk */
}
.anim-bar select {
  max-width: 13.75rem;
}
.anim-bar .clip-select option {
  padding: 0.125rem 0.375rem;
}
.anim-bar .clip-select option:disabled {
  color: var(--fg2);
}
.anim-bar .clip-select option:checked {
  background: var(--sel);
  color: var(--fg1);
}
.anim-bar .clip-sort {
  max-width: 9.375rem;
}
.anim-bar input[type='range'] {
  flex: 1;
  min-width: 7.5rem;
}
.anim-time {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--fg1);
  min-width: 6.875rem;
  text-align: right;
}
.details-section {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg2);
}
/* ---------- audio ---------- */
.audio-wave-wrap {
  position: relative;
  flex: 1;
  min-height: 8.75rem;
  background: var(--bg0);
}
.audio-wave-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
/* ---------- images ---------- */
.img-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
  background: conic-gradient(#1c2027 90deg, #14171d 90deg 180deg, #1c2027 180deg 270deg, #14171d 270deg) 0 0/1.375rem
    1.375rem;
}
.img-stage img {
  position: absolute;
  transform-origin: 0 0;
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}
.substrip {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  overflow-x: auto;
  border-top: 1px solid var(--line-soft);
  background: var(--bg1);
  flex: none;
}
.subthumb {
  flex: none;
  text-align: center;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
}
.subthumb .st-box {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(#20242c 90deg, #171a20 90deg 180deg, #20242c 180deg 270deg, #171a20 270deg) 0 0/0.75rem
    0.75rem;
  border-radius: 0.25rem;
}
.subthumb img {
  max-width: 4rem;
  max-height: 4rem;
  image-rendering: pixelated;
}
.subthumb .st-label {
  font-size: 0.625rem;
  color: var(--fg2);
  margin-top: 0.1875rem;
  font-family: var(--mono);
}
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr));
  gap: 0.625rem;
  padding: 0.875rem;
}
.img-cell {
  background: var(--bg1);
  border: 1px solid var(--line-soft);
  border-radius: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  text-align: center;
}
.img-cell:hover {
  border-color: var(--accent-dim);
}
.img-cell .ic-box {
  height: 6.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-cell .ic-name {
  color: var(--fg1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.125rem;
}
.img-cell img {
  max-width: 100%;
  max-height: 6.875rem;
  image-rendering: pixelated;
}
.center-note {
  color: var(--fg2);
  padding: 1.25rem;
  text-align: center;
}
/* ---------- texture override picker (docked over the details panel) ---------- */
.texpicker {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  background: var(--bg1);
  border-left: 1px solid var(--line);
  padding: 0.5rem;
}
.texpicker .tp-head {
  display: flex;
  gap: 0.375rem;
  flex: none;
}
.texpicker .tp-filter {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--fg0);
  font: inherit;
  font-size: 0.75rem;
}
.texpicker .tp-actions {
  display: flex;
  gap: 0.25rem;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
}
.texpicker .tp-grid {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.875rem, 1fr));
  gap: 0.375rem;
  align-content: start;
  padding: 0.125rem;
}
.texpicker .tp-cell {
  cursor: pointer;
  border: 1px solid var(--line-soft);
  border-radius: 0.375rem;
  background: var(--bg2);
  padding: 0.1875rem;
  text-align: center;
  position: relative;
}
.texpicker .tp-fit {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  pointer-events: none;
  font: 0.625rem/1 monospace;
  color: #fff;
  background: rgba(18, 22, 30, 0.82);
  border: 1px solid var(--accent-dim);
  border-radius: 0.25rem;
  padding: 1px 0.1875rem;
}
.texpicker .tp-fitprog {
  width: 5.5rem;
  height: 0.625rem;
  vertical-align: middle;
}
.texpicker .tp-cell:hover {
  border-color: var(--accent-dim);
  background: var(--bg3);
}
.texpicker .tp-cell img {
  width: 100%;
  height: 3.5rem;
  object-fit: contain;
  image-rendering: pixelated;
  background: repeating-conic-gradient(#20242e 0 25%, #171a21 0 50%) 0 0/0.75rem 0.75rem;
  border-radius: 0.25rem;
}
.texpicker .tp-label {
  font-size: 0.5625rem;
  color: var(--fg2);
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.texpicker .tp-foot {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  flex: none;
  flex-wrap: wrap;
}
/* ---------- skeleton composite mesh list (details panel) ---------- */
.skel-meshes {
  margin-top: 0.5rem;
}
.skel-meshes .sm-tools {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
  align-items: center;
}
.skel-meshes .sm-filter {
  flex: 1;
  min-width: 0;
  padding: 0.1875rem 0.5rem;
  border-radius: 0.3125rem;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--fg0);
  font: inherit;
  font-size: 0.75rem;
}
.skel-meshes .sm-list {
  height: 42vh;
  max-height: 70vh;
  resize: vertical;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 0.375rem;
}
.skel-meshes .sm-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.71875rem;
  line-height: 1.4;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.skel-meshes .sm-row > input {
  flex: none;
  margin: 0;
}
.skel-meshes .sm-row > a {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bone-tree-acc {
  margin-top: 0.5rem;
}
.bone-tree-acc > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.bone-tree-acc > summary::-webkit-details-marker {
  display: none;
}
.bone-tree-acc > summary::before {
  content: '▸ ';
  color: var(--fg2);
}
.bone-tree-acc[open] > summary::before {
  content: '▾ ';
}
.skel-meshes .sm-row:last-child {
  border-bottom: none;
}
.skel-meshes .sm-row:hover {
  background: var(--bg2);
}
.skel-meshes .sm-row input {
  accent-color: var(--accent);
}
.texpicker .tp-cell.sel {
  border-color: var(--warn);
  box-shadow: 0 0 0 2px #6b5426;
}
/* ---------- friendly-name editor (details panel) ---------- */
.name-edit {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.name-edit .name-input {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--fg0);
  font: inherit;
  font-size: 0.75rem;
}
.name-edit .name-input::placeholder {
  color: var(--fg2);
  font-style: italic;
}
/* ---------- keyboard-navigation owner indicator ---------- */
/* subtle border on whichever panel currently receives the arrow keys */
.kb-target {
  box-shadow: inset 0 0 0 1px var(--accent-dim);
  border-radius: 0.25rem;
}
.texpicker.kb-target {
  box-shadow: inset 0 0 0 1px var(--accent-dim);
  border-radius: 0;
}
.modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.modal-json {
  flex: 1;
  min-height: 7.5rem;
  max-height: 52vh;
  overflow: auto;
  margin: 0;
}
/* ---------- help / FAQ modal ---------- */
/* width follows the base .modal.card (capped at .card's 620px, comfortable for prose) */
.help-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.5rem;
}
.help-intro {
  margin: 0.125rem 0 0.25rem;
  color: var(--fg1);
}
.help-section {
  margin: 1.125rem 0 0.625rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg2);
}
.help-intro + .help-section {
  margin-top: 0.75rem;
  padding-top: 0;
  border-top: 0;
}
.help-qa {
  margin: 0 0 0.75rem;
}
.help-q {
  margin: 0 0 0.25rem;
  color: var(--fg0);
  font-weight: 600;
}
.help-a {
  margin: 0;
  color: var(--fg1);
}
.notice-modal {
  max-width: 30rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.help-a + .help-a {
  margin-top: 0.375rem;
}
.help-a code,
.help-intro code {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg0);
  background: var(--bg3);
  padding: 0 0.25rem;
  border-radius: 0.25rem;
}
.help-legal {
  margin: 1.125rem 0 0.125rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}
.skel-meshes .sm-row.sel {
  background: var(--sel);
  box-shadow: inset 2px 0 0 var(--warn);
}
.skel-meshes .sm-list.kb-target {
  box-shadow: inset 0 0 0 1px var(--accent-dim);
}
.texpicker .tp-color {
  width: 1.75rem;
  height: 1.5rem;
  padding: 1px;
  border: 1px solid var(--line);
  border-radius: 0.3125rem;
  background: var(--bg2);
  cursor: pointer;
}
.texpicker .tp-color:not(.tp-color-set) {
  opacity: 0.5;
}
/* no target colour set (default) */
.texpicker .tp-color.tp-color-set {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.texpicker .tp-pickclear {
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  line-height: 1;
}
.texpicker .tp-swatches {
  display: inline-flex;
  gap: 0.125rem;
  align-items: center;
}
.texpicker .tp-swatch {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 0.1875rem;
  border: 1px solid var(--line);
  display: inline-block;
}
.skel-meshes .sm-slot {
  max-width: 6rem;
}
.texpicker .tp-addcolor {
  padding: 0.125rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1;
}
.texpicker .tp-swatch {
  cursor: pointer;
}
.texpicker .tp-swatch:hover {
  outline: 1px solid var(--bad);
}
/* ------------------------------------------------------------------ onboarding
   (client-side extraction wizard, shared by simple + studio modes) */
.onboard {
  max-width: 40rem;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}
.onboard h2 {
  margin: 0 0 0.375rem;
}
.ob-drop {
  border: 2px dashed var(--line);
  border-radius: 0.625rem;
  padding: 1.625rem 1.25rem;
  text-align: center;
  background: var(--bg1);
  margin: 0.875rem 0;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.ob-drop-icon {
  font-size: 1.625rem;
  color: var(--accent);
}
.ob-browse {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
.ob-bundles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.375rem;
  margin: 0.625rem 0;
}
.ob-bundle {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.4375rem 0.5625rem;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 0.4375rem;
  opacity: 0.55;
}
.ob-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
}
.ob-paths {
  margin: 0.625rem 0 0.25rem;
}
.ob-path {
  margin: 0.375rem 0;
}
.ob-path-os {
  display: block;
  margin-bottom: 0.1875rem;
  color: var(--fg2);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.ob-path code {
  display: inline-block;
  max-width: 100%;
  font-size: 0.6875rem;
  color: var(--fg1);
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 0.3125rem;
  padding: 0.125rem 0.375rem;
  overflow-wrap: anywhere;
  user-select: all;
}
.ob-cats {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0.75rem 0;
}
.ob-cat {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 0.75rem;
  cursor: pointer;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
.ob-cat:hover {
  background: var(--bg2);
}
.ob-cat-icon {
  color: var(--accent);
  width: 1rem;
  text-align: center;
}
.ob-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}
.ob-bar-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.ob-bar-label {
  width: 13.75rem;
  text-align: right;
  color: var(--fg1);
}
.ob-bar {
  flex: 1;
  height: 0.5rem;
  background: var(--bg2);
  border-radius: 0.25rem;
  overflow: hidden;
}
.ob-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 0.25rem;
  transition: width 0.2s;
}
.ob-bar-pct {
  width: 9.375rem;
  color: var(--fg2);
}
.ob-legal {
  margin-top: 1.125rem;
  border-top: 1px solid var(--line);
  padding-top: 0.625rem;
}
.ob-world-link {
  margin: -0.25rem 0 0.75rem;
}
.ob-validate {
  padding: 0.375rem 0.625rem;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 0.4375rem;
}
.ob-done {
  padding: 0.875rem 1rem;
  margin: 0.75rem 0;
}
/* storage & versions panel */
.ver-row {
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ver-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ver-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* long names wrap, never clip */
.ver-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ver-rename-btn {
  flex: none;
  padding: 0.125rem 0.375rem;
}
.ver-rename {
  flex: 1;
  min-width: 0;
  max-width: 16.25rem;
  background: var(--bg3);
  border: 1px solid var(--accent-dim);
  border-radius: 0.3125rem;
  color: var(--fg0);
  padding: 0.125rem 0.4375rem;
  font: inherit;
  font-weight: 700;
  outline: none;
}
.ver-actions {
  display: flex;
  gap: 0.375rem;
}
.chip-btn {
  cursor: pointer;
}
.chip-btn:hover {
  color: var(--accent);
}
.video-modal {
  width: min(45rem, 92vw);
}
.video-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.625rem 0;
}
/* Create Model wizard + the Model details manifest */
.model-wizard {
  width: min(37.5rem, 94vw);
  max-height: 94vh;
  overflow-y: auto;
}
.mw-preview-wrap {
  margin: 0.5rem 0 0.125rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #0d0f13;
}
.mw-preview {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}
.mw-preview:active {
  cursor: grabbing;
}
.mw-picker {
  margin-top: 0.375rem;
}
.mw-picker .sm-list {
  height: 24vh;
}
.mw-namerow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.125rem;
}
.mw-namerow input {
  flex: 1;
}
.model-manifest {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  max-height: 40vh;
  overflow-y: auto;
}
.mm-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.125rem 0.25rem;
  border-bottom: 1px solid var(--line-soft);
}
/* body scrolls on short screens; the h2 header and .modal-actions stay pinned.
   the symmetric padding (pulled back with a negative margin so content still
   lines up with the header/buttons) leaves room for the crop-guide handles that
   overhang the preview, so a wide preview never trips a horizontal scrollbar. */
.video-body {
  overflow-y: auto;
  padding: 0 0.5rem;
  margin: 0 -0.5rem;
}
/* wrap multi-control rows instead of overflowing the modal width on narrow screens */
.video-form label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem 0.625rem;
}
.video-form label > span:first-child {
  min-width: 5rem;
  color: var(--fg1);
}
.video-form input[type='number'] {
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--fg0);
  border-radius: 0.375rem;
  padding: 0.25rem 0.375rem;
  width: 4rem;
}
.video-form .video-cap {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--fg0);
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
}
.video-form .video-clips {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.75rem;
}
.video-form .video-clips-row {
  align-items: flex-start;
}
.video-preview {
  max-width: 100%;
  max-height: min(20rem, 42vh);
  width: auto;
  height: auto;
  background: #000;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  display: block;
  margin: 0 auto;
}
/* width-crop overlay on the video preview */
.video-crop-wrap {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  line-height: 0;
}
.video-crop-dim {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(6, 8, 11, 0.62);
  pointer-events: none;
  z-index: 1;
}
.video-crop-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0.875rem;
  margin-left: -0.4375rem;
  cursor: ew-resize;
  z-index: 2;
  touch-action: none;
}
.video-crop-line::after {
  content: '';
  position: absolute;
  left: 0.375rem;
  top: 0;
  bottom: 0;
  width: 0.125rem;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}
.video-crop-line::before {
  content: '';
  position: absolute;
  left: 0.1875rem;
  top: 50%;
  margin-top: -0.9375rem;
  width: 0.5rem;
  height: 1.875rem;
  border-radius: 0.25rem;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.video-crop-line.locked {
  pointer-events: none;
}
.video-crop-line.locked::before,
.video-crop-line.locked::after {
  opacity: 0.4;
}
.video-form input[type='color'] {
  width: 2.125rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  background: var(--bg3);
  cursor: pointer;
}
.video-preview-ctrls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.375rem 0 0;
}
.video-form .video-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.video-form .video-dim {
  width: 3.875rem;
}
.sep-mini {
  display: inline-block;
  width: 0.75rem;
}
/* compare-mode topbar chip + diff view */
#compare-chip {
  display: inline-flex;
  gap: 0.1875rem;
}
#compare-chip .diff-link {
  color: var(--accent);
}
.diff-view {
  overflow-y: auto;
}
.diff-body {
  margin: 0.75rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.diff-head {
  padding: 0.75rem 1rem;
}
/* accordion title row: label on the left, jump button pinned right */
.diff-cat > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.diff-cat > summary .diff-sum {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diff-jump {
  flex: none;
}
.diff-bundles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.375rem;
}
.diff-cat {
  padding: 0.5rem 0.875rem;
}
.diff-cat > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.diff-cat > summary::-webkit-details-marker {
  display: none;
}
.diff-cat > summary::before {
  content: '▸ ';
  color: var(--fg2);
}
.diff-cat[open] > summary::before {
  content: '▾ ';
}
.diff-cat h4 {
  margin: 0.625rem 0 0.25rem;
}
/* dense multi-column rows: use the full width */
.diff-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1px 0.875rem;
}
.diff-list.with-thumbs {
  grid-template-columns: repeat(auto-fill, minmax(23.75rem, 1fr));
}
.diff-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.125rem 0.25rem;
  color: var(--fg1);
  text-decoration: none;
  border-radius: 0.25rem;
  min-width: 0;
}
.diff-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diff-row:hover {
  background: var(--bg2);
}
.diff-thumb {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  object-fit: contain;
  border-radius: 0.25rem;
  background: repeating-conic-gradient(#1c212b 0% 25%, #141820 0% 50%) 0 0/0.75rem 0.75rem;
}
.diff-pixels {
  display: flex;
  gap: 0.625rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}
.diff-pixels figure {
  margin: 0;
}
.diff-pixels img,
.diff-pixels canvas {
  max-width: 16.25rem;
  max-height: 16.25rem;
  image-rendering: pixelated;
  background: #222;
}
.diff-room-detail {
  padding: 0.25rem 0.5rem 0.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.diff-room-detail > div {
  white-space: normal;
}
.diff-room-asset {
  text-decoration: none;
}
.diff-room-asset.del {
  text-decoration: line-through;
}
.onboard-host {
  position: relative;
  max-width: 45rem;
  width: 90%;
  max-height: 88vh;
  overflow-y: auto;
}
.onboard-host .onboard {
  margin: 0.5rem auto;
}
.bn-close-corner {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
}
.center-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--fg2);
}
/* strings viewer */
.string-view {
  max-width: 53.75rem;
  margin: 1.125rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.string-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.string-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9375rem;
  line-height: 1.5;
  user-select: text;
}
.string-rel-row {
  display: flex;
  gap: 0.625rem;
  padding: 0.25rem 0;
  color: var(--fg1);
}
.string-rel-row:hover {
  color: var(--accent);
}
.string-rel-cur {
  color: var(--fg0);
  background: var(--bg2);
  border-radius: 0.25rem;
}
/* Scenes editor: details-panel item list + selected-item pose/transform
   controls, and the add-model picker modal */
/* ---------- world room viewer (js/viewers/world.js) ---------- */
.world-panel {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 6;
  width: 15.375rem;
  max-height: calc(100% - 1.5rem);
  overflow-y: auto;
  background: rgba(14, 16, 22, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5625rem 0.6875rem;
  backdrop-filter: blur(4px);
  user-select: none;
  font-size: 0.75rem;
}
.world-panel .wp-status {
  min-height: 0.9375rem;
  color: var(--fg2);
  font-size: 0.6875rem;
  overflow-wrap: anywhere;
}
.world-panel .wp-status.bad {
  color: var(--bad);
}
.world-panel .wp-section {
  border-top: 1px solid var(--line-soft);
  margin-top: 0.5rem;
  padding-top: 0.4375rem;
}
.world-panel .wp-title {
  color: var(--fg2);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.1875rem;
}
.world-panel .wp-check {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.125rem 0;
  cursor: pointer;
}
.world-panel .wp-check:has(input:disabled) {
  opacity: 0.45;
  cursor: default;
}
.world-panel .wp-sw {
  width: 0.6875rem;
  height: 0.6875rem;
  border-radius: 0.125rem;
  border: 1px solid #0006;
  flex: none;
}
.world-panel .wp-range {
  margin-top: 0.375rem;
}
/* a control that belongs to the box above it (Rooms away, a distance) */
.world-panel .wp-sub {
  margin-left: 1.375rem;
}
.world-panel .wp-range.wp-sub {
  margin-top: 0.125rem;
  margin-bottom: 0.25rem;
}
.world-panel .wp-range-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--fg1);
  font-size: 0.6875rem;
}
.world-panel .wp-range-head output {
  color: var(--fg0);
  font-variant-numeric: tabular-nums;
}
.world-panel .wp-range input[type='range'] {
  width: 100%;
}
.world-panel .wp-zlinks a {
  color: var(--accent);
  cursor: pointer;
}
.world-panel .wp-zlist {
  max-height: 8rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.5rem;
  margin-top: 0.1875rem;
}
.world-panel .wp-zlist label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  padding: 1px 0;
  cursor: pointer;
}
.world-panel .wp-readout {
  margin: 0.3125rem 0 0.1875rem 0.125rem;
  padding-left: 0.5rem;
  border-left: 2px solid #d6b34f;
  color: var(--fg1);
  font-size: 0.6875rem;
  overflow-wrap: anywhere;
  user-select: text;
}
.world-panel .wp-readout[hidden] {
  display: none;
}
.world-panel .wp-readout.pinned {
  border-left-color: #ffdc69;
}
.world-panel .wp-readout dl {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.125rem 0.4375rem;
  margin: 0;
}
.world-panel .wp-readout dt {
  color: var(--fg2);
}
.world-panel .wp-readout dd {
  margin: 0;
  color: var(--fg0);
  font-variant-numeric: tabular-nums;
}
/* Inspect is a MODE toggle, not a view layer: a distinct button at the top */
.world-panel .wp-inspect {
  display: block;
  width: 100%;
  margin-bottom: 0.375rem;
  padding: 0.3125rem 0.5rem;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  color: var(--fg1);
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
}
.world-panel .wp-inspect:hover:not(:disabled) {
  color: var(--fg0);
  border-color: var(--fg2);
}
.world-panel .wp-inspect:disabled {
  opacity: 0.45;
  cursor: default;
}
/* Session-edit reset: surfaces under the Inspect toggle once an edit exists */
.world-panel .wp-reset-edits {
  display: block;
  width: 100%;
  margin: -0.125rem 0 0.375rem;
  padding: 0.1875rem 0.5rem;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 0.375rem;
  color: var(--fg2);
  font-size: 0.6875rem;
  cursor: pointer;
  text-align: center;
}
.world-panel .wp-reset-edits:hover {
  color: var(--fg0);
  border-color: var(--fg2);
}
.world-panel .wp-reset-edits[hidden] {
  display: none;
}
/* Pinned-mesh preview (small standalone spinner canvas in the readout) */
.world-panel .wp-preview {
  margin-top: 0.375rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.3125rem;
  overflow: hidden;
  background: #171a20;
}
.world-panel .wp-preview canvas {
  display: block;
  width: 100%;
  height: auto;
}
/* Temporary-edit controls (nudge / rotate / step / delete) while pinned */
.world-panel .wp-edit {
  display: grid;
  grid-template-columns: 2.125rem 1fr 1fr;
  gap: 0.1875rem 0.3125rem;
  margin-top: 0.4375rem;
  align-items: center;
}
.world-panel .wp-edit .axis {
  color: var(--fg2);
  font-size: 0.625rem;
  text-transform: uppercase;
}
.world-panel .wp-edit button {
  padding: 0.125rem 0;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  color: var(--fg1);
  font-size: 0.6875rem;
  cursor: pointer;
}
.world-panel .wp-edit button:hover {
  color: var(--fg0);
  border-color: var(--fg2);
}
.world-panel .wp-edit select {
  grid-column: 2 / 4;
  padding: 0.125rem 0.1875rem;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  color: var(--fg1);
  font-size: 0.6875rem;
}
.world-panel .wp-edit-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.375rem;
}
.world-panel .wp-edit-actions button {
  flex: 1;
  padding: 0.1875rem 0.375rem;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  color: var(--fg1);
  font-size: 0.6875rem;
  cursor: pointer;
}
.world-panel .wp-edit-actions .wp-delete {
  color: #e79a8e;
  border-color: #6b3a34;
}
.world-panel .wp-edit-actions .wp-delete:hover {
  color: #ffb3a6;
  border-color: #a35247;
}
/* Pinned effect instance: per-emitter summary (rate/life/colour swatches/sprite) */
.world-panel .wp-readout .wp-fx-emitters {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.125rem 0 0.25rem;
}
.world-panel .wp-readout .wp-fx-emitter {
  display: flex;
  align-items: center;
  gap: 0.3125rem;
  flex-wrap: wrap;
}
.world-panel .wp-readout .wp-fx-emitter-text {
  color: var(--fg1);
}
/* Wave C: pinned-spawn animation player (reuses the Models clip PlaybackBar) */
.world-panel .wp-variant {
  margin-top: 0.5rem;
  border-top: 1px solid var(--line-soft);
  padding-top: 0.4375rem;
}
.world-panel .wp-variant-title {
  color: var(--fg2);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.world-panel .wp-variant-select {
  width: 100%;
}
.world-panel .wp-anim {
  margin-top: 0.5rem;
  border-top: 1px solid var(--line-soft);
  padding-top: 0.4375rem;
}
.world-panel .wp-anim-title {
  color: var(--fg2);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.world-panel .wp-anim-hint {
  padding: 0.1875rem 0;
  overflow-wrap: anywhere;
}
.world-panel .wp-anim .anim-bar {
  margin: 0;
  padding: 0;
  border: 0;
}
.world-panel .wp-anim .anim-bar select {
  max-width: 100%;
}
.world-panel .wp-anim .anim-bar input[type='range'] {
  min-width: 5rem;
}
/* Advanced accordion (Water / Lighting / Performance / Height levels) */
.world-panel .wp-advanced {
  border-top: 1px solid var(--line-soft);
  margin-top: 0.5rem;
  padding-top: 0.375rem;
}
.world-panel .wp-advanced > summary {
  color: var(--fg2);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.3125rem;
}
.world-panel .wp-advanced > summary::-webkit-details-marker {
  display: none;
}
.world-panel .wp-advanced > summary::before {
  content: '▸';
  font-size: 0.5625rem;
  transition: transform 0.12s;
}
.world-panel .wp-advanced[open] > summary::before {
  transform: rotate(90deg);
}
.world-panel .wp-advanced > summary:hover {
  color: var(--fg0);
}
.world-panel .wp-advanced > .wp-section:first-of-type {
  border-top: 0;
  margin-top: 0.25rem;
  padding-top: 0;
}
@media (max-width: 900px) {
  .world-panel {
    width: min(15.375rem, 44vw);
  }
}
/* loading/perf HUD (js/viewers/world/hud.js): world-panel styling, top-left */
.world-hud {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 6;
  max-width: 18.75rem;
  background: rgba(14, 16, 22, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.375rem 0.5625rem;
  backdrop-filter: blur(4px);
  user-select: none;
  font-size: 0.6875rem;
  color: var(--fg1);
  font-variant-numeric: tabular-nums;
}
.world-hud .wh-head {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  float: right;
}
.world-hud .wh-toggle {
  background: none;
  border: 0;
  color: var(--fg2);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0 0.125rem;
}
.world-hud .wh-toggle:hover {
  color: var(--fg0);
}
.world-hud .wh-chip-fps {
  color: var(--fg2);
}
.world-hud .wh-chip-fps[hidden] {
  display: none;
}
.world-hud .wh-body[hidden] {
  display: none;
}
.world-hud .wh-stage {
  color: var(--fg0);
}
.world-hud .wh-stage.steady {
  color: var(--fg2);
}
.world-hud .wh-stage.bad {
  color: var(--bad);
}
.world-hud .wh-stats {
  margin-top: 1px;
}
.world-hud .wh-env {
  margin-top: 1px;
  color: var(--fg2);
  overflow-wrap: anywhere;
}
/* shared viewer lighting overlay (mesh / rig / model viewers) */
.light-overlay {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 6;
  width: 11.875rem;
}
.light-overlay .wp-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* model variant strip: keyboard focus ring on the active cell */
.variant-strip .subthumb.kb-focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
/* clip picker text filter (PlaybackBar) */
.clip-filter {
  width: 6.875rem;
  min-width: 0;
  padding: 0.1875rem 0.375rem;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  background: var(--bg3);
  color: var(--fg0);
  font-size: 0.71875rem;
}
/* an effect system's colours and pictures in the World inspector (viewers/world/view-readout.ts buildEmitterSummary) */
.we-swatches {
  display: inline-flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.we-swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 0.1875rem;
  border: 1px solid var(--line);
  display: inline-block;
}
.we-thumb {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.25rem;
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--bg3);
  image-rendering: pixelated;
}
/* ------------------------------------------------------------------ Brighter Data on a phone
   (src/mobile-gate.ts): a dialog over the app, once per visit */
.mgate-overlay {
  z-index: 70;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
.mgate-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  color: var(--fg2);
  font-size: 1rem;
  cursor: pointer;
}
.mgate-close:hover,
.mgate-close:focus-visible {
  background: var(--bg3);
  color: var(--fg0);
  outline: none;
}
.mgate-lede {
  margin: 0;
  color: var(--fg1);
}
.mgate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mgate .mgate-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 0.625rem;
  background: var(--bg2);
  color: var(--fg0);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mgate .mgate-action:hover {
  border-color: var(--accent-dim);
  text-decoration: none;
}
.mgate .mgate-action:active {
  transform: scale(0.985);
  background: var(--sel);
}
.mgate .mgate-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mgate .mgate-action svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}
.mgate-action-ico {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}
.mgate-continue {
  min-height: 2.75rem;
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
}
/* 2D maps: the canvas owns touch gestures, controls retain normal scrolling. */
.map-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 12.5rem;
}
.map-workspace {
  display: flex;
  position: relative;
  flex: 1;
  min-height: 10rem;
  overflow: hidden;
}
.map-inspection-toolbar {
  display: inline-flex;
  gap: 0.375rem;
}
.map-inspection {
  width: 18.75rem;
  flex: none;
  padding: 0.625rem;
  overflow: auto;
  background: var(--bg1);
  border-left: 1px solid var(--line);
}
.map-inspection[hidden] {
  display: none;
}
.map-inspection fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
}
.map-inspection input[type='search'] {
  width: 100%;
  box-sizing: border-box;
  margin: 0.375rem 0;
  padding: 0.4375rem;
  color: var(--fg0);
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 0.3125rem;
}
.map-inspection details {
  margin: 0.625rem 0;
}
.map-options {
  max-height: 13.75rem;
  overflow: auto;
  margin: 0.375rem 0;
}
.map-options label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 1.75rem;
}
.map-options label span {
  flex: 1;
  overflow-wrap: anywhere;
}
.map-options small {
  color: var(--fg2);
}
.map-selection pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.6875rem;
  max-height: 16.25rem;
  overflow: auto;
}
.map-overlaps {
  max-height: 11.25rem;
  overflow: auto;
}
.map-results button,
.map-overlaps button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0.25rem 0;
}
.map-status {
  padding: 0.4375rem 0.625rem;
  font-size: 0.75rem;
  flex: none;
}
/* "Show in world": the model's rooms */
.model-rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  max-height: 50vh;
  overflow-y: auto;
  margin: 0.5rem 0;
}
.model-rooms .model-room {
  text-align: left;
}
/* the model card picture modal */
.card-preview {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0;
}
.card-preview canvas {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
}
.card-preview canvas.checker {
  background: repeating-conic-gradient(#2a2d33 0% 25%, #1f2227 0% 50%) 50% / 1rem 1rem;
}
