/*
 * MiningHub 3D Viewer Styles
 * Updated to match advanced map design language
 */

:root {
  /* Core colors - aligned with advanced map but for dark theme */
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --panel: rgba(15, 23, 42, 0.92);
  --panel-solid: #111827;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Accent colors - matching advanced map's blue */
  --accent: #0091af;
  --accent-light: #38bdf8;
  --accent-hover: #00b4d8;
  --color-blue-dk: #182342;

  /* Status colors */
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;

  /* Borders and shadows */
  --border-light: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(0, 145, 175, 0.3);
  --box-shadow-m: 0 4px 16px rgba(0, 0, 0, 0.4);
  --box-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

  /* Transitions - matching advanced map */
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Mobile specific */
  --mobile-bottom-bar-height: 56px;
  --mobile-panel-max-height: 70vh;
}

* { box-sizing: border-box; }

body, html {
  margin: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 20% 20%, #111827, #0b1020 60%, #060912);
  color: var(--text);
  font-family: "Nunito Sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

#app {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* App loading state - hide all content except loading overlay */
#app.app-loading header,
#app.app-loading #canvas-host > *:not(#viewer-loading),
#app.app-loading #slideshow-controls,
#app.app-loading #mobile-bottom-bar,
#app.app-loading #mobile-info-bar,
#app.app-loading #mobile-info-backdrop {
  opacity: 0;
  pointer-events: none;
}

/* Fade-in transition when app-loading is removed */
header,
#canvas-host > *:not(#viewer-loading),
#slideshow-controls,
#mobile-bottom-bar {
  transition: opacity 0.4s ease-in-out;
}

header {
  grid-column: 1 / -1; /* header spans full width above canvas + panel */
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

header .title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  color: var(--text);
}

header .spacer { flex: 1; }

.control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.control label {
  font-weight: 500;
}

.control input[type="range"] {
  accent-color: var(--accent);
  height: 4px;
}

.control input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.badge {
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--color-blue-dk);
  color: white;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
#canvas-host {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}


/* ==========================================================================
   Collar Detail Panel (click on collar in 3D view)
   ========================================================================== */
.collar-detail-panel {
  position: fixed;
  top: 60px;
  left: 16px;
  width: 340px;
  max-height: calc(100vh - 100px);
  background: var(--panel);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  z-index: 500;
  box-shadow: var(--box-shadow-m);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

.collar-detail-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.collar-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-medium);
  flex-shrink: 0;
}

.collar-detail-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.collar-detail-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.collar-detail-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.collar-detail-content {
  padding: 10px 14px 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.collar-detail-content::-webkit-scrollbar {
  width: 6px;
}
.collar-detail-content::-webkit-scrollbar-track {
  background: transparent;
}
.collar-detail-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.collar-detail-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.collar-detail-content .info-section-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 10px;
  margin-bottom: 4px;
  font-weight: 600;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.collar-detail-content .info-section-title:first-child {
  margin-top: 0;
}

.collar-detail-content .info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 3px 0;
  gap: 12px;
}

.collar-detail-content .info-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 70px;
  flex-shrink: 0;
}

.collar-detail-content .info-value {
  font-size: 12px;
  color: var(--text);
  text-align: right;
  flex: 1;
  word-break: break-word;
}

.collar-detail-content .info-value.highlight {
  color: var(--accent);
  font-weight: 600;
}

.collar-detail-content .assay-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 4px;
}

.collar-detail-content .assay-table th {
  text-align: left;
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  padding: 3px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--panel);
}

.collar-detail-content .assay-table td {
  padding: 2px 4px;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.collar-detail-content .assay-table tr:last-child td {
  border-bottom: none;
}

.collar-detail-content .assay-table tbody tr:hover {
  outline: 1px solid var(--accent);
}

.collar-detail-content .assay-table tbody tr.assay-row-muted td {
  color: rgba(255, 255, 255, 0.3);
}

.collar-detail-content .assay-table tbody tr.assay-row-highlight {
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 0 0 var(--accent);
  outline: 1px solid var(--accent);
}

/* Resize handle */
.collar-detail-resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 10;
  border-radius: 0 0 10px 0;
}

.collar-detail-resize::before {
  content: '';
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.2);
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.collar-detail-resize:hover::before {
  border-color: rgba(255, 255, 255, 0.5);
}

.collar-detail-panel.resizing {
  transition: none;
  user-select: none;
}

/* Mobile: collar detail panel as bottom drawer */
@media (max-width: 768px) {
  .collar-detail-panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: var(--mobile-bottom-bar-height, 56px);
    width: 100%;
    max-height: 60vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }

  .collar-detail-panel.visible {
    transform: translateY(0);
  }

  .collar-detail-resize {
    display: none;
  }
}

#error {
  padding: 16px;
  color: #fecdd3;
  background: rgba(127, 29, 29, 0.18);
  border: 1px solid rgba(254, 202, 202, 0.3);
  border-radius: 8px;
  margin: 16px;
}

/* ==========================================================================
   Assay/Commodity Panel Styles
   ========================================================================== */

#assay-panel {
  width: 320px;
  background: var(--panel);
  border-left: 1px solid var(--border-medium);
  padding: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#assay-panel .panel-handle {
  display: none;
}

#assay-panel .panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

#assay-panel .panel-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

#assay-panel .panel-content {
  padding: 14px 16px 16px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
#assay-panel .panel-content::-webkit-scrollbar {
  width: 6px;
}
#assay-panel .panel-content::-webkit-scrollbar-track {
  background: transparent;
}
#assay-panel .panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
#assay-panel .panel-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Terms of Use footer pinned at bottom of panel */
.panel-terms-footer {
  flex-shrink: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

/* Panel-embedded legends (below Grade Scale) */
#panel-legends-container:empty {
  display: none;
}

.panel-legend-block {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.panel-legend-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.panel-legend-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.panel-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.panel-legend-color {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-legend-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* Transparent swatch pattern (for transparent voxel breakpoints in legends) */
.transparent-legend-swatch {
  background: repeating-conic-gradient(
    rgba(255, 255, 255, 0.15) 0% 25%,
    rgba(255, 255, 255, 0.05) 0% 50%
  ) 50% / 8px 8px !important;
  border: 1px dashed rgba(255, 255, 255, 0.2) !important;
}

/* ==========================================================================
   Mobile Bottom Bar & Panel Toggle
   ========================================================================== */

/* Mobile bottom bar container - holds controls at bottom of screen */
#mobile-bottom-bar {
  display: none;
}

/* Mobile toggle button - hidden by default on desktop */
#panel-toggle {
  display: none;
  position: fixed;
  z-index: 25;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

/* Backdrop overlay for mobile panel */
#panel-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 599; /* Just below assay-panel (600) */
  opacity: 0;
  transition: opacity var(--transition);
}

#panel-backdrop.visible {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   Mobile Base Styles - defaults before media queries override
   ========================================================================== */

/* Viewer mobile tabs - hidden by default (shown via mobile media query) */
.viewer-mobile-tabs {
  display: none;
}

/* Tab panes: always visible on desktop (tab switching only on mobile) */
.viewer-tab-pane {
  display: block;
}

/* Hotspots/Navigation tab: hidden on desktop (has its own standalone panel), shown on mobile via tab */
#viewer-tab-hotspots:not(.active) {
  display: none;
}

/* Mobile controls section - only visible on mobile (inside Options tab) */
.mobile-controls-section {
  display: none;
}

/* ==========================================================================
   Mobile Styles - Responsive Layout
   ========================================================================== */

@media (max-width: 768px) {
  /* Reset desktop grid layout on mobile - single column */
  #app {
    grid-template-columns: 1fr;
  }

  /* Hide header controls on mobile - moved into panel Options tab */
  header .control {
    display: none !important;
  }

  header .badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  header .title {
    font-size: 13px;
  }

  /* Mobile bottom bar - fixed at bottom */
  #mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-bottom-bar-height);
    background: var(--panel);
    border-top: 1px solid var(--border-light);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 601; /* Above panel backdrop (599) and panel (600) for toggle button access */
    padding: 0 12px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  /* Bottom bar sections */
  .bottom-bar-left,
  .bottom-bar-center,
  .bottom-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .bottom-bar-center {
    flex: 1;
    justify-content: center;
  }

  /* Mobile panel toggle button - in bottom bar */
  #panel-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent);
    border: none;
    color: white;
    font-size: 20px;
  }

  #panel-toggle:hover {
    background: var(--accent-hover);
  }

  #panel-toggle:active {
    transform: scale(0.95);
  }

  #panel-toggle.panel-open {
    background: var(--danger);
  }

  /* Assay panel - slide-up drawer from bottom */
  #assay-panel {
    position: fixed;
    top: auto;
    bottom: var(--mobile-bottom-bar-height);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    max-height: var(--mobile-panel-max-height);
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
    z-index: 600; /* Above all canvas-host content: log (100), collar-detail (500), annotations */
  }

  #assay-panel.mobile-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* Mobile panel handle - pull indicator + drag-to-resize */
  #assay-panel .panel-handle {
    display: block;
    width: 100%;
    height: 24px;
    flex-shrink: 0;
    cursor: grab;
    position: relative;
    touch-action: none;
  }

  /* Visible grabber bar */
  #assay-panel .panel-handle::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  #assay-panel .panel-handle:active {
    cursor: grabbing;
  }

  /* Hide desktop drag handle on mobile - tabs replace it */
  #assay-panel .panel-drag-handle {
    display: none;
  }

  /* Viewer mobile tabs */
  .viewer-mobile-tabs {
    display: flex;
    margin-top: 10px;
    border-bottom: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
  }

  .viewer-mobile-tab {
    flex: 1;
    padding: 10px 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    text-align: center;
  }

  .viewer-mobile-tab:hover {
    color: var(--text);
  }

  .viewer-mobile-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  /* Tab pane visibility on mobile */
  .viewer-tab-pane {
    display: none;
  }

  .viewer-tab-pane.active {
    display: block;
  }

  #assay-panel .panel-content {
    max-height: calc(var(--mobile-panel-max-height) - 60px);
    overflow-y: auto;
    padding-bottom: 20px;
  }

  #assay-panel .collars-content {
    max-height: none;
  }

  /* Hide desktop panel header on mobile - tabs replace it */
  #assay-panel .panel-header {
    display: none;
  }

  /* Hide panel terms footer on mobile - terms link in bottom bar */
  .panel-terms-footer {
    display: none;
  }
}

/* Desktop: hide mobile-only elements */
@media (min-width: 769px) {
  #assay-panel .panel-handle {
    display: none;
  }

  #mobile-bottom-bar {
    display: none !important;
  }

  .mobile-controls-section {
    display: none !important;
  }

  .viewer-mobile-tabs {
    display: none !important;
  }

  /* Hide standalone terms footer on desktop - now inside panel */
  .terms-footer {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .mobile-controls-section {
    display: block;
  }

  .mobile-controls-section .panel-row {
    margin-bottom: 12px;
  }

  .mobile-controls-section .panel-row:last-child {
    margin-bottom: 0;
  }

  .mobile-controls-section input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
    height: 4px;
  }

  .mobile-controls-section input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
  }

  .mobile-controls-section span {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
  }
}
/* Panel form elements */
#assay-panel h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

#assay-panel .panel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

#assay-panel label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 75px;
  font-weight: 500;
}

#assay-panel select {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#assay-panel select:hover {
  border-color: var(--border-accent);
}

#assay-panel select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 145, 175, 0.15);
}

/* Unit selector row */
#assay-panel .unit-selector-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

#assay-panel .unit-selector-row label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 75px;
  font-weight: 500;
}

#assay-panel .unit-selector-row select {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  max-width: 80px;
}

#assay-panel .unit-selector-row select:hover {
  border-color: var(--border-accent);
}

#assay-panel .unit-selector-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 145, 175, 0.15);
}

/* Legend section */
#assay-panel .legend {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

#assay-panel .legend-title {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

#assay-panel .legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#assay-panel .legend-actions {
  display: flex;
  gap: 6px;
}

#assay-panel .legend-btn {
  padding: 3px 8px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

#assay-panel .legend-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* Discrete range legend */
#assay-panel .legend-ranges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

#assay-panel .legend-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

#assay-panel .legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

#assay-panel .legend-range-label {
  font-weight: 500;
  white-space: nowrap;
}

#assay-panel .stats {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
}

/* ==========================================================================
   Breakpoint Editor Modal
   ========================================================================== */
.breakpoint-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}

.breakpoint-modal {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  box-shadow: var(--box-shadow-lg);
  display: none;
}

.breakpoint-modal.visible {
  display: block;
}

.breakpoint-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: grab;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px 12px 0 0;
}

.breakpoint-modal-header:active {
  cursor: grabbing;
}

.breakpoint-modal-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.breakpoint-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.breakpoint-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.breakpoint-modal-body {
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.breakpoint-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.breakpoint-row:last-child {
  margin-bottom: 0;
}

.breakpoint-row label {
  font-size: 11px;
  color: var(--text-muted);
  width: 55px;
  flex-shrink: 0;
  font-weight: 500;
}

.breakpoint-row input[type="number"] {
  flex: 1;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  width: 80px;
  transition: border-color var(--transition-fast);
}

.breakpoint-row input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

.breakpoint-row input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid var(--border-medium);
  border-radius: 6px;
  cursor: pointer;
  background: none;
}

.breakpoint-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.breakpoint-row input[type="color"]::-webkit-color-swatch {
  border-radius: 3px;
  border: none;
}

.breakpoint-modal-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.breakpoint-modal-footer button {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.breakpoint-modal-footer .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

.breakpoint-modal-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.breakpoint-modal-footer .btn-primary {
  background: var(--accent);
  border: none;
  color: white;
  font-weight: 600;
}

.breakpoint-modal-footer .btn-primary:hover {
  background: var(--accent-hover);
}
.breakpoint-row .delete-break-btn {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}
.breakpoint-row:hover .delete-break-btn {
  opacity: 1;
}
.breakpoint-row .delete-break-btn:hover {
  color: #ef4444;
}
.breakpoint-row .delete-break-btn.hidden {
  visibility: hidden;
}
.breakpoint-add-zone {
  position: relative;
  height: 8px;
  margin: 2px 0;
  cursor: pointer;
}
.breakpoint-add-zone:hover {
  height: auto;
}
.breakpoint-add-zone .add-break-placeholder {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px dashed rgba(107, 114, 128, 0.5);
  border-radius: 6px;
  background: rgba(107, 114, 128, 0.08);
}
.breakpoint-add-zone:hover .add-break-placeholder {
  display: flex;
}
.breakpoint-add-zone .add-break-placeholder span {
  font-size: 11px;
  color: #6b7280;
}
.breakpoint-add-zone:hover .add-break-placeholder span {
  color: #9ca3af;
}

/* Breakpoint range indicators */
.breakpoint-range-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-dim, #6b7280);
  padding: 2px 0;
  margin: 2px 0 4px;
}

.range-indicator-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Collar visibility controls - Collapsible sections */

#assay-panel .collars-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}
#assay-panel .collars-main-header:hover {
  opacity: 0.9;
}
#assay-panel .collars-title {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#assay-panel .collapse-icon {
  font-size: 10px;
  transition: transform 0.2s;
}
#assay-panel .collapse-icon.collapsed {
  transform: rotate(-90deg);
}
#assay-panel .collars-toggle-all {
  font-size: 10px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 6px;
}
#assay-panel .collars-toggle-all:hover {
  text-decoration: underline;
}
#assay-panel .collars-content {
  max-height: 50vh;
  overflow-y: scroll;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
#assay-panel .collars-content::-webkit-scrollbar {
  width: 6px;
}
#assay-panel .collars-content::-webkit-scrollbar-track {
  background: transparent;
}
#assay-panel .collars-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
#assay-panel .collars-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
#assay-panel .collars-content.collapsed {
  display: none;
}

/* Mineral Content Section (collapsible) */
#assay-panel .mineral-content-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
#assay-panel .mineral-content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}
#assay-panel .mineral-content-header:hover {
  opacity: 0.9;
}
#assay-panel .mineral-content-title {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#assay-panel .mineral-content-title .collapse-icon {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: #9ca3af;
}
#assay-panel .mineral-content-title .collapse-icon.collapsed {
  transform: rotate(-90deg);
}
#assay-panel .mineral-content-body {
  display: block;
  max-height: 50vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
#assay-panel .mineral-content-body::-webkit-scrollbar {
  width: 6px;
}
#assay-panel .mineral-content-body::-webkit-scrollbar-track {
  background: transparent;
}
#assay-panel .mineral-content-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
#assay-panel .mineral-content-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
#assay-panel .mineral-content-body.collapsed {
  display: none;
}

/* News Article Group */
#assay-panel .article-group {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  overflow: hidden;
}
#assay-panel .article-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#assay-panel .article-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
#assay-panel .article-header.article-highlighted {
  background: rgba(56, 189, 248, 0.15);
}
#assay-panel .article-icon {
  font-size: 12px;
  flex-shrink: 0;
}
#assay-panel .article-title {
  font-size: 11px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#assay-panel .article-date {
  font-size: 9px;
  color: #6b7280;
  flex-shrink: 0;
}
#assay-panel .article-checkbox {
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
#assay-panel .article-link {
  color: #6b7280;
  text-decoration: none;
  font-size: 12px;
  padding: 2px;
  flex-shrink: 0;
}
#assay-panel .article-link:hover {
  color: var(--accent);
}
#assay-panel .article-collars {
  padding: 4px 8px 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#assay-panel .article-collars.collapsed {
  display: none;
}

/* No Article Group */
#assay-panel .no-article-group {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  overflow: hidden;
}
#assay-panel .no-article-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  color: #9ca3af;
  font-size: 11px;
}
#assay-panel .no-article-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
#assay-panel .no-article-header.article-highlighted {
  background: rgba(56, 189, 248, 0.15);
}

/* Folder Group (from hierarchy) */
#assay-panel .folder-group {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}
#assay-panel .folder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  border-left: 3px solid #38bdf8;
}
#assay-panel .folder-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
#assay-panel .folder-header.folder-highlighted {
  background: rgba(56, 189, 248, 0.15);
}
#assay-panel .folder-icon {
  font-size: 12px;
  flex-shrink: 0;
}
#assay-panel .folder-title {
  font-size: 11px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
#assay-panel .folder-checkbox {
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
#assay-panel .folder-children {
  padding: 4px 8px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#assay-panel .folder-children.collapsed {
  display: none;
}

/* Collar Items */
#assay-panel .collar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
#assay-panel .collar-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
#assay-panel .collar-item.panel-highlighted {
  background: rgba(56, 189, 248, 0.15);
}
#assay-panel .collar-item input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
#assay-panel .collar-item label {
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
#assay-panel .collar-item .highlight-star {
  color: #fbbf24;
  font-size: 10px;
  flex-shrink: 0;
}
#assay-panel .collar-item .label-toggle-checkbox {
  width: 12px;
  height: 12px;
  margin: 0 0 0 4px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #38bdf8;
}
#assay-panel .collar-item .label-toggle-icon {
  font-size: 9px;
  font-weight: 700;
  color: #38bdf8;
  flex-shrink: 0;
  margin-left: -1px;
  opacity: 0.7;
}

/* ==========================================================================
   Slideshow Controls
   ========================================================================== */

#slideshow-controls {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 50;
  box-shadow: var(--box-shadow-m);
}

#slideshow-controls.visible {
  display: flex;
}

#slideshow-controls button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(0, 145, 175, 0.15);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

#slideshow-controls button:hover:not(:disabled) {
  background: rgba(0, 145, 175, 0.25);
  border-color: var(--accent);
}

#slideshow-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#slideshow-controls .slideshow-indicator {
  font-size: 13px;
  color: var(--text);
  min-width: 50px;
  text-align: center;
  font-weight: 600;
}

#slideshow-controls .slideshow-play-btn {
  padding: 8px 10px;
}

#slideshow-controls .slideshow-play-btn svg {
  display: block;
}

/* Mobile slideshow - integrated into bottom bar */
@media (max-width: 768px) {
  #slideshow-controls {
    position: static;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    gap: 8px;
  }

  #slideshow-controls button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
  }

  #slideshow-controls button span.btn-text {
    display: none;
  }

  #slideshow-controls .slideshow-indicator {
    font-size: 12px;
    min-width: 40px;
  }
}

/* Annotation fade animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ==========================================================================
   Hotspot Panel (presentation states - left side)
   ========================================================================== */

#hotspot-panel {
  position: absolute;
  top: 16px;
  left: 12px;
  min-width: 240px;
  max-width: 280px;
  width: auto;
  background: var(--panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px 12px 0 0;
  padding: 8px 0 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 20;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: var(--box-shadow-m);
}

#hotspot-panel.dragging {
  transition: none;
  user-select: none;
}

.hotspot-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px 12px 0 0;
  background: rgba(0, 0, 0, 0.1);
  cursor: grab;
}

.hotspot-panel-header:active {
  cursor: grabbing;
}

.hotspot-panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hotspot-panel-collapse {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.hotspot-panel-collapse:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.hotspot-panel-content {
  padding: 8px;
  max-height: 35vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.hotspot-panel-content::-webkit-scrollbar {
  width: 6px;
}
.hotspot-panel-content::-webkit-scrollbar-track {
  background: transparent;
}
.hotspot-panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.hotspot-panel-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

#hotspot-panel.collapsed .hotspot-panel-content {
  display: none;
}

#hotspot-panel.collapsed .hotspot-panel-header {
  border-bottom: none;
  border-radius: 12px;
}

/* Hotspot item */
.hotspot-item {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  border-left: 3px solid #f97316;
  cursor: pointer;
  transition: background var(--transition-fast);
  background: rgba(255, 255, 255, 0.03);
}

.hotspot-item:last-child {
  margin-bottom: 0;
}

.hotspot-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hotspot-item.hotspot-active {
  background: rgba(0, 145, 175, 0.15);
  border-left-color: var(--accent-light);
}

.hotspot-item-body {
  flex: 1;
  min-width: 0;
}

.hotspot-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.hotspot-item-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

/* Hide desktop hotspot panel on mobile — navigation moves to mobile tab */
@media (max-width: 768px) {
  #hotspot-panel {
    display: none !important;
  }
}

/* Commodity loading overlay */
.commodity-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  z-index: 50;
  color: var(--text);
  font-size: 14px;
}

.commodity-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

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

/* Layer Items (GeoTIFF overlays in hierarchy) */
#assay-panel .layer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.15s;
}
#assay-panel .layer-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
#assay-panel .layer-item .layer-checkbox {
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
#assay-panel .layer-item .layer-checkbox:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#assay-panel .layer-item .layer-icon {
  font-size: 12px;
  flex-shrink: 0;
}
#assay-panel .layer-item .layer-name {
  font-size: 11px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Voxel Layer Items (voxel overlays in hierarchy) */
#assay-panel .voxel-layer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.15s;
  flex-wrap: wrap;
}
#assay-panel .voxel-layer-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
#assay-panel .voxel-layer-item .voxel-layer-checkbox {
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
#assay-panel .voxel-layer-item .voxel-layer-checkbox:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#assay-panel .voxel-layer-item .voxel-layer-icon {
  font-size: 12px;
  flex-shrink: 0;
}
#assay-panel .voxel-layer-item .voxel-layer-name {
  font-size: 11px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#assay-panel .voxel-threshold-container {
  width: 100%;
  padding-left: 22px;
  margin-top: 2px;
}
#assay-panel .voxel-threshold-slider {
  width: 100%;
  height: 4px;
  cursor: pointer;
  accent-color: var(--accent);
}
#assay-panel .voxel-breakpoint-legend {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  padding-left: 22px;
  margin-top: 2px;
  flex-wrap: wrap;
}
#assay-panel .voxel-bp-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
#assay-panel .transparent-swatch {
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.15) 2px,
    rgba(255, 255, 255, 0.05) 2px,
    rgba(255, 255, 255, 0.05) 4px
  ) !important;
}

/* DXF Layer Items (DXF mesh overlays in hierarchy) */
#assay-panel .dxf-layer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.15s;
  flex-wrap: wrap;
}
#assay-panel .dxf-layer-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
#assay-panel .dxf-layer-item .dxf-layer-checkbox {
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
#assay-panel .dxf-layer-item .dxf-layer-checkbox:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#assay-panel .dxf-layer-item .dxf-icon {
  font-size: 12px;
  flex-shrink: 0;
}
#assay-panel .dxf-layer-item .dxf-name {
  font-size: 11px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#assay-panel .layer-opacity-container {
  width: 100%;
  padding-left: 22px;
  margin-top: 2px;
}
#assay-panel .layer-opacity-slider {
  width: 100%;
  height: 4px;
  cursor: pointer;
  accent-color: var(--accent);
}
#assay-panel .dxf-opacity-container {
  width: 100%;
  padding-left: 22px;
  margin-top: 2px;
}
#assay-panel .dxf-opacity-slider {
  width: 100%;
  height: 4px;
  cursor: pointer;
  accent-color: var(--accent);
}
#assay-panel .voxel-opacity-container {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding-left: 22px;
  margin-top: 2px;
}
#assay-panel .voxel-opacity-label {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}
#assay-panel .voxel-opacity-slider {
  flex: 1;
  height: 4px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* Slideshow annotation boxes */
.slideshow-annotation-box {
  transition: opacity 0.3s ease-out;
}

/* ================================================
   Compass Component
   ================================================ */
.compass {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 72px;
  height: 72px;
  z-index: 30;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.compass.dragging {
  cursor: grabbing;
}

.compass-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--border-medium);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--box-shadow-m);
}
.compass-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.1s ease-out;
}

.compass-direction {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.compass-direction.north {
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--danger);
}

.compass-direction.south {
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
}

.compass-direction.east {
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.compass-direction.west {
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Compass needle */
.compass-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 24px;
  transform: translate(-50%, -100%);
  background: linear-gradient(to bottom, var(--danger) 0%, var(--danger) 100%);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.compass-needle-south {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 18px;
  transform: translate(-50%, 0%);
  background: linear-gradient(to bottom, var(--text-dim) 0%, #4b5563 100%);
  clip-path: polygon(50% 100%, 100% 0%, 0% 0%);
}

.compass-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Tick marks */
.compass-ticks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.compass-tick {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 1px;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  transform-origin: 50% 34px;
}

.compass-tick.major {
  height: 7px;
  background: rgba(255, 255, 255, 0.4);
}

/* Mobile compass adjustments — move to bottom-right, same row as scale bar */
@media (max-width: 768px) {
  .compass {
    width: 56px;
    height: 56px;
    top: auto;
    left: auto;
    right: 12px;
    bottom: calc(var(--mobile-bottom-bar-height) + 12px);
  }

  .compass-direction {
    font-size: 8px;
  }

  .compass-direction.north { top: 4px; }
  .compass-direction.south { bottom: 4px; }
  .compass-direction.east { right: 4px; }
  .compass-direction.west { left: 4px; }

  .compass-needle {
    height: 18px;
    width: 3px;
  }

  .compass-needle-south {
    height: 14px;
    width: 3px;
  }

  .compass-tick {
    transform-origin: 50% 26px;
    height: 4px;
  }

  .compass-center {
    width: 6px;
    height: 6px;
  }
}

/* ================================================
   Viewer Toolbar
   ================================================ */
.viewer-toolbar {
  position: absolute;
  top: 16px;
  left: 100px;
  display: flex;
  gap: 8px;
  z-index: 30;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.toolbar-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.toolbar-btn.active {
  background: rgba(0, 145, 175, 0.2);
  color: var(--accent);
  border-color: var(--accent);
}

.toolbar-btn svg {
  flex-shrink: 0;
}

.toolbar-label {
  font-weight: 500;
}

@media (max-width: 768px) {
  .viewer-toolbar {
    top: 12px;
    left: 80px;
    gap: 6px;
  }

  .toolbar-btn {
    padding: 8px 10px;
  }

  .toolbar-label {
    display: none;
  }
}

/* ================================================
   Scale Bar
   ================================================ */
.scale-bar {
  position: absolute;
  bottom: 24px;
  left: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  z-index: 99999;
  pointer-events: none;
}

.scale-bar-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-bottom: 2px;
}

.scale-bar-powered-by {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.3px;
}

.scale-bar-logo {
  width: 100px;
  height: auto;
  opacity: 0.8;
  object-fit: contain;
}

.scale-bar-line {
  height: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-left: 2px solid rgba(255, 255, 255, 0.9);
  border-right: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  min-width: 50px;
  transition: width 0.2s ease-out;
}

.scale-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.3px;
}

/* Mobile scale bar - move above bottom bar */
@media (max-width: 768px) {
  .scale-bar {
    bottom: calc(var(--mobile-bottom-bar-height) + 12px);
    left: 12px;
    z-index: 40;
  }

  .scale-bar-branding {
    gap: 0;
    margin-bottom: 1px;
  }

  .scale-bar-powered-by {
    font-size: 7px;
  }

  .scale-bar-logo {
    width: 65px;
  }

  .scale-bar-line {
    height: 6px;
  }

  .scale-bar-label {
    font-size: 10px;
  }
}

/* ================================================
   Measurement Context Menu
   ================================================ */
.measurement-context-menu {
  position: fixed;
  display: none;
  flex-direction: column;
  min-width: 160px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 0;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}
.measurement-context-menu.visible {
  display: flex;
}
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.context-menu-item:hover {
  background: rgba(56, 189, 248, 0.15);
}
.context-menu-item svg {
  flex-shrink: 0;
  color: #9ca3af;
}
.context-menu-item:hover svg {
  color: var(--accent);
}
.context-menu-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.context-menu-item.disabled:hover {
  background: none;
}

/* ================================================
   Hierarchy Zoom-to-Extent Context Menu
   ================================================ */
.hierarchy-zoom-menu {
  position: fixed;
  display: none;
  flex-direction: column;
  min-width: 160px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 0;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}
.hierarchy-zoom-menu.visible {
  display: flex;
}
.hierarchy-zoom-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.hierarchy-zoom-menu-item:hover {
  background: rgba(56, 189, 248, 0.15);
}
.hierarchy-zoom-menu-item svg {
  flex-shrink: 0;
  color: #9ca3af;
}
.hierarchy-zoom-menu-item:hover svg {
  color: var(--accent);
}

/* ================================================
   Measurement Mode Cursor
   ================================================ */
#canvas-host.measure-mode {
  cursor: crosshair;
}
#canvas-host.measure-mode canvas {
  cursor: crosshair;
}

/* ================================================
   Measurement Line Label (CSS2D)
   ================================================ */
.measurement-label {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: background 0.15s, border-color 0.15s;
}
.measurement-label:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--accent);
}
.measurement-label.selected {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent);
}

/* Measurement endpoint markers */
.measurement-endpoint {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.measurement-endpoint.snap-indicator {
  background: #22c55e;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* ================================================
   Terms of Use Footer Bar
   ================================================ */
.terms-footer {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-top-left-radius: 8px;
  z-index: 40;
}

.terms-link {
  color: var(--text-dim);
  font-size: 11px;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color var(--transition-fast);
}

.terms-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ================================================
   Terms of Use Modal
   ================================================ */
.terms-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.terms-modal-overlay.visible {
  display: flex;
}

.terms-modal {
  background: var(--panel-solid);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--box-shadow-lg);
}

.terms-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 16px 16px 0 0;
}

.terms-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.terms-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.terms-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.terms-modal-body {
  padding: 24px;
  overflow-y: auto;
  line-height: 1.7;
  font-size: 14px;
  color: var(--text-muted);
}

.terms-modal-body h3 {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin: 24px 0 10px 0;
}

.terms-modal-body h3:first-of-type {
  margin-top: 0;
}

.terms-modal-body p {
  margin: 0 0 12px 0;
}

.terms-modal-body strong {
  color: var(--text);
}

.terms-effective-date {
  color: var(--text-dim);
  font-size: 12px;
  font-style: italic;
  margin-bottom: 20px !important;
}

.terms-footer-text {
  margin-top: 24px !important;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  font-style: italic;
  color: var(--text-dim);
  font-size: 13px;
}

/* Mobile terms footer - positioned in bottom bar area */
@media (max-width: 768px) {
  .terms-footer {
    position: static;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    border-radius: 0;
  }

  .terms-link {
    font-size: 10px;
    padding: 8px;
  }

  .terms-modal {
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }

  .terms-modal-header {
    padding: 14px 16px;
  }

  .terms-modal-header h2 {
    font-size: 16px;
  }

  .terms-modal-body {
    padding: 16px;
    font-size: 13px;
  }

  .terms-modal-body h3 {
    font-size: 14px;
  }
}

/* ================================================
   Mobile Info Bar (tap info display)
   ================================================ */
#mobile-info-bar {
  display: none;
}

@media (max-width: 768px) {
  #mobile-info-bar {
    position: fixed;
    bottom: var(--mobile-bottom-bar-height);
    left: 0;
    right: 0;
    width: 100%;
    max-height: 60vh;
    background: var(--panel);
    border-top: 1px solid var(--border-medium);
    border-radius: 16px 16px 0 0;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 44;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
  }

  #mobile-info-bar.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
  }

  .mobile-info-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }

  .mobile-info-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), color var(--transition-fast);
  }

  .mobile-info-close:hover,
  .mobile-info-close:active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text);
  }

  .mobile-info-content {
    padding: 12px 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
  }

  .mobile-info-content .info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
  }

  .mobile-info-content .info-row:last-child {
    border-bottom: none;
  }

  .mobile-info-content .info-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 80px;
    flex-shrink: 0;
  }

  .mobile-info-content .info-value {
    font-size: 13px;
    color: var(--text);
    text-align: right;
    flex: 1;
    word-break: break-word;
  }

  .mobile-info-content .info-value.highlight {
    color: var(--accent);
    font-weight: 600;
  }

  .mobile-info-content .info-section-title {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 12px;
    margin-bottom: 4px;
    font-weight: 600;
  }

  .mobile-info-content .info-section-title:first-child {
    margin-top: 0;
  }

  /* Backdrop for dismissing on tap outside */
  #mobile-info-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--mobile-bottom-bar-height);
    background: transparent;
    z-index: 43;
  }

  #mobile-info-backdrop.visible {
    display: block;
  }
}

/* ============================================================================
   COLLAR LABELS (CSS2D floating text labels)
   ============================================================================ */

.collar-label-3d {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  line-height: 1.3;
}

.collar-label-renderer {
  pointer-events: none;
}

/* ============================================================================
   PUBLISH PREVIEW BANNER
   ============================================================================ */

#publish-preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: rgba(234, 179, 8, 0.95);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px 40px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.preview-banner-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #1a1a1a;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.preview-banner-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   SCREEN IMAGE OVERLAY (Public Viewer)
   ============================================================================ */

.screen-image-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.screen-image-wrapper {
  position: absolute;
  pointer-events: none;
  box-sizing: border-box;
}

.screen-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Image layer items in the hierarchy panel */
.image-layer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.image-layer-item .image-layer-icon { font-size: 13px; flex-shrink: 0; }
.image-layer-item .image-layer-name {
  flex: 1;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   Video Overlay Styles
   ============================================ */

.screen-video-wrapper {
  position: absolute;
  box-sizing: border-box;
  background: #000;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  overflow: hidden;
}

.screen-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
  z-index: 1;
}

.video-controls.visible {
  opacity: 1;
}

.video-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.9;
  width: 24px;
  text-align: center;
}

.video-btn:hover {
  opacity: 1;
}

.video-seek-bar {
  flex: 1;
  height: 4px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  outline: none;
}

.video-seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.video-seek-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

.video-time-display {
  color: #fff;
  font-size: 11px;
  font-family: monospace;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.9;
}

.video-volume-slider {
  width: 50px;
  height: 4px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  outline: none;
  flex-shrink: 0;
}

.video-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.video-volume-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

/* Audio overlay (minimal bar player) */
.screen-audio-wrapper {
  background: rgba(0, 0, 0, 0.85) !important;
  border-radius: 8px;
  height: auto !important;
  min-height: 50px;
  min-width: 280px;
  max-width: 400px;
  overflow: visible !important;
}

.screen-audio-wrapper .audio-label {
  color: #fff;
  font-size: 11px;
  padding: 6px 12px 0;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen-audio-wrapper .video-controls,
.screen-audio-wrapper .audio-controls {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
  background: transparent !important;
  padding: 6px 10px 8px;
}

/* Video layer items in the hierarchy panel */
.video-layer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.video-layer-item .video-layer-icon { font-size: 13px; flex-shrink: 0; }
.video-layer-item .video-layer-name {
  flex: 1;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================================
   LEGEND LAYER - Hierarchy panel items
   ============================================================================ */

.legend-layer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
}
.legend-layer-item .legend-layer-checkbox { flex-shrink: 0; }
.legend-layer-item .legend-layer-icon { font-size: 13px; flex-shrink: 0; }
.legend-layer-item .legend-layer-name {
  flex: 1;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legend-layer-item .legend-layer-count {
  font-size: 10px;
  color: var(--text-muted, #9ca3af);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1px 6px;
  flex-shrink: 0;
}

/* ========================================================================
   PROJECT CTA CARD (bottom-right corner)
   ======================================================================== */

.project-cta {
  position: absolute;
  bottom: 52px;
  right: 16px;
  width: 180px;
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  z-index: 35;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.6s ease, z-index 0s;
  pointer-events: none;
}

.project-cta.visible {
  opacity: 0.9;
  pointer-events: auto;
  transition: opacity 0.25s ease, z-index 0s;
}

.project-cta.visible:hover {
  opacity: 1;
  z-index: 9999;
}

.project-cta-map {
  width: 100%;
  height: 80px;
  display: block;
  background: #1a1a2e;
}

.project-cta-info {
  padding: 8px 10px 4px;
}

.project-cta-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.project-cta-location {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

.project-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 4px 10px 0;
  padding: 6px 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.project-cta-btn:hover {
  background: var(--accent-hover);
}

.project-cta-sub {
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  padding: 3px 0 8px;
}

/* Hide CTA on mobile - too much screen real estate */
@media (max-width: 768px) {
  .project-cta {
    display: none !important;
  }
}
