:root { color-scheme: dark; font-family: "Instrument Sans", system-ui, sans-serif; background: #0b131b; color: #e8f0f0; }
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1450px; margin: auto; padding: 8px 18px 18px; }
.replay-header { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; font-size: .8125rem; }
.replay-header h1 { margin: 0; font-size: inherit; }
.replay-header #status { margin: 0 0 0 auto; }
h2 { font-size: 1rem; margin-top: 0; }
p { color: #a9bcc6; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 245px; gap: 14px; }
.map { height: min(64vh, 680px); min-height: 330px; position: relative; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; border-radius: 10px; }
aside, .timeline { background: #14222d; border: 1px solid #263947; border-radius: 10px; padding: 16px; }
aside { align-self: start; padding: 12px; font-size: .88rem; }
aside h2 { margin-bottom: 5px; }
aside label { display: block; padding: 2px 0; }
aside hr { margin: 8px 0; }
aside #details { margin: 6px 0; }
aside #details:empty { display: none; }
.feedback { max-width: 460px; margin: 16px auto 0; padding: 16px; background: #14222d; border: 1px solid #263947; border-radius: 10px; font-size: .88rem; }
.feedback h2 { margin-bottom: 10px; }
.feedback form { display: grid; gap: 7px; }
.feedback textarea, .feedback input { width: 100%; padding: 7px 10px; background: #0b131b; color: inherit; border: 1px solid #405665; border-radius: 6px; font: inherit; }
.feedback textarea { resize: vertical; }
.feedback p { margin: 0; }
.feedback button { justify-self: start; }
.feedback button:disabled { opacity: .6; cursor: default; }
#feedback-status:empty { display: none; }
.site-credit { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; margin-top: 12px; color: #a9bcc6; font-size: .8125rem; }
.sidebar-qr { display: block; width: 100%; max-width: 320px; margin: 12px auto 0; padding: 8px; background: #fff9e9; border: 0; border-radius: 4px; }
.sidebar-qr:hover { background: #fff9e9; }
.sidebar-qr img { display: block; width: 100%; height: auto; }
#qr-preview { width: min(480px, calc(100% - 24px), calc(100dvh - 80px)); padding: 12px; background: #14222d; color: #e8f0f0; border: 1px solid #405665; border-radius: 10px; }
#qr-preview::backdrop { background: #080d14b8; }
#qr-preview form { display: flex; justify-content: flex-end; margin-bottom: 8px; }
#qr-preview img { display: block; width: 100%; height: auto; padding: 12px; background: #fff9e9; border-radius: 4px; }
.layer-sources { margin-top: 8px; }
.layer-sources summary { cursor: pointer; color: #a9bcc6; }
hr { border: 0; border-top: 1px solid #304452; margin: 14px 0; }
select { width: 100%; }
button, select { background: #223746; border: 1px solid #405665; color: inherit; padding: 7px 10px; border-radius: 6px; font: inherit; }
button { cursor: pointer; }
button:hover { background: #344c5e; }
input { accent-color: #71e1c8; }
.zoom { position: absolute; bottom: 12px; left: 12px; display: flex; gap: 6px; }
.timeline { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#download-progress { width: min(100%, 360px); accent-color: #71e1c8; }
#seek { flex: 1 1 160px; }
#time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.note, #details { font-size: .86rem; line-height: 1.5; }
@media (max-width: 690px) { main { padding: 6px 8px 8px; } .workspace { grid-template-columns: 1fr; } .replay-header #status { margin-left: 0; } }

.swatch { display: inline-block; width: 16px; margin-left: 5px; border-top: 3px solid; vertical-align: middle; }
.swatch.power { color: #f8aa58; }
.swatch.telecom { color: #c2a2ff; }
.swatch.chart { color: #77caff; border-top-style: dashed; }
.note a { color: #a9d9ff; }
.swatch.power-link { color: #ffd46b; border-top-style: dashed; }

[hidden] { display: none; }
.swatch.fibre { color: #e5a8e7; border-top-style: dotted; }
.swatch.archive { color: #72d8be; border-top-style: dashed; }

.detection-feed { margin-top: 14px; padding: 16px; background: #14222d; border: 1px solid #263947; border-radius: 10px; }
.feed-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.feed-header h2 { margin: 0; }
.feed-header label { font-size: .88rem; }
.feed-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.feed-controls select { width: auto; }
.alert-corridor-control input { display: block; width: 100%; margin: 0; }
.detection-feed:has(#feed-scroll-toggle:checked) #feed-table { max-height: 240px; overflow: auto; scrollbar-gutter: stable; }
.detection-feed table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.detection-feed th, .detection-feed td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #263947; }
.detection-feed th { position: sticky; top: 0; background: #14222d; color: #a9bcc6; }
.detection-feed th:nth-child(2), .detection-feed td:nth-child(2) { width: 8rem; }
.detection-feed td:nth-child(4) { white-space: nowrap; font-variant-numeric: tabular-nums; }

.feed-entry { cursor: pointer; }
.feed-entry:hover, .feed-entry:focus-within { background: #223746; }
.feed-jump { max-width: 7rem; overflow-wrap: anywhere; background: transparent; border: 0; padding: 0; color: #a9d9ff; text-align: left; }
.feed-jump:hover { background: transparent; text-decoration: underline; }

#replay-date { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
#replay-date input, #replay-date button { min-height: 28px; padding: 2px 6px; }
#replay-date input { background: #223746; border: 1px solid #405665; border-radius: 6px; color: inherit; font: inherit; }

#vessel-preview {
  width: min(900px, calc(100% - 24px));
  padding: 18px;
  background: #14222d;
  color: #e8f0f0;
  border: 1px solid #405665;
  border-radius: 10px;
}
#vessel-preview::backdrop { background: #080d14b8; }
#vessel-preview form { float: right; }
#vessel-preview-chart { display: block; width: 100%; height: auto; background: #0d2638; border-radius: 8px; }

#vessel-preview-legend, #vessel-type-key { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0; list-style: none; }
#vessel-preview-legend li, #vessel-type-key li { border-left: 4px solid; padding-left: 6px; }
