@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;800&display=swap');

:root {
  --bg:        #0a0c10;
  --surface:   #111419;
  --border:    #1e2330;
  --accent:    #00e5ff;
  --accent2:   #ff3c6e;
  --text:      #d8dde8;
  --muted:     #8891a8;
  --radius:    6px;
  --ui-scale:  1;
}

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

html { height: 100%; }

body {
  font-family: 'Syne', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ─── TOP SECTION (fills viewport, no scroll) ─────────────────────────── */
.top-section {
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* ─── HEADER ─────────────────────────────── */
header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.logo-mark {
  width: 36px; height: 36px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: grid; place-items: center;
  position: relative;
}
.logo-mark::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: .5; }
}
header h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
}
header h1 .brand-accent {
  color: var(--accent);
}
header span.sub {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ─── UPLOAD STRIP ───────────────────────── */
.upload-strip {
  display: flex;
  gap: 16px;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap;                 /* commit to a single row */
  align-items: center;
}
.upload-label {
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
}
.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
/* Visually hidden but in DOM so change events fire reliably */
.file-btn input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
.file-btn .btn {
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  letter-spacing: .06em;
  padding: 7px 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, color .2s;
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap;
}
.file-btn .btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.file-btn .btn svg { width:14px; height:14px; flex-shrink:0; pointer-events: none; }
.file-name {
  font-family: 'Space Mono', monospace;
  font-size: .68rem;
  color: var(--accent);
  /* Leading-ellipsis instead of trailing — for DJI names like
     DJI_20260722_140013_0009_D.MP4 the informative tail (frame number,
     camera suffix, extension) is what a user visually confirms, and
     hiding it behind a trailing ellipsis is worse UX than hiding the
     date prefix. `direction: rtl` flips the truncation side; explicit
     text-align keeps LTR characters readable. 2026-07-28. */
  max-width: 140px;
  flex: 0 1 140px;                   /* shrink under strip pressure */
  min-width: 0;                      /* required for flex-child ellipsis */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
  text-align: left;
}
/* Hide the "Full/Exit" label on the fullscreen button — the icon toggle
   is enough visual state. The span is kept in the DOM so the existing
   textContent toggle in app.js keeps working without a code change. */
#fs-label { display: none; }
.divider { width:1px; height:28px; background: var(--border); }

/* status pill */
#status {
  margin-left: auto;
  font-family: 'Space Mono', monospace;
  font-size: .68rem;
  letter-spacing: .06em;
  padding: 5px 12px;
  border-radius: 20px;
  background: #1a1f2b;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all .3s;
}
#status.ready   { border-color: var(--accent); color: var(--accent); }
#status.error   { border-color: var(--accent2); color: var(--accent2); }

/* ─── MAIN WORKSPACE ─────────────────────── */
.workspace {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ─── VIDEO PANEL ────────────────────────── */
.video-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #080a0d;
  border-right: 1px solid var(--border);
}
.panel-label {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.panel-label .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent2);
}
.panel-label .dot.map { background: var(--accent); }
.video-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#video-player {
  width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  background: #000;
  display: block;
  outline: none;
}

/* ─── TELEMETRY TICKER ───────────────────── */
.telem-bar {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  overflow-x: auto;
}
.telem-field {
  padding: 8px 14px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.telem-field .key { color: var(--muted); }
.telem-field .val { color: var(--accent); font-weight: 700; }

/* ─── MAP PANEL ──────────────────────────── */
.map-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#map {
  flex: 1 1 0;
  min-height: 0;
  /* Explicit fallback height in case flex chain breaks */
  height: 100%;
}

/* Leaflet overrides */
.leaflet-container { background: #0d1117 !important; }

/* North arrow */
.map-north-arrow {
  background: rgba(10, 12, 16, 0.82) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 6px 8px 4px !important;
  backdrop-filter: blur(4px);
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  margin-bottom: 8px !important;
}

/* Scale bar */
.leaflet-control-scale {
  margin-bottom: 8px !important;
  margin-right: 8px !important;
}
.leaflet-control-scale-line {
  background: rgba(10, 12, 16, 0.82) !important;
  border: 2px solid var(--accent) !important;
  border-top: none !important;
  color: var(--text) !important;
  font-family: 'Space Mono', monospace !important;
  font-size: .62rem !important;
  font-weight: 700;
  padding: 1px 6px 2px !important;
  line-height: 1.3;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.leaflet-control-scale-line + .leaflet-control-scale-line {
  border-top: 2px solid var(--accent) !important;
  margin-top: -2px;
}
/* No global tile filter — satellite imagery must render with natural colours */
.flight-marker {
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  width: 10px !important;
  height: 10px !important;
  margin-left: -5px !important;
  margin-top: -5px !important;
  cursor: pointer;
  transition: transform .15s;
}
.flight-marker:hover { transform: scale(1.6); }

/* ─── ALTITUDE LEGEND ────────────────────── */
.alt-legend {
  background: rgba(10, 12, 16, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
}
.alt-legend-title {
  font-family: 'Space Mono', monospace;
  font-size: .58rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: flex-start;
}
/* Row that holds bar + labels side by side */
.alt-legend-body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
}
.alt-legend-bar {
  width: 14px;
  height: 100px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.alt-legend-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  height: 100px;
  font-family: 'Space Mono', monospace;
  font-size: .55rem;
  color: var(--text);
  line-height: 1;
}

/* Distance measure button */
.snap-measure-btn {
  margin-top: 8px;
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  letter-spacing: .05em;
  padding: 6px 12px;
  border: 1px solid #ffe066;
  background: transparent;
  color: #ffe066;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .2s, color .2s;
  width: 100%;
}
.snap-measure-btn:hover  { background: rgba(255,224,102,.12); }
.snap-measure-btn.active { background: rgba(255,224,102,.2); opacity: .7; cursor: wait; }
.snap-measure-btn svg    { width: 13px; height: 13px; flex-shrink: 0; }

/* Measure result */
.snap-measure-result {
  display: none;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(255,224,102,.07);
  border: 1px solid rgba(255,224,102,.3);
  border-radius: var(--radius);
}
.snap-measure-row {
  display: flex;
  gap: 10px;
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  padding: 2px 0;
}
.measure-val { color: #ffe066 !important; }

/* Measure tooltips */
.measure-hint {
  font-family: 'Space Mono', monospace;
  font-size: .68rem;
  background: rgba(10,12,16,.9);
  border: 1px solid #ffe066;
  color: #ffe066;
  border-radius: var(--radius);
  padding: 5px 10px;
  animation: blink 1.2s ease-in-out infinite;
}
.measure-hint::before { display: none; }
.measure-result-tip {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  background: rgba(10,12,16,.9);
  border: 1px solid rgba(255,224,102,.5);
  color: #ffe066;
  border-radius: var(--radius);
  padding: 5px 10px;
}
.measure-result-tip::before { display: none; }
@keyframes blink {
  0%,100% { opacity: 1; } 50% { opacity: .5; }
}

/* Path click tooltip */
.path-tooltip {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  background: rgba(10,12,16,.9);
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 4px 8px;
  white-space: nowrap;
  box-shadow: none;
}
.path-tooltip::before { display: none; }

/* Numbered snapshot pins */
.snap-pin {
  width: 24px;
  height: 24px;
  background: var(--accent2);
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: .55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
}

/* ─── SNAPSHOT BUTTON ────────────────────── */
.snapshot-bar {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
#btn-snapshot {
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  letter-spacing: .06em;
  padding: 7px 16px;
  border: 1px solid var(--accent2);
  background: transparent;
  color: var(--accent2);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: background .2s, color .2s;
  white-space: nowrap;
}
#btn-snapshot:hover { background: var(--accent2); color: #fff; }
#btn-snapshot svg { width: 14px; height: 14px; pointer-events: none; }
#btn-snapshot:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.snapshot-hint {
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  color: var(--muted);
}

/* ─── SNAPSHOTS TABLE ────────────────────── */
#snapshots-section {
  display: none;
  flex-shrink: 0;
  border-top: 2px solid var(--border);
  background: var(--surface);
}
#snapshots-section.has-items { display: block; }

.snapshots-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
}
.snapshots-header h2 {
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.snapshots-header h2 .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent2);
}
#btn-export-csv {
  font-family: 'Space Mono', monospace;
  font-size: .66rem;
  letter-spacing: .06em;
  padding: 5px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
#btn-export-csv:hover { border-color: var(--accent); color: var(--accent); }

/* Full-width table */
#snapshots-table {
  width: 100%;
  border-collapse: collapse;
}
#snapshots-table thead tr {
  background: #0d1017;
}
#snapshots-table th {
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 400;
}
#snapshots-table th:nth-child(1) { width: 33%; }
#snapshots-table th:nth-child(2) { width: 27%; }
#snapshots-table th:nth-child(3) { width: 40%; }

#snapshots-table tbody tr {
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
#snapshots-table tbody tr:hover { background: #0d1017; }

/* Col 1 — thumbnail */
.snap-td-img {
  padding: 12px 16px;
}
.snap-thumb {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity .15s;
}
.snap-thumb:hover { opacity: .8; }

/* Col 2 — location data */
.snap-td-meta {
  padding: 12px 16px;
  vertical-align: top;
}
.snap-meta-row {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  font-family: 'Space Mono', monospace;
  font-size: calc(var(--ui-scale, 1) * .65rem);
  align-items: baseline;
}
.snap-mk {
  color: var(--muted);
  min-width: 52px;
  flex-shrink: 0;
}
.snap-mv {
  color: var(--accent);
  font-weight: 700;
}
/* Camera angle diagrams */
.snap-cam-diagrams {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.snap-cam-diagram-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.snap-cam-label {
  font-family: 'Space Mono', monospace;
  font-size: .58rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cam-svg {
  display: block;
  border-radius: var(--radius);
  background: #080b10;
  border: 1px solid var(--border);
}
.snap-row-num {
  font-family: 'Space Mono', monospace;
  font-size: calc(var(--ui-scale, 1) * .65rem);
  color: #a8b2c8;
  margin-bottom: 8px;
}

/* Col 3 — notes + delete */
.snap-td-note {
  padding: 12px 16px;
}
.snap-note {
  width: 100%;
  font-family: 'Space Mono', monospace;
  font-size: calc(var(--ui-scale, 1) * .72rem);
  background: #0d1017;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  resize: vertical;
  min-height: 80px;
  transition: border-color .2s;
}
.snap-note:focus { outline: none; border-color: var(--accent); }
.snap-note::placeholder { color: var(--muted); }
.snap-delete {
  margin-top: 8px;
  font-family: 'Space Mono', monospace;
  font-size: .6rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 0;
  display: flex; align-items: center; gap: 5px;
  transition: color .2s;
}
.snap-delete:hover { color: var(--accent2); }
.snap-delete svg { width: 11px; height: 11px; }

/* Reorder + shift controls */
.snap-reorder, .snap-shift {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.snap-shift { margin-bottom: 8px; }
.snap-arrow {
  background: #1a1f2b;
  border: 1px solid #2e3650;
  border-radius: var(--radius);
  color: #a8b2c8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  transition: border-color .15s, color .15s, background .15s;
  font-family: 'Space Mono', monospace;
  font-size: calc(var(--ui-scale, 1) * .65rem);
  white-space: nowrap;
}
.snap-arrow:hover { border-color: var(--accent); color: var(--accent); background: #1e2840; }
.snap-arrow:active { background: #242d4a; }
.snap-arrow svg { width: 12px; height: 12px; }
.snap-arrow--shift { gap: 4px; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--muted);
  user-select: none;
}
.empty-state svg { opacity: .25; }
.empty-state p {
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  letter-spacing: .08em;
}

/* ─── FONT SIZE TOGGLE ───────────────────── */
.font-size-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}
.font-size-ctrl span {
  font-family: 'Space Mono', monospace;
  font-size: .6rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 0 4px;
}
.btn-font-size {
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 9px;
  border: 1px solid #2e3650;
  background: #1a1f2b;
  color: #a8b2c8;
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1;
  transition: border-color .15s, color .15s;
  user-select: none;
}
.btn-font-size:hover { border-color: var(--accent); color: var(--accent); }

/* Fullscreen button */
#btn-fullscreen {
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  padding: 4px 9px;
  border: 1px solid #2e3650;
  background: #1a1f2b;
  color: #a8b2c8;
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1;
  transition: border-color .15s, color .15s;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}
#btn-fullscreen:hover { border-color: var(--accent); color: var(--accent); }
#btn-fullscreen svg   { width: 13px; height: 13px; flex-shrink: 0; }

/* ─── EXPORT BUTTON ──────────────────────────────────────────────────────── */
#btn-export {
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  letter-spacing: .06em;
  padding: 7px 14px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .2s, color .2s;
  white-space: nowrap;
}
#btn-export:hover { background: var(--accent); color: #000; }
#btn-export svg   { width: 14px; height: 14px; pointer-events: none; }

/* ─── MODAL ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.modal-box--narrow { width: 440px; }
.modal-box--wide   { width: 640px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s;
}
.modal-close:hover { color: var(--accent2); }
.modal-body { padding: 20px 22px 22px; }
.modal-subtitle {
  font-family: 'Space Mono', monospace;
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* Export options */
.export-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.export-option {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.export-option:hover {
  border-color: var(--accent);
  background: rgba(0,229,255,.04);
}
.export-option svg {
  width: 22px; height: 22px;
  color: var(--accent);
  margin-bottom: 4px;
  flex-shrink: 0;
}
.export-option--disabled {
  opacity: .45;
  cursor: not-allowed;
}
.export-option--disabled:hover {
  border-color: var(--border);
  background: var(--bg);
}
.export-opt-title {
  font-family: 'Syne', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.export-opt-desc {
  font-family: 'Space Mono', monospace;
  font-size: .63rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Export accordion (2026-07-22) — collapsed rows keep the modal short as
   the deliverable list grows. Uses native <details>/<summary> so it's
   keyboard-accessible with no JS. Reuses the same border/hover treatment
   as .export-option for visual continuity. */
.export-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.export-acc {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  transition: border-color .2s, background .2s;
}
.export-acc[open] {
  border-color: var(--accent);
  background: rgba(0,229,255,.03);
}
.export-acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.export-acc-head::-webkit-details-marker { display: none; }
.export-acc:hover:not([open]) {
  border-color: var(--accent);
  background: rgba(0,229,255,.04);
}
.export-acc-head svg {
  width: 20px; height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}
.export-acc-title {
  font-family: 'Syne', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
}
.export-acc-tag {
  font-family: 'Space Mono', monospace;
  font-size: .58rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}
.export-acc-tag--pro {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0,229,255,.12);
}
.export-acc-chev {
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform .2s;
  margin-left: 2px;
}
.export-acc[open] .export-acc-chev {
  transform: rotate(45deg);
  border-color: var(--accent);
}
.export-acc-body {
  padding: 4px 16px 14px 46px;   /* 46px lines the text under the title,
                                    past the summary's icon */
}
.export-acc-desc {
  font-family: 'Space Mono', monospace;
  font-size: .68rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 12px 0;
}
.export-acc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.coming-soon {
  font-family: 'Space Mono', monospace;
  font-size: .58rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 7px;
}

/* Presentation submodal form */
.form-fields { display: flex; flex-direction: column; gap: 14px; }
.form-field   { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.required { color: var(--accent2); font-size: .7rem; }
.optional {
  font-size: .58rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 6px;
  text-transform: none;
  letter-spacing: 0;
}
.form-input {
  font-family: 'Space Mono', monospace;
  font-size: .75rem;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color .2s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }
.form-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.form-row .form-input { flex: 1; }
.form-row .form-field { flex: 1; min-width: 0; }
.form-row-sep {
  font-family: 'Space Mono', monospace;
  font-size: .8rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* ─── RESOLUTION RADIO PILLS ────────────────────────────────────────────── */
.radio-pills {
  display: flex;
  gap: 8px;
}
.radio-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.radio-pill:hover { border-color: #3a4570; }
.radio-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.radio-pill-title {
  font-family: 'Space Mono', monospace;
  font-size: .75rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.radio-pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  flex-shrink: 0;
  transition: border-color .2s, background .2s;
}
.radio-pill-sub {
  font-size: .65rem;
  color: var(--muted);
  padding-left: 15px;
}
.radio-pill:has(input:checked) {
  border-color: var(--accent);
  background: #0d1726;
}
.radio-pill:has(input:checked) .radio-pill-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px #0d1726;
}
.radio-pill:has(input:checked) .radio-pill-title { color: var(--accent); }

.radio-warning {
  margin-top: 8px;
  padding: 9px 12px;
  background: #2a1410;
  border: 1px solid #5a2e22;
  border-radius: var(--radius);
  color: #ffb38a;
  font-size: .72rem;
  line-height: 1.5;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.form-btn-cancel {
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.form-btn-cancel:hover { border-color: var(--accent2); color: var(--accent2); }
.form-btn-submit {
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  padding: 8px 18px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #000;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: opacity .2s;
}
.form-btn-submit:hover    { opacity: .85; }
.form-btn-submit:disabled { opacity: .4; cursor: not-allowed; }
.form-note {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  margin-top: 12px;
  min-height: 1rem;
  color: var(--accent);
}

/* ─── ORTHOMOSAIC PANEL ──────────────────────────────────────────────────── */
#ortho-section {
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: 32px;
}
.ortho-body { padding: 0 24px; }
.ortho-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  padding: 20px 0 16px;
}
.ortho-field { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.ortho-field--btn { display: flex; flex-direction: row; align-items: flex-end; gap: 8px; min-width: unset; }
.ortho-label {
  font-family: 'Space Mono', monospace;
  font-size: calc(var(--ui-scale, 1) * .62rem);
  color: #a8b2c8;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ortho-hint { color: #6b7a99; font-size: .85em; text-transform: none; letter-spacing: 0; }
.ortho-time { width: 130px; }
.ortho-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 9px 18px;
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.ortho-run-btn:hover:not(:disabled) { opacity: .85; }
.ortho-run-btn:disabled { opacity: .35; cursor: not-allowed; }
.ortho-cancel-btn {
  background: none;
  border: 1px solid var(--accent2);
  color: var(--accent2);
  padding: 9px 14px;
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity .15s;
}
.ortho-cancel-btn:hover { opacity: .75; }
.ortho-notice {
  background: #1a140a;
  border: 1px solid #5a3800;
  border-radius: var(--radius);
  color: #ffb347;
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  line-height: 1.6;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.ortho-progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}
.ortho-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s ease;
}
.ortho-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.ortho-stage {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  color: var(--accent);
  letter-spacing: .06em;
}
.ortho-pct { font-family: 'Space Mono', monospace; font-size: .65rem; color: var(--muted); }
.ortho-log {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  height: 160px;
  overflow-y: auto;
  font-family: 'Space Mono', monospace;
  font-size: calc(var(--ui-scale, 1) * .62rem);
  line-height: 1.7;
  color: var(--muted);
  scroll-behavior: smooth;
}
.ortho-log .log-frame { color: var(--text); }
.ortho-log .log-warn  { color: #ffb347; }
.ortho-log .log-ok    { color: var(--accent); }
.ortho-log .log-error { color: var(--accent2); }

/* ─── ORTHOMOSAIC INPUT WARNINGS MODAL ──────────────────────────────────── */
/* Deliberately above the normal modal layer (9000) — this should sit on top
   of the ortho-modal it follows, and of anything else that might be open,
   without depending on DOM order or the two modals never overlapping. */
#ortho-warnings-modal {
  z-index: 9500;
}
#ortho-warnings-modal .modal-box {
  border-color: #5a3800;
}
#ortho-warnings-modal .modal-title {
  color: #ffb347;
}
.ortho-warnings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ortho-warning-item {
  background: #1a140a;
  border: 1px solid #5a3800;
  border-left: 4px solid #ffb347;
  border-radius: var(--radius);
  color: #ffcf85;
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  line-height: 1.65;
  padding: 14px 16px;
}

/* ─── MODAL XL ───────────────────────────────────────────────────────────── */
.modal-box--xl { width: min(920px, calc(100vw - 32px)); }

/* ─── ORTHO SCRUBBER ─────────────────────────────────────────────────────── */
.ortho-scrubber-wrap {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0;
  user-select: none;
}

.ortho-preview-video {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #000;
}

/* Range scrub bar sits flush below the video */
.ortho-scrub-range {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  height: 28px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg);
  outline: none;
}
.ortho-scrub-range::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}
.ortho-scrub-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #000;
  margin-top: -6px;
  cursor: grab;
  box-shadow: 0 0 0 2px rgba(0,229,255,.25);
}
.ortho-scrub-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #000;
  cursor: grab;
}

/* Trim region indicator — thin coloured bar below the scrub handle */
.ortho-trim-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}
.ortho-trim-region {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--accent);
  opacity: .65;
  border-radius: 2px;
  /* left and width set by JS */
}

/* ─── TRIM CONTROLS ──────────────────────────────────────────────────────── */
.ortho-trim-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.ortho-trim-side {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ortho-trim-side--right { flex-direction: row-reverse; }

.ortho-trim-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ortho-trim-label {
  font-family: 'Space Mono', monospace;
  font-size: .6rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ortho-trim-value {
  font-family: 'Space Mono', monospace;
  font-size: .9rem;
  color: var(--text);
  min-width: 60px;
  text-align: center;
}
.ortho-trim-value--accent { color: var(--accent); font-size: 1.05rem; }

.ortho-trim-btn {
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 6px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #a8b2c8;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.ortho-trim-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── ADVANCED SETTINGS DISCLOSURE ──────────────────────────────────────── */
.ortho-advanced {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 4px;
}
.ortho-advanced-summary {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  color: var(--muted);
  letter-spacing: .07em;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  outline: none;
}
.ortho-advanced-summary::-webkit-details-marker { display: none; }
.ortho-advanced-summary::before {
  content: '▶ ';
  font-size: .6em;
  transition: transform .15s;
}
details[open] .ortho-advanced-summary::before { content: '▼ '; }
.ortho-advanced-body { padding: 12px 14px 14px; }
.ortho-adv-row { display: flex; gap: 20px; flex-wrap: wrap; }


/* ── Leg alignment modal (manual inter-leg adjustment) ─────────────────── */
.legadj-hint {
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 12px;
  line-height: 1.5;
}
.legadj-hint strong { color: var(--text); font-weight: 600; }
.legadj-canvas-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 420px;
}
#legadj-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none; /* pointer-drag panning owns touch gestures */
}
.legadj-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.legadj-viewbtns { display: flex; gap: 8px; }
.legadj-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.legadj-pad-mid { display: flex; gap: 34px; }
.legadj-arrow {
  width: 34px;
  height: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.legadj-arrow:hover { background: rgba(0, 229, 255, .08); border-color: var(--accent); }
.legadj-arrow:active { background: rgba(0, 229, 255, .18); }
.legadj-readout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  font-size: .8rem;
  color: var(--muted);
}
.legadj-val {
  font-family: 'Space Mono', monospace;
  color: var(--accent);
}
.legadj-coarse-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.legadj-coarse-label input { accent-color: var(--accent); }

/* ── Closed Beta Access Gate (2026-07-24) ────────────────────────────────
   Full-screen password modal shown on first visit. Reuses .modal-backdrop
   and .modal-box for base layout; the classes below add branding, the
   CLOSED BETA badge, welcome copy styling, and the error state. Also
   locks page scroll while the gate is up. */
html.beta-locked, body.beta-locked {
  overflow: hidden !important;
  height: 100%;
}
.beta-gate-backdrop {
  z-index: 99999;
  display: flex;
  background: rgba(6, 8, 12, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.beta-gate-box {
  background: linear-gradient(180deg, #0d1117 0%, #0a0c10 100%);
  border: 1px solid var(--border);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(0, 229, 255, 0.15);
  overflow: hidden;
  animation: beta-gate-in 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes beta-gate-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.beta-gate-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.06) 0%, transparent 60%);
}
.beta-badge {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 3px;
  padding: 3px 7px;
  text-transform: uppercase;
}
.beta-gate-header .modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.beta-gate-body { padding: 20px 22px 22px; }
.beta-welcome {
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 14px;
}
.beta-welcome strong { color: var(--text); font-weight: 700; }
.beta-instruct {
  font-family: 'Syne', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
}
#beta-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.beta-input {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 11px 12px;
}
.beta-submit {
  padding: 11px 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
}
.beta-error {
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  color: var(--accent2);
  margin: 10px 0 0;
  min-height: 14px;
  opacity: 0;
  transition: opacity 0.15s;
}
.beta-error.visible { opacity: 1; }
.beta-footer {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.beta-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
.beta-link:hover { border-bottom-style: solid; }

/* ── Closed Beta Terms & Conditions Gate ──────────────────────────────────
   Second, separate full-screen gate shown AFTER the password gate succeeds.
   Reuses .beta-gate-backdrop / .beta-gate-box / .beta-gate-header /
   .beta-badge / .beta-gate-body / .beta-welcome / .beta-instruct /
   .beta-footer / .beta-link directly, so it's a pixel-perfect match to the
   password gate's styling with no duplicated rules. Only what's actually
   new — the scrollable terms text and the agree checkbox — gets its own
   classes below. Unlike the password gate, this one is NOT persisted: it is
   shown fresh on every page load. */
.terms-scroll-box {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.02);
}
.terms-scroll-box::-webkit-scrollbar { width: 8px; }
.terms-scroll-box::-webkit-scrollbar-track { background: transparent; }
.terms-scroll-box::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.terms-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.terms-list li {
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}
.terms-list li strong { color: var(--text); font-weight: 700; }
.terms-checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
}
.terms-checkbox-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.terms-checkbox-row span {
  font-family: 'Syne', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
#terms-agree-submit { width: 100%; justify-content: center; }

/* DEFENSIVE FIX: .beta-gate-box (shared with the password gate, where it's
   intentional — clips the corner gradient/animation on short content) sets
   overflow:hidden, which silently overrides .modal-box's own
   overflow-y:auto and defeats scrolling for the much longer terms content.
   .terms-scroll-box above is meant to be the thing that actually scrolls,
   but this makes the OUTER box scrollable too, scoped only to the terms
   modal via #terms-gate-backdrop — so the whole modal can always be
   scrolled to reach its content even if something about the inner box's
   sizing doesn't come out as expected on a given screen. Belt and braces:
   there should never be a way for this modal's content to become
   unreachable. */
#terms-gate-backdrop .beta-gate-box {
  overflow-y: auto;
  max-height: 90vh;
}

/* ── Password gate form (rebuilt — markup had been removed, CSS above was
   already there and waiting) ────────────────────────────────────────────── */
.beta-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-sizing: border-box;
}
.beta-input:focus {
  outline: none;
  border-color: var(--accent);
}
.beta-submit { width: 100%; justify-content: center; }

/* ── Header session controls (2026-07-26) ──────────────────────────────
   Save / Load buttons + autosave status indicator on the right of the
   header. The status pill goes idle (invisible) → "UNSAVED" (accent2) →
   "ALL CHANGES SAVED" (accent), giving the user Google-Docs-style
   confidence that their edits are being persisted. */
header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-brand { flex: 0 0 auto; }
.header-session {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-right: 4px;
}
.session-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  min-width: 110px;
  justify-content: flex-end;
}
.session-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.session-status[data-state="unsaved"] { opacity: 1; color: var(--accent2); }
.session-status[data-state="unsaved"]::after { content: 'UNSAVED'; }
.session-status[data-state="saved"]   { opacity: 1; color: var(--accent); }
.session-status[data-state="saved"]::after   { content: 'ALL CHANGES SAVED'; }
.session-status[data-state="error"]   { opacity: 1; color: var(--accent2); }
.session-status[data-state="error"]::after   { content: 'SAVE FAILED'; }

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.header-btn svg { width: 14px; height: 14px; }
.header-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.header-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.header-btn--primary {
  border-color: rgba(0, 229, 255, 0.35);
  color: var(--accent);
  background: rgba(0, 229, 255, 0.06);
}
.header-btn--primary:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.14);
  border-color: var(--accent);
}

/* Snapshot thumbnail placeholder — used while a restored capture's frame
   is being regenerated by seeking the video. The SVG placeholder already
   has its own spinning arc; this just adds a subtle border so the state
   is legible. 2026-07-26. */
.snap-thumb--placeholder {
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: #0a0c10;
}

/* ── KML export colour swatches (2026-08-01) ─────────────────────────────
   Row of round swatches for choosing the marker colour applied to pins,
   direction lines, and their end markers on a Google Earth export.
   Selected swatch gets a text-coloured ring with a surface-coloured
   inset so it reads clearly against any swatch background including
   white. Custom swatch shows a subtle rainbow so it's obviously
   distinct from the preset colours. */
.colour-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  align-items: center;
}
.colour-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--sw, #888);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease, border-color 0.15s ease;
  position: relative;
  flex: 0 0 auto;
}
.colour-swatch:hover { transform: scale(1.1); }
.colour-swatch--selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface) inset;
}
.colour-swatch--custom {
  background: conic-gradient(from 0deg, #ff3c6e, #ffb300, #7cff3c, #00e5ff, #b84dff, #ff3c6e);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.colour-swatch--custom input[type="color"] {
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 0;
  padding: 0;
}
