body,
html {
  height: 100%;
  margin: 0;
  background: #0b0e14;
  color: #d8dee9;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
canvas {
  display: block;
}
.ui {
  position: fixed;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: rgba(20, 24, 33, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  padding: 8px 10px;
  border-radius: 10px;
  z-index: 10;
  max-width: calc(100vw - 24px);
}
.ui button,
.ui label {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.ui button:hover,
.ui label:hover {
  background: rgba(255, 255, 255, 0.12);
}
.ui button.active {
  background: rgba(0, 255, 0, 0.2);
  border-color: rgba(0, 255, 0, 0.4);
}
.ui input[type="file"] {
  display: none;
}
.drop-hint {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 24, 33, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  padding: 8px 12px;
  border-radius: 10px;
  z-index: 10;
  font-size: 13px;
  color: #bfc7d5;
}
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(82vw, 320px);
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  overflow: auto;
  z-index: 20;
  padding: 10px 12px;
  color: #111827;
  transform: translateX(100%);
  transition: transform 240ms ease;
  pointer-events: none;
  -webkit-overflow-scrolling: touch;
}
body.sidebar-open .sidebar {
  transform: translateX(0);
  pointer-events: auto;
}
@media (min-width: 1024px) {
  .sidebar {
    width: 320px;
  }
}
.sidebar h3 {
  margin: 6px 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.tree {
  font-size: 13px;
  user-select: none;
}
.tree-item {
  margin: 2px 0;
}
.tree-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 6px;
}
.tree-header:hover {
  background: #f3f4f6;
}
.tree-header.selected {
  background: #e0f2fe;
}
.tree-toggle {
  width: 14px;
  text-align: center;
  opacity: 0.7;
}
.tree-children {
  margin-left: 16px;
}
.tree-vis {
  margin-right: 4px;
}
.overlay {
  position: fixed;
  inset: 0;
  background: 0 0;
  backdrop-filter: none;
  display: none;
  z-index: 50;
  pointer-events: auto;
}
.overlay-ui {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(20, 24, 33, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 10px;
  border-radius: 10px;
  z-index: 60;
  color: #e5e7eb;
}
.overlay-canvas-wrap {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
.overlay-axis {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 96px;
  height: 96px;
  z-index: 65;
  pointer-events: none;
}
.overlay-floorlabel {
  position: fixed;
  top: 92px;
  left: 12px;
  width: 64px;
  text-align: center;
  font-weight: 800;
  color: transparent;
  font-size: 20px;
  z-index: 61;
  pointer-events: none;
}
.overlay-floorlist {
  position: fixed;
  top: 120px;
  left: 12px;
  width: 40px;
  max-height: 40vh;
  overflow: auto;
  z-index: 60;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  color: #111827;
  scroll-snap-type: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0.6) 8%,
    rgba(0, 0, 0, 1) 20%,
    rgba(0, 0, 0, 1) 80%,
    rgba(0, 0, 0, 0.6) 92%,
    rgba(0, 0, 0, 0)
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0.6) 8%,
    rgba(0, 0, 0, 1) 20%,
    rgba(0, 0, 0, 1) 80%,
    rgba(0, 0, 0, 0.6) 92%,
    rgba(0, 0, 0, 0)
  );
}
.overlay-floorlist h4 {
  display: none;
}
.overlay-floorlist .floor-btn {
  width: 100%;
  margin: 4px 0;
  appearance: none;
  border: none;
  background: 0 0;
  color: #111827;
  border-radius: 0;
  padding: 7px 0;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: transform 160ms ease, background-color 160ms ease,
    border-color 160ms ease, opacity 160ms ease, font-size 160ms ease;
  opacity: 0.5;
}
.overlay-floorlist .floor-btn:hover {
  opacity: 0.8;
}
.overlay-floorlist .floor-btn.active {
  color: #1d4ed8;
  transform: scale(1.08);
  opacity: 1;
  font-weight: 700;
  font-size: 18px;
}
@media (max-width: 1023px) {
  .overlay-floorlist {
    top: auto;
    bottom: 8px;
    left: 0;
    right: 0;
    width: 100%;
    max-height: none;
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-mask-image: linear-gradient(
      to right,
      rgba(0, 0, 0, 0),
      rgba(0, 0, 0, 0.6) 6%,
      rgba(0, 0, 0, 1) 18%,
      rgba(0, 0, 0, 1) 82%,
      rgba(0, 0, 0, 0.6) 94%,
      rgba(0, 0, 0, 0)
    );
    mask-image: linear-gradient(
      to right,
      rgba(0, 0, 0, 0),
      rgba(0, 0, 0, 0.6) 6%,
      rgba(0, 0, 0, 1) 18%,
      rgba(0, 0, 0, 1) 82%,
      rgba(0, 0, 0, 0.6) 94%,
      rgba(0, 0, 0, 0)
    );
  }
  #overlayFloorButtons {
    display: flex;
    gap: 8px;
    padding: 0 6px;
  }
  .overlay-floorlist .floor-btn {
    width: auto;
    padding: 8px 12px;
    margin: 0;
    opacity: 0.8;
  }
  #viewFloorplanButton {
    bottom: 140px !important;
  }
}
.overlay-export {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, 90vw);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 10px;
  z-index: 70;
  display: none;
  color: #111827;
}
.overlay-export h4 {
  margin: 4px 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.overlay-export .row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.overlay-export button {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #f3f4f6;
  color: #111827;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.overlay-export button:hover {
  background: #e5e7eb;
}
.overlay-export textarea {
  width: 100%;
  height: 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: #111827;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
}
#hotspotLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}
.hotspot {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  color: #111827;
  font: 600 12px ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto;
}
.hotspot .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.18);
  animation: hotspotPulse 2s ease-in-out infinite;
}
@keyframes hotspotPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.1);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    transform: scale(1);
  }
}
.overlay-legend {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 66;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  color: #111827;
  min-width: 140px;
  max-width: min(50vw, 220px);
  display: none;
}
@media (max-width: 768px) {
  #floorplanModal .floorplan-canvas-mobile {
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    bottom: 0;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1.5);
    transform-origin: center;
  }
  #floorplanModal {
    height: 100vh !important;
    height: 100dvh !important;
    padding-top: env(safe-area-inset-top, 0) !important;
  }
  #floorplanModal > div {
    height: 100vh !important;
    height: 100dvh !important;
    margin-top: calc(-1 * env(safe-area-inset-top, 0)) !important;
  }
  #floorplanModal .floorplan-header {
    position: sticky !important;
    top: 0 !important;
    top: env(safe-area-inset-top, 0) !important;
    z-index: 2 !important;
    height: calc(64px + env(safe-area-inset-top, 0)) !important;
    padding-top: env(safe-area-inset-top, 0) !important;
  }
  #floorplanCanvas {
    top: calc(64px + env(safe-area-inset-top, 0)) !important;
    bottom: 60px !important;
  }
}
@media (max-width: 1023px) {
  .overlay-legend {
    position: fixed !important;
    bottom: 60px !important;
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .overlay-legend h4 {
    display: block !important;
    font-size: 11px !important;
    margin: 0 0 4px 0 !important;
    text-align: center !important;
    width: 100% !important;
  }
  .overlay-legend .legend-item {
    font-size: 10px !important;
    margin: 2px !important;
    padding: 3px 6px !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
  }
  .overlay-legend .legend-swatch {
    width: 8px !important;
    height: 8px !important;
    flex: 0 0 8px !important;
    margin-right: 0 !important;
  }
}
.overlay-legend h4 {
  margin: 4px 0 8px;
  font-size: 13px;
  font-weight: 700;
}
.overlay-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: 4px 0;
}
.overlay-legend .legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: 0 0 14px;
}
@media (max-width: 1023px) {
  #toggleTreeBtn {
    display: none;
  }
}
@media (max-width: 768px) {
  #viewFloorButton {
    bottom: 80px !important;
    z-index: 90 !important;
  }
  #viewFloorButton button {
    padding: 14px 28px;
    font-size: 18px;
    border-radius: 30px;
  }
}
.overlay-ui {
  display: none !important;
}
#camInfo {
  display: none !important;
}
#sidebar {
  display: none !important;
}
#toggleTreeBtn {
  display: none !important;
}
#sidebarToggle {
  display: none !important;
}
#hotspotModeBtn {
  display: none !important;
}
#saveHotspotsBtn {
  display: none !important;
}
#toggleBBoxBtn {
  display: none !important;
}
#viewFloorBtn {
  display: none !important;
}
#fileInput,
label[for="fileInput"] {
  display: none !important;
}
#detailedFloorplanButton button,
#viewFloorButton button,
#viewFloorplanButton button {
  background: #fff !important;
  color: #111827 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}
#typeMenu {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 90;
  background: rgba(20, 24, 33, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 10px;
  border-radius: 10px;
  color: #e5e7eb;
  transform: translateX(-120%);
  transition: transform 0.2s ease;
  backdrop-filter: blur(6px);
}
#typeMenu.open {
  transform: translateX(0);
}
#typeMenu .type-item {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  margin: 4px 0;
}
#typeMenu .type-item:hover {
  background: rgba(255, 255, 255, 0.12);
}
#typeMenu .type-item.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}
#filter1BHKBtn,
#filter2BHKBtn,
#filter2BHKMBtn,
#filter3BHKBtn,
#filter4BHKBtn,
#filterPenthouseABtn,
#filterPenthouseBBtn,
#filterSkyVillaBtn {
  display: none !important;
}
#controls {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 85;
  gap: 0 !important;
  background: 0 0 !important;
  border: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
}
#typeMenuBtn {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
#typeMenuBtn:hover {
  background: #fff;
}
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
      135deg,
      rgba(30, 58, 138, 0.1) 0,
      rgba(59, 130, 246, 0.1) 50%,
      rgba(96, 165, 250, 0.1) 100%
    ),
    linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.1) 100%
    );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}
.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-content {
  text-align: center;
  color: #000;
  max-width: 400px;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.loading-progress {
  margin-top: 1.5rem;
}
.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0.6)
  );
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease-out;
}
.loading-text {
  font-size: 1.1rem;
  color: #000;
  font-weight: 500;
  margin-bottom: 1rem;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}
@media (max-width: 768px) {
  .loading-content {
    padding: 1.5rem;
    max-width: 300px;
  }
  .loading-text {
    font-size: 1rem;
  }
}
