:root {
  --ink: #1e2327;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --muted: #626c73;
  --accent: #0b6f68;
  --accent-soft: #dcefed;
  --warn: #9f4c20;
  --shadow: 0 18px 54px rgba(22, 27, 31, 0.16);
  --rr-shell-bg: #f7f0fa;
  --rr-shell-edge: #ddc4e2;
  --rr-rail-bg: rgba(216, 184, 220, 0.3);
  --rr-rail-border: rgba(76, 45, 96, 0.18);
  --rr-rail-shadow: rgba(76, 45, 96, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--rr-shell-bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

img,
video,
canvas {
  -webkit-user-drag: none;
  user-select: none;
}

.room-app {
  min-height: 100vh;
}

.brand-logo {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  top: max(16px, env(safe-area-inset-top));
  z-index: 27;
  width: clamp(104px, 8.8vw, 158px);
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 10px 24px rgba(26, 31, 35, 0.16));
}

.room-viewport {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px 0 76px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.07) 0,
      rgba(255, 255, 255, 0.07) 1px,
      rgba(120, 70, 140, 0.022) 2px,
      rgba(120, 70, 140, 0.022) 4px
    ),
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 50%),
    linear-gradient(90deg, #d7b4dc 0%, var(--rr-shell-edge) 10%, #f4ebf7 25%, #faf6fb 50%, #f4ebf7 75%, var(--rr-shell-edge) 90%, #d7b4dc 100%);
}

.canvas-shell {
  position: relative;
  width: min(92vw, calc(177.7778vh - 206px));
  height: auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: transparent;
  isolation: isolate;
  filter: drop-shadow(0 24px 56px rgba(76, 45, 96, 0.12));
}

.sky-layer,
.room-canvas,
.light-canvas,
.window-layer,
.door-layer,
.sign-layer,
.frame-layer,
.furniture-layer,
.ceiling-layer,
.lighting-layer,
.light-object-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sky-layer {
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: #93cbea;
}

.sky-layer.is-active {
  opacity: 1;
}

.sky-media-plane {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  pointer-events: none;
}

.sky-media-plane video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.room-canvas {
  z-index: 1;
  display: block;
  cursor: default;
}

.light-canvas {
  z-index: 2;
  display: block;
  pointer-events: none;
}

.room-canvas.is-paint-mode {
  cursor: pointer;
}

.window-layer {
  z-index: 3;
  pointer-events: none;
}

.door-layer {
  z-index: 3;
  pointer-events: none;
}

.sign-layer {
  z-index: 4;
  pointer-events: none;
}

.window-layer.is-window-mode {
  pointer-events: auto;
  cursor: crosshair;
}

.door-layer.is-door-mode {
  pointer-events: auto;
  cursor: crosshair;
}

.door-layer.is-view-mode {
  pointer-events: auto;
}

.door-layer.is-view-mode .door-item {
  cursor: pointer;
}

.sign-layer.is-sign-mode {
  pointer-events: auto;
  cursor: crosshair;
}

.window-layer.is-select-mode,
.door-layer.is-select-mode,
.sign-layer.is-select-mode,
.frame-layer.is-select-mode,
.furniture-layer.is-select-mode,
.ceiling-layer.is-select-mode,
.light-object-layer.is-select-mode {
  pointer-events: none;
}

.frame-layer {
  z-index: 4;
  pointer-events: none;
}

.frame-layer.is-frame-mode {
  pointer-events: auto;
  cursor: crosshair;
}

.window-layer.is-read-only,
.sign-layer.is-read-only,
.frame-layer.is-read-only,
.furniture-layer.is-read-only,
.ceiling-layer.is-read-only,
.light-object-layer.is-read-only {
  pointer-events: none;
}

.door-layer.is-read-only {
  pointer-events: auto;
}

.furniture-layer {
  z-index: 5;
  pointer-events: none;
}

.furniture-layer.is-furniture-mode {
  pointer-events: auto;
}

.ceiling-layer {
  z-index: 6;
  pointer-events: none;
}

.ceiling-layer.is-ceiling-mode {
  pointer-events: auto;
}

.lighting-layer {
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.lighting-layer.is-active {
  opacity: 1;
}

.lighting-layer::before,
.lighting-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lighting-layer::before {
  background:
    radial-gradient(
      circle at var(--lighting-focus-x, 50%) var(--lighting-focus-y, 34%),
      rgba(var(--lighting-focus-rgb, 255, 225, 170), var(--lighting-focus-opacity, 0)) 0%,
      rgba(var(--lighting-focus-rgb, 255, 225, 170), calc(var(--lighting-focus-opacity, 0) * 0.42)) var(--lighting-focus-size, 38%),
      rgba(var(--lighting-focus-rgb, 255, 225, 170), 0) calc(var(--lighting-focus-size, 38%) + 18%)
    ),
    rgba(var(--lighting-tint-rgb, 255, 190, 105), var(--lighting-tint-opacity, 0));
  mix-blend-mode: var(--lighting-blend-mode, screen);
}

.lighting-layer::after {
  background:
    radial-gradient(
      ellipse at 50% 50%,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, calc(var(--lighting-vignette, 0) * 0.45)) 68%,
      rgba(0, 0, 0, var(--lighting-vignette, 0)) 100%
    ),
    rgba(0, 0, 0, var(--lighting-darkness, 0));
  mix-blend-mode: multiply;
}

.light-object-layer {
  z-index: 19;
  pointer-events: none;
}

.light-object-layer.is-lighting-mode {
  pointer-events: auto;
}

.light-object-layer:not(.is-lighting-mode) .light-handle {
  display: none;
}

.light-object-layer.is-select-mode .light-handle {
  display: block;
  pointer-events: auto;
}

.light-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: var(--light-color);
  box-shadow:
    0 0 0 2px rgba(24, 27, 30, 0.48),
    0 0 var(--light-preview-size) color-mix(in srgb, var(--light-color) 62%, transparent);
  transform: translate(-50%, -50%);
  cursor: grab;
}

.light-handle.is-selected {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.9),
    0 0 0 6px rgba(11, 111, 104, 0.38),
    0 0 var(--light-preview-size) color-mix(in srgb, var(--light-color) 72%, transparent);
}

.light-handle:active {
  cursor: grabbing;
}

.room-transition {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 42%),
    rgba(13, 17, 20, 0.86);
  color: #f7f2e8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.room-transition.is-active {
  opacity: 1;
  pointer-events: auto;
}

.room-transition[hidden] {
  display: none;
}

.route-notice {
  position: absolute;
  left: 50%;
  top: 18px;
  z-index: 22;
  max-width: min(520px, calc(100% - 28px));
  padding: 9px 12px;
  border: 1px solid rgba(159, 76, 32, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.94);
  color: #6f3518;
  box-shadow: 0 10px 32px rgba(22, 27, 31, 0.14);
  font-size: 0.85rem;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
}

.object-context-menu {
  position: absolute;
  z-index: 40;
  width: 178px;
  padding: 6px;
  border: 1px solid rgba(18, 25, 32, 0.16);
  border-radius: 8px;
  background: rgba(20, 25, 31, 0.96);
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(12, 16, 20, 0.28);
  backdrop-filter: blur(18px);
}

.object-context-title {
  overflow: hidden;
  padding: 6px 7px 7px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.object-context-menu button {
  width: 100%;
  min-height: 32px;
  display: block;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.82rem;
  text-align: left;
}

.object-context-menu button:hover,
.object-context-menu button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.room-transition-content {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 18px 22px;
  border: 1px solid rgba(247, 242, 232, 0.2);
  border-radius: 8px;
  background: rgba(18, 22, 25, 0.72);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

.room-transition-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(247, 242, 232, 0.28);
  border-top-color: #f7f2e8;
  border-radius: 50%;
  animation: room-transition-spin 780ms linear infinite;
}

.room-transition-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.canvas-shell.is-capturing-room .resize-handle,
.canvas-shell.is-capturing-room .frame-mini-actions,
.canvas-shell.is-capturing-room .draft-box,
.canvas-shell.is-capturing-room .light-handle,
.canvas-shell.is-capturing-room .ceiling-anchor {
  display: none !important;
}

.canvas-shell.is-capturing-room .furniture-item.is-selected,
.canvas-shell.is-capturing-room .ceiling-item.is-selected {
  outline: 0 !important;
}

.canvas-shell.is-capturing-room .sign-item.is-selected {
  box-shadow:
    inset 0 0 0 2px rgba(32, 35, 38, 0.16),
    0 8px 18px rgba(20, 24, 28, 0.15);
}

.canvas-shell.is-capturing-room .window-item.is-selected {
  box-shadow:
    0 2px 0 rgba(255, 249, 231, 0.38),
    0 10px 20px rgba(20, 24, 28, 0.16);
}

.canvas-shell.is-capturing-room .door-item.is-selected {
  box-shadow:
    inset 0 0 0 2px rgba(42, 29, 20, 0.2),
    0 9px 20px rgba(20, 24, 28, 0.18);
}

.canvas-shell.is-capturing-room .frame-item.is-selected {
  box-shadow: 0 8px 18px rgba(20, 24, 28, 0.16);
}

.canvas-shell.is-capturing-room .frame-item.is-selected .frame-linework polygon {
  stroke: #22272b;
}

@keyframes room-transition-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .room-transition,
  .room-transition-spinner {
    animation: none;
    transition: none;
  }
}

.window-item,
.door-item,
.sign-item,
.frame-item {
  position: absolute;
  min-width: 24px;
  min-height: 24px;
  overflow: hidden;
  pointer-events: auto;
}

.sign-item {
  background: #fff3b8;
  border: 0;
  box-shadow:
    inset 0 0 0 2px rgba(32, 35, 38, 0.16),
    0 8px 18px rgba(20, 24, 28, 0.15);
  cursor: move;
}

.sign-item.is-selected {
  box-shadow:
    0 0 0 2px rgba(11, 111, 104, 0.26),
    inset 0 0 0 2px rgba(32, 35, 38, 0.2),
    0 9px 20px rgba(20, 24, 28, 0.17);
}

.sign-content {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
  color: #1e2327;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.36);
  transform-origin: top left;
}

.sign-linework {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.sign-linework polygon {
  fill: none;
  stroke: rgba(28, 31, 34, 0.82);
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.window-item {
  background: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 2px 0 rgba(255, 249, 231, 0.38),
    0 10px 20px rgba(20, 24, 28, 0.16);
  cursor: move;
}

.door-item {
  --door-panel-fill: rgba(104, 68, 43, 0.5);
  --door-line: #211a14;
  --door-knob: #e4c075;
  --door-reveal: rgba(62, 42, 28, 0.62);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 244, 220, 0.08) 0,
      rgba(255, 244, 220, 0.08) 5px,
      rgba(55, 38, 27, 0.13) 6px,
      rgba(55, 38, 27, 0.13) 10px
    ),
    linear-gradient(90deg, rgba(55, 38, 27, 0.34), rgba(255, 244, 220, 0.18) 22%, rgba(43, 29, 20, 0.34)),
    #8b5f3e;
  box-shadow:
    inset 8px 0 10px rgba(19, 13, 9, 0.26),
    inset -8px 0 10px rgba(255, 246, 222, 0.14),
    0 12px 20px rgba(20, 24, 28, 0.2);
  cursor: move;
}

.door-item[data-door-texture="painted"] {
  --door-panel-fill: rgba(88, 127, 154, 0.38);
  --door-line: #162f3c;
  --door-knob: #f2dfaa;
  --door-reveal: rgba(36, 65, 84, 0.6);
  background:
    linear-gradient(90deg, rgba(18, 42, 56, 0.28), rgba(241, 249, 252, 0.16) 24%, rgba(18, 42, 56, 0.28)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.08)),
    #6aa5bd;
}

.door-item[data-door-texture="glass"] {
  --door-panel-fill: rgba(128, 204, 226, 0.28);
  --door-line: #14313b;
  --door-knob: #d9eef5;
  --door-reveal: rgba(32, 72, 94, 0.58);
  background:
    linear-gradient(124deg, transparent 0 38%, rgba(255, 255, 255, 0.34) 39%, rgba(255, 255, 255, 0.13) 47%, transparent 48%),
    linear-gradient(90deg, rgba(32, 72, 94, 0.24), rgba(230, 248, 255, 0.2) 24%, rgba(32, 72, 94, 0.28)),
    #5a9db2;
}

.door-item[data-door-texture="metal"] {
  --door-panel-fill: rgba(124, 132, 137, 0.42);
  --door-line: #20282d;
  --door-knob: #d8d4c8;
  --door-reveal: rgba(58, 65, 70, 0.62);
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 2px,
      rgba(0, 0, 0, 0.06) 3px,
      rgba(0, 0, 0, 0.06) 6px
    ),
    linear-gradient(90deg, rgba(73, 76, 78, 0.26), rgba(255, 255, 255, 0.14) 24%, rgba(73, 76, 78, 0.28)),
    #81898d;
}

.door-item.is-selected {
  box-shadow:
    0 0 0 2px rgba(11, 111, 104, 0.24),
    inset 8px 0 10px rgba(19, 13, 9, 0.26),
    inset -8px 0 10px rgba(255, 246, 222, 0.14),
    0 10px 22px rgba(20, 24, 28, 0.2);
}

.door-linework {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter:
    drop-shadow(0 1px 0 rgba(255, 246, 222, 0.42))
    drop-shadow(0 3px 3px rgba(23, 18, 13, 0.18));
}

.door-linework polygon,
.door-linework line,
.door-linework circle {
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.door-reveal-fill {
  fill: var(--door-reveal);
  stroke: none;
}

.door-panel-fill {
  fill: var(--door-panel-fill);
  stroke: none;
}

.door-linework polygon,
.door-linework line {
  fill: none;
  stroke: var(--door-line);
  stroke-width: 3;
}

.door-linework [data-role="panelOutline"] {
  stroke-width: 2.2;
}

.door-linework [data-role="threshold"] {
  stroke-width: 4.2;
}

.door-linework circle {
  fill: var(--door-knob);
  stroke: var(--door-line);
  stroke-width: 2.5;
}

.door-item.is-balcony-door {
  --door-panel-fill: rgba(88, 164, 194, 0.38);
  --door-line: #14313b;
  --door-knob: #d9eef5;
  --door-reveal: rgba(32, 72, 94, 0.58);
}

.door-item.is-gallery-door {
  --door-panel-fill: rgba(111, 75, 146, 0.44);
  --door-line: #2c2038;
  --door-knob: #f7df8e;
  --door-reveal: rgba(64, 42, 88, 0.6);
}

.door-item.has-no-destination {
  filter: saturate(0.8);
}

.door-label {
  position: absolute;
  left: 50%;
  top: 8%;
  z-index: 3;
  max-width: 82%;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 250, 239, 0.92);
  color: #211a14;
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.1;
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  transform:
    translate(-50%, 5px)
    rotate(var(--door-label-rotation, 0deg))
    skewX(var(--door-label-skew, 0deg));
  transform-origin: 50% 0;
  white-space: nowrap;
}

.door-item.is-balcony-door .door-label {
  color: #14313b;
}

.door-item.is-gallery-door .door-label {
  color: #2c2038;
}

.door-item.has-no-destination .door-label {
  color: #4d565c;
}

.window-item.is-selected {
  box-shadow:
    0 0 0 2px rgba(11, 111, 104, 0.2),
    0 2px 0 rgba(255, 249, 231, 0.38),
    0 10px 20px rgba(20, 24, 28, 0.18);
}

.window-lip-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.window-lip {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.window-lip-left {
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.3),
    inset -9px 0 13px rgba(28, 22, 17, 0.17),
    2px 0 4px rgba(25, 20, 16, 0.16);
}

.window-lip-right {
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.3),
    inset 9px 0 13px rgba(28, 22, 17, 0.17),
    -2px 0 4px rgba(25, 20, 16, 0.16);
}

.window-lip-bottom {
  z-index: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 9px 13px rgba(28, 22, 17, 0.16),
    0 -2px 5px rgba(25, 20, 16, 0.16);
}

.window-linework {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
  filter:
    drop-shadow(0 1px 0 rgba(255, 246, 222, 0.5))
    drop-shadow(0 3px 3px rgba(23, 18, 13, 0.22));
}

.window-linework path,
.window-linework line,
.window-linework polygon {
  fill: none;
  stroke: #241f19;
  stroke-width: 3.2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.window-linework .window-trim-fill {
  fill: rgba(248, 238, 214, 0.16);
  stroke: none;
}

.window-exterior {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.window-exterior-plane {
  position: absolute;
  background-size: cover;
  background-position: center;
  pointer-events: none;
  transform-origin: top left;
}

.window-exterior-plane video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.frame-item {
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 8px 18px rgba(20, 24, 28, 0.16);
  cursor: move;
  isolation: isolate;
}

.frame-item.is-selected {
  box-shadow:
    0 0 0 2px rgba(11, 111, 104, 0.22),
    0 8px 18px rgba(20, 24, 28, 0.18);
}

.frame-item.is-media-frame {
  box-shadow:
    0 0 0 1px rgba(42, 32, 48, 0.36),
    0 9px 22px rgba(20, 24, 28, 0.2);
}

.frame-item.is-media-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 5px solid rgba(255, 248, 242, 0.88);
  box-shadow:
    inset 0 0 0 1px rgba(42, 32, 48, 0.42),
    0 0 0 1px rgba(42, 32, 48, 0.22);
  pointer-events: none;
}

.frame-item.is-media-frame.is-selected::before {
  border-color: rgba(197, 244, 247, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(42, 32, 48, 0.5),
    0 0 0 1px rgba(11, 111, 104, 0.44);
}

.frame-item img,
.special-frame-embed,
.special-frame-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.frame-item img {
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.special-frame-embed {
  border: 0;
}

.spotify-frame-embed {
  background: #121212;
}

.youtube-frame-embed {
  background: #0f0f0f;
}

.frame-layer:not(.is-read-only) .special-frame-embed,
.frame-layer:not(.is-read-only) .special-frame-empty {
  pointer-events: none;
}

.frame-layer:not(.is-read-only) .frame-item.is-player-active .special-frame-embed {
  pointer-events: auto;
}

.frame-layer:not(.is-read-only) .frame-item.is-player-active {
  cursor: default;
}

.frame-empty,
.special-frame-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.frame-empty {
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.28) 25%, transparent 25% 50%, rgba(255, 255, 255, 0.28) 50% 75%, transparent 75%),
    rgba(255, 255, 255, 0.15);
  background-size: 18px 18px;
}

.special-frame-empty {
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.spotify-frame-empty {
  background: #121212;
  color: #1ed760;
}

.youtube-frame-empty {
  background: #0f0f0f;
  color: #ff2b2b;
}

.special-frame-edit-placeholder {
  background:
    linear-gradient(135deg, rgba(255, 248, 242, 0.26), rgba(197, 244, 247, 0.18)),
    rgba(17, 19, 22, 0.18);
  color: transparent;
}

.frame-linework {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.frame-linework polygon {
  fill: none;
  stroke: #22272b;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.frame-item.is-selected .frame-linework polygon {
  stroke: var(--accent);
}

.sticky-note-layer {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
}

.sticky-note-item {
  position: absolute;
  width: clamp(22px, 1.8vw, 34px);
  aspect-ratio: 1;
  display: block;
  padding: 0;
  border: 1px solid rgba(63, 47, 14, 0.24);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 42%),
    var(--sticky-note-color, #fff176);
  box-shadow:
    0 4px 7px rgba(18, 16, 13, 0.18),
    inset 0 -5px 9px rgba(95, 75, 12, 0.08);
  cursor: pointer;
  overflow: hidden;
  pointer-events: auto;
  transform: translate(-50%, -50%) rotate(var(--sticky-note-rotation, -4deg));
}

.sticky-note-item::before {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 0;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: rgba(255, 255, 255, 0.32);
}

.sticky-note-item:hover,
.sticky-note-item:focus-visible {
  border-color: rgba(11, 111, 104, 0.56);
  outline: none;
  transform: translate(-50%, -53%) rotate(var(--sticky-note-rotation, -4deg));
}

.frame-drag-rim {
  position: absolute;
  z-index: 6;
  display: block;
  pointer-events: auto;
  cursor: move;
}

.frame-item:not(.is-media-frame) .frame-drag-rim {
  display: none;
}

.frame-item.is-read-only .frame-drag-rim {
  display: none;
}

.frame-drag-rim-top {
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
}

.frame-drag-rim-right {
  top: 14px;
  right: 0;
  bottom: 14px;
  width: 14px;
}

.frame-drag-rim-bottom {
  right: 0;
  bottom: 0;
  left: 0;
  height: 14px;
}

.frame-drag-rim-left {
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 14px;
}

.furniture-item {
  position: absolute;
  min-width: 24px;
  min-height: 24px;
  overflow: visible;
  pointer-events: auto;
  transform-origin: 50% 100%;
  cursor: move;
  user-select: none;
}

.furniture-image {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  filter: drop-shadow(0 7px 7px rgba(18, 16, 13, 0.18));
  transform: perspective(760px) scaleX(var(--furniture-flip, 1)) rotateY(var(--furniture-turn, 0deg));
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
}

.furniture-item.is-wall-mounted {
  transform-origin: 50% 50%;
}

.furniture-item.is-wall-mounted .furniture-image {
  object-position: center center;
  filter: drop-shadow(0 5px 5px rgba(18, 16, 13, 0.2));
  transform: scaleX(var(--furniture-flip, 1)) rotateZ(var(--furniture-turn, 0deg));
  transform-origin: 50% 50%;
}

.furniture-item.is-floor-decal .furniture-image {
  object-position: center center;
  filter: drop-shadow(0 3px 3px rgba(18, 16, 13, 0.14));
  transform: perspective(780px) rotateX(63deg) rotateZ(var(--furniture-turn, 0deg)) scaleX(var(--furniture-flip, 1));
  transform-origin: 50% 50%;
}

.furniture-shelf-items {
  position: absolute;
  z-index: 5;
  left: 8%;
  right: 8%;
  top: 0;
  bottom: 20%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4%;
  pointer-events: none;
}

.shelf-item {
  position: relative;
  width: clamp(18px, 18%, 34px);
  aspect-ratio: 0.74;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(64, 47, 16, 0.42);
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 246, 196, 0.82)),
    #fff5bf;
  box-shadow:
    0 4px 6px rgba(18, 16, 13, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  color: #6f5900;
  cursor: pointer;
  font-size: clamp(0.62rem, 1.8vw, 0.78rem);
  font-weight: 850;
  line-height: 1;
  pointer-events: auto;
  transform: rotate(-3deg);
}

.shelf-item::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 28%;
  height: 1px;
  background: rgba(111, 89, 0, 0.26);
  box-shadow: 0 5px 0 rgba(111, 89, 0, 0.2);
}

.shelf-item:hover,
.shelf-item:focus-visible {
  border-color: rgba(11, 111, 104, 0.68);
  outline: none;
  transform: translateY(-2px) rotate(-2deg);
}

.furniture-shadow {
  position: absolute;
  z-index: 1;
  left: 18%;
  right: 18%;
  bottom: -4%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(21, 18, 14, 0.36), rgba(21, 18, 14, 0) 68%);
  transform: rotateX(62deg) scaleX(var(--furniture-shadow-scale, 1));
  pointer-events: none;
}

.furniture-item:not(.has-shadow) .furniture-shadow {
  display: none;
}

.furniture-item.is-selected {
  outline: 2px solid rgba(11, 111, 104, 0.76);
  outline-offset: 3px;
}

.furniture-item.is-floor-decal.is-selected {
  outline-offset: 1px;
}

.ceiling-item {
  position: absolute;
  min-width: 24px;
  min-height: 24px;
  overflow: visible;
  pointer-events: auto;
  cursor: move;
  user-select: none;
}

.ceiling-anchor {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: -5px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(31, 36, 39, 0.72);
  border-radius: 50%;
  background: rgba(243, 239, 226, 0.86);
  box-shadow: 0 1px 4px rgba(18, 16, 13, 0.24);
  transform: translateX(-50%);
  cursor: grab;
}

.ceiling-anchor:active {
  cursor: grabbing;
}

.ceiling-hanger {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 0;
  height: var(--hanger-length);
  transform: translateX(-50%);
  pointer-events: none;
}

.ceiling-item.is-string .ceiling-hanger {
  width: 2px;
  background: rgba(38, 32, 26, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.ceiling-item.is-chain .ceiling-hanger {
  width: 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(35, 32, 29, 0.88) 0 5px,
      rgba(255, 255, 255, 0) 5px 10px
    );
}

.ceiling-image {
  position: absolute;
  z-index: 3;
  left: 0;
  top: var(--ceiling-image-top);
  width: 100%;
  height: var(--ceiling-image-height);
  display: none;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 7px 8px rgba(18, 16, 13, 0.22));
}

.ceiling-item.has-image .ceiling-image {
  display: block;
}

.ceiling-placeholder {
  position: absolute;
  z-index: 3;
  left: 12%;
  right: 12%;
  top: var(--ceiling-image-top);
  height: var(--ceiling-image-height);
  display: grid;
  place-items: center;
  border: 1px dashed rgba(31, 36, 39, 0.32);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.34);
}

.ceiling-item.has-image .ceiling-placeholder {
  display: none;
}

.ceiling-item.is-selected {
  outline: 2px solid rgba(11, 111, 104, 0.76);
  outline-offset: 3px;
}

.frame-mini-actions {
  position: absolute;
  z-index: 8;
  top: 4px;
  right: 4px;
  display: none;
  gap: 4px;
}

.frame-item.is-selected .frame-mini-actions {
  display: flex;
}

.mini-button {
  height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(32, 35, 38, 0.22);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
  color: #1f292e;
  font-size: 0.72rem;
  cursor: pointer;
}

.mini-button:hover {
  border-color: rgba(11, 111, 104, 0.55);
  color: var(--accent);
}

.resize-handle {
  position: absolute;
  z-index: 9;
  width: 12px;
  height: 12px;
  border: 1px solid #ffffff;
  border-radius: 2px;
  background: var(--accent);
  display: none;
}

.window-item.is-selected .resize-handle,
.door-item.is-selected .resize-handle,
.sign-item.is-selected .resize-handle,
.frame-item.is-selected .resize-handle,
.furniture-item.is-selected .resize-handle {
  display: block;
}

.ceiling-item.is-selected .resize-handle {
  display: block;
}

.ceiling-item .resize-handle[data-handle="nw"],
.ceiling-item .resize-handle[data-handle="ne"] {
  top: calc(var(--ceiling-image-top) - 6px);
}

.resize-handle[data-handle="nw"] {
  top: -6px;
  left: -6px;
  cursor: nwse-resize;
}

.resize-handle[data-handle="ne"] {
  top: -6px;
  right: -6px;
  cursor: nesw-resize;
}

.resize-handle[data-handle="sw"] {
  bottom: -6px;
  left: -6px;
  cursor: nesw-resize;
}

.resize-handle[data-handle="se"] {
  right: -6px;
  bottom: -6px;
  cursor: nwse-resize;
}

.frame-item.is-media-frame .resize-handle[data-handle="nw"] {
  top: 3px;
  left: 3px;
}

.frame-item.is-media-frame .resize-handle[data-handle="ne"] {
  top: 3px;
  right: 3px;
}

.frame-item.is-media-frame .resize-handle[data-handle="sw"] {
  bottom: 3px;
  left: 3px;
}

.frame-item.is-media-frame .resize-handle[data-handle="se"] {
  right: 3px;
  bottom: 3px;
}

.draft-box {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(11, 111, 104, 0.12);
  pointer-events: none;
}

.draft-box.is-invalid {
  border-color: var(--warn);
  background: rgba(159, 76, 32, 0.12);
}

.floating-tools {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  top: 50%;
  z-index: 30;
  transform: translateY(-50%);
}

.floating-tools,
.right-orb-rail {
  border: 1px solid var(--rr-rail-border);
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.11) 0,
      rgba(255, 255, 255, 0.11) 1px,
      rgba(120, 70, 140, 0.035) 2px,
      rgba(120, 70, 140, 0.035) 4px
    ),
    var(--rr-rail-bg);
  box-shadow: 0 18px 45px var(--rr-rail-shadow);
  backdrop-filter: blur(18px);
}

.room-back-button {
  --tool-fill: #f3f0fa;
  --tool-border: #b8a9e8;
  --tool-icon: #5c4e9a;
  --tool-glow: rgba(184, 169, 232, 0.22);
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 29;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(66, 74, 87, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--tool-icon);
  box-shadow: 0 10px 26px rgba(26, 31, 35, 0.12);
  cursor: pointer;
  backdrop-filter: blur(16px);
}

.room-back-button:hover {
  border-color: var(--tool-border);
  background: var(--tool-fill);
  box-shadow: 0 10px 28px var(--tool-glow);
  color: var(--tool-icon);
}

.room-back-button span {
  transform: translateY(-1px);
  font-size: 1.35rem;
  line-height: 1;
}

.tool-orb-rail {
  display: grid;
  gap: 8px;
  padding: 9px;
}

.tool-orb {
  --tool-fill: #d9faf4;
  --tool-border: #69cfc3;
  --tool-icon: #117b76;
  --tool-glow: rgba(105, 207, 195, 0.26);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(66, 74, 87, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(26, 31, 35, 0.12);
  color: var(--tool-icon);
  cursor: pointer;
  backdrop-filter: blur(18px);
}

.tool-orb[data-mode="select"] {
  --tool-fill: #d9faf4;
  --tool-border: #69cfc3;
  --tool-icon: #117b76;
  --tool-glow: rgba(105, 207, 195, 0.26);
}

.tool-orb[data-mode="paint"] {
  --tool-fill: #ffe4f1;
  --tool-border: #f59ac6;
  --tool-icon: #a8326f;
  --tool-glow: rgba(245, 154, 198, 0.26);
}

.tool-orb[data-mode="window"] {
  --tool-fill: #ddebff;
  --tool-border: #82afff;
  --tool-icon: #2c5fa8;
  --tool-glow: rgba(130, 175, 255, 0.26);
}

.tool-orb[data-mode="door"] {
  --tool-fill: #ffe8c7;
  --tool-border: #e6a85e;
  --tool-icon: #8b5a19;
  --tool-glow: rgba(230, 168, 94, 0.26);
}

.tool-orb[data-mode="sign"] {
  --tool-fill: #fff3b8;
  --tool-border: #e6c84f;
  --tool-icon: #806800;
  --tool-glow: rgba(230, 200, 79, 0.24);
}

.tool-orb[data-mode="frame"] {
  --tool-fill: #e8e0ff;
  --tool-border: #a996f2;
  --tool-icon: #5744a6;
  --tool-glow: rgba(169, 150, 242, 0.26);
}

.tool-orb[data-mode="furniture"] {
  --tool-fill: #e2f7d7;
  --tool-border: #91d47d;
  --tool-icon: #3e7a34;
  --tool-glow: rgba(145, 212, 125, 0.26);
}

.tool-orb[data-mode="itemCrafter"] {
  --tool-fill: #fff7cc;
  --tool-border: #e4c753;
  --tool-icon: #806800;
  --tool-glow: rgba(228, 199, 83, 0.24);
}

.tool-orb[data-mode="ceiling"] {
  --tool-fill: #e8f7ff;
  --tool-border: #8fd3f4;
  --tool-icon: #26799e;
  --tool-glow: rgba(143, 211, 244, 0.26);
}

.tool-orb[data-mode="lighting"] {
  --tool-fill: #fff0c9;
  --tool-border: #ffc75f;
  --tool-icon: #9a6400;
  --tool-glow: rgba(255, 199, 95, 0.28);
}

.tool-orb[data-mode="house"] {
  --tool-fill: #f0e7da;
  --tool-border: #c8a985;
  --tool-icon: #6b4f35;
  --tool-glow: rgba(200, 169, 133, 0.24);
}

.tool-orb[data-mode="room"] {
  --tool-fill: #e6e0d8;
  --tool-border: #b8a99a;
  --tool-icon: #5c554d;
  --tool-glow: rgba(184, 169, 154, 0.22);
}

.tool-orb svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.tool-orb:not(:disabled):not(.is-disabled):hover,
.tool-orb.is-active {
  border-color: var(--tool-border);
  background: var(--tool-fill);
  box-shadow: 0 12px 32px var(--tool-glow);
  color: var(--tool-icon);
}

.tool-orb.is-active {
  box-shadow: 0 12px 32px var(--tool-glow);
}

.tool-orb:disabled,
.tool-orb.is-disabled,
.mode-button:disabled,
.mode-button.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.right-orb-rail {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  top: 50%;
  z-index: 34;
  display: grid;
  gap: 10px;
  padding: 10px;
  transform: translateY(-50%);
}

.right-rail-orb {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(18px);
}

.camera-launcher {
  border: 1px solid #7eb6ff;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 38%),
    #ddebff;
  box-shadow:
    0 16px 36px rgba(57, 111, 196, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  color: #2c5fa8;
}

.camera-launcher svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.camera-launcher:hover,
.camera-launcher.is-capturing {
  border-color: #5f9cf4;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 38%),
    #cfe2ff;
  color: #1f5299;
}

.camera-launcher:disabled {
  cursor: progress;
  opacity: 0.82;
}

.debug-launcher {
  border: 1px solid #b69be8;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 38%),
    #efe5ff;
  box-shadow:
    0 16px 36px rgba(92, 66, 143, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  color: #5b3f91;
}

.debug-launcher svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.debug-launcher:hover,
.debug-launcher.is-active {
  border-color: #9c7adc;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0) 38%),
    #e4d5ff;
  color: #4d2f84;
}

.auth-launcher {
  border: 1px solid #7c8fe6;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 38%),
    #e1e7ff;
  box-shadow:
    0 16px 36px rgba(68, 82, 161, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  color: #4151a8;
}

.auth-launcher svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.auth-launcher:hover,
.auth-launcher.is-active,
body.is-alpha-authenticated .auth-launcher {
  border-color: #6376dc;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 38%),
    #d1d9ff;
  color: #31429b;
}

.map-launcher {
  border: 1px solid #7cb7df;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 38%),
    #dff4ff;
  box-shadow:
    0 16px 36px rgba(49, 103, 139, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  color: #246c94;
}

.map-launcher svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.map-launcher:hover,
.map-launcher.is-active {
  border-color: #5ba5d1;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 38%),
    #cceeff;
  color: #175b82;
}

.closet-launcher {
  border: 1px solid #61d4c4;
  background: #d8faf2;
  box-shadow: 0 14px 34px rgba(97, 212, 196, 0.24);
  color: #147e78;
}

.closet-launcher svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.closet-launcher:hover,
.closet-launcher.is-active {
  border-color: #47c9b7;
  background: #c7f7ed;
  color: #0b6f68;
}

.item-inventory-launcher {
  border: 1px solid #e4c753;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 38%),
    #fff7cc;
  box-shadow:
    0 16px 36px rgba(128, 104, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  color: #806800;
}

.item-inventory-launcher svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.item-inventory-launcher:hover,
.item-inventory-launcher.is-active {
  border-color: #d6b83c;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0) 38%),
    #fff0a8;
  color: #6f5900;
}

.closet-drawer {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(84px, calc(env(safe-area-inset-right) + 84px));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 33;
  width: min(360px, calc(100vw - 104px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(33, 76, 85, 0.16);
  border-radius: 8px;
  background: rgba(250, 255, 252, 0.94);
  box-shadow: 0 22px 64px rgba(26, 45, 47, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 22px));
  transition: opacity 150ms ease, transform 150ms ease;
  backdrop-filter: blur(22px);
}

.closet-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.closet-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.closet-drawer-title {
  color: #1f3033;
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.15;
}

.closet-drawer-subtitle,
.closet-capacity {
  color: #557072;
  font-size: 0.78rem;
}

.closet-close-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(33, 76, 85, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #24545b;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.slot-usage-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.slot-usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(33, 76, 85, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  color: #40575a;
  font-size: 0.78rem;
}

.slot-usage-row strong {
  color: #203539;
  font-size: 0.78rem;
}

.closet-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  min-height: 0;
}

.closet-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid rgba(33, 76, 85, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.closet-item.is-blueprint {
  border-color: rgba(11, 111, 104, 0.18);
  background: rgba(229, 247, 241, 0.72);
}

.closet-thumb {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #e5f1ee;
  color: #356167;
  font-weight: 760;
}

.closet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.closet-item-body {
  min-width: 0;
}

.closet-item-actions {
  display: grid;
  gap: 5px;
  justify-items: stretch;
}

.closet-item-name {
  overflow: hidden;
  color: #203539;
  font-size: 0.86rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.closet-item-name-input {
  width: 100%;
  min-width: 0;
  height: 25px;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #203539;
  font-size: 0.86rem;
  font-weight: 720;
}

.closet-item-name-input:hover,
.closet-item-name-input:focus {
  border-color: rgba(33, 76, 85, 0.18);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

.closet-item-meta,
.closet-empty {
  color: #657a7c;
  font-size: 0.76rem;
}

.closet-empty {
  padding: 12px;
  border: 1px dashed rgba(33, 76, 85, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.items-drawer-title {
  color: #2d2a18;
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.15;
}

.items-drawer-subtitle,
.items-capacity {
  color: #6f641f;
  font-size: 0.78rem;
}

.item-inventory-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  min-height: 0;
}

.item-inventory-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid rgba(128, 104, 0, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.item-inventory-thumb {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #fff0a8;
  color: #806800;
  font-weight: 800;
}

.item-inventory-body {
  min-width: 0;
}

.item-inventory-name {
  overflow: hidden;
  color: #302b16;
  font-size: 0.86rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-inventory-meta,
.item-inventory-empty {
  color: #776d38;
  font-size: 0.76rem;
}

.item-inventory-actions {
  display: grid;
  gap: 5px;
}

.item-inventory-empty {
  padding: 12px;
  border: 1px dashed rgba(128, 104, 0, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.note-body-input {
  min-height: 172px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

.chat-launcher {
  width: 56px;
  height: 56px;
  border: 1px solid #b678ff;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 38%),
    #e7ccff;
  box-shadow:
    0 16px 36px rgba(110, 53, 184, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.44);
  color: #6e35b8;
}

.chat-launcher svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.chat-launcher:hover,
.chat-launcher.is-active {
  border-color: #a15dff;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 38%),
    #d9b2ff;
  color: #5f25a8;
}

.profile-launcher {
  border: 1px solid #f09bc4;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 38%),
    #ffe3f0;
  box-shadow:
    0 16px 36px rgba(162, 60, 112, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  color: #a8326f;
}

.profile-launcher svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.profile-launcher:hover,
.profile-launcher.is-active {
  border-color: #e576ad;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 38%),
    #ffd4e8;
  color: #90235e;
}

.store-launcher {
  border: 1px solid #f0b94d;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 38%),
    #ffe39a;
  box-shadow:
    0 16px 36px rgba(138, 90, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  color: #8a5a00;
}

.store-launcher svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.store-launcher:hover,
.store-launcher.is-active {
  border-color: #d99d2e;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 38%),
    #ffd978;
  color: #704800;
}

.map-page {
  position: fixed;
  inset: 0;
  z-index: 24;
  padding: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.13) 0,
      rgba(255, 255, 255, 0.13) 1px,
      rgba(120, 70, 140, 0.045) 2px,
      rgba(120, 70, 140, 0.045) 5px
    ),
    linear-gradient(135deg, rgba(216, 184, 220, 0.95), rgba(247, 240, 250, 0.98) 48%, rgba(199, 236, 244, 0.92));
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.map-page[hidden] {
  display: none;
}

.map-page.is-open {
  opacity: 1;
  pointer-events: auto;
}

.map-page-shell {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 32px max(348px, calc(env(safe-area-inset-right) + 348px)) 76px max(178px, calc(env(safe-area-inset-left) + 178px));
}

.map-page-header {
  position: fixed;
  top: max(96px, calc(env(safe-area-inset-top) + 96px));
  left: max(18px, env(safe-area-inset-left));
  right: auto;
  z-index: 35;
  width: 168px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(76, 45, 96, 0.18);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.18) 0,
      rgba(255, 255, 255, 0.18) 1px,
      rgba(120, 70, 140, 0.04) 2px,
      rgba(120, 70, 140, 0.04) 5px
    ),
    rgba(255, 248, 242, 0.86);
  box-shadow: 0 18px 44px rgba(76, 45, 96, 0.16);
  backdrop-filter: blur(18px);
}

.map-neighborhood-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 5px;
  min-width: 0;
}

.map-neighborhood-picker span,
.map-page-kicker {
  color: #6b4f76;
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-neighborhood-picker select {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid rgba(76, 45, 96, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: #2a2030;
  font-size: 0.82rem;
  font-weight: 720;
}

.map-page-header h1 {
  display: none;
}

.map-onboarding-card {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid rgba(76, 45, 96, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.map-onboarding-card span {
  color: #6b4f76;
  font-size: 0.7rem;
  font-weight: 820;
  text-transform: uppercase;
}

.map-onboarding-card ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 17px;
  color: #42354a;
  font-size: 0.73rem;
  line-height: 1.25;
}

.map-private-house-button {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 0.78rem;
  line-height: 1.15;
}

.map-close-button {
  justify-self: start;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(76, 45, 96, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: #4b355b;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.map-close-button:hover {
  border-color: rgba(76, 45, 96, 0.28);
  background: #fff8f2;
}

.map-page-layout {
  position: relative;
  width: min(calc(100vw - 548px), calc(177.7778vh - 206px));
  aspect-ratio: 16 / 9;
  min-height: 0;
  filter: drop-shadow(0 24px 56px rgba(76, 45, 96, 0.12));
}

.map-board,
.map-info-panel {
  border: 1px solid rgba(64, 38, 90, 0.16);
  border-radius: 8px;
  background: rgba(255, 252, 255, 0.82);
  box-shadow: 0 22px 64px rgba(36, 26, 45, 0.18);
  backdrop-filter: blur(22px);
}

.map-board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: auto;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(93, 160, 154, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(93, 160, 154, 0.16) 1px, transparent 1px),
    #f7fbf2;
  background-size: 44px 44px;
}

.map-board.has-mask {
  background-color: #9e78a8;
  background-image: var(--map-texture-image);
  background-position: 0 0;
  background-repeat: repeat;
  background-size: 128px 128px;
}

.map-board.has-mask::before {
  content: none;
}

.map-board.has-mask .map-board-sign,
.map-board.has-mask .map-road {
  display: none;
}

.map-board-sign {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 2;
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  border: 2px solid #2a2030;
  border-radius: 6px;
  background: #fff8f2;
  box-shadow: 6px 6px 0 rgba(42, 32, 48, 0.14);
  color: #2a2030;
  transform: rotate(-1deg);
}

.map-board-sign span {
  color: #6e35b8;
  font-size: 0.72rem;
  font-weight: 820;
}

.map-board-sign strong {
  font-size: 1rem;
  line-height: 1;
}

.map-road {
  position: absolute;
  left: -8%;
  right: -8%;
  top: 50%;
  height: 96px;
  border-top: 4px solid rgba(255, 248, 242, 0.86);
  border-bottom: 4px solid rgba(255, 248, 242, 0.86);
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 40px,
      rgba(255, 248, 242, 0.78) 40px,
      rgba(255, 248, 242, 0.78) 72px
    ),
    #575d68;
  box-shadow: inset 0 0 0 1px rgba(42, 32, 48, 0.22);
  transform: translateY(-50%) rotate(-2deg);
}

.map-region-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.map-texture-layer {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  background-position: 0 0;
  background-repeat: repeat;
  transform: scale(var(--map-flip-x, 1), var(--map-flip-y, 1));
}

.map-texture-layer[hidden] {
  display: none;
}

.map-texture-layer-road {
  z-index: 1;
  background-image: var(--map-road-texture);
  background-size: 640px auto;
  -webkit-mask-image: var(--map-road-mask-image);
  mask-image: var(--map-road-mask-image);
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.map-texture-layer-park {
  z-index: 2;
  background-image: var(--map-park-texture);
  background-size: 128px 128px;
  -webkit-mask-image: var(--map-park-mask-image);
  mask-image: var(--map-park-mask-image);
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.map-lot-grid {
  --map-columns: 7;
  --map-rows: 5;
  position: relative;
  z-index: 2;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--map-columns), minmax(82px, 1fr));
  grid-template-rows: repeat(var(--map-rows), minmax(82px, 1fr));
  gap: 12px;
  padding: 84px 24px 24px;
}

.map-lot-grid.is-region-map {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
}

.map-lot {
  min-width: 0;
  min-height: 82px;
  display: grid;
  align-content: space-between;
  gap: 5px;
  padding: 10px;
  border: 2px solid rgba(68, 85, 67, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.38)),
    #dff1d5;
  color: #2d442e;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(68, 85, 67, 0.12);
  text-align: left;
}

.map-lot.is-mask-lot {
  position: absolute;
  min-height: 0;
  align-content: center;
  justify-items: center;
  padding: 4px;
  overflow: hidden;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: transparent;
  text-align: center;
}

.map-lot.is-mask-lot:not(.is-occupied):not(.is-reserved):not(.is-current) {
  border-style: dashed;
  border-color: rgba(255, 252, 255, 0.72);
  box-shadow:
    0 0 0 1px rgba(42, 32, 48, 0.32),
    inset 0 0 0 1px rgba(42, 32, 48, 0.16);
}

.map-lot.is-mask-lot::before {
  content: none;
}

.map-lot.is-mask-lot .map-lot-label,
.map-lot.is-mask-lot .map-lot-name,
.map-lot.is-mask-lot .map-lot-meta {
  position: relative;
  z-index: 1;
  opacity: 0;
}

.map-lot:hover,
.map-lot.is-selected {
  border-color: #2a2030;
  box-shadow:
    0 14px 30px rgba(76, 45, 96, 0.18),
    inset 0 0 0 2px rgba(255, 248, 242, 0.72);
}

.map-lot.is-mask-lot:hover,
.map-lot.is-mask-lot.is-selected,
.map-lot.is-mask-lot.is-current {
  border-style: solid;
  border-color: #2a2030;
  color: #2a2030;
  background: rgba(255, 252, 255, 0.18);
  box-shadow:
    0 10px 24px rgba(76, 45, 96, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.76);
}

.map-lot.is-mask-lot:hover .map-lot-label,
.map-lot.is-mask-lot:hover .map-lot-name,
.map-lot.is-mask-lot:hover .map-lot-meta,
.map-lot.is-mask-lot.is-selected .map-lot-label,
.map-lot.is-mask-lot.is-selected .map-lot-name,
.map-lot.is-mask-lot.is-selected .map-lot-meta,
.map-lot.is-mask-lot.is-occupied .map-lot-label,
.map-lot.is-mask-lot.is-occupied .map-lot-name,
.map-lot.is-mask-lot.is-occupied .map-lot-meta,
.map-lot.is-mask-lot.is-current .map-lot-label,
.map-lot.is-mask-lot.is-current .map-lot-name,
.map-lot.is-mask-lot.is-current .map-lot-meta,
.map-lot.is-mask-lot.is-reserved .map-lot-label,
.map-lot.is-mask-lot.is-reserved .map-lot-name,
.map-lot.is-mask-lot.is-reserved .map-lot-meta {
  opacity: 1;
}

.map-lot.is-occupied {
  border-color: rgba(53, 89, 143, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.34)),
    #cceeff;
  color: #183e5f;
}

.map-lot.is-mask-lot.is-occupied {
  border-color: rgba(163, 80, 120, 0.72);
  background: rgba(244, 134, 191, 0.56);
  color: #2a2030;
  box-shadow:
    0 8px 20px rgba(126, 44, 96, 0.16),
    inset 0 0 0 1px rgba(255, 248, 242, 0.38);
}

.map-lot.is-current {
  border-color: #00b8c9;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.28)),
    #18a8ff;
  color: #041f3c;
  box-shadow:
    0 14px 34px rgba(0, 132, 255, 0.32),
    0 0 0 3px rgba(0, 132, 255, 0.18),
    inset 0 0 0 2px rgba(255, 248, 242, 0.82);
}

.map-lot.is-mask-lot.is-current {
  border-color: #008cff;
  background: rgba(0, 132, 255, 0.82);
  color: #ffffff;
  box-shadow:
    0 12px 28px rgba(0, 72, 160, 0.28),
    0 0 0 3px rgba(0, 132, 255, 0.18),
    inset 0 0 0 1px rgba(255, 248, 242, 0.5);
}

.map-lot.is-mask-lot.is-reserved:not(:hover):not(.is-selected):not(.is-current) {
  border-color: rgba(163, 80, 120, 0.72);
  border-style: solid;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.18) 0,
      rgba(255, 255, 255, 0.18) 6px,
      rgba(151, 45, 104, 0.16) 6px,
      rgba(151, 45, 104, 0.16) 12px
    ),
    rgba(244, 134, 191, 0.44);
  background-size: auto;
  background-repeat: repeat;
  background-blend-mode: normal;
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 242, 0.32),
    0 5px 14px rgba(74, 50, 82, 0.12);
}

.map-lot.is-reserved {
  border-color: rgba(76, 45, 96, 0.16);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(76, 45, 96, 0.08) 0,
      rgba(76, 45, 96, 0.08) 6px,
      rgba(255, 255, 255, 0.42) 6px,
      rgba(255, 255, 255, 0.42) 12px
    ),
    #eadff0;
  color: #6b5a70;
}

.map-lot-label {
  color: rgba(42, 32, 48, 0.78);
  font-size: 0.72rem;
  font-weight: 860;
}

.map-lot-name {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 820;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-lot-meta {
  color: rgba(42, 32, 48, 0.58);
  font-size: 0.72rem;
  font-weight: 700;
}

.map-lot.is-current .map-lot-label,
.map-lot.is-current .map-lot-meta {
  color: rgba(4, 31, 60, 0.78);
}

.map-lot.is-mask-lot.is-current .map-lot-label,
.map-lot.is-mask-lot.is-current .map-lot-name,
.map-lot.is-mask-lot.is-current .map-lot-meta {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(4, 31, 60, 0.38);
}

.map-info-panel {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  top: max(96px, calc(env(safe-area-inset-top) + 96px));
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px));
  z-index: 35;
  width: min(300px, calc(100vw - 36px));
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.map-wallet,
.map-current-house,
.map-selection {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(76, 45, 96, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.map-wallet span,
.map-current-house span,
.map-selection-kicker {
  color: #6b5a70;
  font-size: 0.72rem;
  font-weight: 780;
  text-transform: uppercase;
}

.map-wallet strong,
.map-current-house strong,
.map-selection strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #261e2c;
  font-size: 1rem;
}

.map-selection p {
  margin: 0;
  color: #58636a;
  font-size: 0.84rem;
  line-height: 1.4;
}

.map-primary-button {
  width: 100%;
  margin-top: auto;
}

.map-status.is-error,
.status-line.is-error {
  color: var(--warn);
}

.app-footer {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 70;
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 14px;
  border: 1px solid rgba(76, 45, 96, 0.14);
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.18) 0,
      rgba(255, 255, 255, 0.18) 1px,
      rgba(120, 70, 140, 0.04) 2px,
      rgba(120, 70, 140, 0.04) 5px
    ),
    rgba(255, 248, 242, 0.78);
  box-shadow: 0 14px 36px rgba(76, 45, 96, 0.16);
  color: #6b5a70;
  pointer-events: auto;
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.footer-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 680;
  line-height: 1.1;
  pointer-events: auto;
  white-space: nowrap;
}

.footer-dock span:not(.footer-brand),
.footer-link {
  color: #5f4ab0;
}

.footer-link {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 680;
  line-height: 1.1;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: #3f2f92;
  text-decoration: underline;
}

.footer-brand {
  color: #2a2030;
  font-weight: 820;
}

.footer-product {
  color: #7c6b82;
  font-size: 0.68rem;
  line-height: 1.1;
  white-space: nowrap;
}

.about-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.about-modal[hidden] {
  display: none;
}

.about-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 22, 42, 0.32);
  backdrop-filter: blur(8px);
}

.about-modal-panel {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 36px));
  max-height: min(780px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(76, 45, 96, 0.18);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.18) 0,
      rgba(255, 255, 255, 0.18) 1px,
      rgba(120, 70, 140, 0.032) 2px,
      rgba(120, 70, 140, 0.032) 5px
    ),
    rgba(255, 252, 255, 0.96);
  box-shadow: 0 28px 82px rgba(36, 26, 45, 0.28);
}

.about-modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(76, 45, 96, 0.1);
}

.about-modal-header h2 {
  margin: 0;
  color: #2a2030;
  font-size: 1rem;
  line-height: 1.1;
}

.about-modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(76, 45, 96, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: #4b355b;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.about-modal-body {
  overflow: auto;
  padding: 14px 18px 18px;
}

.about-modal-body p {
  margin: 0 0 13px;
  color: #302436;
  font-size: clamp(0.92rem, 1.15vw, 1rem);
  line-height: 1.52;
}

.about-modal-body p:last-child {
  margin-bottom: 0;
}

.item-read-modal {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.item-read-modal[hidden] {
  display: none;
}

.item-read-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 22, 42, 0.28);
  backdrop-filter: blur(8px);
}

.item-read-modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 36px));
  max-height: min(680px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(128, 104, 0, 0.2);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.2) 0,
      rgba(255, 255, 255, 0.2) 1px,
      rgba(128, 104, 0, 0.035) 2px,
      rgba(128, 104, 0, 0.035) 5px
    ),
    rgba(255, 254, 245, 0.97);
  box-shadow: 0 28px 82px rgba(36, 32, 18, 0.26);
}

.item-read-modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(128, 104, 0, 0.12);
}

.item-read-modal-header h2 {
  margin: 0;
  overflow: hidden;
  color: #302b16;
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-read-modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(128, 104, 0, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: #806800;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.item-read-body {
  overflow: auto;
  min-height: 180px;
  padding: 18px;
  color: #2c281a;
  font-size: 0.96rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-drawer {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 33;
  width: min(390px, calc(100vw - 92px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(64, 38, 90, 0.16);
  border-radius: 8px;
  background: rgba(255, 252, 255, 0.94);
  box-shadow: 0 22px 64px rgba(36, 26, 45, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 22px));
  transition: opacity 150ms ease, transform 150ms ease;
  backdrop-filter: blur(22px);
}

.chat-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.store-drawer {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 33;
  width: min(420px, calc(100vw - 92px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(127, 84, 20, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.95);
  box-shadow: 0 22px 64px rgba(47, 36, 18, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 22px));
  transition: opacity 150ms ease, transform 150ms ease;
  backdrop-filter: blur(22px);
}

.store-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.store-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.store-drawer-title {
  color: #2f2516;
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.15;
}

.store-drawer-subtitle {
  margin-top: 2px;
  color: #7d6845;
  font-size: 0.78rem;
}

.store-close-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(127, 84, 20, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #6b4308;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.store-wallet {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.store-wallet div {
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(127, 84, 20, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
}

.store-wallet strong,
.store-wallet span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-wallet strong {
  color: #2f2516;
  font-size: 0.82rem;
}

.store-wallet span {
  margin-top: 2px;
  color: #806d4d;
  font-size: 0.68rem;
}

.store-category-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border-radius: 8px;
  background: #f1eadc;
}

.store-category-tab {
  min-height: 32px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #735f3e;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 760;
}

.store-category-tab.is-active {
  border-color: rgba(127, 84, 20, 0.16);
  background: #ffffff;
  color: #61400d;
  box-shadow: 0 1px 4px rgba(73, 55, 24, 0.08);
}

.store-product-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1 1 auto;
  overflow: auto;
}

.store-product,
.store-empty {
  border: 1px solid rgba(127, 84, 20, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.store-product {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
}

.store-product-thumb {
  width: 58px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #f5ead1;
  color: #6b4308;
  font-weight: 800;
}

.store-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-product-video-thumb {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(85, 196, 214, 0.42), rgba(183, 140, 224, 0.34)),
    #f7f0fa;
  color: #254a64;
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
}

.store-product-body {
  min-width: 0;
}

.store-product-title,
.store-product-meta,
.store-product-price {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-product-title {
  color: #2f2516;
  font-size: 0.86rem;
  font-weight: 760;
}

.store-product-meta {
  margin-top: 2px;
  color: #75664f;
  font-size: 0.74rem;
}

.store-product-price {
  margin-top: 3px;
  color: #6b4308;
  font-size: 0.74rem;
  font-weight: 760;
}

.store-empty {
  padding: 12px;
  color: #75664f;
  font-size: 0.84rem;
}

.chat-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-drawer-title {
  color: #251d2d;
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.15;
}

.chat-drawer-subtitle {
  margin-top: 2px;
  color: #76548f;
  font-size: 0.78rem;
}

.chat-close-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(64, 38, 90, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #4d1f73;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.chat-close-button:hover {
  border-color: rgba(101, 39, 168, 0.42);
  background: #f3e8ff;
}

.chat-channel-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border-radius: 8px;
  background: #eee7f4;
}

.chat-channel-tab {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #6b5878;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 760;
}

.chat-channel-tab.is-active {
  border-color: rgba(101, 39, 168, 0.16);
  background: #ffffff;
  color: #4d1f73;
  box-shadow: 0 1px 4px rgba(55, 36, 70, 0.08);
}

body.is-visitor-mode .floating-tools {
  display: none;
}

body.is-visitor-mode .debug-launcher,
body.is-visitor-mode .debug-panel {
  display: none;
}

body.is-map-open .floating-tools {
  display: none;
}

body.is-map-open .debug-panel {
  display: none;
}

body.is-map-open .brand-logo {
  z-index: 35;
  left: max(18px, env(safe-area-inset-left));
  top: max(18px, env(safe-area-inset-top));
  width: clamp(112px, 7vw, 148px);
}

body.is-map-open .right-orb-rail {
  display: none;
}

body.is-visitor-mode .tool-panel {
  display: none;
}

body.is-visitor-mode .room-canvas {
  cursor: default;
}

body.is-visitor-mode .window-item,
body.is-visitor-mode .sign-item,
body.is-visitor-mode .frame-item,
body.is-visitor-mode .furniture-item,
body.is-visitor-mode .ceiling-item {
  cursor: default;
  pointer-events: none;
}

body.is-visitor-mode .door-item {
  cursor: pointer;
  pointer-events: auto;
}

body.is-visitor-mode .frame-mini-actions,
body.is-visitor-mode .resize-handle,
body.is-visitor-mode .ceiling-anchor {
  display: none !important;
}

body.is-visitor-mode .furniture-item.has-shelf-items {
  pointer-events: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tool-panel {
  position: fixed;
  left: var(--tool-panel-left, max(88px, calc(env(safe-area-inset-left) + 88px)));
  top: var(--tool-panel-top, max(116px, calc(env(safe-area-inset-top) + 116px)));
  z-index: 31;
  width: var(--tool-panel-width, min(390px, calc(100vw - 146px)));
  min-width: min(300px, calc(100vw - 20px));
  height: var(--tool-panel-height, auto);
  min-height: 190px;
  max-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(26, 31, 35, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 252, 255, 0.96), rgba(250, 247, 252, 0.9)),
    var(--panel);
  box-shadow: 0 14px 38px rgba(54, 38, 66, 0.2);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transform-origin: top left;
  transition: opacity 140ms ease, transform 140ms ease;
  overflow: hidden;
}

.tool-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.tool-panel.is-moving,
.tool-panel.is-resizing {
  transition: none;
  user-select: none;
}

.tool-panel-chrome {
  position: sticky;
  top: -8px;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: -8px -8px 0;
  padding: 7px 9px;
  border-bottom: 1px solid rgba(76, 45, 96, 0.1);
  border-radius: 8px 8px 0 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.2) 0,
      rgba(255, 255, 255, 0.2) 1px,
      rgba(120, 70, 140, 0.035) 2px,
      rgba(120, 70, 140, 0.035) 5px
    ),
    rgba(255, 252, 255, 0.94);
  cursor: grab;
}

.tool-panel-chrome:active {
  cursor: grabbing;
}

.tool-panel-grip {
  display: grid;
  gap: 3px;
  width: 16px;
}

.tool-panel-grip span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: rgba(95, 74, 176, 0.46);
}

.tool-panel-title {
  min-width: 0;
  display: grid;
  color: #2a2030;
  font-weight: 820;
  line-height: 1.05;
}

.tool-panel-title-kicker {
  color: #76548f;
  font-size: 0.64rem;
  font-weight: 760;
  text-transform: uppercase;
}

.tool-panel-reset-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(95, 74, 176, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: #5f4ab0;
  cursor: pointer;
}

.tool-panel-reset-button:hover {
  border-color: rgba(0, 184, 201, 0.42);
  color: #007d89;
}

.tool-panel-reset-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.tool-panel-resize-handle {
  position: sticky;
  right: -6px;
  bottom: -6px;
  align-self: flex-end;
  width: 24px;
  height: 24px;
  margin: -10px -6px -6px 0;
  cursor: nwse-resize;
}

.tool-panel-resize-handle::before {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(95, 74, 176, 0.42);
  border-bottom: 2px solid rgba(95, 74, 176, 0.42);
  border-radius: 0 0 4px 0;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(11, 36px);
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(76, 45, 96, 0.1);
  border-radius: 999px;
  background: rgba(241, 237, 246, 0.9);
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-tabs::-webkit-scrollbar {
  display: none;
}

.mode-button,
.preset-button,
.plain-button,
.dev-toggle {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.mode-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: #5f4ab0;
}

.mode-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.mode-button:hover {
  border-color: rgba(0, 184, 201, 0.28);
  background: rgba(255, 255, 255, 0.7);
  color: #007d89;
}

.mode-button.is-active {
  background: #fff8f2;
  border-color: rgba(42, 32, 48, 0.28);
  color: #0b6f68;
  box-shadow: 0 7px 18px rgba(76, 45, 96, 0.13);
}

.panel-section {
  display: none;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.panel-section.is-active {
  display: flex;
  flex: 1 1 auto;
  overflow: auto;
  padding: 1px 3px 3px 1px;
  scrollbar-width: thin;
}

.field {
  display: grid;
  gap: 4px;
  color: #465057;
  font-size: 0.8rem;
}

.field > span,
.slider-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

select,
input[type="text"],
input[type="color"],
textarea {
  width: 100%;
  border: 1px solid rgba(32, 35, 38, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
}

select,
input[type="text"] {
  height: 32px;
  padding: 0 9px;
}

.readonly-route {
  color: var(--muted);
  font-size: 0.78rem;
}

input[type="color"] {
  height: 34px;
  padding: 4px;
}

.paint-color-field {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.paint-color-field input[type="color"] {
  width: 42px;
  min-width: 42px;
  justify-self: end;
  cursor: pointer;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.toggle-field {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 9px;
  color: #465057;
  font-size: 0.8rem;
}

.toggle-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

output {
  min-width: 34px;
  color: var(--muted);
  text-align: right;
}

.tool-primary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.tool-section {
  border: 1px solid rgba(64, 42, 79, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.52);
  overflow: hidden;
}

.tool-section summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  color: #392943;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 820;
  letter-spacing: 0;
  list-style: none;
  text-transform: uppercase;
}

.tool-section summary::-webkit-details-marker {
  display: none;
}

.tool-section summary::after {
  content: ">";
  color: rgba(95, 74, 176, 0.72);
  font-size: 0.76rem;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.tool-section[open] summary {
  border-bottom: 1px solid rgba(64, 42, 79, 0.08);
  background: rgba(252, 248, 255, 0.74);
}

.tool-section[open] summary::after {
  transform: rotate(90deg);
}

.tool-section-body {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.compact-color-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.compact-color-row input[type="color"] {
  width: 42px;
  min-width: 42px;
}

.paint-actions {
  display: grid;
}

.object-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.house-room-panel {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(32, 35, 38, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.house-room-actions,
.house-room-row {
  display: grid;
  align-items: center;
  gap: 8px;
}

.house-room-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.house-room-actions {
  color: #465057;
  font-size: 0.88rem;
  font-weight: 680;
}

.house-room-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.house-room-list {
  display: grid;
  gap: 6px;
}

.house-room-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 6px;
  border: 1px solid rgba(32, 35, 38, 0.09);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.house-room-row.is-current {
  border-color: rgba(11, 111, 104, 0.34);
  background: rgba(11, 111, 104, 0.08);
}

.house-room-button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f292e;
  text-align: left;
  cursor: pointer;
}

.house-room-button:disabled {
  cursor: default;
}

.house-room-name,
.house-room-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.house-room-name {
  font-weight: 700;
}

.house-room-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.house-room-row-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 5px;
}

.house-room-badge {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(32, 35, 38, 0.08);
  color: #465057;
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.house-room-delete {
  min-height: 28px;
  padding-inline: 8px;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.permission-panel {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(32, 35, 38, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.permission-title {
  color: #465057;
  font-size: 0.88rem;
  font-weight: 680;
}

.chat-members {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-member {
  min-width: 0;
  display: inline-grid;
  grid-template-columns: 26px minmax(0, auto) auto;
  align-items: center;
  gap: 6px;
  padding: 4px 7px 4px 4px;
  border: 1px solid rgba(32, 35, 38, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
}

.chat-avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(18, 22, 26, 0.28);
}

.chat-avatar.has-image {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  text-shadow: none;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.chat-member-label,
.chat-member-role {
  overflow: hidden;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-member-label {
  max-width: 140px;
  color: #283238;
  font-size: 0.78rem;
  font-weight: 720;
}

.chat-member-role {
  color: var(--muted);
  font-size: 0.7rem;
}

.chat-thread {
  min-height: 210px;
  max-height: none;
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1 1 auto;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(32, 35, 38, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(250, 247, 253, 0.92), rgba(255, 255, 255, 0.76)),
    #ffffff;
  scrollbar-width: thin;
}

.chat-empty {
  align-self: center;
  justify-self: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.chat-message {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
}

.chat-message-body {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(32, 35, 38, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.chat-message-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.chat-message-meta strong {
  min-width: 0;
  overflow: hidden;
  color: #273239;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message-meta time {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.chat-message p {
  margin: 0;
  color: #1f292e;
  font-size: 0.88rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat-composer {
  display: grid;
  flex: 0 0 auto;
  gap: 7px;
  padding-top: 2px;
}

.chat-message-field textarea {
  min-height: 72px;
  max-height: 140px;
  resize: vertical;
  padding: 9px;
  color: #1f292e;
  line-height: 1.35;
}

.auth-session-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(65, 81, 168, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: #4b5874;
  line-height: 1.35;
}

.auth-session-card span {
  color: #6c5880;
  font-size: 0.68rem;
  font-weight: 820;
  text-transform: uppercase;
}

.auth-session-card strong {
  color: #25305e;
  font-size: 0.98rem;
}

.auth-session-card p {
  margin: 0;
  font-size: 0.8rem;
}

.auth-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(65, 81, 168, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.auth-form strong {
  color: #25305e;
  font-size: 0.92rem;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-primary-button {
  background: #4151a8;
  border-color: rgba(65, 81, 168, 0.2);
  color: #ffffff;
}

body.is-alpha-authenticated .auth-form {
  opacity: 0.62;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 1px,
      rgba(120, 70, 140, 0.03) 2px,
      rgba(120, 70, 140, 0.03) 4px
    ),
    linear-gradient(90deg, #dfbfdf, #f7eff8 38%, #e6f5ff 100%);
}

.auth-gate[hidden] {
  display: none;
}

.auth-gate-panel {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(76, 45, 96, 0.16);
  border-radius: 8px;
  background: rgba(255, 252, 255, 0.94);
  box-shadow: 0 28px 80px rgba(76, 45, 96, 0.24);
  backdrop-filter: blur(18px);
}

.auth-gate-logo {
  width: 148px;
  height: auto;
  display: block;
}

.auth-gate-kicker {
  color: #6c5880;
  font-size: 0.72rem;
  font-weight: 840;
  text-transform: uppercase;
}

.auth-gate h1 {
  margin: 0;
  color: #25305e;
  font-size: 2rem;
  line-height: 1;
}

.auth-gate p {
  max-width: 58ch;
  margin: 0;
  color: #4b5874;
  line-height: 1.45;
}

.auth-gate-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auth-gate-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(65, 81, 168, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.auth-gate-form strong {
  color: #25305e;
  font-size: 0.96rem;
}

.auth-gate-status {
  min-height: 18px;
}

.onboarding-tour {
  position: fixed;
  inset: 0;
  z-index: 92;
  pointer-events: auto;
}

.onboarding-tour[hidden] {
  display: none;
}

.onboarding-tour-scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 28, 0.28);
  backdrop-filter: blur(2px);
}

.onboarding-tour-spotlight {
  position: fixed;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  box-shadow:
    0 0 0 9999px rgba(20, 16, 28, 0.32),
    0 14px 34px rgba(20, 16, 28, 0.26);
  pointer-events: none;
}

.onboarding-tour-pointer {
  position: fixed;
  height: 2px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(20, 16, 28, 0.24);
  pointer-events: none;
  transform-origin: left center;
}

.onboarding-tour-card {
  position: fixed;
  z-index: 2;
  width: min(340px, calc(100vw - 36px));
  display: grid;
  gap: 9px;
  padding: 15px;
  border: 1px solid rgba(76, 45, 96, 0.16);
  border-radius: 8px;
  background: rgba(255, 252, 255, 0.96);
  box-shadow: 0 24px 60px rgba(20, 16, 28, 0.24);
}

.onboarding-tour-step {
  color: #6c5880;
  font-size: 0.68rem;
  font-weight: 840;
  text-transform: uppercase;
}

.onboarding-tour-card h2 {
  margin: 0;
  color: #25305e;
  font-size: 1.12rem;
}

.onboarding-tour-card p {
  margin: 0;
  color: #4b5874;
  font-size: 0.9rem;
  line-height: 1.4;
}

.onboarding-tour-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chat-user-field.is-locked,
.profile-user-field.is-locked {
  opacity: 0.72;
}

.chat-user-field.is-locked select,
.profile-user-field.is-locked select {
  cursor: not-allowed;
}

.profile-summary {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(168, 50, 111, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.profile-avatar-preview {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 860;
  text-shadow: 0 2px 4px rgba(18, 22, 26, 0.3);
  box-shadow:
    inset 0 0 0 1px rgba(36, 26, 45, 0.08),
    0 10px 22px rgba(168, 50, 111, 0.14);
}

.profile-avatar-preview.has-image {
  background: rgba(255, 255, 255, 0.72);
  text-shadow: none;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-avatar-name {
  margin-top: 7px;
  color: #705b73;
  font-size: 0.78rem;
  line-height: 1.3;
}

.profile-color-field input[type="color"] {
  height: 40px;
  padding: 4px;
}

.profile-standee-panel {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(168, 50, 111, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.profile-standee-preview {
  --profile-standee-flip: 1;
  width: 96px;
  height: 124px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 860;
  text-shadow: 0 2px 4px rgba(18, 22, 26, 0.3);
  box-shadow:
    inset 0 0 0 1px rgba(36, 26, 45, 0.08),
    0 10px 22px rgba(168, 50, 111, 0.14);
}

.profile-standee-preview.has-image {
  background: transparent;
  text-shadow: none;
}

.profile-standee-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: bottom center;
  transform: scaleX(var(--profile-standee-flip));
  transform-origin: bottom center;
}

.profile-standee-preview.is-flipped {
  --profile-standee-flip: -1;
}

.profile-standee-meta {
  display: grid;
  gap: 4px;
  color: #705b73;
  font-size: 0.78rem;
  line-height: 1.3;
}

.profile-standee-meta strong {
  color: #2a2030;
  font-size: 0.9rem;
}

.profile-standee-presets {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(168, 50, 111, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
}

.profile-standee-presets-title {
  color: #705b73;
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.standee-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.standee-preset-button {
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 6px;
  border: 1px solid rgba(32, 35, 38, 0.11);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.66);
  color: #2a2030;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 760;
  text-align: center;
}

.standee-preset-button:hover,
.standee-preset-button.is-active {
  border-color: rgba(168, 50, 111, 0.42);
  background: rgba(255, 235, 247, 0.72);
}

.standee-preset-button img {
  width: 100%;
  height: 72px;
  display: block;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 8px 10px rgba(36, 26, 45, 0.16));
}

.standee-preset-button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #465057;
  font-size: 0.88rem;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #a8326f;
}

.profile-standee-adjustments {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(168, 50, 111, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
}

.profile-standee-adjustments .field {
  gap: 6px;
}

.profile-standee-adjustments .field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-standee-adjustments output {
  color: #705b73;
  font-size: 0.78rem;
  font-weight: 820;
}

.profile-standee-adjustments input[type="range"] {
  width: 100%;
}

.quick-chat {
  position: fixed;
  inset: 0;
  z-index: 32;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.quick-chat.is-open {
  opacity: 1;
}

.quick-chat-form {
  position: fixed;
  left: 50%;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 16px));
  width: min(560px, calc(100vw - 420px));
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto 34px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(76, 45, 96, 0.16);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.16) 0,
      rgba(255, 255, 255, 0.16) 1px,
      rgba(110, 53, 184, 0.026) 2px,
      rgba(110, 53, 184, 0.026) 4px
    ),
    rgba(255, 252, 255, 0.94);
  box-shadow: 0 18px 42px rgba(76, 45, 96, 0.18);
  pointer-events: auto;
  transform: translate(-50%, 14px) scale(0.98);
  transition: transform 150ms ease;
  backdrop-filter: blur(18px);
}

.quick-chat.is-open .quick-chat-form {
  transform: translate(-50%, 0) scale(1);
}

.quick-chat-info {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  top: max(18px, env(safe-area-inset-top));
  width: clamp(132px, 8.5vw, 158px);
  min-height: 120px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(76, 45, 96, 0.16);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.16) 0,
      rgba(255, 255, 255, 0.16) 1px,
      rgba(110, 53, 184, 0.026) 2px,
      rgba(110, 53, 184, 0.026) 4px
    ),
    rgba(255, 252, 255, 0.92);
  box-shadow: 0 18px 42px rgba(76, 45, 96, 0.16);
  pointer-events: auto;
  transform: translateY(-8px) scale(0.98);
  transition: transform 150ms ease;
  backdrop-filter: blur(18px);
}

.quick-chat.is-open .quick-chat-info {
  transform: translateY(0) scale(1);
}

.quick-chat-info strong {
  overflow: hidden;
  color: #2a2030;
  font-size: 0.82rem;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-chat-info span {
  overflow: hidden;
  color: #6b5a70;
  font-size: 0.74rem;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

.quick-chat-channel-label {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(76, 45, 96, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.58);
  color: #6b5a70;
  display: block;
  font-size: 0.74rem;
  font-weight: 760;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.quick-chat input[type="text"] {
  height: 36px;
  min-width: 0;
}

.quick-chat-send-button,
.quick-chat-log-button {
  min-height: 36px;
}

.quick-chat-send-button {
  background: #5f2c86;
  border-color: rgba(61, 30, 82, 0.12);
  color: #ffffff;
}

.quick-chat-close-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(76, 45, 96, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #4b355b;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.quick-chat-status {
  min-height: 34px;
  font-size: 0.72rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

body.is-quick-chat-open .app-footer {
  opacity: 0;
  pointer-events: none;
}

.house-shout {
  --house-shout-bg: rgba(255, 250, 217, 0.95);
  --house-shout-border: rgba(42, 32, 48, 0.92);
  --house-shout-text: #241a2d;
  position: absolute;
  top: 4.5%;
  left: 50%;
  z-index: 27;
  width: min(58%, 680px);
  padding: 14px 18px;
  border: 3px solid var(--house-shout-border);
  border-radius: 8px;
  background: var(--house-shout-bg);
  color: var(--house-shout-text);
  box-shadow:
    7px 7px 0 rgba(42, 32, 48, 0.14),
    0 18px 42px rgba(36, 26, 45, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.house-shout::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border: 3px solid rgba(42, 32, 48, 0.62);
  clip-path: polygon(
    0 22%, 5% 15%, 9% 20%, 14% 9%, 18% 17%, 24% 7%, 28% 15%,
    34% 8%, 40% 16%, 46% 7%, 52% 15%, 58% 8%, 64% 16%, 70% 8%,
    76% 17%, 82% 9%, 88% 19%, 94% 13%, 100% 22%,
    96% 48%, 100% 72%, 94% 86%, 88% 81%, 82% 93%, 76% 83%,
    70% 94%, 64% 84%, 58% 92%, 52% 85%, 46% 94%, 40% 84%,
    34% 93%, 28% 84%, 22% 92%, 16% 83%, 10% 91%, 5% 82%, 0 72%,
    4% 50%
  );
}

.house-shout.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.house-shout strong {
  display: block;
  margin-bottom: 4px;
  font-size: clamp(0.78rem, 1.05vw, 0.96rem);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.house-shout p {
  position: relative;
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.4rem);
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.standee-layer {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

.standee-slot {
  --standee-width: 24%;
  --standee-height: 64%;
  --standee-bottom: 0%;
  --standee-x: 4%;
  --standee-scale: 1;
  --standee-art-height: 82%;
  --standee-bubble-gap: 26px;
  position: absolute;
  bottom: var(--standee-bottom);
  z-index: 2;
  width: var(--standee-width);
  height: var(--standee-height);
  opacity: 0;
  transform: translateY(18px) scale(var(--standee-scale));
  transform-origin: bottom center;
  transition: opacity 180ms ease, transform 180ms ease;
}

.standee-slot-front-left {
  left: var(--standee-x);
  z-index: 4;
}

.standee-slot-front-right {
  right: var(--standee-x);
  z-index: 4;
}

.standee-slot-back-left {
  --standee-width: 22%;
  --standee-height: 57%;
  --standee-bottom: 0%;
  --standee-x: 23%;
  --standee-scale: 0.9;
  left: var(--standee-x);
  z-index: 3;
}

.standee-slot-back-right {
  --standee-width: 22%;
  --standee-height: 57%;
  --standee-bottom: 0%;
  --standee-x: 23%;
  --standee-scale: 0.9;
  right: var(--standee-x);
  z-index: 3;
}

.standee-slot.is-visible {
  opacity: 1;
  transform: translateY(0) scale(var(--standee-scale));
}

.standee-slot.is-new-message .standee-bubble {
  animation: standee-bubble-new 760ms ease-out;
}

.standee-slot.is-new-message .standee-art {
  animation: standee-art-new 980ms ease-in-out;
}

.standee-slot.is-shout .standee-bubble {
  --standee-bubble-border: rgba(42, 32, 48, 0.94);
  --standee-bubble-bg: rgba(255, 250, 217, 0.95);
  box-shadow:
    7px 7px 0 rgba(42, 32, 48, 0.16),
    0 18px 42px rgba(36, 26, 45, 0.2);
}

.standee-slot.is-shout .standee-bubble p {
  font-weight: 900;
}

@keyframes standee-bubble-new {
  0% {
    outline: 0 solid rgba(255, 231, 122, 0.7);
    outline-offset: 0;
  }
  34% {
    outline: 5px solid rgba(255, 231, 122, 0.34);
    outline-offset: 4px;
  }
  100% {
    outline: 0 solid rgba(255, 231, 122, 0);
    outline-offset: 10px;
  }
}

@keyframes standee-art-new {
  0% {
    transform:
      translateX(-50%)
      translateY(0);
  }
  20% {
    transform:
      translateX(-50%)
      translateY(-5px);
  }
  42% {
    transform:
      translateX(-50%)
      translateY(2px);
  }
  62% {
    transform:
      translateX(-50%)
      translateY(-3px);
  }
  100% {
    transform:
      translateX(-50%)
      translateY(0);
  }
}

.standee-art {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: var(--standee-art-height);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 252, 255, 0.72);
  border-radius: 8px 8px 0 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 42%),
    var(--standee-color, #4f6f8f);
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 900;
  text-shadow: 0 4px 10px rgba(18, 22, 26, 0.28);
  box-shadow: 0 18px 42px rgba(36, 26, 45, 0.18);
  transform: translateX(-50%);
  transform-origin: bottom center;
}

.standee-slot.has-standee {
  --standee-art-height: 100%;
}

.standee-slot.has-standee .standee-art {
  width: 150%;
  overflow: visible;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  text-shadow: none;
}

.standee-art img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  display: block;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 20px 26px rgba(36, 26, 45, 0.2));
}

.standee-slot.is-flipped .standee-art img {
  transform: scaleX(-1);
}

.standee-art span {
  display: grid;
  place-items: center;
  width: 74%;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
}

.standee-bubble {
  --standee-bubble-x: -50%;
  --standee-tail-x: 50%;
  --standee-bubble-bg: rgba(255, 252, 255, 0.92);
  --standee-bubble-border: rgba(42, 32, 48, 0.84);
  --standee-bubble-text: #241a2d;
  position: absolute;
  left: 50%;
  bottom: calc(var(--standee-art-height) + var(--standee-bubble-gap));
  z-index: 2;
  width: min(124%, 360px);
  min-width: min(280px, 132%);
  padding: 13px 14px;
  border: 2px solid var(--standee-bubble-border);
  border-radius: 8px;
  background: var(--standee-bubble-bg);
  color: var(--standee-bubble-text);
  box-shadow:
    6px 6px 0 rgba(42, 32, 48, 0.12),
    0 18px 42px rgba(36, 26, 45, 0.18);
  opacity: 1;
  transform: translateX(var(--standee-bubble-x));
  transition: opacity 260ms ease, transform 260ms ease;
}

.standee-bubble::before,
.standee-bubble::after {
  content: "";
  position: absolute;
  left: var(--standee-tail-x);
  width: 0;
  height: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

.standee-bubble::before {
  bottom: -15px;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 15px solid var(--standee-bubble-border);
}

.standee-bubble::after {
  bottom: -11px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid var(--standee-bubble-bg);
}

.standee-slot.is-bubble-hidden .standee-bubble {
  opacity: 0;
  transform: translate(var(--standee-bubble-x), -8px);
}

.standee-slot-front-left .standee-bubble,
.standee-slot-back-left .standee-bubble {
  --standee-bubble-x: -44%;
  --standee-tail-x: 44%;
}

.standee-slot-front-right .standee-bubble,
.standee-slot-back-right .standee-bubble {
  --standee-bubble-x: -56%;
  --standee-tail-x: 56%;
}

.standee-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.standee-meta strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standee-meta span {
  color: #705b73;
  font-size: 0.75rem;
  font-weight: 700;
}

.standee-bubble p {
  position: relative;
  margin: 0;
  font-size: clamp(0.9rem, 1.2vw, 1.08rem);
  line-height: 1.38;
  overflow-wrap: break-word;
  white-space: normal;
  word-break: normal;
}

.standee-slot.emote-mad .standee-bubble,
.house-shout.emote-mad {
  --standee-bubble-bg: #cf2438;
  --standee-bubble-border: #4d0712;
  --standee-bubble-text: #fff34f;
  --house-shout-bg: #cf2438;
  --house-shout-border: #4d0712;
  --house-shout-text: #fff34f;
  background:
    repeating-linear-gradient(115deg, rgba(255, 243, 79, 0.16) 0 4px, transparent 4px 18px),
    var(--standee-bubble-bg, var(--house-shout-bg));
  box-shadow:
    7px 7px 0 rgba(77, 7, 18, 0.26),
    0 18px 42px rgba(77, 7, 18, 0.22);
}

.standee-slot.emote-mad .standee-bubble p,
.house-shout.emote-mad p {
  color: #fff34f;
  font-weight: 1000;
  text-shadow: 2px 2px 0 rgba(77, 7, 18, 0.62);
}

.standee-slot.emote-mad .standee-bubble p::before,
.standee-slot.emote-mad .standee-bubble p::after,
.house-shout.emote-mad p::before,
.house-shout.emote-mad p::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 26px;
  height: 13px;
  border-top: 4px solid #fff34f;
  border-radius: 50%;
}

.standee-slot.emote-mad .standee-bubble p::before,
.house-shout.emote-mad p::before {
  left: -7px;
  transform: rotate(-24deg);
}

.standee-slot.emote-mad .standee-bubble p::after,
.house-shout.emote-mad p::after {
  right: -7px;
  transform: rotate(24deg);
}

.standee-slot.emote-sad .standee-bubble,
.house-shout.emote-sad {
  --standee-bubble-bg: #d9efff;
  --standee-bubble-border: #2c76e2;
  --standee-bubble-text: #009bff;
  --house-shout-bg: #d9efff;
  --house-shout-border: #2c76e2;
  --house-shout-text: #009bff;
}

.standee-slot.emote-sad .standee-bubble p,
.house-shout.emote-sad p {
  color: #009bff;
  font-weight: 900;
}

.standee-slot.emote-sad .speech-letter,
.house-shout.emote-sad .speech-letter {
  display: inline-block;
  transform-origin: 50% 80%;
  animation: standee-sad-wiggle 620ms ease-in-out infinite;
  animation-delay: var(--speech-letter-delay, 0ms);
}

.standee-slot.emote-aaa .standee-bubble,
.house-shout.emote-aaa {
  --standee-bubble-bg: #ffe05a;
  --standee-bubble-border: #2b2119;
  --standee-bubble-text: #241a2d;
  --house-shout-bg: #ffe05a;
  --house-shout-border: #2b2119;
  --house-shout-text: #241a2d;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.72) 0 7px, transparent 8px),
    radial-gradient(circle at 88% 23%, rgba(255, 255, 255, 0.58) 0 5px, transparent 6px),
    var(--standee-bubble-bg, var(--house-shout-bg));
}

.standee-slot.emote-aaa .standee-bubble p,
.house-shout.emote-aaa p {
  font-weight: 1000;
  letter-spacing: 0;
  animation: standee-aaa-shake 180ms steps(2, end) infinite;
}

.standee-slot.emote-meh .standee-bubble,
.house-shout.emote-meh {
  --standee-bubble-bg: #e1e0e3;
  --standee-bubble-border: #6f6874;
  --standee-bubble-text: #4d4850;
  --house-shout-bg: #e1e0e3;
  --house-shout-border: #6f6874;
  --house-shout-text: #4d4850;
  filter: saturate(0.78);
}

.standee-slot.is-new-message.emote-meh .standee-bubble {
  animation: standee-bubble-new 760ms ease-out, standee-meh-slump 1900ms ease-in-out infinite;
}

.standee-slot.emote-meh:not(.is-new-message) .standee-bubble,
.house-shout.emote-meh {
  animation: standee-meh-slump 1900ms ease-in-out infinite;
}

.standee-slot.emote-meh .standee-bubble p,
.house-shout.emote-meh p {
  font-style: italic;
  font-weight: 800;
}

.standee-slot.emote-love .standee-bubble,
.house-shout.emote-love {
  --standee-bubble-bg: #ffd9ec;
  --standee-bubble-border: #d32778;
  --standee-bubble-text: #8a164d;
  --house-shout-bg: #ffd9ec;
  --house-shout-border: #d32778;
  --house-shout-text: #8a164d;
  box-shadow:
    0 0 0 0 rgba(255, 71, 159, 0.34),
    7px 7px 0 rgba(211, 39, 120, 0.16),
    0 18px 42px rgba(211, 39, 120, 0.18);
}

.standee-slot.is-new-message.emote-love .standee-bubble {
  animation: standee-bubble-new 760ms ease-out, standee-love-pulse 1450ms ease-in-out infinite;
}

.standee-slot.emote-love:not(.is-new-message) .standee-bubble,
.house-shout.emote-love {
  animation: standee-love-pulse 1450ms ease-in-out infinite;
}

.standee-slot.emote-love .standee-bubble p,
.house-shout.emote-love p {
  color: #8a164d;
  font-weight: 900;
}

.standee-slot.emote-love .standee-bubble p::before,
.standee-slot.emote-love .standee-bubble p::after,
.house-shout.emote-love p::before,
.house-shout.emote-love p::after {
  position: absolute;
  color: #ff4b9e;
  font-size: 0.88em;
  font-weight: 1000;
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.72);
  animation: standee-love-float 1400ms ease-in-out infinite;
}

.standee-slot.emote-love .standee-bubble p::before,
.house-shout.emote-love p::before {
  content: "<3";
  left: -16px;
  top: -14px;
}

.standee-slot.emote-love .standee-bubble p::after,
.house-shout.emote-love p::after {
  content: "<3";
  right: -16px;
  bottom: -12px;
  animation-delay: 360ms;
}

.standee-slot.emote-ellipsis .standee-bubble,
.house-shout.emote-ellipsis {
  --standee-bubble-bg: rgba(255, 255, 255, 0.98);
  --standee-bubble-border: #111111;
  --standee-bubble-text: #111111;
  --house-shout-bg: rgba(255, 255, 255, 0.98);
  --house-shout-border: #111111;
  --house-shout-text: #111111;
  border-width: 4px;
  box-shadow:
    8px 8px 0 rgba(0, 0, 0, 0.18),
    0 18px 42px rgba(0, 0, 0, 0.18);
}

.standee-slot.emote-ellipsis .standee-bubble p,
.house-shout.emote-ellipsis p {
  min-height: 1.2em;
  color: #111111;
  font-size: clamp(1.9rem, 3vw, 3rem);
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 0.92;
  text-align: center;
}

.standee-slot.emote-ellipsis .standee-bubble p::before,
.house-shout.emote-ellipsis p::before {
  content: "";
  position: absolute;
  top: -14px;
  right: -2px;
  width: 11px;
  height: 16px;
  border: 2px solid #1e6dd8;
  border-radius: 70% 70% 70% 0;
  background: #69c4ff;
  transform: rotate(-28deg);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.48);
}

@keyframes standee-sad-wiggle {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  28% {
    transform: translateY(1px) rotate(-1deg);
  }
  62% {
    transform: translateY(-1px) rotate(1deg);
  }
}

@keyframes standee-aaa-shake {
  0%,
  100% {
    transform: translate(0, 0) rotate(0);
  }
  33% {
    transform: translate(-2px, 1px) rotate(-1deg);
  }
  66% {
    transform: translate(2px, -1px) rotate(1deg);
  }
}

@keyframes standee-meh-slump {
  0%,
  100% {
    transform: translateX(var(--standee-bubble-x, -50%)) translateY(0) rotate(-0.5deg);
  }
  50% {
    transform: translateX(var(--standee-bubble-x, -50%)) translateY(5px) rotate(1.2deg);
  }
}

@keyframes standee-love-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(255, 71, 159, 0.26),
      7px 7px 0 rgba(211, 39, 120, 0.16),
      0 18px 42px rgba(211, 39, 120, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 10px rgba(255, 71, 159, 0),
      7px 7px 0 rgba(211, 39, 120, 0.18),
      0 18px 42px rgba(211, 39, 120, 0.22);
  }
}

@keyframes standee-love-float {
  0%,
  100% {
    opacity: 0.58;
    transform: translateY(0) scale(0.92);
  }
  50% {
    opacity: 1;
    transform: translateY(-7px) scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .standee-slot.emote-sad .speech-letter,
  .house-shout.emote-sad .speech-letter,
  .standee-slot.emote-aaa .standee-bubble p,
  .house-shout.emote-aaa p,
  .standee-slot.emote-meh .standee-bubble,
  .house-shout.emote-meh,
  .standee-slot.emote-love .standee-bubble,
  .house-shout.emote-love,
  .standee-slot.emote-love .standee-bubble p::before,
  .standee-slot.emote-love .standee-bubble p::after,
  .house-shout.emote-love p::before,
  .house-shout.emote-love p::after {
    animation: none;
  }
}

.floating-drawer {
  --drawer-accent: #5f4ab0;
  --drawer-accent-rgb: 95, 74, 176;
  --drawer-soft: #f1edf6;
  position: fixed;
  left: var(--floating-drawer-left, calc(100vw - min(430px, calc(100vw - 108px)) - 88px));
  top: var(--floating-drawer-top, max(18px, env(safe-area-inset-top)));
  right: auto;
  bottom: auto;
  z-index: 33;
  width: var(--floating-drawer-width, min(430px, calc(100vw - 108px)));
  min-width: min(300px, calc(100vw - 20px));
  height: var(--floating-drawer-height, min(680px, calc(100vh - 28px)));
  min-height: min(320px, calc(100vh - 20px));
  max-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
  border: 1px solid rgba(76, 45, 96, 0.14);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.14) 0,
      rgba(255, 255, 255, 0.14) 1px,
      rgba(var(--drawer-accent-rgb), 0.022) 2px,
      rgba(var(--drawer-accent-rgb), 0.022) 4px
    ),
    rgba(255, 252, 255, 0.94);
  box-shadow: 0 22px 64px rgba(76, 45, 96, 0.2);
  opacity: 0;
  overflow: auto;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 150ms ease, transform 150ms ease;
  backdrop-filter: blur(22px);
}

.floating-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.floating-drawer.is-moving,
.floating-drawer.is-resizing {
  transition: none;
  user-select: none;
}

.profile-drawer {
  --drawer-accent: #a8326f;
  --drawer-accent-rgb: 168, 50, 111;
  --drawer-soft: #ffe6f1;
}

.auth-drawer {
  --drawer-accent: #4151a8;
  --drawer-accent-rgb: 65, 81, 168;
  --drawer-soft: #edf0ff;
}

.closet-drawer {
  --drawer-accent: #0b6f68;
  --drawer-accent-rgb: 11, 111, 104;
  --drawer-soft: #e5fbf6;
}

.items-drawer {
  --drawer-accent: #806800;
  --drawer-accent-rgb: 128, 104, 0;
  --drawer-soft: #fff7cc;
}

.chat-drawer {
  --drawer-accent: #6e35b8;
  --drawer-accent-rgb: 110, 53, 184;
  --drawer-soft: #f3e8ff;
}

.store-drawer {
  --drawer-accent: #8a5a00;
  --drawer-accent-rgb: 138, 90, 0;
  --drawer-soft: #fff0c9;
}

.floating-drawer-chrome {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 -12px 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(76, 45, 96, 0.1);
  border-radius: 8px 8px 0 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.2) 0,
      rgba(255, 255, 255, 0.2) 1px,
      rgba(var(--drawer-accent-rgb), 0.035) 2px,
      rgba(var(--drawer-accent-rgb), 0.035) 5px
    ),
    rgba(255, 252, 255, 0.94);
  cursor: grab;
}

.floating-drawer-chrome:active {
  cursor: grabbing;
}

.floating-drawer-grip {
  display: grid;
  gap: 3px;
  width: 16px;
}

.floating-drawer-grip span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: rgba(var(--drawer-accent-rgb), 0.46);
}

.floating-drawer-title {
  min-width: 0;
  display: grid;
  gap: 1px;
  color: #2a2030;
  line-height: 1.05;
}

.floating-drawer-title-kicker {
  color: rgba(var(--drawer-accent-rgb), 0.72);
  font-size: 0.64rem;
  font-weight: 760;
  text-transform: uppercase;
}

.floating-drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.floating-drawer-reset-button,
.floating-drawer-close-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(var(--drawer-accent-rgb), 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: var(--drawer-accent);
  cursor: pointer;
}

.floating-drawer-close-button {
  font-size: 1.1rem;
  line-height: 1;
}

.floating-drawer-reset-button:hover,
.floating-drawer-close-button:hover {
  border-color: rgba(var(--drawer-accent-rgb), 0.42);
  background: var(--drawer-soft);
  color: var(--drawer-accent);
}

.floating-drawer-reset-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.floating-drawer-resize-handle {
  position: sticky;
  right: -8px;
  bottom: -8px;
  align-self: flex-end;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: -8px -8px -8px 0;
  cursor: nwse-resize;
}

.floating-drawer-resize-handle::before {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(var(--drawer-accent-rgb), 0.42);
  border-bottom: 2px solid rgba(var(--drawer-accent-rgb), 0.42);
  border-radius: 0 0 4px 0;
}

.floating-drawer .status-line {
  flex: 0 0 auto;
}

.chat-channel-tabs {
  border: 1px solid rgba(76, 45, 96, 0.1);
  border-radius: 999px;
  background: rgba(241, 237, 246, 0.9);
}

.chat-channel-tab {
  border-radius: 999px;
}

.chat-channel-tab.is-active {
  border-color: rgba(110, 53, 184, 0.18);
  background: #fff8f2;
  color: #5f25a8;
  box-shadow: 0 7px 18px rgba(76, 45, 96, 0.11);
}

.chat-user-field {
  padding: 8px;
  border: 1px solid rgba(76, 45, 96, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
}

.chat-members {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid rgba(76, 45, 96, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  scrollbar-width: thin;
}

.chat-member {
  flex: 0 0 auto;
  border-color: rgba(110, 53, 184, 0.12);
  background: rgba(255, 248, 242, 0.74);
}

.chat-thread {
  border-color: rgba(76, 45, 96, 0.12);
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.16) 0,
      rgba(255, 255, 255, 0.16) 1px,
      rgba(110, 53, 184, 0.025) 2px,
      rgba(110, 53, 184, 0.025) 5px
    ),
    rgba(250, 247, 253, 0.82);
}

.chat-message-body {
  border-color: rgba(76, 45, 96, 0.1);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 18px rgba(76, 45, 96, 0.07);
}

.chat-message.is-current-user .chat-message-body {
  border-color: rgba(11, 111, 104, 0.18);
  background: rgba(216, 250, 242, 0.76);
}

.chat-message.is-current-user .chat-message-meta strong {
  color: #0b6f68;
}

.chat-composer {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(76, 45, 96, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.chat-message-field {
  min-width: 0;
}

.chat-message-field textarea {
  min-height: 58px;
  max-height: 120px;
}

.chat-send-button {
  min-height: 38px;
  align-self: end;
}

.danger-button {
  border-color: rgba(170, 51, 51, 0.28);
  color: #9a2f2f;
}

.danger-button:hover:not(:disabled) {
  border-color: rgba(170, 51, 51, 0.52);
  color: #7f2424;
}

.sign-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rich-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.rich-button {
  min-height: 32px;
}

.sign-editor {
  min-height: 112px;
  max-height: 190px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(32, 35, 38, 0.15);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: #1f292e;
  font-size: 0.92rem;
  line-height: 1.35;
  outline: none;
}

.sign-editor[contenteditable="true"]:focus {
  border-color: rgba(11, 111, 104, 0.46);
  box-shadow: 0 0 0 3px rgba(11, 111, 104, 0.1);
}

.sign-editor[contenteditable="false"] {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

.compact-action {
  min-height: 30px;
  font-size: 0.78rem;
}

.texture-browser {
  display: grid;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(32, 35, 38, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.52);
}

.texture-browser-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
}

.texture-category-field {
  min-width: 0;
}

.texture-carousel-shell {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 26px;
  gap: 5px;
  align-items: center;
}

.texture-carousel {
  display: flex;
  gap: 6px;
  min-width: 0;
  min-height: 62px;
  padding: 2px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.texture-tile {
  width: 56px;
  min-width: 56px;
  display: grid;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(32, 35, 38, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
  color: #3f474d;
  cursor: pointer;
}

.texture-tile:hover,
.texture-tile.is-active {
  border-color: rgba(11, 111, 104, 0.5);
  background: var(--accent-soft);
}

.texture-thumb {
  width: 48px;
  height: 42px;
  display: block;
  border-radius: 4px;
  border: 1px solid rgba(32, 35, 38, 0.1);
  object-fit: cover;
  image-rendering: pixelated;
}

.texture-name {
  overflow: hidden;
  color: #465057;
  font-size: 0.62rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.texture-browser-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 0.75rem;
}

.carousel-button {
  width: 26px;
  height: 38px;
  border: 1px solid rgba(32, 35, 38, 0.13);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.76);
  color: #465057;
  cursor: pointer;
}

.carousel-button:hover:not(:disabled) {
  border-color: rgba(11, 111, 104, 0.44);
  color: var(--accent);
}

.carousel-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.sky-preset-grid {
  max-height: 174px;
  overflow: auto;
  padding-right: 2px;
}

.preset-button {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(32, 35, 38, 0.11);
  text-align: left;
}

.preset-button:hover,
.preset-button.is-active {
  border-color: rgba(11, 111, 104, 0.44);
  background: var(--accent-soft);
}

.sky-preset-button {
  min-height: 58px;
  padding: 5px;
  align-items: stretch;
  flex-direction: column;
  gap: 5px;
  font-size: 0.74rem;
}

.preset-thumbnail {
  width: 100%;
  height: 34px;
  display: block;
  border-radius: 4px;
  border: 1px solid rgba(32, 35, 38, 0.12);
  object-fit: cover;
  image-rendering: auto;
}

.sky-preset-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-swatch {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 5px;
  border: 1px solid rgba(32, 35, 38, 0.18);
}

.sky-day {
  background: linear-gradient(#84c2ee 0 48%, #f0d188 80%, #d88761);
}

.cloud-light {
  background:
    radial-gradient(circle at 30% 38%, #ffffff 0 18%, transparent 19%),
    radial-gradient(circle at 56% 46%, #ffffff 0 22%, transparent 23%),
    linear-gradient(#a9d6ef, #e9f5fb);
}

.forest-view {
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(29, 83, 52, 0.9) 49% 54%, transparent 55%),
    linear-gradient(#a5d6e6 0 42%, #52795f 43%, #233d32 100%);
}

.night-view {
  background:
    radial-gradient(circle at 26% 24%, #f8f1c5 0 4%, transparent 5%),
    radial-gradient(circle at 70% 34%, #ffffff 0 2%, transparent 3%),
    linear-gradient(#172036, #384568 62%, #141b25);
}

.file-action {
  position: relative;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(32, 35, 38, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: #253036;
  cursor: pointer;
  overflow: hidden;
}

.compact-file {
  min-height: 32px;
  font-size: 0.78rem;
}

.file-action:hover {
  border-color: rgba(11, 111, 104, 0.44);
  color: var(--accent);
}

.file-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-action.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.file-action.is-disabled input {
  cursor: not-allowed;
}

.plain-button,
.dev-toggle {
  min-height: 32px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(32, 35, 38, 0.16);
  font-size: 0.8rem;
}

.plain-button:hover:not(:disabled),
.dev-toggle:hover,
.dev-toggle.is-active {
  border-color: rgba(11, 111, 104, 0.44);
  color: var(--accent);
}

.plain-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.plain-button.small {
  min-height: 28px;
  padding: 0 7px;
  font-size: 0.74rem;
}

.chat-send-button {
  min-height: 38px;
  background: #5f2c86;
  border-color: rgba(61, 30, 82, 0.12);
  color: #ffffff;
}

.chat-send-button:hover:not(:disabled) {
  border-color: rgba(61, 30, 82, 0.3);
  background: #4d1f73;
  color: #ffffff;
}

.mode-note {
  margin: 0;
  color: #3f474d;
  font-size: 0.78rem;
  line-height: 1.3;
}

.status-line {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.76rem;
}

.status-line.is-warning {
  color: var(--warn);
}

.debug-panel {
  position: fixed;
  right: max(88px, calc(env(safe-area-inset-right) + 88px));
  top: max(18px, env(safe-area-inset-top));
  z-index: 33;
  width: min(390px, calc(100vw - 116px));
  max-height: min(680px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(64, 42, 79, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 252, 255, 0.97), rgba(250, 247, 252, 0.92)),
    var(--panel);
  box-shadow: 0 16px 42px rgba(54, 38, 66, 0.2);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 140ms ease, transform 140ms ease;
  overflow: hidden;
}

.debug-panel[hidden] {
  display: none;
}

.debug-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.debug-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(76, 45, 96, 0.1);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.2) 0,
      rgba(255, 255, 255, 0.2) 1px,
      rgba(120, 70, 140, 0.035) 2px,
      rgba(120, 70, 140, 0.035) 5px
    ),
    rgba(255, 252, 255, 0.94);
}

.debug-panel-title {
  min-width: 0;
  display: grid;
  color: #2a2030;
  line-height: 1.05;
}

.debug-panel-title span {
  color: #76548f;
  font-size: 0.64rem;
  font-weight: 760;
  text-transform: uppercase;
}

.debug-panel-title strong {
  font-size: 0.96rem;
}

.debug-panel-body {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  scrollbar-width: thin;
}

.dev-reset {
  display: inline-flex;
  align-items: center;
}

.slot-dev-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.slot-dev-grid input {
  min-width: 0;
}

.dev-template-panel {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(32, 35, 38, 0.1);
}

.dev-template-title {
  color: #4b5158;
  font-size: 0.78rem;
  font-weight: 700;
}

.state-json {
  display: none;
  min-height: 170px;
  resize: vertical;
  padding: 10px;
  color: #283137;
  font: 0.74rem/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.state-json.is-visible {
  display: block;
}

@media (max-width: 760px) {
  .app-footer {
    display: none;
  }

  .room-viewport {
    place-items: start center;
    padding: clamp(118px, 17vh, 150px) 0 0;
  }

  .canvas-shell {
    width: min(94vw, 167.1111vh);
  }

  .floating-tools {
    left: max(14px, env(safe-area-inset-left));
    top: auto;
    bottom: 14px;
    transform: none;
  }

  .right-orb-rail {
    top: auto;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(72px, calc(env(safe-area-inset-bottom) + 72px));
    gap: 8px;
    transform: none;
  }

  .right-rail-orb {
    width: 48px;
    height: 48px;
  }

  .camera-launcher,
  .auth-launcher,
  .profile-launcher,
  .map-launcher,
  .chat-launcher,
  .closet-launcher,
  .item-inventory-launcher,
  .store-launcher {
    top: auto;
    transform: none;
  }

  .camera-launcher svg,
  .auth-launcher svg,
  .profile-launcher svg,
  .map-launcher svg,
  .chat-launcher svg,
  .closet-launcher svg,
  .item-inventory-launcher svg,
  .store-launcher svg {
    width: 23px;
    height: 23px;
  }

  .map-page {
    padding: 0;
  }

  .map-page-shell {
    place-items: start center;
    padding: clamp(176px, 24vh, 214px) 0 0;
  }

  .map-page-layout {
    width: min(94vw, 167.1111vh);
  }

  .map-page-header {
    top: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 6px;
    min-height: 38px;
    padding: 5px 6px;
  }

  .map-close-button {
    grid-column: 2;
    grid-row: 1;
  }

  .map-neighborhood-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .map-neighborhood-picker span {
    display: none;
  }

  .map-neighborhood-picker select {
    height: 28px;
    font-size: 0.76rem;
  }

  .map-page-header h1 {
    font-size: 0.84rem;
  }

  .map-onboarding-card,
  .map-private-house-button {
    grid-column: 1 / -1;
  }

  .map-onboarding-card {
    padding: 7px;
  }

  .map-onboarding-card ol {
    gap: 3px;
    font-size: 0.68rem;
  }

  .map-close-button {
    width: 32px;
    height: 32px;
  }

  .map-lot-grid {
    grid-template-columns: repeat(var(--map-columns), minmax(66px, 1fr));
    grid-template-rows: repeat(var(--map-rows), minmax(68px, 1fr));
    gap: 8px;
    padding: 70px 12px 12px;
  }

  .map-lot {
    min-height: 68px;
    padding: 8px;
  }

  .map-lot-name {
    font-size: 0.78rem;
  }

  .map-info-panel {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: 38vh;
    overflow: auto;
  }

  body.is-map-open .brand-logo {
    left: max(14px, env(safe-area-inset-left));
    top: max(12px, env(safe-area-inset-top));
    width: 106px;
  }

  body.is-map-open .right-orb-rail {
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    bottom: auto;
    transform: none;
  }

  .closet-drawer {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    transform: translateY(18px);
  }

  .closet-drawer.is-open {
    transform: translateY(0);
  }

  .chat-drawer {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    transform: translateY(18px);
  }

  .chat-drawer.is-open {
    transform: translateY(0);
  }

  .profile-summary {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .profile-avatar-preview {
    width: 72px;
    height: 72px;
    font-size: 1.1rem;
  }

  .profile-standee-panel {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .profile-standee-preview {
    width: 72px;
    height: 92px;
    font-size: 1.1rem;
  }

  .standee-preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-chat {
    inset: 0;
    width: auto;
  }

  .quick-chat-info {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: min(154px, calc(100vw - 158px));
    min-height: 118px;
    padding: 10px;
  }

  .quick-chat-form {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    grid-template-columns: minmax(0, 1fr) auto auto 32px;
    transform: translateY(14px) scale(0.98);
  }

  .quick-chat.is-open .quick-chat-form {
    transform: translateY(0) scale(1);
  }

  .house-shout {
    top: max(84px, calc(env(safe-area-inset-top) + 84px));
    width: min(74vw, 420px);
    padding: 11px 13px;
  }

  .auth-gate {
    padding: 12px;
  }

  .auth-gate-panel {
    width: calc(100vw - 24px);
    padding: 16px;
  }

  .auth-gate-forms {
    grid-template-columns: 1fr;
  }

  .standee-slot {
    --standee-width: 31%;
    --standee-height: 52%;
  }

  .standee-slot-back-left,
  .standee-slot-back-right {
    --standee-width: 28%;
    --standee-height: 45%;
    --standee-x: 22%;
  }

  .standee-bubble {
    min-width: min(210px, 160%);
    padding: 10px 11px;
  }

  .standee-bubble p {
    font-size: 0.86rem;
  }

  .store-drawer {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    transform: translateY(18px);
  }

  .store-drawer.is-open {
    transform: translateY(0);
  }

  .floating-drawer {
    left: var(--floating-drawer-left, max(12px, env(safe-area-inset-left)));
    top: var(--floating-drawer-top, max(12px, env(safe-area-inset-top)));
    right: auto;
    bottom: auto;
    width: var(--floating-drawer-width, min(430px, calc(100vw - 24px)));
    height: var(--floating-drawer-height, min(680px, calc(100vh - 24px)));
    transform: translateY(8px) scale(0.98);
  }

  .floating-drawer.is-open {
    transform: translateY(0) scale(1);
  }

  .debug-panel {
    left: max(12px, env(safe-area-inset-left));
    right: max(78px, calc(env(safe-area-inset-right) + 78px));
    top: max(12px, env(safe-area-inset-top));
    width: auto;
    max-height: min(620px, calc(100vh - 24px));
  }

  .chat-composer {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-thread {
    min-height: 160px;
  }

  .chat-member-label {
    max-width: 108px;
  }

  .tool-orb-rail {
    grid-template-columns: repeat(4, 42px);
    gap: 6px;
  }

  .tool-panel {
    left: var(--tool-panel-left, max(14px, env(safe-area-inset-left)));
    top: var(--tool-panel-top, max(96px, env(safe-area-inset-top)));
    width: var(--tool-panel-width, min(390px, calc(100vw - 28px)));
    max-height: min(74vh, calc(100vh - 28px));
    transform: translateY(10px) scale(0.98);
    transform-origin: top left;
  }

  .mode-tabs {
    grid-template-columns: repeat(11, 36px);
  }

  .tool-orb {
    width: 42px;
    height: 42px;
  }

  .tool-orb svg {
    width: 21px;
    height: 21px;
  }
}
