.plot-map-page {
  background: var(--bg);
  color: hsl(var(--foreground));
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.plot-map-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.plot-map-main {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.plot-map-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: #000;
  overflow: hidden;
}

.plot-map-bg-refresh {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 45;
  margin: 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  user-select: none;
}

.plot-map-property-sidebar.gallery-property-sidebar.lightbox-panel {
  flex: 0 0 360px;
  width: 360px;
  min-width: 360px;
  max-height: none;
  height: auto;
  align-self: stretch;
  margin: 0;
  border-radius: 0;
  border-top: none;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: hsl(var(--card));
}

.plot-map-stat-row {
  margin: 0;
  padding: 0 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.plot-map-stat-row:hover,
.plot-map-stat-row.is-map-mode-preview {
  background: rgba(255, 255, 255, 0.04);
}

.plot-map-stat-row.is-map-mode-active {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 2px 0 0 hsl(var(--primary));
}

.plot-map-stat-row:focus-visible {
  outline: 1px solid hsl(var(--ring) / 0.4);
  outline-offset: 0;
}

.plot-map-stat-row .plot-map-plot-details-hover-detail {
  display: inline;
  margin-top: 0;
}

.plot-map-property-sidebar .gallery-property-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 12px;
  background: hsl(var(--card));
}

.plot-map-property-sidebar .gallery-property-sidebar-renders {
  flex-shrink: 0;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: hsl(var(--card));
  max-height: 45%;
  overflow-y: auto;
}

.plot-map-property-sidebar .build-discord-section {
  margin: 0;
}

.plot-map-property-sidebar .build-discord-section-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

#plot-map-property-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#plot-map-property-panel[hidden] {
  display: none !important;
}

#plot-map-plot-details {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#plot-map-plot-details[hidden] {
  display: none !important;
}

.plot-map-plot-details-empty {
  margin: 0;
  padding: 18px;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.5;
}

.plot-map-plot-details-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plot-map-plot-details-meta p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: hsl(var(--muted-foreground));
}

.plot-map-plot-details-meta strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.plot-map-plot-details-hover-detail {
  color: hsl(var(--muted-foreground));
}

.plot-map-unified-stats {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.plot-map-unified-stats .plot-map-plot-details-meta,
.plot-map-unified-stats-block {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  gap: 4px;
}

.plot-map-open-editor {
  text-decoration: none;
}

#plot-map-world-frame,
#plot-map-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#plot-map-world-frame {
  z-index: 0;
  opacity: 1;
  pointer-events: none;
  overflow: hidden;
  background: transparent;
}

#plot-map-world-frame.is-bw .plot-map-world-iframe {
  filter: grayscale(100%) contrast(0.68) brightness(0.46);
}

.plot-map-world-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
  background: transparent;
}

#plot-map-canvas {
  z-index: 1;
  cursor: grab;
  background: transparent;
}

#plot-map-canvas.is-dragging {
  cursor: grabbing;
}

.plot-map-empty,
.plot-map-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.plot-map-empty[hidden],
.plot-map-error[hidden] {
  display: none !important;
}

.plot-map-error {
  color: hsl(var(--destructive, 0 84% 60%));
}

.plot-map-stage-controls {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.plot-map-chart-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  flex: none;
  height: 120px;
  min-height: 120px;
  background: transparent;
  border-top: none;
  overflow: hidden;
  pointer-events: none;
}

.plot-map-chart-panel[hidden] {
  display: none !important;
}

#plot-map-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.plot-map-main.has-chart .plot-map-delete-property {
  bottom: calc(20px + 120px);
}

.plot-map-delete-property {
  position: absolute;
  right: 20px;
  bottom: 20px;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid hsl(var(--destructive, 0 84% 60%) / 0.35);
  background: hsl(var(--destructive, 0 84% 60%) / 0.12);
  color: hsl(var(--destructive, 0 84% 60%) / 0.75);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.plot-map-delete-property.is-ready {
  color: hsl(var(--destructive, 0 84% 60%));
}

.plot-map-delete-property:hover:not(:disabled) {
  background: hsl(var(--destructive, 0 84% 60%) / 0.2);
  border-color: hsl(var(--destructive, 0 84% 60%) / 0.55);
}

.plot-map-delete-property:focus-visible {
  outline: 2px solid hsl(var(--destructive, 0 84% 60%) / 0.55);
  outline-offset: 2px;
}

.plot-map-delete-property:disabled {
  opacity: 0.7;
  cursor: wait;
}

.plot-map-delete-property[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .plot-map-layout {
    flex-direction: column;
  }

  .plot-map-property-sidebar.gallery-property-sidebar.lightbox-panel {
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: 42vh;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .plot-map-delete-property {
    right: 16px;
    bottom: 16px;
  }

  .plot-map-main.has-chart .plot-map-delete-property {
    bottom: calc(16px + 100px);
  }

  .plot-map-chart-panel {
    flex-basis: 100px;
    height: 100px;
    min-height: 100px;
  }
}
