/* SonarSniffer survey report. Dark by design: sonar imagery reads best on a dark surround. */
:root {
  --bg: #070d18;
  --surface: #0e1726;
  --surface-2: #142035;
  --line: #22314a;
  --text: #e6edf7;
  --muted: #8a9bb5;
  --accent: #f5a524;
  --accent-ink: #1a1203;
  --wreck: #ff5a5a;
  --structure: #40c4ff;
  --debris: #7be27b;
  --fish: #c38bff;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.note { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.note.banner { background: rgba(245, 165, 36, .08); border: 1px solid rgba(245, 165, 36, .25); color: #f3d9a8; padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; }

/* Header */
.top { display: flex; align-items: center; gap: 24px; padding: 18px 28px; background: linear-gradient(180deg, #0c1628, var(--bg)); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand svg { width: 38px; height: 38px; color: var(--accent); flex: none; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.brand h1 { font-size: 22px; overflow-wrap: anywhere; }
.top-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; flex: 1; }
.top-meta b { color: var(--text); font-weight: 600; }
.top-actions { display: flex; gap: 8px; }

/* Tabs */
.tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 2px; padding: 0 20px; background: rgba(7, 13, 24, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { appearance: none; background: none; border: 0; color: var(--muted); font: 600 14px var(--font); padding: 14px 14px 12px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--surface-2); color: var(--accent); font-size: 12px; text-align: center; }

main { flex: 1; padding: 22px 28px 40px; width: 100%; max-width: 1600px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Cards and grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.kpi .s { color: var(--muted); font-size: 12px; }
.hero { margin: 0; }
.hero-img { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.hero-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.class-bars { display: flex; flex-direction: column; gap: 8px; }
.class-bar { display: grid; grid-template-columns: 90px 1fr 44px; align-items: center; gap: 10px; font-size: 13.5px; }
.class-bar .track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.class-bar .fill { height: 100%; border-radius: 4px; }
.class-bar .n { text-align: right; font-variant-numeric: tabular-nums; }
.mini-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; transition: border-color .15s; }
.mini:hover { border-color: var(--accent); }
.mini img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #000; }
.mini div { padding: 6px 8px; font-size: 12px; display: flex; justify-content: space-between; gap: 6px; }

/* Buttons and chips */
.chip, .btn { appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 13px var(--font); padding: 6px 12px; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip:hover, .btn:hover { border-color: #3a4d6e; }
.chip.active, .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn { border-radius: 10px; padding: 9px 14px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.link { appearance: none; background: none; border: 0; color: var(--accent); font: 600 13px var(--font); cursor: pointer; padding: 0; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* Charts */
.chart { width: 100%; height: 220px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .axis line, .chart .grid line { stroke: var(--line); }
.chart .legend text { fill: var(--text); font-size: 12px; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13px; }

/* Maps */
.map-panel.active { display: block; }
.map-wrap { position: relative; height: calc(100vh - 210px); min-height: 480px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #0a1220; }
.map { position: absolute !important; inset: 0; width: 100%; height: 100%; }
.side { position: absolute; top: 12px; left: 12px; width: 250px; max-height: calc(100% - 24px); overflow: auto; background: rgba(14, 23, 38, .94); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 14px; box-shadow: var(--shadow); font-size: 13.5px; z-index: 2; }
.side .row { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.side select { width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; }
.slider { width: 100%; accent-color: var(--accent); }
.tool-row { display: flex; flex-wrap: wrap; gap: 6px; }
.measure-out { margin-top: 8px; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.class-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px 24px; }
.class-filter .chip { padding: 3px 9px; font-size: 12px; }
.chart-list { display: flex; flex-direction: column; gap: 4px; }
.chart-opt { display: grid; grid-template-columns: 18px 1fr; gap: 2px 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.chart-opt:hover { background: var(--surface-2); }
.chart-opt.active { border-color: var(--accent); background: rgba(245, 165, 36, .07); }
.chart-opt input { margin: 3px 0 0; accent-color: var(--accent); }
.chart-opt small { grid-column: 2; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.coords { position: absolute; right: 12px; bottom: 30px; background: rgba(7, 13, 24, .85); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font: 12px var(--mono); color: var(--text); z-index: 2; pointer-events: none; }
.map-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--muted); z-index: 3; background: rgba(7, 13, 24, .8); }
.drawer { position: absolute; left: 274px; right: 12px; bottom: 12px; max-height: 42%; display: flex; flex-direction: column; background: rgba(14, 23, 38, .97); border: 1px solid var(--line); border-radius: 12px; z-index: 2; box-shadow: var(--shadow); }
.drawer-head { display: flex; gap: 12px; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.drawer-head .link { margin-left: auto; }
.drawer-body { overflow: auto; }
.maplibregl-popup-content { background: var(--surface) !important; color: var(--text); border: 1px solid var(--line); border-radius: 12px !important; padding: 12px !important; box-shadow: var(--shadow) !important; font: 13px/1.45 var(--font); }
.maplibregl-popup-tip { border-top-color: var(--surface) !important; border-bottom-color: var(--surface) !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; }
.pop img { width: 220px; display: block; border-radius: 8px; margin: 8px 0; background: #000; }
.pop .k { color: var(--muted); }
.maplibregl-ctrl-scale { background: rgba(7, 13, 24, .8) !important; color: var(--text) !important; border-color: var(--muted) !important; }

/* Detections */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar select { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font: 600 13px var(--font); }
.toolbar .inline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.toolbar input[type=range] { accent-color: var(--accent); }
.spacer { flex: 1; }
.seg { display: inline-flex; gap: 4px; }
.det-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.det { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.det .pic { position: relative; background: #000; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; cursor: zoom-in; overflow: hidden; }
.det .pic img { width: 100%; height: 100%; object-fit: contain; }
.det .pic .noimg { color: var(--muted); font-size: 12px; }
.det .badge { position: absolute; top: 10px; left: 10px; font: 700 11px var(--font); text-transform: uppercase; letter-spacing: .08em; padding: 4px 8px; border-radius: 6px; color: #08101c; }
.det .idtag { position: absolute; top: 10px; right: 10px; font: 600 11px var(--mono); padding: 3px 7px; border-radius: 6px; background: rgba(7, 13, 24, .8); color: var(--text); }
.det .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.det .title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.det .title strong { font-size: 15px; }
.confbar { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.confbar span { display: block; height: 100%; background: var(--accent); }
.det dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 12.5px; }
.det dt { color: var(--muted); }
.det dd { margin: 0; font-variant-numeric: tabular-nums; }
.det .what { font-size: 12.5px; color: #c9d4e5; }
.det .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.det .acts .chip { padding: 4px 10px; font-size: 12px; }
.empty { text-align: center; padding: 40px; }

/* Tables */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px; cursor: pointer; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl td { padding: 7px 10px; border-bottom: 1px solid rgba(34, 49, 74, .6); white-space: nowrap; }
.tbl tr:hover td { background: rgba(245, 165, 36, .05); }
.tbl tr.clickable { cursor: pointer; }

/* Imagery */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.img-card { padding: 0; overflow: hidden; }
.img-card .thumb { background: #000; height: 300px; display: flex; align-items: center; justify-content: center; cursor: zoom-in; overflow: hidden; }
.img-card .thumb img { max-width: 100%; max-height: 100%; }
.img-card .cap { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.img-card .cap div { min-width: 0; }

/* Video */
.video-card video { width: 100%; max-height: 72vh; background: #000; border-radius: 10px; display: block; }

/* Globe */
.globe { position: relative; height: 70vh; min-height: 420px; margin-top: 18px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

/* Files */
.file-group { margin-bottom: 18px; }
.file-group h3 { margin-top: 6px; }

/* Lightbox with pan and zoom */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(3, 6, 12, .92); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lb-inner { position: relative; width: 94vw; height: 92vh; display: flex; flex-direction: column; }
.lb-stage { flex: 1; overflow: hidden; position: relative; cursor: grab; border-radius: 10px; background: #000; }
.lb-stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; image-rendering: auto; }
.lb-caption { padding: 10px 4px 0; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lb-close { position: absolute; top: -6px; right: -6px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 22px; cursor: pointer; }

.foot { padding: 18px 28px 28px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

@media (max-width: 1100px) {
  .grid-2, .grid-3, .grid-charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .top { padding: 14px 16px; gap: 12px; }
  main { padding: 16px 16px 32px; }
  .tabs { padding: 0 8px; }
  .side { width: auto; right: 12px; max-height: 45%; }
  .drawer { left: 12px; }
  .map-wrap { height: calc(100vh - 170px); }
  .mini-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
