/* ==========================================================================
   Nebulocity - Pillars of Creation Theme (Molten Copper & Celestial Aquamarine)
   Inspired by the Hubble Heritage M16 Pillars of Creation:
   - Velvet Cosmic Obsidian & Deep Interstellar Bedrock
   - S-II / H-alpha Molten Copper & Burnished Bronze (656-672nm) Dust Towers
   - O-III Celestial Aquamarine & Ionized Turquoise (500nm) Gas Glow
   - Starlight Topaz & Pure Cosmic Silver Radiance
   ========================================================================== */

:root {
  --bg-dark: #07080d;
  --bg-surface: #0b0e17;
  --bg-card: rgba(14, 18, 29, 0.78);
  --bg-card-hover: rgba(22, 28, 44, 0.88);
  --bg-glass: rgba(11, 14, 23, 0.80);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(20, 184, 166, 0.35);
  --border-active: #14b8a6;
  --border-copper-glow: rgba(224, 122, 56, 0.35);
  --border-copper-active: #e07a38;
  
  /* Pillars of Creation Spectrum */
  --accent-copper: #e07a38;        /* S-II Molten Copper (672nm) */
  --accent-bronze: #c25e24;        /* S-II Burnished Bronze */
  --accent-topaz: #f97316;         /* S-II Spiced Starlight Topaz */
  --accent-gold: #f59e0b;          /* H-alpha Warm Starlight Gold */
  --accent-amber: #fbbf24;         /* H-alpha Ionized Amber */
  --accent-cyan: #14b8a6;          /* O-III Celestial Aquamarine (500nm) */
  --accent-oiii: #14b8a6;          /* O-III Primary */
  --accent-teal: #06b6d4;          /* O-III Deep Ionized Turquoise */
  --accent-aquamarine: #22d3ee;    /* O-III Crystalline Gas Glow */
  --accent-emerald: #10b981;       /* H-alpha green transition */
  --accent-violet: #818cf8;        /* Spectral stellar wind periwinkle */
  --accent-blue: #38bdf8;          /* Starlight Blue */
  --accent-rose: #f43f5e;          /* Shockwave emission */
  
  --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(20, 184, 166, 0.22);
  --shadow-copper: 0 0 20px rgba(224, 122, 56, 0.3);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.75);
}

/* 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-copper);
}

/* 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(20, 184, 166, 0.25), rgba(224, 122, 56, 0.22));
  border: 1px solid rgba(20, 184, 166, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22d3ee;
  box-shadow: 0 0 16px rgba(20, 184, 166, 0.25), 0 0 10px rgba(224, 122, 56, 0.2);
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-block;
  width: max-content;
  max-width: 100%;
  background: linear-gradient(105deg, #ffffff 0%, #22d3ee 35%, #e07a38 68%, #f59e0b 100%);
  -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(20, 184, 166, 0.18), rgba(224, 122, 56, 0.14));
  border: 1px solid rgba(20, 184, 166, 0.45);
  color: #22d3ee;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 14px rgba(20, 184, 166, 0.2);
}

.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(20, 184, 166, 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, #e07a38 0%, #c25e24 60%, #a34816 100%);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 14px rgba(224, 122, 56, 0.4), 0 0 18px rgba(194, 94, 36, 0.25);
  border: 1px solid rgba(249, 115, 22, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-primary,
.btn-primary *,
.btn-primary .btn-label,
.btn-primary .btn-text,
.btn-primary span,
.btn-primary i,
.btn-primary svg {
  color: #ffffff !important;
  fill: currentColor;
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f98846 0%, #e07a38 55%, #b8521d 100%);
  color: #ffffff !important;
  box-shadow: 0 0 24px rgba(224, 122, 56, 0.65), 0 0 10px rgba(249, 115, 22, 0.4);
  transform: translateY(-1px);
}

.btn-primary:hover * {
  color: #ffffff !important;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 0 12px rgba(224, 122, 56, 0.4);
}

.btn-primary:disabled,
.btn-primary.disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.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, rgba(20, 184, 166, 0.22), rgba(224, 122, 56, 0.16));
  border: 1px solid rgba(20, 184, 166, 0.45);
  color: #22d3ee;
  box-shadow: 0 0 14px rgba(20, 184, 166, 0.2);
  font-weight: 600;
}

.btn-accent * {
  color: #22d3ee;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.55);
  border-color: #06b6d4;
  transform: translateY(-1px);
}

.btn-accent:hover * {
  color: #ffffff !important;
}

button.btn-text,
a.btn-text {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}
button.btn-text:hover,
a.btn-text:hover {
  color: #ffffff;
  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-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-toggle-mobile-btn {
  display: none; /* Hidden on desktop */
}

.filter-collapsible-sections {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.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(20, 184, 166, 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(20, 184, 166, 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-copper);
  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(20, 184, 166, 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(20, 184, 166, 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:hover svg {
  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%;
}

/* Custom Canvas Photo Overlay (placed behind native Aladin GUI controls) */
#astro-canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1 !important;
}

/* Ensure Aladin Lite v3 native GUI controls & context menu sit above custom photo overlay canvas */
#aladin-container .aladin-box,
#aladin-container .aladin-location-box,
#aladin-container .aladin-layers-control,
#aladin-container .aladin-zoom-control,
#aladin-container .aladin-fov-box,
#aladin-container .aladin-scale-box,
#aladin-container .aladin-coo-box,
#aladin-container .aladin-reticle,
#aladin-container .aladin-stack-control,
#aladin-container .aladin-catalog-control,
#aladin-container .aladin-cm-box,
#aladin-container .aladin-context-menu,
#aladin-container .aladin-menu,
#aladin-container div[class*="aladin-"] {
  z-index: 60 !important;
}

/* 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);
}

/* Floating Quick Target Search Box on Map */
.map-quick-search-container {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  width: 360px;
  max-width: calc(100% - 30px);
}

.map-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(14, 18, 27, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.map-search-input-wrap:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.25);
}

.map-search-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--accent-cyan);
  pointer-events: none;
}

#map-quick-search {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 0.5rem 2rem 0.5rem 2.1rem;
  font-size: 0.8rem;
  outline: none;
}

.map-search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.map-search-clear:hover { color: var(--accent-rose); }
.map-search-clear.hidden { display: none; }

.map-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: rgba(10, 14, 23, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
}
.map-search-results.hidden { display: none; }

.map-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s ease;
}
.map-search-item:last-child { border-bottom: none; }
.map-search-item:hover { background: rgba(20, 184, 166, 0.12); }

.map-search-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}
.map-search-item-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.map-search-item-type {
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--accent-cyan);
  border: 1px solid var(--border-subtle);
}

/* Floating Target Hover Preview Tooltip */
.sky-hover-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 50;
  background: rgba(10, 14, 23, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  display: flex;
  gap: 0.6rem;
  width: 250px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), 0 0 15px rgba(20, 184, 166, 0.2);
  transition: opacity 0.15s ease;
}
.sky-hover-tooltip.hidden { opacity: 0; visibility: hidden; }

.hover-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.hover-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
}

.hover-info h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hover-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hover-badge {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

.guide-kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--accent-cyan);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

/* 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(20, 184, 166, 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-copper);
  cursor: pointer;
  height: 4px;
}

/* Utility hidden class */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Comprehensive Dynamic Responsive Suite
   Supports Desktop (Unchanged), Windows Scaling (125%-175%), Tablets & Mobile
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Windows Scaling & Medium Screens (769px to 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) and (min-width: 769px) {
  .app-header {
    padding: 0 0.85rem;
  }

  /* Hide stats badge on scaled desktop to conserve 160px width */
  .stats-badge {
    display: none !important;
  }

  .header-center {
    gap: 0.75rem;
  }

  .view-mode-tabs .tab-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .survey-dropdown {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem 0.35rem 1.65rem;
    max-width: 160px;
  }

  .header-actions {
    gap: 0.4rem;
  }

  .header-actions .btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.76rem;
    gap: 0.3rem;
  }

  /* Dynamic sidebar width under scaling */
  .sidebar {
    width: clamp(330px, 30vw, 400px);
  }

  /* Modals under scaling */
  .target-log-modal-card {
    width: 96vw;
    max-width: 1140px;
    height: 90vh;
    padding: 1rem 1.25rem;
  }

  .detail-modal-card {
    width: 96vw;
    max-width: 960px;
    padding: 1.25rem;
  }
}

/* Secondary button text label compression under 1024px */
@media (max-width: 1024px) and (min-width: 769px) {
  #btn-prep-guide .btn-label-text {
    display: none;
  }

  #btn-open-target-log .btn-label-text {
    font-size: 0.72rem;
  }

  .user-display-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------------------
   2. Mobile & Tablet Devices (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Dynamic 2-Tier Mobile Header */
  .app-header {
    height: auto !important;
    min-height: auto !important;
    padding: 0.45rem 0.65rem !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    grid-template-areas:
      "brand actions"
      "center center" !important;
    gap: 0.45rem 0.65rem !important;
    position: relative !important;
    z-index: 100 !important;
    flex-shrink: 0 !important;
    background: rgba(10, 14, 22, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
  }

  .brand {
    grid-area: brand;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
  }

  .logo-icon svg {
    width: 16px;
    height: 16px;
  }

  .brand-text h1 {
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .brand-text .subtext {
    display: none !important; /* Hide subtext on mobile */
  }

  .header-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
  }

  .header-actions .btn {
    padding: 0.38rem 0.45rem;
    font-size: 0.72rem;
    min-width: 34px;
    height: 34px;
    justify-content: center;
    border-radius: var(--radius-sm);
  }

  .header-actions .btn svg {
    width: 15px;
    height: 15px;
  }

  .header-actions .btn-label-text {
    display: none !important; /* Icon-only action buttons on mobile */
  }

  .header-center {
    grid-area: center;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    justify-content: space-between;
  }

  .stats-badge {
    display: none !important;
  }

  .survey-selector-wrapper {
    flex: 1;
    min-width: 120px;
    max-width: 160px;
  }

  .survey-dropdown {
    width: 100%;
    font-size: 0.72rem;
    padding: 0.35rem 0.45rem 0.35rem 1.65rem;
    height: 32px;
    border-radius: var(--radius-sm);
  }

  .survey-selector-wrapper .select-icon {
    left: 8px;
    width: 12px;
    height: 12px;
  }

  .view-mode-tabs {
    flex: 1.2;
    display: flex;
    justify-content: space-between;
    padding: 2px;
    height: 32px;
    border-radius: var(--radius-sm);
  }

  .view-mode-tabs .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 0.25rem 0.35rem;
    font-size: 0.68rem;
    gap: 3px;
  }

  .view-mode-tabs .tab-btn svg {
    width: 12px;
    height: 12px;
  }

  /* Dynamic Workspace Stacking on Mobile */
  .workspace {
    flex: 1 !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .workspace.view-split {
    flex-direction: column !important;
  }

  .workspace.view-split .map-viewport {
    height: 40vh !important;
    min-height: 200px !important;
    max-height: 48vh !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    position: relative !important;
    border-bottom: 1px solid var(--border-subtle);
  }

  .workspace.view-split .sidebar {
    width: 100% !important;
    height: auto !important;
    flex: 1 !important;
    min-height: 0 !important;
    border-right: none !important;
    overflow-y: auto !important;
  }

  .workspace.view-map .sidebar {
    display: none !important;
  }

  .workspace.view-map .map-viewport {
    width: 100% !important;
    height: 100% !important;
  }

  .workspace.view-gallery .map-viewport {
    display: none !important;
  }

  .workspace.view-gallery .sidebar {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-right: none !important;
    overflow-y: auto !important;
  }

  .workspace-resizer {
    display: none !important;
  }

  /* Mobile Collapsible Filter Card */
  .filter-card {
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
  }

  .filter-toggle-mobile-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    background: rgba(20, 184, 166, 0.12) !important;
    border: 1px solid rgba(20, 184, 166, 0.45) !important;
    color: var(--accent-cyan) !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 0.35rem 0.75rem !important;
    min-height: 36px !important;
    border-radius: var(--radius-sm) !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
    transition: all 0.2s ease !important;
  }

  .filter-toggle-mobile-btn * {
    pointer-events: none !important;
  }

  .filter-toggle-mobile-btn svg {
    width: 14px !important;
    height: 14px !important;
    color: var(--accent-cyan) !important;
    transition: transform 0.25s ease, color 0.2s ease !important;
  }

  .filter-toggle-mobile-btn:active,
  .filter-card.filters-expanded .filter-toggle-mobile-btn,
  .filter-toggle-mobile-btn.active {
    background: var(--accent-cyan) !important;
    color: #050811 !important;
    font-weight: 700 !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 14px rgba(20, 184, 166, 0.45) !important;
  }

  .filter-card.filters-expanded .filter-toggle-mobile-btn svg,
  .filter-toggle-mobile-btn.active svg {
    color: #050811 !important;
  }

  .filter-card.filters-expanded .filter-toggle-mobile-btn .filter-chevron,
  .filter-toggle-mobile-btn.active .filter-chevron {
    transform: rotate(180deg) !important;
  }

  .filter-collapsible-sections {
    display: none;
    flex-direction: column;
    gap: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    animation: fadeInFilters 0.25s ease;
  }

  .filter-card.filters-expanded .filter-collapsible-sections {
    display: flex !important;
  }

  @keyframes fadeInFilters {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .search-input-group input {
    font-size: 0.78rem;
    padding: 0.42rem 1.8rem 0.42rem 2rem;
  }

  /* Gallery Grid on Mobile */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 0.65rem !important;
    padding: 0.65rem !important;
  }

  .gallery-card {
    border-radius: var(--radius-sm);
  }

  .card-thumb-container {
    height: 110px;
  }

  .card-content {
    padding: 0.55rem;
    gap: 0.25rem;
  }

  .card-title {
    font-size: 0.82rem;
  }

  .card-meta-line {
    font-size: 0.68rem;
  }

  .card-actions-row {
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
  }

  .card-btn {
    font-size: 0.68rem;
    padding: 0.25rem 0.5rem;
  }

  /* Floating Sky Controls on Mobile */
  .sky-controls-floating {
    bottom: 8px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    transform: none !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
    padding: 0.35rem 0.45rem !important;
    gap: 0.35rem !important;
    background: rgba(11, 16, 26, 0.92) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: var(--radius-md) !important;
    z-index: 45 !important;
  }

  .sky-controls-floating::-webkit-scrollbar {
    display: none;
  }

  .sky-float-btn {
    font-size: 0.68rem !important;
    padding: 0.3rem 0.55rem !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
    border-radius: var(--radius-sm) !important;
  }

  .sky-float-slider-wrap {
    flex-shrink: 0 !important;
    font-size: 0.68rem !important;
    padding: 0.2rem 0.45rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .sky-float-slider {
    width: 45px !important;
  }

  .map-quick-search-container {
    top: 8px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
  }

  .map-search-input-wrap input {
    font-size: 0.78rem !important;
    padding: 0.4rem 1.8rem 0.4rem 2rem !important;
  }

  /* Modals on Mobile */
  .modal-overlay {
    padding: 0.4rem !important;
    align-items: flex-start !important;
    overflow-y: auto !important;
  }

  .modal-card {
    width: 96vw !important;
    max-width: 96vw !important;
    margin: 0.5rem auto !important;
    padding: 1.15rem 0.9rem !important;
    max-height: 94vh !important;
  }

  .modal-close {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    font-size: 1.15rem;
  }

  /* Detail Modal on Mobile */
  .detail-layout {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .image-viewer-container {
    height: clamp(200px, 30vh, 260px) !important;
  }

  .image-actions-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }

  .image-actions-bar .btn {
    flex: 1 1 calc(50% - 0.4rem) !important;
    min-width: 120px !important;
    font-size: 0.72rem !important;
    padding: 0.35rem 0.5rem !important;
    justify-content: center !important;
  }

  .detail-title-row h2 {
    font-size: 1.15rem !important;
    line-height: 1.25 !important;
  }

  .detail-subtitle {
    font-size: 0.74rem !important;
  }

  .modal-tabs {
    display: flex !important;
    width: 100% !important;
  }

  .modal-tab-btn {
    flex: 1 !important;
    font-size: 0.72rem !important;
    padding: 0.35rem 0.4rem !important;
    justify-content: center !important;
  }

  .meta-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem !important;
  }

  .meta-card {
    padding: 0.35rem 0.5rem !important;
  }

  .meta-label {
    font-size: 0.58rem !important;
  }

  .meta-val {
    font-size: 0.78rem !important;
  }

  .meta-subval {
    font-size: 0.62rem !important;
  }

  /* Form Inputs on Mobile (Prevents iOS zoom on focus) */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }

  .form-row {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
}

/* --------------------------------------------------------------------------
   3. Small Smartphone Screens (<= 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .brand-text h1 {
    font-size: 0.88rem;
  }

  .tab-btn .tab-label-text {
    display: none;
  }

  .tab-btn {
    padding: 0.3rem 0.45rem;
  }

  .tab-btn svg {
    margin-right: 0;
  }

  .survey-dropdown {
    font-size: 0.7rem;
    max-width: 130px;
  }
}

/* ==========================================================================
   User Authentication & Account Management Suite
   ========================================================================== */

/* Header Controls */
.auth-header-container {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-auth-trigger {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.2);
}

.user-menu-wrapper {
  position: relative;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(14, 18, 27, 0.8);
  border: 1px solid var(--border-glow);
  padding: 0.3rem 0.75rem 0.3rem 0.4rem;
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.15);
}

.user-profile-btn:hover {
  background: rgba(26, 35, 54, 0.95);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(20, 184, 166, 0.3);
}

.user-avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #07090e;
}

.user-avatar-badge svg {
  width: 15px;
  height: 15px;
}

.user-display-name {
  font-weight: 600;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.user-profile-btn[aria-expanded="true"] .dropdown-chevron {
  transform: rotate(180deg);
}

.user-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(20, 184, 166, 0.15);
  padding: 0.6rem;
  z-index: 1000;
  animation: dropdownFadeIn 0.18s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  padding: 0.4rem 0.6rem;
}

.user-dropdown-name {
  font-weight: 600;
  color: var(--accent-cyan);
  font-size: 0.85rem;
}

.user-dropdown-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  word-break: break-all;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.4rem 0;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.78rem;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.dropdown-item svg {
  width: 15px;
  height: 15px;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-item.logout-item {
  color: var(--accent-rose);
}

.dropdown-item.logout-item:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #ff6482;
}

/* Authentication Modal Card */
.auth-modal-card {
  width: 480px;
  max-width: 94vw;
  padding: 2rem;
  background: linear-gradient(180deg, #0e121b 0%, #07090e 100%);
  border: 1px solid var(--border-glow);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(20, 184, 166, 0.15);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-badge-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem auto;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(20, 184, 166, 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: 0 0 16px rgba(20, 184, 166, 0.25);
}

.auth-badge-icon svg {
  width: 24px;
  height: 24px;
}

.auth-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.auth-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1.25rem;
}

/* Auth Segmented Nav Tabs */
.auth-nav-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
  margin-top: 1rem;
}

.auth-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn svg {
  width: 15px;
  height: 15px;
}

.auth-tab-btn:hover {
  color: var(--text-main);
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(0, 166, 255, 0.2));
  color: var(--accent-cyan);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.15);
  font-weight: 600;
}

/* Alert Banner inside Modal */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 1.25rem;
  animation: alertFadeIn 0.2s ease;
}

@keyframes alertFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-alert svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.auth-alert.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.auth-alert.warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* Auth Tab Panes */
.auth-tab-content {
  display: none;
}

.auth-tab-content.active {
  display: block;
  animation: tabFadeIn 0.2s ease;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form Groups & Inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.required-star {
  color: var(--accent-cyan);
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap .input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 2.4rem 0.65rem 2.4rem;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(20, 184, 166, 0.04);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.25);
}

/* Prevent browser autofill from flashing stark white/light-blue background in dark mode */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-input:-webkit-autofill:active,
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0b101b inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  caret-color: #f1f5f9 !important;
  border-color: rgba(20, 184, 166, 0.4) !important;
  transition: background-color 5000s ease-in-out 0s;
}

.auth-input:focus + .input-icon,
.input-icon-wrap:focus-within .input-icon {
  color: var(--accent-cyan);
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.btn-toggle-password svg {
  width: 16px;
  height: 16px;
}

.btn-toggle-password:hover {
  color: var(--text-main);
}

.input-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.input-hint.error-text {
  color: var(--accent-rose);
}

/* Password Strength Meter */
.password-meter-wrap {
  margin-top: 4px;
}

.strength-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--text-dim);
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: var(--radius-full);
}

.strength-bar-fill.weak {
  background: var(--accent-rose);
}

.strength-bar-fill.medium {
  background: var(--accent-amber);
}

.strength-bar-fill.strong {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.strength-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* Form Actions */
.form-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-copper);
  cursor: pointer;
}

.btn-auth-submit {
  width: 100%;
  justify-content: center;
  padding: 0.72rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  margin-top: 0.6rem;
  background: linear-gradient(135deg, #e07a38 0%, #c25e24 60%, #a34816 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(224, 122, 56, 0.4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(249, 115, 22, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-auth-submit,
.btn-auth-submit *,
.btn-auth-submit .btn-label,
.btn-auth-submit .btn-text,
.btn-auth-submit svg,
.btn-auth-submit i,
.btn-auth-submit span {
  color: #ffffff !important;
  fill: #ffffff;
  font-weight: 700 !important;
}

.btn-auth-submit:hover {
  background: linear-gradient(135deg, #f98846 0%, #e07a38 55%, #b8521d 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 0 26px rgba(224, 122, 56, 0.7);
  transform: translateY(-1px);
}

.btn-auth-submit:hover * {
  color: #000000 !important;
}

.btn-auth-submit:active {
  transform: translateY(0);
}

.btn-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-footer-prompt {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.link-btn {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0.2rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: all 0.2s ease;
}

.link-btn:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

/* Activation Screen */
.activation-card {
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.activation-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem auto;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  box-shadow: 0 0 24px rgba(20, 184, 166, 0.3);
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(20, 184, 166, 0.2); }
  50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(20, 184, 166, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 15px rgba(20, 184, 166, 0.2); }
}

.activation-icon-wrap svg {
  width: 32px;
  height: 32px;
}

.activation-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.activation-msg {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.activation-email-display {
  display: inline-block;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glow);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.15);
}

.activation-instructions {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.activation-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

/* Spinner Icon */
.spin {
  animation: spinAnim 1s linear infinite;
}

@keyframes spinAnim {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Global Floating Toast */
.auth-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(20, 184, 166, 0.2);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 420px;
}

.auth-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon.success {
  color: var(--accent-cyan);
}

.toast-icon.warning {
  color: var(--accent-amber);
}

.toast-icon.error {
  color: var(--accent-rose);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.toast-close:hover {
  color: var(--text-main);
}

/* Responsive Overrides for Authentication */
@media (max-width: 768px) {
  .auth-modal-card {
    padding: 1.5rem 1rem;
  }
  
  .auth-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}

/* ==========================================================================
   User FITS Observation Upload & Community Gallery Styles
   ========================================================================== */

/* Header Upload Button */
.btn-upload-trigger {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

/* Sidebar Quick Filter Button ("My Uploads") */
.filter-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.2);
  color: var(--accent-cyan);
  transition: all 0.2s ease;
}

.filter-quick-btn svg {
  width: 12px;
  height: 12px;
}

.filter-quick-btn:hover {
  background: rgba(20, 184, 166, 0.2);
  border-color: var(--accent-cyan);
  text-decoration: none;
}

.filter-quick-btn.active {
  background: var(--accent-cyan);
  color: #07090e;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.4);
}

/* Author Tag Pill on Photo Cards */
.pill-author-btn {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-main);
  transition: all 0.2s ease;
}

.pill-author-btn:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: var(--accent-violet);
  color: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.pill-author-btn svg {
  width: 12px;
  height: 12px;
}

/* Upload Modal Card */
.upload-modal-card {
  width: 640px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  background: linear-gradient(180deg, #0e121b 0%, #07090e 100%);
  border: 1px solid var(--border-glow);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(168, 85, 247, 0.15);
}

/* Non-FITS / Plate Solving Notice Banner */
.non-fits-notice {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(20, 184, 166, 0.12));
  border: 1px solid rgba(20, 184, 166, 0.4);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.15);
  animation: fadeInNotice 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInNotice {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.non-fits-notice-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.35);
}

.non-fits-notice-icon svg {
  width: 18px;
  height: 18px;
}

.non-fits-notice-content h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.non-fits-notice-content p {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.non-fits-notice-content strong {
  color: var(--accent-cyan);
}

/* Form Section Dividers */
.upload-section-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.35rem 0 0.1rem 0;
}

.upload-section-divider span {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.upload-section-divider::before,
.upload-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(20, 184, 166, 0.25), transparent);
}

.input-hint-tag {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.upload-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.upload-badge-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem auto;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(20, 184, 166, 0.2));
  border: 1px solid var(--accent-violet);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-violet);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.3);
}

.upload-badge-icon svg {
  width: 24px;
  height: 24px;
}

.upload-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.upload-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* FITS Drag & Drop Zone */
.fits-drop-zone {
  border: 2px dashed rgba(20, 184, 166, 0.3);
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.fits-drop-zone:hover,
.fits-drop-zone.drag-active {
  border-color: var(--accent-cyan);
  background: rgba(20, 184, 166, 0.06);
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.2);
  transform: translateY(-1px);
}

.drop-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
  transition: transform 0.2s ease;
}

.fits-drop-zone:hover .drop-icon {
  transform: scale(1.1);
}

.drop-icon svg {
  width: 20px;
  height: 20px;
}

.drop-text-primary {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.drop-text-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.sample-fits-btn {
  margin-top: 8px;
  background: rgba(20, 184, 166, 0.08);
  border: 1px dashed rgba(20, 184, 166, 0.4);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.8rem;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.sample-fits-btn:hover {
  background: rgba(20, 184, 166, 0.18);
  border-style: solid;
  color: #ffffff;
}

.sample-fits-btn svg {
  width: 13px;
  height: 13px;
}

/* Selected File Pill */
.selected-file-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.1);
}

.selected-file-pill.sub-pill {
  border-color: var(--border-subtle);
  padding: 0.5rem 0.8rem;
  margin-top: 0.4rem;
}

.file-pill-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.file-pill-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.file-pill-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-pill-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.file-pill-size {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.file-pill-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s ease;
}

.file-pill-remove:hover {
  color: var(--accent-rose);
}

.custom-file-input {
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Upload Progress Display */
.upload-progress-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

.progress-status-text {
  color: var(--accent-cyan);
  font-weight: 500;
}

.progress-pct-badge {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 600;
}

.progress-fill-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.5);
  transition: width 0.2s ease;
}

/* Upload Modal Enhanced Select, Detection Badges & Mismatch Cards */
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.meta-status-badge {
  font-size: 0.72rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.meta-status-badge.detected {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.meta-status-badge.missing {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.select-with-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-with-icon-wrap .input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
  z-index: 2;
}

.auth-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 2rem 0.65rem 2.4rem;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s ease;
}

.auth-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(20, 184, 166, 0.04);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.25);
}

.auth-select option {
  background: #090e18;
  color: #f1f5f9;
  padding: 8px 12px;
}

.select-chevron {
  position: absolute;
  right: 12px;
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

.mismatch-card {
  margin-top: 6px;
  padding: 0.65rem 0.8rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.77rem;
  animation: alertFadeIn 0.2s ease;
}

.mismatch-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #fde68a;
  line-height: 1.35;
}

.mismatch-header svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #fbbf24;
}

.mismatch-header strong {
  color: #ffffff;
  font-weight: 600;
}

.mismatch-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-mismatch-add {
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-size: 0.74rem;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-mismatch-add svg {
  width: 12px;
  height: 12px;
}

.btn-mismatch-add:hover {
  background: var(--accent-cyan);
  color: #050811;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.3);
}

.btn-mismatch-correct {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.74rem;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-mismatch-correct svg {
  width: 12px;
  height: 12px;
}

.btn-mismatch-correct:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #ffffff;
}

.custom-add-row {
  margin-top: 6px;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  animation: alertFadeIn 0.2s ease;
}

.custom-add-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  color: #f1f5f9;
  font-size: 0.8rem;
  font-family: var(--font-main);
}

.custom-add-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.3);
}

.btn-custom-add-confirm {
  background: linear-gradient(135deg, #e07a38, #c25e24);
  color: #ffffff !important;
  font-weight: 700;
  border: 1px solid rgba(249, 115, 22, 0.5);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-custom-add-confirm:hover {
  background: linear-gradient(135deg, #f98846, #e07a38);
  box-shadow: 0 0 14px rgba(224, 122, 56, 0.5);
}

.btn-custom-add-cancel {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-custom-add-cancel:hover {
  color: #ffffff;
  border-color: var(--text-muted);
}

@media (max-width: 768px) {
  .upload-modal-card,
  .edit-tags-modal-card {
    padding: 1.5rem 1rem;
  }
}

/* Detail Title Row & Fix Tags Trigger */
.detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.detail-title-row h2 {
  margin-bottom: 0;
}

/* Fix Tags Button in Detail Modal (Below Image Actions Bar) */
.btn-edit-tags-detail {
  background: rgba(168, 85, 247, 0.2) !important;
  border: 1px solid rgba(168, 85, 247, 0.5) !important;
  color: #d8b4fe !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-edit-tags-detail:hover {
  background: rgba(168, 85, 247, 0.35) !important;
  border-color: #e9d5ff !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
  transform: translateY(-1px);
}

.btn-edit-tags-detail svg {
  width: 14px;
  height: 14px;
}

/* Edit Tags Modal Card */
.edit-tags-modal-card {
  width: 550px;
  max-width: 95vw;
  padding: 2rem;
  background: linear-gradient(180deg, #0e121b 0%, #07090e 100%);
  border: 1px solid var(--border-glow);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(168, 85, 247, 0.15);
}

.edit-tags-preview-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.edit-tags-thumb-img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(20, 184, 166, 0.3);
  background: #020617;
}

.edit-tags-preview-info {
  flex: 1;
}

.preview-note {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 0.15rem;
}

.preview-tip {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
}

.edit-tags-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Fix Location Button in Detail Modal */
.btn-solve-detail {
  background: rgba(20, 184, 166, 0.15) !important;
  border: 1px solid rgba(20, 184, 166, 0.45) !important;
  color: #67e8f9 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-solve-detail:hover {
  background: rgba(20, 184, 166, 0.3) !important;
  border-color: #a5f3fc !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(20, 184, 166, 0.4);
  transform: translateY(-1px);
}

.btn-solve-detail svg {
  width: 14px;
  height: 14px;
}

/* Invert / Rotate 180° Button in Detail Modal */
.btn-rotate-detail {
  background: rgba(224, 122, 56, 0.15) !important;
  border: 1px solid rgba(224, 122, 56, 0.45) !important;
  color: #fb923c !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-rotate-detail:hover {
  background: rgba(224, 122, 56, 0.3) !important;
  border-color: #fdba74 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(224, 122, 56, 0.4);
  transform: translateY(-1px);
}

.btn-rotate-detail svg {
  width: 14px;
  height: 14px;
}


#plate-solve-modal,
#edit-tags-modal {
  z-index: 200 !important;
}

/* Plate Solving Modal Card */
.plate-solve-modal-card {
  width: 620px;
  max-width: 95vw;
  padding: 2rem;
  background: linear-gradient(180deg, #0b111a 0%, #06090e 100%);
  border: 1px solid rgba(20, 184, 166, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 35px rgba(20, 184, 166, 0.15);
}

.plate-solve-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plate-solve-preview-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.plate-solve-thumb-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(20, 184, 166, 0.3);
  background: #020617;
}

.plate-solve-preview-info {
  flex: 1;
}

.preview-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.15rem;
}

.preview-curr-coords {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.preview-curr-coords strong {
  color: #94a3b8;
}

/* Plate Solve Target/Coordinate Hint Field */
.plate-solve-hint-wrap {
  margin-bottom: 1.25rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.plate-solve-hint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.plate-solve-hint-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plate-solve-hint-label svg {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

.plate-solve-hint-badge {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  background: rgba(20, 184, 166, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(20, 184, 166, 0.25);
}

.plate-solve-hint-inner {
  position: relative;
  width: 100%;
}

.plate-solve-hint-input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  background: rgba(4, 8, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #f1f5f9;
  font-family: inherit;
  transition: all 0.2s ease;
}

.plate-solve-hint-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(20, 184, 166, 0.04);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.25);
}

.plate-solve-hint-subtext {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.45rem;
  line-height: 1.35;
}

.plate-solve-hint-subtext i {
  vertical-align: -2px;
  color: var(--accent-cyan);
}

.plate-solve-hint-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.hint-chip:hover {
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

.hint-chip.active {
  background: rgba(20, 184, 166, 0.2);
  border-color: var(--accent-cyan);
  color: #38bdf8;
  font-weight: 600;
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.25);
}

.hint-chip-feature {
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.hint-chip-raw {
  opacity: 0.75;
  font-size: 0.68rem;
  border-style: dashed;
}

/* Stepper */
.solve-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 0 0.5rem;
}

.solve-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.solve-step.active {
  opacity: 1;
}

.solve-step.active .step-num {
  background: rgba(20, 184, 166, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.4);
}

.solve-step.completed .step-num {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #22c55e;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step-num svg {
  width: 15px;
  height: 15px;
}

.step-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

.solve-step.active .step-label {
  color: #ffffff;
}

.step-divider {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 0.5rem -1rem;
}

/* Status / Radar Box */
.solve-status-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.25rem;
  background: rgba(10, 16, 26, 0.9);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.radar-container {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(20, 184, 166, 0.4);
  position: relative;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.15) 0%, transparent 70%);
  flex-shrink: 0;
}

.radar-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border-top: 2px solid var(--accent-cyan);
  animation: radarRotate 2s linear infinite;
  opacity: 0.6;
}

@keyframes radarRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.radar-center-blip {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: radarPulse 1.2s ease-in-out infinite alternate;
}

@keyframes radarPulse {
  from { opacity: 0.4; transform: translate(-50%, -50%) scale(0.8); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
}

.solve-status-text-wrap {
  flex: 1;
}

.status-headline {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.2rem;
}

.status-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* 3-Tier Plate Solving Cascade Indicator */
.solve-tiers-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  background: rgba(13, 20, 32, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 1.15rem;
}

.tier-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  transition: all 0.25s ease;
  user-select: none;
}

.tier-badge .tier-num {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.tier-badge .tier-name {
  font-size: 0.73rem;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tier-badge .tier-name svg {
  width: 12px;
  height: 12px;
}

.tier-arrow {
  color: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.tier-arrow svg {
  width: 13px;
  height: 13px;
}

/* Active Tier */
.tier-badge.active {
  background: rgba(20, 184, 166, 0.16);
  border-color: rgba(20, 184, 166, 0.55);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.25);
}

.tier-badge.active .tier-num {
  color: var(--accent-cyan);
}

.tier-badge.active .tier-name {
  color: #ffffff;
}

/* Solved / Success Tier */
.tier-badge.success {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.tier-badge.success .tier-num {
  color: #34d399;
}

.tier-badge.success .tier-name {
  color: #ffffff;
}

/* Inconclusive / Skipped Tier */
.tier-badge.inconclusive {
  opacity: 0.5;
  border-color: rgba(239, 68, 68, 0.35);
}

.tier-badge.inconclusive .tier-num {
  color: #f87171;
}

/* Solved Results Panel */
.solve-results-panel {
  padding: 1rem 1.25rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #34d399;
  margin-bottom: 0.85rem;
}

.results-header svg {
  width: 16px;
  height: 16px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.result-card {
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
}

.res-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.res-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}

.res-val.highlight {
  color: var(--accent-cyan);
}

.res-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.fits-write-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding: 0.4rem 0.65rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  color: #86efac;
}

.fits-write-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.plate-solve-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Astrometry.net API Key Configuration Drawer */
.astrometry-config-wrap {
  margin-bottom: 1.25rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  transition: all 0.25s ease;
}

.astrometry-config-wrap:focus-within {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.astrometry-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.astrometry-config-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.astrometry-config-title svg {
  width: 14px;
  height: 14px;
}

.badge-opt {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  font-size: 0.65rem;
  color: #fde68a;
  text-transform: none;
}

.astrometry-help-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #38bdf8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.astrometry-help-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.astrometry-help-link svg {
  width: 11px;
  height: 11px;
}

.astrometry-key-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.astrometry-input-inner {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.astrometry-key-icon {
  position: absolute;
  left: 0.75rem;
  width: 14px;
  height: 14px;
  color: #64748b;
  pointer-events: none;
}

.astrometry-key-input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2.2rem;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #f1f5f9;
  font-size: 0.82rem;
  font-family: var(--font-mono, monospace);
  transition: all 0.2s ease;
}

.astrometry-key-input:focus {
  outline: none;
  border-color: #fbbf24;
  background: rgba(2, 6, 23, 0.95);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.btn-key-eye {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.btn-key-eye:hover {
  color: #ffffff;
}

.btn-key-eye svg {
  width: 14px;
  height: 14px;
}

.astrometry-key-subtext {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.4rem;
}

/* Shake animation for missing key */
@keyframes shakeKey {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.input-shake {
  animation: shakeKey 0.4s ease-in-out;
  border-color: #f43f5e !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.4) !important;
}

/* Guaranteed Deep Background Solve Card */
.deep-solve-card {
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.04) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(245, 158, 11, 0.05);
  animation: fadeInDeep 0.3s ease-out;
}

@keyframes fadeInDeep {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.deep-solve-card-inner {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.deep-solve-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.deep-solve-icon-box svg {
  width: 20px;
  height: 20px;
}

.deep-solve-text-box {
  flex: 1;
}

.deep-solve-headline {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fef3c7;
  margin-bottom: 0.25rem;
}

.deep-solve-desc {
  font-size: 0.78rem;
  color: #d1d5db;
  line-height: 1.45;
  margin: 0;
}

.deep-solve-card-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-deep-solve {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-deep-solve:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

/* Floating Background Plate Solve Notification Pill */
.bg-solve-pill {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 999;
  max-width: 420px;
  background: rgba(11, 17, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 40px;
  padding: 0.55rem 0.85rem 0.55rem 0.75rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(245, 158, 11, 0.2);
  animation: slideUpPill 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

@keyframes slideUpPill {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.bg-solve-pill.success {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(34, 197, 94, 0.3);
}

.bg-solve-pill.error {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(239, 68, 68, 0.3);
}

.bg-solve-pill-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bg-solve-pill-radar {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bg-solve-pill.success .bg-solve-pill-radar {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
}

.bg-solve-radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  animation: pillPulse 1.2s ease-in-out infinite alternate;
}

.bg-solve-pill.success .bg-solve-radar-dot {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: none;
}

@keyframes pillPulse {
  from { transform: scale(0.7); opacity: 0.5; }
  to { transform: scale(1.3); opacity: 1; }
}

.bg-solve-pill-content {
  flex: 1;
  min-width: 160px;
}

.bg-solve-pill-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.bg-solve-pill-subtext {
  display: block;
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-top: 0.1rem;
  line-height: 1.2;
}

.bg-solve-action-btn,
.bg-solve-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #cbd5e1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.bg-solve-action-btn:hover,
.bg-solve-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.bg-solve-action-btn svg {
  width: 12px;
  height: 12px;
}


/* Delete Confirmation Modal & Delete Button Styles */
.btn-danger {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.35) !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.3);
}

.delete-modal-card {
  max-width: 480px;
  width: 90%;
  padding: 1.75rem;
  background: #0f172a;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-lg);
  text-align: center;
}

.delete-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
}

.delete-icon-wrap svg {
  width: 26px;
  height: 26px;
}

.delete-modal-card h3 {
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.delete-modal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.delete-target-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  text-align: left;
}

.delete-target-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.delete-target-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.delete-target-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delete-target-sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

.delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ==========================================================================
   Celestial Features & Cross-Catalog Tagging Styles
   ========================================================================== */

.meta-features-section {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.meta-features-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-features-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
}

.meta-features-title svg {
  width: 15px;
  height: 15px;
  color: var(--accent-cyan);
}

.meta-features-count {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(20, 184, 166, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.meta-features-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.feature-pill:hover {
  background: rgba(20, 184, 166, 0.12);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(20, 184, 166, 0.25);
  color: #ffffff;
}

.feature-pill-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.feature-pill-name {
  font-weight: 600;
  color: #f8fafc;
}

.feature-pill-type {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.22);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.35);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.feature-pill-catalogs {
  font-size: 0.7rem;
  color: #94a3b8;
  font-family: monospace;
}

.feature-pill-empty {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 0.4rem 0;
  font-style: italic;
}

/* Gallery Card Features & Match Badges */
.card-features-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.card-feature-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #c084fc;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-feature-badge svg {
  width: 11px;
  height: 11px;
  color: #c084fc;
  flex-shrink: 0;
}

.card-match-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(20, 184, 166, 0.18);
  border: 1px solid rgba(20, 184, 166, 0.45);
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  text-shadow: 0 0 6px rgba(20, 184, 166, 0.35);
}

.card-match-badge svg {
  width: 11px;
  height: 11px;
  color: #38bdf8;
  flex-shrink: 0;
}

/* Map Quick Search Result Matched Feature */
.map-search-matched-feature {
  font-size: 0.68rem;
  color: #38bdf8;
  background: rgba(20, 184, 166, 0.14);
  border: 1px solid rgba(20, 184, 166, 0.3);
  padding: 1px 6px;
  border-radius: 9999px;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.map-search-matched-feature svg {
  width: 10px;
  height: 10px;
  color: #38bdf8;
}

/* ==========================================================================
   Photographed Targets Log & Integration Portfolio Modal Styles
   ========================================================================== */

.target-log-modal-card {
  width: 1180px;
  max-width: 96vw;
  height: 90vh;
  max-height: 92vh;
  padding: 1.15rem 1.4rem;
  background: linear-gradient(180deg, #0d121e 0%, #080a11 100%);
  border: 1px solid rgba(20, 184, 166, 0.25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(20, 184, 166, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.target-log-header {
  text-align: center;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
  position: relative;
}

.target-log-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  display: inline-block;
  width: max-content;
  max-width: 100%;
  background: linear-gradient(105deg, #ffffff 0%, #22d3ee 35%, #e07a38 68%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0;
  line-height: 1.25;
}

/* Top Statistics Banner */
.target-log-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .target-log-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .target-log-stats-bar {
    grid-template-columns: 1fr;
  }
}

.target-stat-item {
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  cursor: pointer;
  user-select: none;
}

.target-stat-item:hover {
  background: rgba(24, 32, 50, 0.92);
  border-color: rgba(20, 184, 166, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 0 10px rgba(20, 184, 166, 0.15);
}

.target-stat-item.highlight-cyan {
  border-color: rgba(20, 184, 166, 0.35);
  background: linear-gradient(135deg, rgba(18, 24, 38, 0.9) 0%, rgba(20, 184, 166, 0.08) 100%);
  box-shadow: 0 0 15px rgba(20, 184, 166, 0.08);
}

.target-stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.target-stat-icon svg {
  width: 14px;
  height: 14px;
}

.target-stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.target-stat-value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.highlight-cyan .target-stat-value {
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(20, 184, 166, 0.4);
}

.target-stat-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
  margin-top: 1px;
}

.target-stat-label .stat-subtext {
  font-size: 0.82em;
  color: var(--accent-cyan);
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 0.2rem;
}


/* Controls Bar */
.target-log-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  background: rgba(14, 18, 27, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}

.target-log-search-wrap {
  position: relative;
  flex: 2;
  min-width: 240px;
  display: flex;
  align-items: center;
}

.target-search-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.target-log-search-input {
  width: 100%;
  background: rgba(8, 11, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.45rem 1.8rem 0.45rem 2rem;
  color: var(--text-main);
  font-size: 0.82rem;
  outline: none;
  transition: all 0.2s ease;
}

.target-log-search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.25);
}

.target-search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
}

.target-search-clear:hover {
  color: var(--accent-rose);
}

.target-search-clear.hidden {
  display: none;
}

.target-log-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 180px;
}

.target-select-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
  pointer-events: none;
}

.target-log-select {
  width: 100%;
  background: rgba(8, 11, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  color: var(--text-main);
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.target-log-select:focus {
  border-color: var(--accent-cyan);
}

.target-log-select option {
  background: #0d121e;
  color: #fff;
}

/* View Context Label Bar */
.target-log-view-label-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.target-log-scope-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.target-log-scope-text strong {
  color: var(--accent-cyan);
}

.target-log-scope-text svg {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

.target-log-hint-text {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text-dim);
}

.target-log-hint-text svg {
  width: 13px;
  height: 13px;
}

/* Grid Container */
.target-log-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  grid-auto-rows: max-content;
  align-items: start;
  gap: 1.25rem;
  padding-right: 8px;
  padding-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .target-log-grid {
    grid-template-columns: 1fr;
  }
}

/* Empty State */
.target-log-empty-state {
  grid-column: 1 / -1;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.target-log-empty-state .empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.target-log-empty-state .empty-state-icon svg {
  width: 32px;
  height: 32px;
}

.target-log-empty-state h4 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.35rem;
}

/* Target Log Card */
.target-log-card {
  background: rgba(14, 18, 27, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  position: relative;
}

.target-log-card:hover {
  transform: translateY(-3px);
  border-color: rgba(20, 184, 166, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(20, 184, 166, 0.15);
  background: rgba(18, 24, 38, 0.95);
}

/* Thumbnail Wrap */
.target-log-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 180px;
  flex-shrink: 0;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.target-log-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 0 0;
  --tx: 0%;
  --ty: 0%;
  --scale: 1;
  --hover-boost: 1;
  transform: translate(var(--tx, 0%), var(--ty, 0%)) scale(calc(var(--scale, 1) * var(--hover-boost, 1)));
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  display: block;
}

.target-log-card:hover .target-log-card-thumb {
  --hover-boost: 1.025;
}

/* Reticle / Finder Scope Overlay on Centered Object */
.target-card-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.75;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), left 0.45s cubic-bezier(0.16, 1, 0.3, 1), top 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.target-log-card:hover .target-card-reticle {
  opacity: 0.95;
  transform: translate(-50%, -50%) scale(1.08);
}

.target-card-reticle.is-full-fov {
  opacity: 0.85;
}

.target-card-reticle.is-full-fov .reticle-ring {
  border-style: dashed;
  animation: reticlePulse 2s infinite ease-in-out;
}

@keyframes reticlePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(20, 184, 166, 0.5);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 16px rgba(20, 184, 166, 0.85);
  }
}

.target-card-reticle.reticle-hidden {
  opacity: 0 !important;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.7);
}

.reticle-ring {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(20, 184, 166, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.5), inset 0 0 6px rgba(20, 184, 166, 0.25);
}

.reticle-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #f97316;
  border-radius: 50%;
  box-shadow: 0 0 8px #e07a38, 0 0 2px #ffffff;
}

.reticle-crosshair {
  position: absolute;
  background: rgba(20, 184, 166, 0.85);
  box-shadow: 0 0 4px rgba(20, 184, 166, 0.6);
}

.reticle-crosshair.ch-top {
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  height: 8px;
}

.reticle-crosshair.ch-bottom {
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  height: 8px;
}

.reticle-crosshair.ch-left {
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 1.5px;
}

.reticle-crosshair.ch-right {
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 1.5px;
}

.reticle-target-name {
  position: absolute;
  top: 48px;
  white-space: nowrap;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(7, 9, 14, 0.88);
  border: 1px solid rgba(20, 184, 166, 0.4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  padding: 1.5px 7px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.target-log-card:hover .reticle-target-name {
  opacity: 1;
  transform: translateY(0);
}

.target-card-reticle.label-above .reticle-target-name {
  top: auto;
  bottom: 48px;
}

/* Card Zoom Toggle Button */
.btn-target-card-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(20, 184, 166, 0.45);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.btn-target-card-zoom:hover {
  background: rgba(20, 184, 166, 0.22);
  border-color: #00e5ff;
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(20, 184, 166, 0.45);
}

.btn-target-card-zoom svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.btn-target-card-zoom.is-full-fov {
  border-color: rgba(255, 255, 255, 0.25);
  color: #94a3b8;
  background: rgba(12, 16, 24, 0.85);
}

.btn-target-card-zoom.is-full-fov:hover {
  border-color: rgba(20, 184, 166, 0.5);
  color: #fff;
  background: rgba(20, 184, 166, 0.15);
}

/* Badges on Thumbnail */
.target-card-top-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  z-index: 3;
  max-width: calc(100% - 130px);
  pointer-events: none;
}

.target-badge-type {
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(20, 184, 166, 0.4);
  color: #38bdf8;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.target-badge-type svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.target-badge-constellation {
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.target-badge-constellation svg {
  width: 11px;
  height: 11px;
  color: var(--accent-violet);
}

/* Big Glowing Total Exposure Badge */
.target-badge-total-exposure {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(7, 9, 14, 0.9);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--accent-cyan);
  color: #38bdf8;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 14px rgba(20, 184, 166, 0.45);
  text-shadow: 0 0 8px rgba(20, 184, 166, 0.5);
  z-index: 2;
}

.target-badge-total-exposure svg {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

.target-badge-sessions {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  padding: 0.22rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
}

.target-badge-sessions svg {
  width: 12px;
  height: 12px;
  color: var(--accent-violet);
}

/* Card Body */
.target-log-card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 280px;
}

.target-card-header-row {
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.target-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.target-card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Observation Dates Timeline Section */
.target-card-dates-section {
  margin-bottom: 1rem;
  background: rgba(8, 11, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 0.7rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 110px;
}

.target-dates-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.55rem;
  flex-shrink: 0;
}

.target-dates-section-title svg {
  width: 13px;
  height: 13px;
  color: var(--accent-cyan);
}

.target-dates-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
  padding-right: 2px;
}

.target-session-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
  font-size: 0.73rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.target-session-chip:hover {
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.45);
  color: #fff;
  transform: translateY(-1px);
}

.target-session-chip.active {
  background: rgba(20, 184, 166, 0.22);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.35);
  transform: translateY(-1px);
}

.target-session-chip.active .session-chip-badge {
  background: var(--accent-cyan);
  color: #07090e;
  font-weight: 700;
}

.target-active-session-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  max-width: 175px;
  background: rgba(7, 9, 14, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(20, 184, 166, 0.5);
  color: #38bdf8;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 3;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.25);
  pointer-events: none;
  transition: all 0.2s ease;
}

.target-active-session-pill .active-session-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-active-session-pill svg {
  width: 12px;
  height: 12px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.session-selected-hint {
  color: var(--accent-cyan);
  font-weight: 600;
  margin-left: 4px;
}

.dates-click-hint {
  color: var(--accent-cyan);
  text-transform: none;
  font-weight: 500;
  font-size: 0.68rem;
  opacity: 0.85;
}

.target-session-chip svg {
  width: 12px;
  height: 12px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.session-chip-date {
  font-weight: 600;
  color: #f1f5f9;
}

.session-chip-badge {
  background: rgba(20, 184, 166, 0.14);
  color: #38bdf8;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.68rem;
  font-weight: 600;
}

.session-chip-filter {
  color: #94a3b8;
  font-size: 0.68rem;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 5px;
}

/* Card Actions */
.target-card-actions {
  margin-top: auto;
  display: flex;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.target-card-actions .btn {
  flex: 1;
  font-size: 0.75rem;
  padding: 0.4rem 0.5rem;
  justify-content: center;
}

.target-card-actions .btn svg {
  width: 13px;
  height: 13px;
}

/* Sidebar Quick Link Button */
.sidebar-target-log-btn {
  width: 100%;
  margin-top: 0.6rem;
  margin-bottom: 0.25rem;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(20, 184, 166, 0.08);
  border-color: rgba(20, 184, 166, 0.25);
  color: #38bdf8;
}

.sidebar-target-log-btn:hover {
  background: rgba(20, 184, 166, 0.18);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.2);
}

/* Grouping Mode Toolbar & Category Quick Filters */
.target-log-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex-shrink: 0;
}

.target-group-mode-toggle {
  display: inline-flex;
  background: rgba(8, 11, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.target-mode-btn {
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.target-mode-btn svg {
  width: 13px;
  height: 13px;
}

.target-mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.target-mode-btn.active {
  background: var(--accent-cyan);
  color: #07090e;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.35);
}

.target-mode-btn.active svg {
  color: #07090e;
}

.target-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.target-cat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.73rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.target-cat-pill svg {
  width: 12px;
  height: 12px;
}

.target-cat-pill:hover {
  background: rgba(20, 184, 166, 0.1);
  border-color: rgba(20, 184, 166, 0.3);
  color: #fff;
}

.target-cat-pill.active {
  background: rgba(20, 184, 166, 0.18);
  border-color: var(--accent-cyan);
  color: #38bdf8;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.25);
}

/* Catalog Designations Chips on Card */
.target-catalogs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0.35rem;
  margin-bottom: 0.4rem;
}

.target-catalog-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

/* Object Type Badge Variants */
.badge-type-star {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.65) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.badge-type-star svg {
  width: 11px;
  height: 11px;
  color: #fbbf24;
}

.badge-type-nebula {
  background: rgba(6, 182, 212, 0.18) !important;
  border-color: rgba(6, 182, 212, 0.6) !important;
  color: #22d3ee !important;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.25);
}

.badge-type-galaxy {
  background: rgba(168, 85, 247, 0.18) !important;
  border-color: rgba(168, 85, 247, 0.65) !important;
  color: #c084fc !important;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.25);
}

.badge-type-cluster {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  color: #34d399 !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.badge-type-remnant {
  background: rgba(244, 63, 94, 0.18) !important;
  border-color: rgba(244, 63, 94, 0.6) !important;
  color: #fb7185 !important;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.25);
}

.target-card-coords {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #94a3b8;
  margin-right: 6px;
}

/* Layout Display Mode Switcher (List vs Grid) */
.target-layout-mode-toggle {
  display: inline-flex;
  background: rgba(8, 11, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  margin-left: auto;
}

/* Layout Overrides when in List or Drilldown mode */
.target-log-grid.is-list-view,
.target-log-grid.is-drilldown-view {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.target-log-list,
.target-drilldown-container {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ========================================================
   TARGET LOG: LIST VIEW STYLES
   ======================================================== */
.target-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.target-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: rgba(13, 18, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.target-list-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.2s ease;
}

.target-list-row:hover {
  background: rgba(19, 27, 46, 0.95);
  border-color: rgba(20, 184, 166, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 0 15px rgba(20, 184, 166, 0.12);
}

.target-list-row:hover::before {
  background: var(--accent-cyan);
}

.target-list-left-wrap {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex: 1;
  min-width: 0;
}

.target-list-avatar-wrap {
  width: 140px;
  height: 105px;
  min-width: 140px;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #080c14;
  flex-shrink: 0;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.target-list-row:hover .target-list-avatar-wrap {
  border-color: rgba(20, 184, 166, 0.45);
  box-shadow: 0 0 16px rgba(20, 184, 166, 0.2);
}

.target-list-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 0 0;
  display: block;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.target-list-avatar-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
}

.target-list-avatar-badge svg {
  width: 12px !important;
  height: 12px !important;
}

.target-list-col-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.target-list-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.target-list-title {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-list-sub-row {
  font-size: 0.77rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-list-coords {
  font-family: var(--font-mono);
  color: #94a3b8;
  font-size: 0.73rem;
}

.target-list-equip {
  color: #cbd5e1;
}

.target-list-catalogs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Observation Session Chips inside List View */
.target-list-sessions-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.target-list-sessions-prefix {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
}

.target-list-sessions-prefix svg {
  width: 11px !important;
  height: 11px !important;
  color: var(--accent-cyan);
}

.target-list-sessions-chips .target-session-chip {
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.18s ease;
}

.target-list-sessions-chips .target-session-chip:hover {
  background: rgba(20, 184, 166, 0.16);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: translateY(-1px);
}

.target-list-sessions-chips .target-session-chip.active {
  background: rgba(20, 184, 166, 0.24);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.35);
}

.target-list-sessions-chips .target-session-chip.active .session-chip-badge {
  background: var(--accent-cyan);
  color: #07090e;
  font-weight: 700;
}

.target-list-sessions-chips .target-session-chip svg {
  width: 11px !important;
  height: 11px !important;
  color: var(--accent-cyan);
}

.target-list-sessions-chips .session-chip-date {
  font-weight: 600;
}

.target-list-sessions-chips .session-chip-badge {
  background: rgba(20, 184, 166, 0.12);
  color: #38bdf8;
  border-radius: 3px;
  padding: 0 4px;
  font-size: 0.66rem;
  font-weight: 600;
}

.target-list-sessions-chips .session-chip-filter {
  color: #94a3b8;
  font-size: 0.66rem;
}

.target-list-right-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding-left: 0.95rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.target-list-col-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  text-align: right;
}

.target-list-stat-exposure {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(20, 184, 166, 0.3);
}

.target-list-stat-exposure svg {
  width: 12px !important;
  height: 12px !important;
  color: var(--accent-cyan);
}

.target-list-stat-sessions {
  font-size: 0.71rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 3px;
}

.target-list-stat-sessions svg {
  width: 11px !important;
  height: 11px !important;
}

.target-list-stat-dates {
  font-size: 0.67rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 3px;
}

.target-list-stat-dates svg {
  width: 10px !important;
  height: 10px !important;
}

.target-list-col-action {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.btn-target-open-tile {
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.35);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-target-open-tile svg {
  width: 12px !important;
  height: 12px !important;
  transition: transform 0.2s ease;
}

.target-list-row:hover .btn-target-open-tile {
  background: var(--accent-cyan);
  color: #07090e;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.35);
}

.target-list-row:hover .btn-target-open-tile svg {
  transform: translateX(2px);
  color: #07090e;
}

/* ========================================================
   TARGET LOG: DRILL-DOWN TILES VIEW STYLES
   ======================================================== */
.target-drilldown-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.target-drilldown-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: rgba(13, 18, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.btn-back-to-list {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back-to-list svg {
  width: 15px;
  height: 15px;
  color: var(--accent-cyan);
  transition: transform 0.2s ease;
}

.btn-back-to-list:hover {
  background: rgba(20, 184, 166, 0.16);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.btn-back-to-list:hover svg {
  transform: translateX(-3px);
}

.target-drilldown-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.crumb-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.crumb-link:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.crumb-separator {
  width: 14px;
  height: 14px;
  color: #64748b;
}

.crumb-current {
  color: #ffffff;
  font-weight: 600;
}

.target-drilldown-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.3);
  color: #38bdf8;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.target-drilldown-stats-badge svg {
  width: 13px;
  height: 13px;
  color: var(--accent-cyan);
}

.target-drilldown-stats-badge strong {
  color: #ffffff;
  font-family: var(--font-mono);
}

.target-drilldown-featured-tile-wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.target-session-tiles-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.target-drilldown-section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-left svg {
  width: 17px;
  height: 17px;
  color: var(--accent-cyan);
}

.section-title-left h4 {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.section-title-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.section-title-hint {
  font-size: 0.74rem;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.section-title-hint svg {
  width: 12px;
  height: 12px;
}

.target-session-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.target-session-tile-card {
  background: rgba(13, 18, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.22s ease;
  cursor: pointer;
  position: relative;
}

.target-session-tile-card:hover {
  border-color: rgba(20, 184, 166, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(20, 184, 166, 0.15);
}

.target-session-tile-card.is-active-session {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 18px rgba(20, 184, 166, 0.35);
  background: rgba(15, 25, 45, 0.95);
}

.session-tile-thumb-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  background: #080c14;
  overflow: hidden;
}

.session-tile-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 0 0;
  transition: opacity 0.2s ease, transform 0.4s ease;
}

.session-tile-badge-exp {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(7, 10, 18, 0.85);
  border: 1px solid rgba(20, 184, 166, 0.4);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.session-tile-badge-exp svg {
  width: 11px;
  height: 11px;
  color: var(--accent-cyan);
}

.session-tile-badge-featured {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9));
  color: #050811;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.session-tile-badge-featured svg {
  width: 11px;
  height: 11px;
}

.session-tile-body {
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.session-tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.session-tile-date {
  font-weight: 600;
  font-size: 0.86rem;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.session-tile-date svg {
  width: 13px;
  height: 13px;
  color: var(--accent-cyan);
}

.session-tile-gain {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.session-tile-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-tile-uploader {
  font-size: 0.71rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.session-tile-uploader svg {
  width: 11px;
  height: 11px;
}

.session-tile-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.session-tile-actions .btn {
  flex: 1;
  font-size: 0.72rem;
  padding: 0.35rem 0.5rem;
  justify-content: center;
}

.target-session-tile-card.is-active-session .btn-session-select {
  background: var(--accent-cyan);
  color: #07090e;
  font-weight: 700;
}

.target-drilldown-footer {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

/* ==========================================================================
   Responsive Overrides for Targets Log Modal & List View
   ========================================================================== */

@media (max-width: 1024px) and (min-width: 769px) {
  .target-log-modal-card {
    width: 96vw;
    max-width: 1020px;
    height: 92vh;
    padding: 0.9rem 1.1rem;
  }

  .target-stat-value {
    font-size: 0.95rem;
  }

  .target-stat-label {
    font-size: 0.58rem;
  }

  .target-log-header h2 {
    font-size: 1.15rem;
  }
}

@media (max-width: 768px) {
  .target-log-modal-card {
    width: 98vw !important;
    max-width: 98vw !important;
    height: 96vh !important;
    max-height: 96vh !important;
    padding: 0.55rem 0.5rem !important;
    margin: 0 auto !important;
    border-radius: var(--radius-md) !important;
  }

  .target-log-header {
    margin-bottom: 0.35rem;
    padding-right: 32px; /* Prevent overlap with modal close button */
  }

  .target-log-header h2 {
    font-size: 0.92rem !important;
    line-height: 1.25 !important;
    text-align: left;
  }

  /* 2x2 Compact Stats Bar on Mobile */
  .target-log-stats-bar {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.3rem !important;
    margin-bottom: 0.45rem !important;
  }

  .target-stat-item {
    padding: 0.25rem 0.45rem !important;
    gap: 0.35rem !important;
    border-radius: 4px !important;
  }

  .target-stat-icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
  }

  .target-stat-icon svg {
    width: 11px !important;
    height: 11px !important;
  }

  .target-stat-value {
    font-size: 0.8rem !important;
    line-height: 1.1;
  }

  .target-stat-label {
    font-size: 0.52rem !important;
    letter-spacing: 0.2px;
  }

  /* Toolbar Row on Mobile */
  .target-log-toolbar-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.35rem !important;
    margin-bottom: 0.4rem !important;
  }

  .target-group-mode-toggle {
    display: flex !important;
    width: 100% !important;
  }

  .target-mode-btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 0.28rem 0.4rem !important;
    font-size: 0.68rem !important;
    gap: 4px !important;
  }

  .target-category-pills {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    gap: 4px !important;
    padding-bottom: 2px !important;
  }

  .target-category-pills::-webkit-scrollbar {
    display: none;
  }

  .target-cat-pill {
    flex-shrink: 0 !important;
    font-size: 0.68rem !important;
    padding: 0.22rem 0.5rem !important;
    gap: 3px !important;
  }

  .target-layout-mode-toggle {
    display: flex !important;
    width: 100% !important;
  }

  /* Controls Bar on Mobile */
  .target-log-controls-bar {
    padding: 0.4rem !important;
    gap: 0.35rem !important;
    margin-bottom: 0.4rem !important;
  }

  .target-log-search-wrap,
  .target-log-select-wrap {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .target-log-search-input,
  .target-log-select {
    font-size: 0.78rem !important;
    padding-top: 0.38rem !important;
    padding-bottom: 0.38rem !important;
  }

  .target-log-view-label-bar {
    padding: 0.2rem 0.3rem !important;
    margin-bottom: 0.4rem !important;
    font-size: 0.68rem !important;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .target-log-hint-text {
    display: none !important;
  }

  /* List View Target Rows on Mobile */
  .target-list-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    padding: 0.55rem 0.65rem !important;
    border-radius: var(--radius-sm) !important;
  }

  .target-list-left-wrap {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
    width: 100% !important;
  }

  .target-list-avatar-wrap {
    width: 95px !important;
    height: 72px !important;
    min-width: 95px !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
  }

  .target-list-avatar-badge {
    width: 18px !important;
    height: 18px !important;
    bottom: 2px !important;
    right: 2px !important;
  }

  .target-list-avatar-badge svg {
    width: 10px !important;
    height: 10px !important;
  }

  .target-list-col-main {
    flex: 1 !important;
    min-width: 0 !important;
    gap: 0.22rem !important;
  }

  .target-list-title {
    font-size: 0.92rem !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }

  .target-list-type-badge,
  .target-list-constellation-badge {
    font-size: 0.62rem !important;
    padding: 1px 5px !important;
  }

  .target-list-meta-line {
    font-size: 0.66rem !important;
    line-height: 1.3 !important;
  }

  .target-catalog-chip {
    font-size: 0.6rem !important;
    padding: 0.1rem 0.35rem !important;
  }

  .target-list-sessions-row {
    gap: 4px !important;
  }

  .target-list-sessions-label {
    font-size: 0.64rem !important;
  }

  .target-session-chip {
    font-size: 0.64rem !important;
    padding: 0.18rem 0.42rem !important;
    gap: 3px !important;
  }

  .target-session-chip svg {
    width: 9px !important;
    height: 9px !important;
  }

  /* Right Stats Row on Mobile */
  .target-list-right-wrap {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    border-left: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding-top: 0.45rem !important;
    padding-left: 0 !important;
    margin-top: 0.15rem !important;
  }

  .target-list-col-stats {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.65rem !important;
    flex-wrap: wrap !important;
    text-align: left !important;
  }

  .target-list-stat-exposure {
    font-size: 0.8rem !important;
  }

  .target-list-stat-exposure svg {
    width: 11px !important;
    height: 11px !important;
  }

  .target-list-stat-sessions {
    font-size: 0.67rem !important;
  }

  .target-list-stat-dates {
    display: none !important; /* Hide date range on mobile row to conserve space */
  }

  .btn-target-open-tile {
    font-size: 0.7rem !important;
    padding: 0.26rem 0.6rem !important;
  }

  /* Tiles Grid on Mobile */
  .target-log-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 0.65rem !important;
  }

  .target-session-tiles-grid {
    grid-template-columns: 1fr !important;
  }

  .target-drilldown-nav-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }
}

/* Extra small mobile adjustments (<= 420px: iPhone SE, Galaxy S) */
@media (max-width: 420px) {
  .target-list-avatar-wrap {
    width: 80px !important;
    height: 60px !important;
    min-width: 80px !important;
  }

  .target-list-title {
    font-size: 0.86rem !important;
  }

  .target-list-right-wrap {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .btn-target-open-tile {
    width: 100%;
    justify-content: center;
  }
}






