:root {
  --bg-glass: rgba(18, 17, 16, 0.76);
  --bg-glass-strong: rgba(15, 14, 13, 0.88);
  --bg-card: rgba(255, 250, 242, 0.055);
  --bg-card-hover: rgba(255, 250, 242, 0.11);
  --border-subtle: rgba(235, 222, 202, 0.15);
  --border-gold: rgba(212, 175, 122, 0.55);
  --gold: #d4af7a;
  --gold-bright: #e8c796;
  --text-main: #f7f2ea;
  --text-muted: rgba(240, 232, 218, 0.65);
  --danger: #e27a68;
  --success: #82b895;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #141312;
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  touch-action: none;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
}

.hidden {
  display: none !important;
}

/* Floating Room Labels in 3D */
.room-labels-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.room-tag-3d {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: rgba(18, 17, 16, 0.62);
  border: 1px solid rgba(212, 175, 122, 0.34);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  font-size: 11px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.room-tag-3d:hover {
  background: rgba(28, 25, 22, 0.88);
  border-color: var(--gold);
}

.room-tag-3d strong {
  font-weight: 600;
  color: var(--gold-bright);
  margin-right: 4px;
}

.room-tag-3d span {
  opacity: 0.72;
  font-size: 10px;
}

/* Top Bar */
.top-bar {
  position: fixed;
  top: 14px;
  left: 16px;
  right: 16px;
  height: 60px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 20;
  gap: 12px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-monogram {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(212, 175, 122, 0.28), rgba(212, 175, 122, 0.07));
  border: 1px solid var(--border-gold);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16px;
  color: var(--gold-bright);
  flex-shrink: 0;
}

.brand-copy h1 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--text-main);
  white-space: nowrap;
}

.brand-copy p {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.view-btn:hover {
  color: var(--text-main);
}

.view-btn.active {
  background: rgba(212, 175, 122, 0.22);
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--border-gold);
}

.view-btn.highlight {
  color: var(--gold-bright);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.icon-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  color: var(--gold-bright);
}

/* Room Navigation Strip */
.room-nav {
  position: fixed;
  top: 82px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: var(--radius-pill);
  z-index: 18;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  scrollbar-width: none;
}

.room-nav::-webkit-scrollbar {
  display: none;
}

.room-chip {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}

.room-chip:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.room-chip.active {
  color: var(--gold-bright);
  background: rgba(212, 175, 122, 0.16);
  border-color: rgba(212, 175, 122, 0.4);
}

/* Left Studio Drawer */
.studio-drawer {
  position: fixed;
  top: 132px;
  left: 16px;
  bottom: 78px;
  width: 326px;
  border-radius: var(--radius-lg);
  z-index: 19;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s;
}

.studio-drawer.collapsed {
  transform: translateX(-355px);
  opacity: 0;
  pointer-events: none;
}

.drawer-expand {
  position: fixed;
  top: 140px;
  left: 16px;
  z-index: 19;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  color: var(--gold-bright);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.drawer-tabs {
  display: flex;
  align-items: center;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 4px;
}

.drawer-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s;
}

.drawer-tab.active {
  background: rgba(212, 175, 122, 0.18);
  color: var(--gold-bright);
}

.drawer-collapse {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 17px;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 122, 0.3) transparent;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.tab-pane.active {
  display: flex;
}

.section-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 600;
}

.section-header small {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-weight: 400;
}

.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.style-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.style-card strong {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 600;
}

.style-card span {
  font-size: 10.5px;
  color: var(--text-muted);
}

.style-card:hover, .style-card.active {
  background: rgba(212, 175, 122, 0.16);
  border-color: var(--border-gold);
}

.finish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.luxury-select, .pose-select {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 6px 9px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  outline: none;
}

.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cat-pill {
  background: var(--bg-card);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.cat-pill.active {
  background: rgba(212, 175, 122, 0.18);
  border-color: var(--border-gold);
  color: var(--gold-bright);
}

.catalog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.catalog-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.catalog-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  transform: translateY(-1px);
}

.cat-swatch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.cat-add {
  font-size: 10px;
  color: var(--gold-bright);
  font-weight: 600;
}

.catalog-item strong {
  font-size: 11.5px;
  color: var(--text-main);
  line-height: 1.25;
}

.catalog-item small {
  font-size: 10px;
  color: var(--text-muted);
}

/* Family Tab */
.person-card {
  display: flex;
  gap: 11px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.person-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.sunaina-av { background: rgba(196, 116, 92, 0.28); border: 1px solid #c4745c; color: #f6cec2; }
.sahil-av { background: rgba(108, 126, 112, 0.32); border: 1px solid #829987; color: #dceade; }
.baby-av { background: rgba(232, 213, 183, 0.25); border: 1px solid #e8d5b7; color: #fff0d8; }

.person-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.person-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.person-top strong {
  font-size: 13px;
}

.person-info p {
  font-size: 11px;
  color: var(--text-muted);
}

.person-controls {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.inline-check label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  transition: 0.2s;
}

.slider::before {
  position: absolute;
  content: '';
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background-color: var(--gold);
}

.switch input:checked + .slider::before {
  transform: translateX(16px);
}

/* Smart Home Controls Tab */
.tod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.tod-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 7px 4px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.tod-btn.active {
  background: rgba(212, 175, 122, 0.2);
  border-color: var(--border-gold);
  color: var(--gold-bright);
}

.smart-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.smart-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.smart-tile-top strong {
  display: block;
  font-size: 12.5px;
}

.smart-tile-top small {
  font-size: 10.5px;
  color: var(--text-muted);
}

.smart-tile-actions {
  display: flex;
  gap: 6px;
}

.btn-mini {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.16s;
}

.btn-mini:hover {
  border-color: var(--border-gold);
  color: var(--gold-bright);
}

.link-btn {
  background: none;
  border: none;
  color: var(--gold-bright);
  font-size: 11px;
  cursor: pointer;
}

.dimmer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.dimmer-row input[type='range'], #slider-rot {
  flex: 1;
  accent-color: var(--gold);
}

.room-lights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.room-light-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.room-light-btn.on {
  background: rgba(212, 175, 122, 0.15);
  border-color: rgba(212, 175, 122, 0.45);
  color: var(--text-main);
}

/* Selection Inspector Bar */
.selection-bar {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: min(530px, calc(100vw - 32px));
  border-radius: var(--radius-lg);
  padding: 12px 15px;
  z-index: 22;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sel-kicker {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.09em;
  color: var(--gold);
  font-weight: 600;
}

.sel-header strong {
  font-size: 14px;
}

.sel-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
}

.sel-swatches {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.swatch-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.15s;
}

.swatch-btn:hover, .swatch-btn.active {
  transform: scale(1.18);
  border-color: #fff;
}

.sel-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.btn-tool {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-tool:hover {
  border-color: var(--border-gold);
}

.btn-tool.danger {
  color: var(--danger);
  border-color: rgba(226, 122, 104, 0.35);
}

/* Bottom Quick Dock */
.quick-dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: var(--radius-pill);
  z-index: 20;
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-dock::-webkit-scrollbar {
  display: none;
}

.dock-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}

.dock-btn.active {
  background: rgba(212, 175, 122, 0.16);
  border-color: rgba(212, 175, 122, 0.42);
  color: var(--text-main);
}

.dock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.dock-btn.active .dock-dot {
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold);
}

/* Bottom-Right Live Floorplan Radar */
.minimap-card {
  position: fixed;
  right: 16px;
  bottom: 78px;
  padding: 9px 10px;
  border-radius: 15px;
  z-index: 18;
  cursor: crosshair;
}

.minimap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: var(--gold-bright);
  margin-bottom: 5px;
  font-weight: 600;
}

.minimap-head small {
  color: var(--text-muted);
  font-weight: 400;
}

#minimap-canvas {
  display: block;
  border-radius: 9px;
  background: rgba(10, 10, 10, 0.55);
}

/* First-Person Walk-In HUD */
.fps-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 24;
}

.fps-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 248, 232, 0.85);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.fps-banner {
  position: absolute;
  top: 132px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  pointer-events: auto;
  white-space: nowrap;
}

.badge-gold {
  background: var(--gold);
  color: #171411;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  cursor: pointer;
}

.fps-dpad {
  position: absolute;
  left: 22px;
  bottom: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
}

.fps-dpad-mid {
  display: flex;
  gap: 4px;
}

.fps-dpad button {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--gold-bright);
  font-size: 14px;
  cursor: pointer;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.68);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 20px;
}

.modal-card {
  width: min(680px, 100%);
  max-height: 86vh;
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  background: var(--bg-glass-strong);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal-head h2 {
  font-family: var(--font-serif);
  font-size: 25px;
  color: var(--gold-bright);
}

.modal-head p {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-close {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.floorplan-preview-wrap {
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  display: grid;
  place-items: center;
}

.floorplan-preview-wrap img {
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

.save-form {
  display: flex;
  gap: 8px;
}

.save-form input {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
}

.btn-gold {
  background: linear-gradient(135deg, #dfbe89, #c49b63);
  border: none;
  color: #191510;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.save-io-row {
  display: flex;
  gap: 8px;
}

.file-label {
  display: inline-flex;
  align-items: center;
}

.saved-layouts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saved-layout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
}

.saved-layout-row strong {
  font-size: 13px;
  display: block;
}

.saved-layout-row small {
  font-size: 11px;
  color: var(--text-muted);
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 84px;
  right: 18px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border-color: var(--border-gold);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 500;
  z-index: 45;
  pointer-events: none;
}

body.zen-mode #studio-drawer,
body.zen-mode #room-nav,
body.zen-mode #quick-dock,
body.zen-mode #minimap-card,
body.zen-mode #camera-controls-pad,
body.zen-mode #selection-bar,
body.zen-mode #room-labels-layer,
body.zen-mode #photo-pins-layer,
body.zen-mode #photo-compare-card {
  opacity: 0;
  pointer-events: none;
}

/* Move-Items Active Mode Pill */
#btn-nav-mode.move-active {
  background: rgba(212, 175, 122, 0.25);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(212, 175, 122, 0.28);
}

#btn-toggle-photos.active {
  background: rgba(212, 175, 122, 0.16);
  border-color: rgba(212, 175, 122, 0.45);
  color: var(--gold-bright);
}

/* Calibrated Ghost Photo Reference Overlay */
.photo-ghost-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.12s ease;
}

/* Floating 3D Photo Spot Pins */
.photo-pins-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

.photo-pin-3d {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 5px;
  border-radius: var(--radius-pill);
  background: rgba(18, 17, 15, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(232, 199, 150, 0.68);
  color: var(--gold-bright);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.42);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.photo-pin-3d * {
  pointer-events: none;
}

.photo-pin-3d:hover,
.photo-pin-3d.active {
  transform: translate(-50%, -50%) scale(1.09);
  background: rgba(212, 175, 122, 0.94);
  color: #181410;
  border-color: #fff6e6;
}

.photo-pin-num {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(232, 199, 150, 0.22);
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 700;
}

.photo-pin-3d.active .photo-pin-num,
.photo-pin-3d:hover .photo-pin-num {
  background: rgba(24, 20, 16, 0.18);
}

/* Photos Tab Grid inside Studio Drawer */
.photos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.photo-card-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: var(--text-main);
  padding: 0;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.photo-card-item:hover,
.photo-card-item.active {
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}

.photo-card-item img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  display: block;
}

.photo-card-meta {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.photo-card-meta strong {
  font-size: 12px;
  color: var(--gold-bright);
}

.photo-card-meta span {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* On-Screen Camera Navigation Pad */
.camera-controls-pad {
  position: fixed;
  right: 16px;
  bottom: 296px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: var(--radius-pill);
  z-index: 18;
}

.camera-controls-pad button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  height: 28px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.camera-controls-pad button:hover {
  background: rgba(212, 175, 122, 0.22);
  border-color: rgba(212, 175, 122, 0.55);
  color: var(--gold-bright);
}

/* Floating Photo vs 3D Comparison Card */
.photo-compare-card {
  position: fixed;
  right: 16px;
  bottom: 344px;
  width: 268px;
  padding: 12px;
  border-radius: 16px;
  border-color: var(--border-gold);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 22;
}

.photo-compare-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.photo-compare-head strong {
  font-size: 13px;
  color: var(--text-main);
  display: block;
}

.photo-compare-caption {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

.photo-compare-preview {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #0c0c0b;
}

.photo-compare-preview img {
  width: 100%;
  height: 132px;
  object-fit: cover;
  display: block;
}

.photo-compare-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.photo-compare-presets .btn-mini {
  padding: 5px 4px;
  font-size: 10px;
  text-align: center;
}

.photo-compare-presets .btn-mini.active {
  background: rgba(212, 175, 122, 0.24);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.photo-compare-nav {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.photo-compare-nav .btn-mini {
  flex: 1;
  text-align: center;
}

.drawer-tab {
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .brand-copy p { display: none; }
  .brand-copy h1 { font-size: 18px; }
  .view-btn { padding: 6px 10px; font-size: 11.5px; }
  .icon-pill { padding: 6px 10px; font-size: 11.5px; }
  .studio-drawer { width: 292px; top: 126px; }
  .minimap-card, .camera-controls-pad { display: none; }
  .fps-banner span:nth-child(2) { display: none; }
}

@media (max-width: 768px) {
  .hide-mobile { display: none; }

  .top-bar {
    top: max(8px, env(safe-area-inset-top, 8px));
    left: 8px;
    right: 8px;
    height: auto;
    padding: 8px 10px;
    border-radius: 15px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brand actions"
      "views views";
    gap: 7px 8px;
  }

  .brand-block {
    grid-area: brand;
    gap: 8px;
  }

  .brand-monogram {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border-radius: 9px;
  }

  .brand-copy h1 {
    font-size: 15.5px;
  }

  .header-actions {
    grid-area: actions;
    justify-self: end;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 5px;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .icon-pill {
    padding: 5px 9px;
    font-size: 11px;
    flex-shrink: 0;
  }

  #btn-zen {
    display: none;
  }

  .view-switcher {
    grid-area: views;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding: 3px;
  }

  .view-btn {
    padding: 6px 4px;
    font-size: 11px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .room-nav {
    top: calc(max(8px, env(safe-area-inset-top, 8px)) + 88px);
    left: 8px;
    right: 8px;
    transform: none;
    max-width: none;
    justify-content: flex-start;
    padding: 4px 6px;
    -webkit-overflow-scrolling: touch;
  }

  .room-chip {
    font-size: 11px;
    padding: 4px 9px;
    flex-shrink: 0;
  }

  .studio-drawer {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(max(8px, env(safe-area-inset-bottom, 8px)) + 48px);
    width: auto;
    height: min(50dvh, 410px);
    border-radius: 18px;
    z-index: 23;
  }

  .studio-drawer.collapsed {
    transform: translateY(calc(100% + 80px));
    opacity: 0;
    pointer-events: none;
  }

  .drawer-collapse {
    transform: rotate(-90deg);
  }

  .drawer-expand {
    top: auto;
    left: 10px;
    bottom: calc(max(8px, env(safe-area-inset-bottom, 8px)) + 50px);
    z-index: 21;
    padding: 8px 14px;
    font-size: 12px;
    background: rgba(20, 18, 15, 0.9);
    border: 1px solid var(--border-gold);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }

  .quick-dock {
    bottom: max(8px, env(safe-area-inset-bottom, 8px));
    left: 8px;
    right: 8px;
    transform: none;
    max-width: none;
    justify-content: flex-start;
    padding: 5px 7px;
    gap: 5px;
    -webkit-overflow-scrolling: touch;
  }

  .dock-btn {
    padding: 6px 10px;
    font-size: 11px;
    gap: 5px;
    flex-shrink: 0;
  }

  .room-tag-3d {
    padding: 2px 7px;
    font-size: 9.5px;
  }

  .room-tag-3d span {
    display: none;
  }

  .photo-pin-3d {
    padding: 3px 7px 3px 4px;
    font-size: 9.5px;
    gap: 4px;
  }

  .photo-pin-num {
    width: 15px;
    height: 15px;
    font-size: 8.5px;
  }

  .photo-compare-card {
    left: 8px;
    right: 8px;
    bottom: calc(max(8px, env(safe-area-inset-bottom, 8px)) + 48px);
    width: auto;
    padding: 10px 12px;
    gap: 6px;
    z-index: 24;
  }

  .photo-compare-preview img {
    height: 78px;
  }

  .selection-bar {
    left: 8px;
    right: 8px;
    transform: none;
    width: auto;
    bottom: calc(max(8px, env(safe-area-inset-bottom, 8px)) + 48px);
    padding: 10px 12px;
    gap: 8px;
    z-index: 24;
  }

  .sel-actions {
    flex-wrap: wrap;
  }

  .fps-banner {
    top: calc(max(8px, env(safe-area-inset-top, 8px)) + 128px);
    left: 8px;
    right: 8px;
    transform: none;
    justify-content: space-between;
    padding: 6px 12px;
  }

  .fps-dpad {
    left: 12px;
    bottom: calc(max(8px, env(safe-area-inset-bottom, 8px)) + 54px);
  }

  .toast {
    top: auto;
    left: 50%;
    right: auto;
    bottom: calc(max(8px, env(safe-area-inset-bottom, 8px)) + 52px);
    transform: translateX(-50%);
    max-width: calc(100vw - 24px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
