/* ==========================================================================
   Astro Sky Map - Stargazing Dark Mode Theme & Design System
   ========================================================================== */

:root {
  --bg-dark: #07090e;
  --bg-surface: #0e121b;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 54, 0.85);
  --bg-glass: rgba(14, 18, 27, 0.7);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 243, 255, 0.3);
  --border-active: #00f3ff;
  
  --accent-cyan: #00f3ff;
  --accent-violet: #a855f7;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-glow: 0 0 20px rgba(0, 243, 255, 0.15);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Layout */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text .subtext {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-top: -2px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stats-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stats-badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

.view-mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.tab-btn svg {
  width: 14px;
  height: 14px;
}

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

.tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid var(--border-glow);
  color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.survey-selector-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
  pointer-events: none;
}

.survey-dropdown {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.85rem 0.45rem 2rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.survey-dropdown:hover, .survey-dropdown:focus {
  border-color: var(--accent-cyan);
  outline: none;
  background: rgba(0, 243, 255, 0.05);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #00a6ff);
  color: #050b14;
  font-weight: 600;
}

.btn-primary:hover {
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-cyan);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-violet), #9333ea);
  color: white;
}

.btn-accent:hover {
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.75rem;
  cursor: pointer;
}
.btn-text:hover { text-decoration: underline; }

.btn-sm {
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
}

/* Workspace Main Container */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.sidebar {
  width: 420px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
  transition: all 0.3s ease;
}

/* Workspace View Modes */
.workspace.view-map .sidebar {
  display: none;
}

.workspace.view-gallery .sidebar {
  width: 100vw;
  border-right: none;
}

.workspace.view-gallery .map-viewport,
.workspace.view-gallery .workspace-resizer {
  display: none;
}

/* Filter Section */
.filter-card {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

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

.filter-header h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-header h3 svg { width: 14px; height: 14px; color: var(--accent-cyan); }

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--text-dim);
}

.search-input-group input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 2rem 0.5rem 2.2rem;
  color: var(--text-main);
  font-size: 0.8rem;
  font-family: var(--font-main);
  transition: border 0.2s ease;
}

.search-input-group input:focus {
  border-color: var(--accent-cyan);
  outline: none;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.clear-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
}
.clear-btn.hidden { display: none; }

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 600;
}

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

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.chip.active {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 500;
}

.filter-row {
  display: flex;
  gap: 0.5rem;
}

.filter-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.custom-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  color: var(--text-main);
  font-size: 0.75rem;
  font-family: var(--font-main);
}
.custom-select:focus { border-color: var(--accent-cyan); outline: none; }

.range-slider {
  width: 100%;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* Gallery Section */
.gallery-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.75rem;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sort-select {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.75rem;
  cursor: pointer;
}
.sort-select option { background: var(--bg-surface); color: var(--text-main); }

.gallery-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: max-content;
  gap: 0.85rem;
  padding-right: 6px;
}

.workspace.view-gallery .gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding: 1rem;
}

/* Card Component */
.astro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 250px;
}

.astro-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.astro-card.active-target {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.card-image-wrap {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: #000;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.astro-card:hover .card-img {
  transform: scale(1.05);
}

.card-type-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--accent-cyan);
}

.overlay-toggle-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 14px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .2s;
  border-radius: 14px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 10px; width: 10px;
  left: 2px; bottom: 2px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-cyan); }
input:checked + .slider:before { transform: translateX(12px); }

.card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.pill svg { width: 11px; height: 11px; color: var(--accent-violet); }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.4rem;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.card-actions {
  display: flex;
  gap: 0.3rem;
}

.btn-card-action {
  background: rgba(0, 243, 255, 0.08);
  border: 1px solid var(--border-glow);
  color: var(--accent-cyan);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}
.btn-card-action:hover {
  background: var(--accent-cyan);
  color: #000;
}
.btn-card-action svg { width: 12px; height: 12px; }

/* Resizer Bar */
.workspace-resizer {
  width: 4px;
  background: var(--border-subtle);
  cursor: col-resize;
  transition: background 0.2s ease;
  z-index: 30;
}
.workspace-resizer:hover { background: var(--accent-cyan); }

/* Map Viewport */
.map-viewport {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
}

.aladin-container {
  width: 100%;
  height: 100%;
}

/* Floating Sky Map Controls */
.sky-controls-floating {
  position: absolute;
  bottom: 54px;
  left: 15px;
  z-index: 40;
  display: flex;
  gap: 0.5rem;
}

.sky-float-btn {
  background: rgba(14, 18, 27, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}
.sky-float-btn svg { width: 14px; height: 14px; color: var(--accent-cyan); }

.sky-float-btn:hover {
  border-color: var(--accent-cyan);
  background: rgba(20, 27, 40, 0.95);
}

.sky-float-btn.active {
  border-color: var(--border-glow);
  color: var(--accent-cyan);
}

/* Toast */
.map-toast {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  background: rgba(0, 243, 255, 0.15);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-cyan);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: var(--shadow-glow);
  transition: opacity 0.3s ease;
}
.map-toast.hidden { opacity: 0; pointer-events: none; }
.toast-content { display: flex; align-items: center; gap: 0.4rem; }
.toast-content svg { width: 14px; height: 14px; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  position: relative;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.modal-close:hover { background: var(--accent-rose); color: white; }

/* Detail Modal Specifics */
.detail-modal-card {
  width: 1000px;
  max-width: 95vw;
  padding: 1.5rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .detail-layout { grid-template-columns: 1fr; }
}

.detail-preview-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-viewer-container {
  position: relative;
  width: 100%;
  height: 380px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.detail-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-overlay-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.badge {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.image-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail-info-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-info-col h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-main);
}

.detail-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.5rem;
}

.modal-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}
.modal-tab-btn svg { width: 14px; height: 14px; }
.modal-tab-btn:hover { color: var(--text-main); }
.modal-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

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

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.meta-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.meta-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}
.meta-val.highlight { color: var(--accent-cyan); font-family: var(--font-mono); }

.meta-subval {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.corners-table-wrapper {
  margin-top: 0.75rem;
}

.corners-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-family: var(--font-mono);
}
.corners-table th, .corners-table td {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.corners-table th { background: rgba(255, 255, 255, 0.04); color: var(--text-muted); }

.header-tree-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.table-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.78rem;
}

.table-scroll {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.header-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}
.header-table th { position: sticky; top: 0; background: #0f172a; padding: 0.4rem 0.6rem; text-align: left; color: var(--accent-cyan); }
.header-table td { padding: 0.35rem 0.6rem; border-bottom: 1px solid rgba(255, 255, 255, 0.04); word-break: break-all; }
.header-table tr:hover { background: rgba(0, 243, 255, 0.05); }

/* Guide Modal */
.guide-modal-card {
  width: 650px;
  max-width: 90vw;
  padding: 2rem;
}

.guide-modal-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-cyan);
}

.guide-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.code-step-card {
  display: flex;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: #000;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-content h4 { font-size: 0.9rem; color: var(--text-main); }
.step-content p { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

.code-block-wrapper {
  background: #050811;
  border: 1px solid var(--border-glow);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  margin: 0.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  overflow-x: auto;
}

.guide-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Floating Sky Map Opacity Slider Overlay */
.sky-float-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sky-float-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  color: var(--accent-cyan);
  font-weight: 600;
}

.sky-float-label svg { width: 13px; height: 13px; }

.sky-float-slider {
  width: 70px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
  height: 4px;
}

/* Utility hidden class */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Design Suite (< 768px & < 480px)
   ========================================================================== */

@media (max-width: 768px) {
  /* Header Adjustments */
  .app-header {
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .header-left {
    gap: 0.5rem;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .survey-select-wrap {
    order: 3;
    width: 100%;
  }

  .survey-select {
    width: 100%;
  }

  .view-mode-tabs {
    order: 2;
    overflow-x: auto;
  }

  .tab-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
  }

  /* Workspace Layout Stacking for Mobile */
  .workspace {
    flex-direction: column;
    height: calc(100vh - 105px);
  }

  .workspace-resizer {
    display: none !important;
  }

  .gallery-sidebar {
    width: 100% !important;
    height: 45%;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .map-viewport {
    width: 100% !important;
    height: 55%;
    flex: 1;
  }

  /* View Mode Overrides for Mobile */
  .workspace.view-map .gallery-sidebar {
    display: none !important;
  }

  .workspace.view-map .map-viewport {
    height: 100% !important;
    width: 100% !important;
  }

  .workspace.view-gallery .map-viewport {
    display: none !important;
  }

  .workspace.view-gallery .gallery-sidebar {
    height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
  }

  /* Floating Sky Controls Overlay for Mobile */
  .sky-controls-floating {
    bottom: 0.75rem;
    width: 94vw;
    left: 50%;
    transform: translateX(-50%);
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.4rem 0.5rem;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
  }

  .sky-float-btn {
    font-size: 0.68rem;
    padding: 0.3rem 0.6rem;
    flex-shrink: 0;
  }

  .sky-float-slider-wrap {
    flex-shrink: 0;
    font-size: 0.68rem;
    padding: 0.25rem 0.5rem;
  }

  .sky-float-slider {
    width: 55px;
  }

  /* Detail Inspection Modal for Mobile */
  .detail-modal-card {
    width: 95vw;
    padding: 1rem;
    max-height: 92vh;
  }

  .image-viewer-container {
    height: 240px;
  }

  .modal-tab-btn {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }

  .meta-grid {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .header-actions .btn {
    padding: 0.35rem 0.5rem;
  }
}
