:root {
  --teal:        #00d4c8;
  --teal-dim:    #00a89e;
  --teal-glow:   rgba(0, 212, 200, 0.18);
  --gold:        #c9942a;
  --gold-bright: #e8b84b;
  --gold-glow:   rgba(201, 148, 42, 0.18);
  --bg:          #080c0f;
  --bg-panel:    #0d1318;
  --bg-card:     #111920;
  --border:      rgba(0, 212, 200, 0.12);
  --border-gold: rgba(201, 148, 42, 0.2);
  --text:        #e4f3f2;
  --text-dim:    #8aa8a5;    /* bumped for contrast against --bg-panel */
  --text-muted:  #6d8b89;    /* for tertiary metadata only */
  --mono:        'Share Tech Mono', monospace;
  --sans:        'Rajdhani', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;               /* readable base for inherited text */
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── HEADER ── */
header {
  height: 48px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  position: relative;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
}

/* Kestrel — warm red-orange (reuses the Client/Note accent #ff7a4a) */
.logo {
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  white-space: nowrap;
}

.logo-kestrel {
  color: #ff7a4a;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255, 122, 74, 0.55);
}

.logo-tight {
  letter-spacing: 0.9px;
  word-spacing: 0;
}

.logo-flight {
  font-size: 20px;
  color: var(--teal);
  text-shadow: 0 0 20px var(--teal);
}

.logo-logger {
  font-size: 20px;
  color: var(--gold-bright);
  text-shadow: 0 0 20px var(--gold);
}

.header-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.file-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.file-name.active { color: var(--teal-dim); }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.map-toggle button {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.map-toggle button.active {
  background: var(--teal-glow);
  color: var(--teal);
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}
.status-dot.live {
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── MAIN ── */
main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── MAP PANEL ──
   42% default width, but allowed to shrink (down to a sensible minimum)
   as the window narrows so the right sidebar never gets cropped. */
#map-panel {
  width: 42%;
  min-width: 240px;
  position: relative;
  border-right: 1px solid var(--border);
}

#map { width: 100%; height: 100%; }

/* scanline overlay for atmosphere */
#map-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.04) 3px,
    rgba(0,0,0,0.04) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.map-label {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--teal);
  background: rgba(8,12,15,0.8);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  z-index: 10;
  text-transform: uppercase;
}

/* ── VIDEO PANEL ── */
#video-panel {
  flex: 1;
  min-width: 0;               /* allow shrinking past content width */
  display: flex;
  flex-direction: column;
  position: relative;
  background: #000;
}

#video-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

video {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* ── DROP ZONE ── */
#drop-zone {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 20;
  background: var(--bg);
  cursor: pointer;
  transition: background 0.2s;
}

#drop-zone.drag-over {
  background: rgba(0, 212, 200, 0.04);
  border: 2px dashed var(--teal);
}

#drop-zone.hidden { display: none; }

.drop-icon {
  width: 72px; height: 72px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-dim);
  font-size: 28px;
  transition: all 0.3s;
}

#drop-zone:hover .drop-icon,
#drop-zone.drag-over .drop-icon {
  border-color: var(--teal);
  box-shadow: 0 0 24px var(--teal-glow);
  color: var(--teal);
}

.drop-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--text);
  text-transform: uppercase;
}

.drop-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.8;
}

.drop-files {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.drop-file-badge {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.drop-file-badge.ready {
  border-color: var(--teal-dim);
  color: var(--teal);
  background: var(--teal-glow);
}

#file-input { display: none; }

/* ── VIDEO CONTROLS ── */
#controls {
  height: 52px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  flex-shrink: 0;
}

.ctrl-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 32px; height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ctrl-btn:hover { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 10px var(--teal-glow); }
.ctrl-btn.active { border-color: var(--teal); color: var(--teal); background: var(--teal-glow); }

.time-display {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}

#progress-wrap {
  flex: 1;
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: visible;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal-dim), var(--teal));
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.1s linear;
}

#progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
  pointer-events: none;
  left: 0%;
  transition: left 0.1s linear;
}

/* ── TELEMETRY BAR ── */
#telemetry {
  height: 40px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 32px;
  flex-shrink: 0;
}

.telem-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.telem-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.telem-value {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--gold-bright);
  text-shadow: 0 0 12px var(--gold-glow);
  min-width: 80px;
}

.telem-unit {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 1px;
}

/* ALT value+unit cluster. The wrapper owns the fixed column width so
   the row still aligns with LAT / LON / FRAME; inside the wrapper the
   value and unit sit 3px apart instead of the 8px telem-item gap. */
.telem-valunit {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  min-width: 80px;
}
.telem-valunit .telem-value {
  min-width: 0;   /* width is owned by the wrapper */
}
.telem-unit-inline {
  font-size: 10px;
  text-transform: lowercase;
}

/* ── TAG PANEL ──
   Visually distinct from the sidebar search panel: gold accent strip,
   stronger top border, its own heading. */
#tag-panel {
  background: linear-gradient(180deg, rgba(201, 148, 42, 0.05) 0%, var(--bg-panel) 60%);
  border-top: 2px solid var(--border-gold);
  padding: 10px 16px 8px;
  flex-shrink: 0;
}

.tag-panel-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--gold-bright);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tag-panel-heading-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold);
  flex-shrink: 0;
}
.tag-panel-heading-hint {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

#tag-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

/* Category buttons row — wraps as a unit so we never push into the right
   sidebar on narrow windows. flex:1 1 100% makes the controls row drop to
   its own line as soon as the categories take real space. */
#tag-cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 100%;
  min-width: 0;
}

/* Custom-input + TAG MOMENT controls. Lives on its own row by default
   (flex-basis:100%) so the input always gets full panel width, never
   collapses to a tiny box. */
#tag-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  flex: 1 1 100%;
  min-width: 0;
}

.tag-cat-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.8px;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.tag-cat-btn:hover {
  border-color: var(--text);
  color: var(--text);
}
/* Generic active state — category buttons use their actual data-cat values
   ("Subject", "Shot Type", "Motion", …) so the legacy lowercase per-cat
   rules below never match. This rule guarantees a clearly-visible selected
   look regardless of category: gold border + brightened text + warm glow +
   inset accent so the pressed-in feel is unambiguous. */
.tag-cat-btn.active {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  background: var(--gold-glow);
  box-shadow:
    0 0 12px var(--gold-glow),
    inset 0 0 0 1px var(--gold);
  transform: translateY(1px);
}

/* Per-category accent tints. These layer on top of the generic .active rule
   so each category still reads as itself when picked. */
.tag-cat-btn[data-cat="Subject"].active {
  border-color: #c59fef; color: #d8bdf5;
  background: rgba(176, 123, 229, 0.15);
  box-shadow: 0 0 12px rgba(176, 123, 229, 0.35), inset 0 0 0 1px #b07be5;
}
.tag-cat-btn[data-cat="Light"].active,
.tag-cat-btn[data-cat="Weather"].active {
  border-color: var(--gold); color: var(--gold-bright);
  background: var(--gold-glow);
  box-shadow: 0 0 12px var(--gold-glow), inset 0 0 0 1px var(--gold);
}
.tag-cat-btn[data-cat="Quality"].active,
.tag-cat-btn[data-cat="Select"].active {
  border-color: var(--teal); color: var(--teal);
  background: var(--teal-glow);
  box-shadow: 0 0 12px var(--teal-glow), inset 0 0 0 1px var(--teal);
}
/* Legacy category names — kept so old DB rows still render colored chips */
.tag-cat-btn[data-cat="vineyard"]:hover,
.tag-cat-btn[data-cat="vineyard"].active,
.tag-cat-btn[data-cat="infrastructure"]:hover,
.tag-cat-btn[data-cat="infrastructure"].active,
.tag-cat-btn[data-cat="issues"]:hover,
.tag-cat-btn[data-cat="issues"].active {
  border-color: var(--text-dim); color: var(--text); background: var(--bg-card);
}

.tag-divider {
  /* Now a horizontal hairline between category row and controls row. */
  width: 100%;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
  margin: 2px 0;
}

.tag-custom-input {
  flex: 1 1 220px;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.2s;
}
.tag-custom-input:focus { border-color: var(--teal-dim); }
.tag-custom-input::placeholder { color: var(--text-dim); }

.tag-now-btn {
  width: auto;
  padding: 0 14px;
  height: 34px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--gold-bright);
  border-color: var(--border-gold);
}
.tag-now-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: var(--gold-glow);
  box-shadow: 0 0 12px var(--gold-glow);
}

#tag-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s, margin-top 0.2s;
}
#tag-label-row:not(:empty) {
  margin-top: 7px;
  max-height: 80px;
}

.tag-preset-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.tag-preset-chip:hover { border-color: var(--text); color: var(--text); }
.tag-preset-chip.active {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  background: var(--gold-glow);
}

/* ── Inline warning next to TAG MOMENT ── */
/* Lives inside #tag-top-row; empty → invisible.
   Visible color is red-orange so it reads as a blocking warning. */
.tag-warn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ff7a4a;                /* warm red-orange */
  text-shadow: 0 0 10px rgba(255, 122, 74, 0.4);
  padding: 0 10px;
  height: 34px;
  display: none;
  align-items: center;
  border: 1px solid rgba(255, 122, 74, 0.55);
  background: rgba(255, 122, 74, 0.08);
  border-radius: 3px;
  white-space: nowrap;
  animation: tag-warn-pulse 1.4s ease-in-out 2;
}
.tag-warn:not(:empty) { display: inline-flex; }
@keyframes tag-warn-pulse {
  0%, 100% { box-shadow: 0 0 0   rgba(255, 122, 74, 0); }
  50%      { box-shadow: 0 0 14px rgba(255, 122, 74, 0.55); }
}

#tag-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--teal);
  letter-spacing: 0.5px;
  min-height: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.15s, margin-top 0.15s;
}
#tag-status:not(:empty) {
  max-height: 24px;
  margin-top: 6px;
}

/* ── TAG DOT (map marker) ── */
.tag-dot {
  width: 10px;
  height: 10px;
  background: var(--gold-bright);
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--gold), 0 0 16px rgba(232, 184, 75, 0.35);
  cursor: pointer;
  transition: transform 0.15s;
}
.tag-dot:hover { transform: scale(1.4); }

/* ── TAG POPUP ── */
.mapboxgl-popup-content {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-gold) !important;
  border-radius: 4px !important;
  padding: 10px 13px !important;
  font-family: var(--sans) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5) !important;
}
.mapboxgl-popup-tip { border-top-color: var(--bg-panel) !important; }

.tag-popup-cat {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.tag-popup-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-bright);
  margin-bottom: 3px;
}
.tag-popup-time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.tag-popup-notes {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

/* Multi-label chip strip inside the popup. Reuses .flight-tag-chip
   colors (per-data-cat tints) so popup chips and sidebar chips read
   as the same vocabulary. */
.tag-popup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 2px;
}
.tag-popup-chip {
  /* Tighter than the sidebar variant — popups are narrow */
  font-size: 11px;
  padding: 2px 8px;
}
.tag-popup-empty {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* ── SAVE BUTTON ── */
.save-btn {
  margin-left: auto;
  width: auto;
  padding: 0 14px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
  border-color: var(--border-gold);
  flex-shrink: 0;
}
.save-btn:hover { border-color: var(--gold); color: var(--gold-bright); box-shadow: 0 0 10px var(--gold-glow); }
.save-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.save-btn:disabled:hover { border-color: var(--border-gold); color: var(--gold); box-shadow: none; }

/* ── FLIGHTS SIDEBAR ──
   Fixed width, never shrinks — the map/video area is the flex grower that
   absorbs window resizes. min-width protects it from any parent layout
   quirks so search/rating/back controls always have room. */
#flights-sidebar {
  width: 320px;
  min-width: 320px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--teal);
  background: rgba(0, 212, 200, 0.04);
  flex-shrink: 0;
}
.sidebar-header > span:first-child,
.sidebar-header > #current-collection-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.sidebar-icon-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: 0 0 8px var(--teal-glow);
}

/* Clear-search icon in the SEARCH RESULTS header — gold by default so
   users always have an obvious one-click exit from search mode. Matches
   the active search panel's gold-accent treatment so state-change
   controls share a visual vocabulary. */
.sidebar-clear-btn {
  width: 26px;
  height: 26px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
  border-color: var(--gold);
  background: var(--gold-glow);
  box-shadow: 0 0 6px var(--gold-glow);
}
.sidebar-clear-btn:hover {
  color: var(--bg);
  border-color: var(--gold-bright);
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Full-width "Searching all flights / Back to …" banner shown under the
   search results header. Makes it unmistakable that search is active and
   where clear will take the user. */
.search-return-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: var(--teal-glow);
  border-bottom: 1px solid rgba(0, 212, 200, 0.35);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--teal);
}
.search-return-banner.hidden { display: none; }
.search-return-banner-label {
  text-transform: uppercase;
  font-weight: 700;
}
/* Back-to-<destination> control — warm gold by default so it reads as a
   state-changing action (leaves search mode), not a passive label. JS
   collapses the label to "Back" when the destination name is long, so
   we no longer need awkward mid-word ellipsis clipping. */
.search-return-banner-btn {
  background: var(--gold-glow);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  padding: 5px 12px;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 0 6px var(--gold-glow);
}
.search-return-banner-btn:hover {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Back arrows are primary navigation — visible by default, not hover-only */
.sidebar-back-btn {
  width: 28px;
  height: 28px;
  font-size: 22px;
  font-weight: 700;
  color: var(--teal);
  border-color: var(--teal);
  background: var(--teal-glow);
  box-shadow: 0 0 6px var(--teal-glow);
}
.sidebar-back-btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
  background: var(--gold-glow);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* ── COLLECTIONS LIST ── */
#collections-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
#collections-list::-webkit-scrollbar { width: 4px; }
#collections-list::-webkit-scrollbar-track { background: transparent; }
#collections-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
#collections-list.hidden { display: none; }

.collection-item {
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 212, 200, 0.06);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.collection-item:hover { background: var(--bg-card); }
.collection-item.active { background: var(--teal-glow); }

.collection-item-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collection-item.active .collection-item-name { color: var(--teal); }

.collection-item-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 9px;
  flex-shrink: 0;
}

.collection-item-chev {
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.sidebar-count {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
}

#flights-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

#flights-list::-webkit-scrollbar { width: 4px; }
#flights-list::-webkit-scrollbar-track { background: transparent; }
#flights-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.flights-empty {
  padding: 24px 14px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  line-height: 1.6;
  text-align: center;
}

.flight-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 212, 200, 0.06);
  transition: background 0.15s;
}
.flight-item:hover { background: var(--bg-card); }
.flight-item.active { background: var(--teal-glow); }

.flight-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.flight-item.active .flight-item-name { color: var(--teal); }

.flight-item-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── SAVE FLIGHT MODAL ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 15, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-backdrop.hidden { display: none; }

.modal-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 28px 32px;
  width: 440px;
  max-width: 90vw;
  box-shadow: 0 0 60px rgba(201, 148, 42, 0.12);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold-bright);
  text-shadow: 0 0 20px var(--gold-glow);
  margin-bottom: 24px;
}

.modal-field { margin-bottom: 16px; }

/* Source-files summary inside the save modal — shows full filenames so the
   user can confirm what record they're about to save, without truncation. */
.modal-source-files {
  margin: -8px 0 20px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
}
.modal-source-files.hidden { display: none; }
.modal-source-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  align-items: baseline;
}
.modal-source-row + .modal-source-row { margin-top: 4px; }
.modal-source-row.hidden { display: none; }
.modal-source-label {
  color: var(--teal);
  letter-spacing: 2px;
  font-weight: 700;
}
.modal-source-value {
  color: var(--text);
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
}

.modal-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 6px;
}

.modal-label .required { color: var(--teal); }

.modal-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
}
.modal-input:focus { border-color: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.modal-textarea { resize: vertical; min-height: 68px; font-family: var(--sans); }

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.modal-btn {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-cancel { color: var(--text-dim); }
.modal-cancel:hover { border-color: var(--text-dim); color: var(--text); }

.modal-save {
  color: var(--gold-bright);
  border-color: var(--border-gold);
}
.modal-save:hover { border-color: var(--gold); box-shadow: 0 0 12px var(--gold-glow); }
.modal-save:disabled { opacity: 0.4; cursor: not-allowed; }

.modal-error {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: #e05252;
  letter-spacing: 1px;
}
.modal-error.hidden { display: none; }

/* ── TAG TIMELINE STRIP ── */
#tag-timeline-wrap {
  height: 28px;
  background: var(--bg-panel);
  border-top: 1px solid rgba(0, 212, 200, 0.06);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  flex-shrink: 0;
}

#tag-timeline {
  flex: 1;
  position: relative;
  height: 100%;
}

/* Subtle baseline running through the middle of the strip */
#tag-timeline::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 212, 200, 0.08);
  transform: translateY(-50%);
  pointer-events: none;
}

.timeline-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 10px;
  border-radius: 1px;
  background: var(--gold-bright);
  cursor: pointer;
  transition: height 0.12s, width 0.12s, box-shadow 0.12s;
  z-index: 1;
}
.timeline-tick:hover {
  height: 16px;
  box-shadow: 0 0 6px var(--gold);
  z-index: 2;
}
.timeline-tick.active {
  height: 20px;
  width: 3px;
  box-shadow: 0 0 8px var(--gold), 0 0 18px var(--gold-glow);
  z-index: 2;
}
/* Category colour overrides */
.timeline-tick[data-cat="infrastructure"]        { background: var(--teal); }
.timeline-tick[data-cat="infrastructure"]:hover  { box-shadow: 0 0 6px var(--teal); }
.timeline-tick[data-cat="infrastructure"].active { box-shadow: 0 0 8px var(--teal), 0 0 18px var(--teal-glow); }
.timeline-tick[data-cat="issues"]        { background: #e07070; }
.timeline-tick[data-cat="issues"]:hover  { box-shadow: 0 0 6px #e05252; }
.timeline-tick[data-cat="issues"].active { box-shadow: 0 0 8px #e05252, 0 0 18px rgba(224,82,82,0.2); }

#tag-active-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--gold-bright);
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── TAG NAV BUTTONS (⏮ / ⏭ in controls bar) ── */
.tag-nav-btn { font-size: 11px; }
.tag-nav-btn:disabled { opacity: 0.22; cursor: not-allowed; }
.tag-nav-btn:disabled:hover {
  border-color: var(--border);
  color: var(--text-dim);
  box-shadow: none;
}

/* (tag-popup-seek styles merged into .tag-popup-actions block above) */

/* ── TAG DOT ACTIVE (currently-playing tag highlight on map) ── */
.tag-dot.active {
  transform: scale(1.5);
  box-shadow: 0 0 14px var(--gold), 0 0 28px rgba(232, 184, 75, 0.55);
  border-color: var(--gold-bright);
}

/* ── UTILITY ── */
.hidden { display: none !important; }

/* ── SEARCH PANEL BOX ──
   Self-contained card at the top of the sidebar. Visually distinct from
   the flight archive list below it: own border, its own padding block,
   and a teal accent so it reads as "different tool" — not just another
   row in the list. */
#search-panel-box {
  margin: 10px 10px 12px;
  padding: 10px 12px 12px;
  background: rgba(0, 212, 200, 0.04);
  border: 1px solid var(--border);
  border-left: 2px solid var(--teal);
  border-radius: 4px;
  flex-shrink: 0;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
/* Visible "search is active" state — gold-rimmed glow so the user can
   immediately see that the sidebar is currently showing results instead
   of the archive list. Toggled from search.js _showSearchMode. */
#search-panel-box.is-active {
  border-color: var(--gold);
  border-left-color: var(--gold-bright);
  background: rgba(201, 148, 42, 0.06);
  box-shadow: 0 0 14px var(--gold-glow);
}

.search-panel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.sidebar-search-heading-icon {
  font-size: 18px;
  line-height: 1;
  color: var(--teal);
  text-shadow: 0 0 8px var(--teal-glow);
  flex-shrink: 0;
}
/* Gold accent when the panel is active so the whole header reads as
   "search mode on". */
#search-panel-box.is-active .sidebar-search-heading-icon {
  color: var(--gold-bright);
  text-shadow: 0 0 8px var(--gold-glow);
}
#search-panel-box.is-active .search-panel-label {
  color: var(--gold-bright);
}

.search-panel-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-panel-row + .search-panel-row { margin-top: 8px; }

.search-panel-sublabel {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-cat-select {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-cat-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 10px var(--teal-glow);
}

#search-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.3px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#search-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 10px var(--teal-glow);
}
#search-input::placeholder { color: var(--text-dim); font-size: 12px; letter-spacing: 0.3px; }

#search-clear {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 3px;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
#search-clear:hover { color: var(--text); border-color: var(--text-dim); }

#search-clear {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
#search-clear:hover { color: var(--text); }

/* Timeline tick colors for new categories */
.timeline-tick[data-cat="light"]        { background: var(--gold-bright); }
.timeline-tick[data-cat="review"]        { background: var(--teal); }
.timeline-tick[data-cat="review"]:hover  { box-shadow: 0 0 6px var(--teal); }
.timeline-tick[data-cat="review"].active { box-shadow: 0 0 8px var(--teal), 0 0 18px var(--teal-glow); }
.timeline-tick[data-cat="subject"]        { background: #c59fef; }
.timeline-tick[data-cat="subject"]:hover  { box-shadow: 0 0 6px #b07be5; }
.timeline-tick[data-cat="subject"].active { box-shadow: 0 0 8px #b07be5, 0 0 18px rgba(176,123,229,0.25); }

/* Moment-era categories */
.timeline-tick[data-cat="Subject"]       { background: #c59fef; }
.timeline-tick[data-cat="Shot Type"]     { background: var(--teal); }
.timeline-tick[data-cat="Motion"]        { background: #78c8ff; }
.timeline-tick[data-cat="Light"]         { background: var(--gold-bright); }
.timeline-tick[data-cat="Weather"]       { background: #b4dcff; }
.timeline-tick[data-cat="Quality"]       { background: #a0a0a0; }
.timeline-tick[data-cat="Select"]        { background: #ffb450; }
.timeline-tick[data-cat="Client / Note"] { background: #ff7a4a; }

/* ── SEARCH RESULTS ── */
#search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
#search-results::-webkit-scrollbar { width: 4px; }
#search-results::-webkit-scrollbar-track { background: transparent; }
#search-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 212, 200, 0.06);
  transition: background 0.15s;
}
.search-result-item:hover { background: var(--bg-card); }
.search-result-item.active { background: var(--teal-glow); }

.search-result-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.search-result-item.active .search-result-name { color: var(--teal); }

.search-result-loc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.search-result-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.search-result-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.search-match-chip {
  background: var(--gold-glow);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 2px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Field-match chip: "in title" / "in place" / "in description".
   Uses the teal accent so it visually separates from tag-label chips.
   Clickable (cursor pointer) — toggles the inline preview. */
.search-match-chip-field {
  background: rgba(0, 212, 200, 0.08);
  border-color: rgba(0, 212, 200, 0.35);
  color: var(--teal);
  text-transform: lowercase;
  cursor: pointer;
}
.search-match-chip-field:hover {
  background: rgba(0, 212, 200, 0.16);
  color: var(--teal);
}

/* Inline description preview inside a search result — opened by the
   field chips. Reads like a mini-card so the user doesn't have to
   activate the flight (or open the save modal) just to see its notes. */
.search-result-preview {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
}
.search-result-preview.hidden { display: none; }
.search-preview-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px;
  align-items: baseline;
}
.search-preview-row + .search-preview-row { margin-top: 4px; }
.search-preview-label {
  color: var(--teal);
  letter-spacing: 1.5px;
  font-weight: 700;
}
.search-preview-value {
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;   /* preserve newlines in description */
}
/* Description block — lives OUTSIDE the compact label/value grid so long
   paragraphs flow full-width underneath the metadata rows. Line breaks in
   the source text are preserved (pre-wrap). */
.search-preview-desc {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 212, 200, 0.18);
}
.search-preview-desc-label {
  color: var(--teal);
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 4px;
}
.search-preview-desc-body {
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.search-preview-desc-body em {
  color: var(--text-dim);
  font-style: italic;
}
.search-preview-open {
  margin-top: 10px;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--teal);
  color: var(--teal);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.search-preview-open:hover {
  background: var(--teal-glow);
  color: var(--gold-bright);
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--teal-glow);
}

.search-match-more {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.search-status {
  padding: 24px 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-align: center;
}

/* ── FLIGHT TAGS LIST (per-flight drill-down) ──
   Compact scrollable list: one row per tag instance. Designed to stay
   usable with hundreds of rows per flight. */
#flight-tags-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
#flight-tags-list.hidden { display: none; }
/* Captured-date subline shown under the flight title in the tag-list
   view. Kept visually lighter than the header label so the title remains
   the dominant element, but always present so legacy flights can't hide
   behind a bare name. */
.flight-tags-subhead {
  padding: 6px 14px 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 212, 200, 0.02);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  text-transform: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.flight-tags-subhead-date {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flight-tags-subhead.is-estimate .flight-tags-subhead-date {
  font-style: italic;
  opacity: 0.85;
}
.flight-tags-subhead.hidden { display: none; }

/* Inline rating editor that sits to the right of the captured-date text
   in the subhead. Hidden for unsaved drafts (app.js toggles .hidden). */
.flight-tags-rating-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.flight-tags-rating-wrap.hidden { display: none; }
.flight-tags-rating-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.flight-tags-rating-select {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold-bright);
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 3px;
  padding: 2px 4px;
  cursor: pointer;
}
.flight-tags-rating-select:hover,
.flight-tags-rating-select:focus {
  border-color: var(--gold);
  outline: none;
}

#flight-tags-list::-webkit-scrollbar { width: 4px; }
#flight-tags-list::-webkit-scrollbar-track { background: transparent; }
#flight-tags-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.flight-tag-item {
  display: block;               /* moment row now contains head + note */
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 212, 200, 0.05);
  cursor: pointer;
  transition: background 0.12s;
}
.flight-tag-row-head {
  display: grid;
  grid-template-columns: 48px auto 1fr 22px;
  grid-column-gap: 8px;
  align-items: center;
}
.flight-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  min-width: 0;
}
.flight-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  padding: 4px 6px 4px 9px;   /* a touch more breathing room */
  border-radius: 4px;          /* less pill-y, more readable */
  background: rgba(0, 212, 200, 0.08);
  border: 1px solid rgba(0, 212, 200, 0.35);
  color: var(--text);
  max-width: 100%;
  white-space: nowrap;
}
.flight-tag-chip[data-cat="Subject"]        { background: rgba(197,159,239,0.10); border-color: rgba(197,159,239,0.45); }
.flight-tag-chip[data-cat="Shot Type"]      { background: rgba(0,212,200,0.10);   border-color: rgba(0,212,200,0.40); }
.flight-tag-chip[data-cat="Motion"]         { background: rgba(120,200,255,0.10); border-color: rgba(120,200,255,0.45); }
.flight-tag-chip[data-cat="Light"]          { background: rgba(255,200,80,0.10);  border-color: rgba(255,200,80,0.45); }
.flight-tag-chip[data-cat="Weather"]        { background: rgba(180,220,255,0.10); border-color: rgba(180,220,255,0.45); }
.flight-tag-chip[data-cat="Quality"]        { background: rgba(160,160,160,0.10); border-color: rgba(160,160,160,0.45); }
.flight-tag-chip[data-cat="Select"]         { background: rgba(255,180,80,0.10);  border-color: rgba(255,180,80,0.50); }
.flight-tag-chip[data-cat="Client / Note"]  { background: rgba(255,122,74,0.10);  border-color: rgba(255,122,74,0.45); }
.flight-tag-chip-x {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  opacity: 0.6;
}
.flight-tag-chip-x:hover {
  color: #ff7a4a;
  opacity: 1;
}
.flight-tag-rating {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-bright);
  padding: 2px 6px;
  border: 1px solid rgba(218,165,32,0.4);
  border-radius: 3px;
}
.flight-tag-empty {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  font-style: italic;
}

/* Row-level delete button — visible on hover/focus/active so it doesn't
   clutter at rest, but always reachable by keyboard. Red-orange on hover
   matches the duplicate-warning color so destructive actions share a
   visual language. */
.flight-tag-del {
  grid-column: 4 / 5;
  width: 20px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, border-color 0.12s, background 0.12s;
}
.flight-tag-item:hover .flight-tag-del,
.flight-tag-item.active .flight-tag-del,
.flight-tag-del:focus-visible {
  opacity: 1;
}
.flight-tag-del:hover {
  color: #ff7a4a;
  border-color: rgba(255, 122, 74, 0.55);
  background: rgba(255, 122, 74, 0.1);
}
.flight-tag-item:hover  { background: var(--bg-card); }
.flight-tag-item.active { background: var(--gold-glow); }

.flight-tag-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-align: right;
}
.flight-tag-item.active .flight-tag-time { color: var(--gold-bright); }

.flight-tag-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-bright);
  justify-self: center;
}
.flight-tag-dot[data-cat="review"]  { background: var(--teal); }
.flight-tag-dot[data-cat="subject"] { background: #c59fef; }
.flight-tag-dot[data-cat="light"]   { background: var(--gold-bright); }
.flight-tag-dot[data-cat="custom"]  { background: var(--text-dim); }

.flight-tag-label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.flight-tag-item.active .flight-tag-label { color: var(--gold-bright); }

.flight-tag-note {
  margin-top: 4px;
  margin-left: 56px;           /* align under chip track, past time column */
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── DROP ZONE RELINK STATE ── */
#drop-state-normal,
#drop-state-relink {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.drop-icon-relink { color: var(--gold); border-color: var(--border-gold); }
#drop-zone:hover .drop-icon-relink,
#drop-zone.drag-over .drop-icon-relink {
  border-color: var(--gold);
  box-shadow: 0 0 24px var(--gold-glow);
  color: var(--gold-bright);
}

.drop-relink-filename {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold-bright);
  letter-spacing: 1px;
  background: var(--gold-glow);
  border: 1px solid var(--border-gold);
  border-radius: 3px;
  padding: 5px 14px;
  /* Center the chip and give it real breathing room. Sized to comfortably
     hold a standard DJI filename (~28 chars) — `min(420px, 100%)` keeps
     it from spilling out of narrow video panels, while `text-align: center`
     ensures short filenames sit centered instead of left-aligned in a wide
     box. Unusually long names scroll horizontally rather than wrap. */
  align-self: center;
  text-align: center;
  min-width: min(420px, 100%);
  max-width: 100%;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  line-height: 1.35;
  scrollbar-width: thin;
  box-sizing: border-box;
}

.drop-relink-error {
  font-family: var(--mono);
  font-size: 10px;
  color: #e07070;
  letter-spacing: 0.8px;
  text-align: center;
}
.drop-relink-error.hidden { display: none; }

/* ── TAG POPUP DELETE BUTTON ── */
/* Popup itself: enforce a sensible min-width so action buttons never wrap
   under short labels. The popup is compact when idle but always wide
   enough to keep "Jump here" and "Delete" side-by-side on one line. */
.tag-popup {
  min-width: 180px;
}
.tag-popup-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-popup-close,
.tag-popup-delete {
  flex: 1 1 0;
  background: none;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 5px 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;   /* buttons stay on one line regardless of width */
}

.tag-popup-close {
  border: 1px solid var(--border-gold);
  color: var(--gold);
}
.tag-popup-close:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  background: var(--gold-glow);
}

.tag-popup-delete {
  border: 1px solid rgba(224, 82, 82, 0.3);
  color: #e07070;
}
.tag-popup-delete:hover {
  border-color: #e05252;
  color: #e05252;
  background: rgba(224, 82, 82, 0.1);
}

/* ── SAVE-FIRST BANNER ──
   Shown above the video whenever a new unsaved flight is loaded. Clicking
   it opens the save modal. Strong pulsing accent so it can't be missed. */
#save-first-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 18px;
  background: linear-gradient(
    90deg,
    rgba(201, 148, 42, 0.22) 0%,
    rgba(201, 148, 42, 0.12) 100%
  );
  border: 0;
  border-bottom: 2px solid var(--gold-bright);
  color: var(--gold-bright);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  flex-shrink: 0;
  animation: save-banner-pulse 2.4s ease-in-out infinite;
  text-align: left;
}
#save-first-banner.hidden { display: none !important; }
#save-first-banner:hover {
  background: linear-gradient(
    90deg,
    rgba(201, 148, 42, 0.32) 0%,
    rgba(201, 148, 42, 0.18) 100%
  );
}

.save-first-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gold-bright);
  color: var(--bg);
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--gold);
}

.save-first-banner-text { flex: 1; }

.save-first-banner-cta {
  font-size: 12px;
  letter-spacing: 2px;
  padding: 4px 12px;
  border: 1px solid var(--gold-bright);
  border-radius: 3px;
  background: rgba(0,0,0,0.25);
  flex-shrink: 0;
}

@keyframes save-banner-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(201, 148, 42, 0); }
  50%      { box-shadow: 0 4px 18px rgba(201, 148, 42, 0.28); }
}

/* ── MAPBOX OVERRIDES ── */
.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right,
.mapboxgl-ctrl-top-right { display: none; }

.mapboxgl-ctrl-top-left { top: 48px; }

/* ── DRONE DOT ── */
.drone-dot {
  width: 14px; height: 14px;
  position: relative;
}

.drone-dot-inner {
  width: 10px; height: 10px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--teal), 0 0 24px rgba(0,212,200,0.4);
  position: absolute;
  top: 2px; left: 2px;
}

.drone-dot-ring {
  width: 14px; height: 14px;
  border: 1.5px solid var(--teal);
  border-radius: 50%;
  position: absolute;
  top: 0; left: 0;
  animation: ring-pulse 2s infinite;
}

@keyframes ring-pulse {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}
