:root {
  color-scheme: dark;
  --bg: #08131d;
  --sidebar: #0a1621;
  --panel: #0d1b27;
  --panel-2: #101f2d;
  --line: #1b2c3a;
  --line-soft: #172633;
  --text: #e6edf2;
  --muted: #8293a1;
  --dim: #5f7383;
  --blue: #45b7e9;
  --amber: #e8ad53;
  --green: #49c9a0;
  --purple: #a28bec;
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; min-width: 360px; background: var(--bg); }
body.auth-locked .app-shell { visibility: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 238px; flex: 0 0 238px; background: var(--sidebar); border-right: 1px solid #172632;
  display: flex; flex-direction: column; min-height: 100vh; padding: 25px 15px 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; padding: 0 10px 38px; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; background: #10344a; color: #62c9f1; font: 800 12px Manrope, sans-serif; letter-spacing: -.5px; border: 1px solid #21506a; }
.brand strong { display: block; font: 800 12px Manrope, sans-serif; letter-spacing: 1.5px; }
.brand small { display: block; font: 500 8px "DM Mono", monospace; color: #748897; letter-spacing: 1.2px; margin-top: 4px; }
.nav-label { color: #627586; font: 500 9px "DM Mono", monospace; letter-spacing: 1.4px; padding: 0 12px 12px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { height: 42px; display: flex; align-items: center; gap: 12px; border-radius: 6px; padding: 0 12px; font-size: 12px; text-decoration: none; color: #8ea0ae; transition: .15s ease; }
.nav-item:hover { color: var(--text); background: #101f2b; }
.nav-item.active { background: #112a3a; color: #65c8ef; box-shadow: inset 2px 0 #48b8e4; }
.nav-icon { width: 16px; font-size: 17px; text-align: center; color: #8297a6; }
.nav-item.active .nav-icon { color: #65c8ef; }
.nav-count { margin-left: auto; font: 500 10px "DM Mono", monospace; color: #dfa94e; background: #332819; border-radius: 4px; padding: 3px 6px; }
.sidebar-bottom { margin-top: auto; }
.system-card { background: #0c1a25; border: 1px solid #1b2b38; border-radius: 7px; padding: 13px 12px; margin: 0 1px 17px; }
.system-title { color: #758997; font: 500 9px "DM Mono", monospace; letter-spacing: .9px; margin-bottom: 13px; }
.status-dot, .pulse { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 8px #49c9a066; }
.system-row { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: #90a0ac; margin: 9px 0 0; }
.system-row strong { color: #55c69d; font: 500 9px "DM Mono", monospace; }
.system-row .amber-text { color: #e6b052; }
.operator { border-top: 1px solid #1a2a36; padding: 14px 5px 0; display: flex; align-items: center; gap: 9px; }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; background: #182b3a; color: #92a8b8; border: 1px solid #2a4050; border-radius: 50%; font: 500 9px "DM Mono", monospace; }
.operator strong { display: block; font-size: 10px; font-weight: 600; }
.operator small { display: block; color: #708391; font-size: 9px; margin-top: 3px; }
.operator .more { margin-left: auto; color: #8193a1; letter-spacing: 2px; }

.main-content { width: calc(100% - 238px); max-width: 1680px; margin: 0 auto; padding: 0 35px 20px; }
.topbar { height: 61px; border-bottom: 1px solid #172632; display: flex; justify-content: space-between; align-items: center; }
.breadcrumb { color: #80919f; font-size: 11px; }
.breadcrumb span { color: #455867; padding: 0 9px; }
.breadcrumb strong { color: #c9d4db; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 19px; }
.session-label { color: #a7b6c0; font: 9px "DM Mono", monospace; }
.demo-pill { color: #e9b55e; font: 500 9px "DM Mono", monospace; letter-spacing: .35px; border: 1px solid #554224; background: #211d16; border-radius: 4px; padding: 6px 9px; }
.demo-pill.live-pill { color: #69d7ad; border-color: #285946; background: #10251e; }
.demo-pill.live-pill .pulse { background: #69d7ad; box-shadow: 0 0 7px #69d7ad; }
.pulse { width: 5px; height: 5px; background: #e4aa4d; box-shadow: 0 0 7px #e4aa4d; animation: pulse 2s infinite; }
.clock { color: #91a1ac; font: 10px "DM Mono", monospace; }
.icon-button { border: 1px solid #223443; background: #10202d; border-radius: 5px; height: 29px; width: 30px; color: #a7b6c0; font-size: 18px; line-height: 1; }
.icon-button:hover, .small-button:hover { border-color: #3a647e; color: #74caed; }
.spinning { animation: spin .7s ease; }
.page-heading { display: flex; justify-content: space-between; align-items: end; padding: 25px 1px 20px; }
.eyebrow { color: #738998; font: 500 9px "DM Mono", monospace; letter-spacing: 1.25px; margin: 0 0 10px; }
.eyebrow-line { display: inline-block; width: 18px; height: 1px; background: #2b5369; margin: 0 7px 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { color: #edf2f5; font: 700 26px Manrope, sans-serif; letter-spacing: -.75px; margin: 0; }
.subheading { color: #8b9ba8; font-size: 11px; margin: 7px 0 0; }
.updated-label { color: #647988; font: 9px "DM Mono", monospace; letter-spacing: .6px; text-align: right; padding-bottom: 3px; }
.updated-label strong { display: block; color: #a4b2bc; font-weight: 400; margin-top: 6px; font-size: 10px; }
.notice-banner { border: 1px solid #56452c; border-radius: 5px; background: #201d17; display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 17px; }
.notice-icon { flex: 0 0 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; color: #e9b661; font: 600 10px "DM Mono", monospace; border: 1px solid #a87d3d; }
.notice-banner p { color: #b7a887; font-size: 10px; line-height: 1.5; margin: 0; }
.notice-banner p strong { color: #efc16b; font: 500 9px "DM Mono", monospace; letter-spacing: .5px; margin-right: 5px; }
.notice-dismiss { margin-left: auto; border: 0; background: none; color: #9c8b68; font-size: 18px; padding: 0 4px; }
.navigation-ticker { display: flex; align-items: center; gap: 10px; height: 34px; margin: -5px 0 14px; padding: 0 10px; border: 1px solid #2d3d42; border-radius: 4px; background: #0d1b24; overflow: hidden; }
.ticker-label { flex: 0 0 auto; color: #e1b45f; font: 500 8px "DM Mono", monospace; letter-spacing: .6px; white-space: nowrap; }
.ticker-window { min-width: 0; flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: inline-flex; gap: 42px; min-width: max-content; color: #aab9c1; font: 9px "DM Mono", monospace; white-space: nowrap; animation: ticker-scroll 60s linear infinite; }
.ticker-track span::after { content: " ◇"; color: #e1b45f; margin-left: 32px; }
.ticker-track.ticker-static { display: block; overflow: hidden; text-overflow: ellipsis; animation: none; }
.ticker-info { flex: 0 0 auto; width: 17px; height: 17px; border: 1px solid #53646a; border-radius: 50%; color: #a4b4ba; background: transparent; font: 9px "DM Mono", monospace; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 13px 15px 12px; min-height: 103px; }
.metric-top { display: flex; justify-content: space-between; color: #8b9ba7; font-size: 10px; align-items: center; }
.metric-icon { width: 23px; height: 23px; border-radius: 5px; display: grid; place-items: center; font-size: 15px; }
.metric-icon.blue { background: #102d3c; color: var(--blue); }
.metric-icon.amber { background: #302719; color: var(--amber); }
.metric-icon.green { background: #142e2b; color: var(--green); }
.metric-icon.purple { background: #25233a; color: var(--purple); }
.metric-value { font: 600 24px Manrope, sans-serif; color: #edf2f4; margin-top: 5px; letter-spacing: -.6px; }
.metric-value small { color: #778a98; font: 500 12px "DM Mono", monospace; }
.metric-word { font: 600 17px Manrope, sans-serif; padding: 4px 0; }
.metric-foot { color: #728491; font-size: 9px; margin-top: 5px; }
.tiny-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; vertical-align: 1px; margin-right: 4px; }
.blue-dot { background: var(--blue); }.amber-dot { background: var(--amber); }.green-dot { background: var(--green); }.purple-dot { background: var(--purple); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(300px, .92fr); gap: 14px; align-items: stretch; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.panel-header { min-height: 59px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); gap: 12px; }
.panel-header h2 { font: 600 12px Manrope, sans-serif; color: #dce5eb; margin: 0; }
.panel-header p { color: #758895; font-size: 9px; margin: 4px 0 0; }
.map-actions { display: flex; align-items: center; gap: 12px; }
.small-button { white-space: nowrap; border: 1px solid #273b49; background: #10202c; border-radius: 4px; color: #a0afb9; font-size: 9px; padding: 6px 8px; }
.map-panel:fullscreen { display: flex; flex-direction: column; width: 100vw; height: 100vh; padding: 12px; overflow: auto; background: #0a1118; }
.map-panel:fullscreen .map-wrap { flex: 1 0 auto; height: calc(100vh - 300px); min-height: 360px; }
.map-wrap { position: relative; overflow: hidden; height: 420px; background: #10212a; }
#map { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; }
#map:active { cursor: grabbing; }
#map.map-zooming { cursor: crosshair; }
.map-zoom-selection { fill: #43b9e833; stroke: #8be1f7; stroke-width: 1.5; stroke-dasharray: 6 4; }
.map-gesture-hint { position: absolute; top: 10px; right: 12px; padding: 5px 7px; color: #dce8ed; background: #07141dcc; border: 1px solid #1d3440; border-radius: 3px; font: 8px "DM Mono", monospace; pointer-events: none; }
.map-water { fill: #f0f4e9; font: 11px "DM Mono", monospace; letter-spacing: 2.8px; opacity: .9; paint-order: stroke; stroke: #172a35; stroke-width: 3px; }
.map-region-label { fill: #f0f4e9; font: 600 18px Manrope, sans-serif; letter-spacing: 3px; opacity: .5; paint-order: stroke; stroke: #172a35; stroke-width: 4px; }
.map-city { pointer-events: none; }
.map-city-dot { fill: #ffe083; stroke: #172a35; stroke-width: 2px; }
.map-city-label { fill: #f4f3e8; font: 600 10px "DM Sans", sans-serif; paint-order: stroke; stroke: #172a35; stroke-width: 3px; stroke-linejoin: round; }
.map-coastal-point { pointer-events: none; }
.map-coastal-mark { fill: #53ddd3; stroke: #0a3038; stroke-width: 2px; }
.map-coastal-label { fill: #9df6eb; font: 600 9px "DM Sans", sans-serif; paint-order: stroke; stroke: #10212a; stroke-width: 3px; stroke-linejoin: round; }
.map-labels { fill: #e3ebeb; font: 9px "DM Mono", monospace; paint-order: stroke; stroke: #172a35; stroke-width: 3px; }
.vessel-marker { cursor: pointer; animation: marker-in .35s ease both; outline: none; }
.vessel-category-fishing { --marker-color: #ffd166; --marker-halo: #ffd16635; }
.vessel-category-cargo { --marker-color: #55c5f0; --marker-halo: #55c5f035; }
.vessel-category-tanker { --marker-color: #ff916f; --marker-halo: #ff916f35; }
.vessel-category-passenger { --marker-color: #c39bff; --marker-halo: #c39bff35; }
.vessel-category-service { --marker-color: #6fddb4; --marker-halo: #6fddb435; }
.vessel-category-other { --marker-color: #d3dee5; --marker-halo: #d3dee535; }
.marker-halo { fill: var(--marker-halo, #d3dee535); stroke: var(--marker-color, #d3dee5); stroke-width: 1; }
.marker-core { fill: var(--marker-color, #d3dee5); stroke: #10212a; stroke-width: 1.5; }
.marker-course { fill: none; stroke: var(--marker-color, #d3dee5); stroke-width: 1.5; }
.vessel-marker:hover .marker-halo, .vessel-marker:focus .marker-halo { filter: brightness(1.5); stroke-width: 1.5; }
.vessel-type-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 15px; padding: 8px 12px; border-top: 1px solid #182a37; background: #0b1823; }
.vessel-type-key { display: inline-flex; align-items: center; gap: 5px; color: #aab8c0; font-size: 8px; white-space: nowrap; }
.vessel-type-key svg { width: 13px; height: 13px; overflow: visible; }
.vessel-type-key path { fill: var(--marker-color); stroke: #10212a; stroke-width: 1.5; }
.map-point-key { display: inline-flex; align-items: center; gap: 5px; color: #aab8c0; font-size: 8px; white-space: nowrap; }
.map-point-key svg { width: 13px; height: 13px; overflow: visible; }
.map-point-key path { fill: #53ddd3; stroke: #0a3038; stroke-width: 1.5; }
.map-scale { position: absolute; bottom: 11px; left: 12px; background: #07141dcf; padding: 6px 8px; color: #899ba7; font: 9px "DM Mono", monospace; border: 1px solid #1d3440; border-radius: 3px; }
.map-scale span { color: #56cae9; margin-right: 4px; }
.map-imagery-status { position: absolute; top: 10px; left: 12px; padding: 5px 7px; color: #e3ebeb; background: #07141dcc; border: 1px solid #1d3440; border-radius: 3px; font: 8px "DM Mono", monospace; }
.map-attribution { position: absolute; right: 46px; bottom: 11px; max-width: 55%; padding: 4px 6px; color: #e3ebeb; background: #07141dcc; border-radius: 3px; font: 7px "DM Mono", monospace; text-align: right; text-decoration: none; }
.map-attribution:hover { text-decoration: underline; }
.map-zoom { position: absolute; right: 12px; bottom: 11px; display: grid; gap: 3px; }
.map-zoom button { width: 25px; height: 24px; color: #a6b5bf; border: 1px solid #2a3e4d; background: #0d1b27e8; border-radius: 3px; }
.map-zoom button:disabled { opacity: .4; cursor: not-allowed; }
.map-tooltip { position: absolute; z-index: 3; min-width: 190px; background: #0b1823f5; border: 1px solid #294455; border-radius: 4px; padding: 9px 10px; pointer-events: none; box-shadow: 0 5px 20px #0005; }
.map-tooltip strong, .map-tooltip span { display: block; font-size: 9px; margin-bottom: 4px; color: #b8c5cc; }
.map-tooltip strong { color: #e8f2f6; font-size: 10px; }
.map-footer { height: 31px; border-top: 1px solid #182a37; display: flex; justify-content: space-between; align-items: center; padding: 0 12px; color: #748794; font-size: 8px; }
.map-footer .tiny-dot { margin-right: 4px; }
.ais-coverage-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 13px; border-top: 1px solid #182a37; background: #0b1823; }
.ais-coverage-summary.alert-active { border-top-color: #9c6632; background: #211a15; }
.ais-coverage-summary h3 { margin: 0 0 4px; color: #c9d6dc; font: 500 9px "DM Mono", monospace; letter-spacing: .5px; text-transform: uppercase; }
.ais-coverage-summary p { margin: 0; color: #81939f; font-size: 9px; line-height: 1.5; }
.ais-coverage-summary .ais-coverage-alert { margin-top: 5px; color: #f0b46a; font-weight: 600; }
.ais-coverage-summary strong { color: #66cda7; font: 600 22px Manrope, sans-serif; white-space: nowrap; }
.ais-source-comparison { padding: 11px 13px 13px; border-top: 1px solid #182a37; background: #0a1620; }
.ais-source-heading h3 { margin: 0 0 4px; color: #c9d6dc; font: 500 9px "DM Mono", monospace; letter-spacing: .5px; text-transform: uppercase; }
.ais-source-heading p { margin: 0 0 9px; color: #81939f; font-size: 9px; line-height: 1.5; }
.ais-source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.ais-source-card { min-width: 0; padding: 8px; border: 1px solid #1b2e3b; border-radius: 3px; background: #0d1b27; }
.ais-source-card-top { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin-bottom: 7px; }
.ais-source-card h4 { margin: 0; color: #cbd7dd; font-size: 9px; font-weight: 600; }
.ais-source-card dl { display: grid; grid-template-columns: 1fr auto; gap: 4px; margin: 0; color: #81939f; font-size: 8px; }
.ais-source-card dd { margin: 0; color: #aab9c1; text-align: right; }
.ais-source-card .source-state { font: 7px "DM Mono", monospace; color: #81939f; white-space: nowrap; }
.ais-source-card .source-state.connected { color: #66cda7; }
.ais-source-card .source-state.error { color: #f0b46a; }
.map-footer { gap: 8px; }
.alert-panel { min-height: 398px; display: flex; flex-direction: column; }
.text-button { color: #53bde4; border: 0; background: transparent; font-size: 9px; white-space: nowrap; padding: 4px; }
.text-button span, .review-link span { font-size: 14px; margin-left: 3px; vertical-align: -1px; }
.alert-list { flex: 1; overflow: auto; max-height: 305px; }
.show-all-alerts .alert-list { max-height: 600px; }
.alert-item { display: flex; gap: 10px; padding: 12px 14px 11px; border-bottom: 1px solid #172733; }
.alert-icon { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; display: grid; place-items: center; font: 600 10px "DM Mono", monospace; margin-top: 1px; }
.alert-icon.review { color: #e7b45b; background: #342a1b; border: 1px solid #65502d; }
.alert-icon.info { color: #5ec4e9; background: #122c3a; border: 1px solid #28516a; }
.alert-copy { min-width: 0; width: 100%; }
.alert-title-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.alert-title-row h3 { font-size: 10px; color: #dbe4e9; font-weight: 600; margin: 0; line-height: 1.4; }
.severity { color: #e1b45f; background: #2c251a; border-radius: 3px; font: 9px "DM Mono", monospace; padding: 3px 5px; }
.severity-info { color: #66c5e8; background: #122a37; }
.alert-copy p { color: #8797a2; font-size: 9px; line-height: 1.5; margin: 6px 0; }
.alert-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #637887; font: 8px "DM Mono", monospace; }
.status-label { border-radius: 3px; color: #9cabb4; background: #182833; padding: 2px 5px; text-transform: capitalize; }
.status-unreviewed { color: #e3b25d; background: #2b251a; }
.status-corroborated { color: #57c8a0; background: #172e2a; }
.status-dismissed { color: #8797a2; }
.alert-panel-footer { border-top: 1px solid #172733; min-height: 32px; padding: 8px 13px; color: #82929c; font-size: 9px; }
.live-alert-note { display: inline-block; margin-top: 6px; color: #6bc9a6; font: 8px "DM Mono", monospace; }

.vessels-panel { margin-top: 14px; }
.table-heading { min-height: 61px; }
.search-box { display: flex; align-items: center; gap: 7px; height: 28px; min-width: 190px; padding: 0 8px; border: 1px solid #263947; background: #0b1823; border-radius: 4px; color: #7f95a4; }
.search-box span { font-size: 16px; }
.search-box input { width: 100%; min-width: 0; background: none; color: #cfdae0; border: 0; outline: none; font-size: 9px; }
.search-box input::placeholder { color: #637886; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
thead { background: #0c1924; }
th { padding: 10px 12px; text-align: left; color: #718492; font: 500 8px "DM Mono", monospace; letter-spacing: .7px; border-bottom: 1px solid #1c2c39; white-space: nowrap; }
td { padding: 10px 12px; color: #aebbc3; font-size: 9px; border-bottom: 1px solid #172733; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #101f2b; }
.vessel-cell { display: flex; gap: 8px; align-items: center; }
.vessel-cell-icon { font-style: normal; color: #54c0e7; font-size: 16px; }
.vessel-cell strong, .vessel-cell small, .time-cell small { display: block; }
.vessel-cell strong { color: #d8e1e6; font-weight: 500; font-size: 9px; }
.vessel-cell small, .time-cell small { color: #677b89; font: 8px "DM Mono", monospace; margin-top: 3px; }
.type-pill { display: inline-block; color: #a7b9c3; background: #1b2a34; border: 1px solid #2a3c48; border-radius: 3px; padding: 3px 6px; font-size: 8px; }
.mono { font: 9px "DM Mono", monospace; }
.muted { color: #536877; }
.source-mark { color: #91a2ae; font-size: 8px; }
.source-mark i { display: inline-block; width: 5px; height: 5px; background: #48c49d; border-radius: 50%; margin-right: 5px; }
.time-cell { font-size: 9px; }
.table-footer { height: 32px; border-top: 1px solid #182a37; display: flex; justify-content: space-between; padding: 0 13px; align-items: center; color: #70828f; font-size: 8px; }
.sources-panel { margin-top: 14px; }
.stored-records-table { min-width: 1050px; }
.record-notes { max-width: 260px; white-space: normal; overflow-wrap: anywhere; }
.record-actions { white-space: nowrap; }
.record-modal { width: min(680px, calc(100vw - 28px)); }
.record-notes-field { grid-column: 1 / -1; }
.record-notes-field textarea { display: block; width: 100%; margin-top: 5px; padding: 8px; color: #dce5ea; background: #08141e; border: 1px solid #293d4a; border-radius: 4px; outline: none; font: 10px "DM Sans", sans-serif; resize: vertical; }
.record-notes-field textarea:focus { border-color: #449bc1; }
.sources-tag { color: #718895; border: 1px solid #273946; border-radius: 3px; padding: 5px 7px; font: 8px "DM Mono", monospace; letter-spacing: .5px; }
.source-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.source-card { padding: 13px 14px 11px; border-right: 1px solid #192a36; min-width: 0; }
.source-card:last-child { border: 0; }
.source-card-top { display: flex; align-items: center; justify-content: space-between; }
.feed-symbol { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; color: #7ccbe6; background: #112d3b; font-size: 13px; }
.feed-state { border-radius: 3px; padding: 3px 5px; font: 8px "DM Mono", monospace; }
.feed-demo { color: #e5b35e; background: #2c251b; }
.feed-off { color: #788995; background: #1a2934; }
.feed-connected { color: #64cba7; background: #172f2b; }
.source-card h3 { font-size: 9px; font-weight: 600; color: #ced9df; margin: 11px 0 4px; }
.source-card p { color: #728591; font-size: 8px; min-height: 22px; line-height: 1.4; margin: 0; }
.source-items { color: #91a2ad; font-size: 8px; line-height: 1.5; margin: 7px 0 0; padding-left: 13px; overflow-wrap: anywhere; }
.source-items a { color: #65c4e7; text-decoration: none; }.source-items a:hover { text-decoration: underline; }
.source-items small { color: #708391; }
.source-card-bottom { display: flex; justify-content: space-between; margin-top: 11px; padding-top: 8px; border-top: 1px solid #1a2a36; color: #6d808d; font-size: 8px; }
.source-card-bottom strong { color: #b6a16c; font: 8px "DM Mono", monospace; }
.aircraft-heading { padding-top: 25px; }
.aircraft-panel { margin-top: 14px; }
.aircraft-panel table { min-width: 850px; }
.aircraft-status { display: inline-block; border-radius: 3px; padding: 4px 6px; font: 8px "DM Mono", monospace; }
.aircraft-status.airborne { color: #72d8b1; background: #12352d; }
.aircraft-status.ground { color: #e5b66b; background: #33291c; }
.mono-cell { font-family: "DM Mono", monospace; font-size: 9px; }
.aircraft-notice { margin-bottom: 14px; }
.footer { display: flex; justify-content: space-between; color: #526674; font: 8px "DM Mono", monospace; letter-spacing: .3px; padding: 17px 2px 3px; }
.footer b { color: #3b5667; padding: 0 4px; }
.loading-state, .empty-state { color: #70838f; font-size: 10px; padding: 25px 14px; text-align: center; }

.modal { width: min(540px, calc(100vw - 28px)); color: var(--text); background: #0d1b27; border: 1px solid #2b414f; border-radius: 8px; padding: 23px; box-shadow: 0 18px 70px #0009; }
.modal::backdrop { background: #02080dc9; backdrop-filter: blur(2px); }
.modal h2 { font: 600 18px Manrope, sans-serif; margin: 0 30px 16px 0; }
.auth-modal { width: min(420px, calc(100vw - 28px)); }
.auth-modal form { display: grid; gap: 12px; }
.auth-field { display: block; color: #9aaab4; font-size: 10px; margin: 12px 0; }
.auth-field .text-input { margin-top: 6px; }
.auth-submit { justify-self: end; min-width: 120px; }
.auth-message { color: #e7a58d; font-size: 10px; line-height: 1.5; min-height: 14px; margin: 0; }
.user-list { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px solid #203440; }
.user-list li { display: flex; justify-content: space-between; padding: 8px 2px; color: #c4d0d6; font-size: 10px; border-bottom: 1px solid #172733; }
.user-list small { color: #81939f; font: 8px "DM Mono", monospace; text-transform: uppercase; }
.settings-modal { width: min(760px, calc(100vw - 28px)); max-height: 90vh; overflow-y: auto; }
.settings-intro { color: #95a5af; font-size: 10px; line-height: 1.55; margin: -7px 0 12px; }
.settings-notice { color: #c8b68d; background: #211d17; border: 1px solid #4f402a; border-radius: 4px; padding: 9px 10px; font-size: 9px; line-height: 1.5; margin-bottom: 16px; }
.settings-notice strong { color: #efc16b; margin-right: 4px; }
.settings-help { color: #81939f; font-size: 9px; line-height: 1.5; margin: -4px 0 9px; }
.settings-section { border-top: 1px solid #1d303d; padding-top: 13px; margin-top: 13px; }
.settings-section h3 { color: #d3dee4; font: 600 11px Manrope, sans-serif; margin: 0 0 10px; }
.provider-setting { border: 1px solid #203440; border-radius: 5px; background: #0a1721; padding: 11px; margin-bottom: 8px; }
.provider-setting-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; }
.provider-setting-title h4 { color: #d2dde3; font-size: 10px; font-weight: 600; margin: 0; }
.secret-status { color: #8396a3; font: 8px "DM Mono", monospace; }
.secret-status.saved { color: #58c8a0; }
.settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 8px; }
.settings-fields label { min-width: 0; color: #8395a2; font-size: 9px; }
.settings-fields input { display: block; width: 100%; height: 31px; margin-top: 5px; padding: 0 8px; color: #dce5ea; background: #08141e; border: 1px solid #293d4a; border-radius: 4px; outline: none; font-size: 9px; }
.settings-fields select { display: block; width: 100%; height: 31px; margin-top: 5px; padding: 0 8px; color: #dce5ea; background: #08141e; border: 1px solid #293d4a; border-radius: 4px; outline: none; font-size: 9px; }
.settings-fields input:focus { border-color: #449bc1; }
.settings-fields select:focus { border-color: #449bc1; }
.settings-fields input::placeholder { color: #5f7381; }
.key-field { display: block; min-width: 0; color: #8395a2; font-size: 9px; margin-top: 9px; }
.key-field textarea { display: block; width: 100%; margin-top: 5px; padding: 8px; color: #dce5ea; background: #08141e; border: 1px solid #293d4a; border-radius: 4px; outline: none; font: 9px "DM Mono", monospace; resize: vertical; }
.key-field textarea:focus { border-color: #449bc1; }
.key-field textarea::placeholder { color: #5f7381; }
.clear-credentials { display: flex; gap: 14px; margin-top: 8px; }
.clear-credentials label { color: #788b98; font-size: 8px; }
.clear-credentials input { accent-color: #48b9df; vertical-align: -1px; }
.single-clear { display: block; margin-top: 8px; }
.ollama-settings { background: #0b1823; padding: 13px; border-radius: 5px; }
.ollama-test-status { color: #81939f; font-size: 9px; line-height: 1.5; margin: 10px 0 0; }
.ollama-test-status.error { color: #e7a58d; }
.ollama-test-status.success { color: #66cda7; }
.email-test-status { align-self: center; margin-right: auto; color: #81939f; font-size: 9px; }
.email-test-status.error { color: #e7a58d; }
.email-test-status.success { color: #66cda7; }
.ssh-settings { background: #0b1823; padding: 13px; border-radius: 5px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.ssh-tunnel-log { max-height: 150px; overflow: auto; margin: 9px 0 0; padding: 8px; color: #9fb0b9; background: #071019; border: 1px solid #1d303d; border-radius: 4px; font: 8px/1.5 "DM Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.modal-close-form { position: absolute; right: 14px; top: 14px; }
.modal-close { border: 0; background: none; color: #8697a3; font-size: 22px; }
.review-details { background: #0a1721; border: 1px solid #1d303d; border-radius: 5px; padding: 12px; margin-bottom: 16px; }
.review-details p { color: #aab8c0; font-size: 11px; line-height: 1.6; margin-bottom: 11px; }
.review-details dl { display: grid; grid-template-columns: 105px 1fr; gap: 8px; margin: 0; font-size: 10px; }
.review-details dt { color: #738693; }.review-details dd { color: #c1cdd3; margin: 0; }
.field-label { display: block; color: #9aaab4; font-size: 10px; margin: 0 0 6px; }
.text-input { width: 100%; height: 35px; background: #091620; border: 1px solid #2a3f4d; border-radius: 4px; color: #e3ebef; padding: 0 9px; font-size: 11px; outline: none; }
.text-input:focus { border-color: #449bc1; }
.disposition-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.button { border-radius: 4px; padding: 8px 10px; font-size: 10px; }
.button-muted { color: #adbbc3; background: #182934; border: 1px solid #304451; }
.button-outline { color: #d4ae6a; background: #241f17; border: 1px solid #66502d; }
.button-primary { color: #081a20; background: #56c5a0; border: 1px solid #56c5a0; font-weight: 600; }
.button:hover { filter: brightness(1.13); }
.modal-note { color: #6f828f; font-size: 9px; line-height: 1.5; margin: 13px 0 0; }
.summary-content { white-space: pre-wrap; color: #c3ced4; background: #0a1721; border: 1px solid #1d303d; border-radius: 5px; padding: 13px; line-height: 1.65; font-size: 11px; }
.summary-warning { display: flex; gap: 9px; margin-top: 12px; padding: 10px; background: #211d17; border: 1px solid #4f402a; border-radius: 4px; }
.summary-warning span { flex: 0 0 16px; height: 16px; border: 1px solid #a97f42; border-radius: 50%; text-align: center; color: #e2b35f; font: 10px "DM Mono", monospace; }
.summary-warning p { color: #b6a887; font-size: 9px; line-height: 1.5; margin: 0; }
.modal-done { margin-top: 14px; float: right; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 5; background: #17352e; border: 1px solid #36745e; color: #b4e3d2; border-radius: 5px; padding: 10px 13px; font-size: 11px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s ease; max-width: min(420px, calc(100vw - 40px)); }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { color: #f0c1aa; background: #38241e; border-color: #714536; }

/* User-selectable dashboard themes. Map imagery remains provider-rendered. */
body.theme-light {
  color-scheme: light;
  --bg: #eef3f6; --sidebar: #ffffff; --panel: #ffffff; --panel-2: #f7fafb;
  --line: #d5e0e6; --line-soft: #e4ebef; --text: #1d2d38; --muted: #617482; --dim: #82939f;
}
body.theme-light .sidebar { border-right-color: #d5e0e6; }
body.theme-light .nav-item { color: #526774; }
body.theme-light .nav-item:hover { background: #edf4f7; }
body.theme-light .nav-item.active { background: #e1f1f7; color: #087da8; }
body.theme-light .topbar { border-bottom-color: #d5e0e6; }
body.theme-light h1, body.theme-light .metric-value { color: #1a2b36; }
body.theme-light .panel-header h2, body.theme-light .alert-title-row h3 { color: #263b47; }
body.theme-light .metric-top, body.theme-light .panel-header p, body.theme-light .subheading,
body.theme-light .metric-foot, body.theme-light .map-footer, body.theme-light td { color: #617482; }
body.theme-light .system-card, body.theme-light .search-box, body.theme-light thead,
body.theme-light .vessel-type-legend, body.theme-light .ais-coverage-summary,
body.theme-light .ais-source-comparison, body.theme-light .settings-section,
body.theme-light .ollama-settings, body.theme-light .ssh-settings { background: #f4f8fa; }
body.theme-light .search-box, body.theme-light input, body.theme-light select,
body.theme-light .key-field textarea, body.theme-light .text-input { color: #243944; background: #ffffff; border-color: #b9cbd4; }
body.theme-light .small-button, body.theme-light .icon-button { color: #46606e; background: #ffffff; border-color: #b9cbd4; }
body.theme-light th { color: #607784; border-bottom-color: #d5e0e6; }
body.theme-light td, body.theme-light .alert-item { border-bottom-color: #e0e8ec; }
body.theme-light .map-gesture-hint, body.theme-light .map-imagery-status,
body.theme-light .map-attribution, body.theme-light .map-scale { color: #e7f0f3; }

body.theme-high-contrast {
  color-scheme: dark;
  --bg: #000000; --sidebar: #050505; --panel: #0a0a0a; --panel-2: #111111;
  --line: #ffffff; --line-soft: #aeb8bf; --text: #ffffff; --muted: #ffffff; --dim: #d5d5d5;
}
body.theme-high-contrast .sidebar, body.theme-high-contrast .panel,
body.theme-high-contrast .metric-card, body.theme-high-contrast .settings-section,
body.theme-high-contrast .provider-setting { border-color: #ffffff; }
body.theme-high-contrast .nav-item, body.theme-high-contrast .metric-top,
body.theme-high-contrast .metric-foot, body.theme-high-contrast .panel-header p,
body.theme-high-contrast .settings-help, body.theme-high-contrast .settings-intro,
body.theme-high-contrast td, body.theme-high-contrast th { color: #ffffff; }
body.theme-high-contrast input, body.theme-high-contrast select,
body.theme-high-contrast textarea, body.theme-high-contrast .small-button,
body.theme-high-contrast .icon-button { color: #ffffff; background: #000000; border-color: #ffffff; }

@keyframes pulse { 50% { opacity: .5; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes marker-in { from { opacity: 0; transform: scale(.8); } to { opacity: 1; } }
@keyframes ticker-scroll { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

@media (min-width: 1450px) { .main-content { padding-left: 45px; padding-right: 45px; } .map-wrap { height: 480px; } .alert-panel { min-height: 450px; } }
@media (max-width: 1100px) {
  .sidebar { width: 205px; flex-basis: 205px; }
  .main-content { width: calc(100% - 205px); padding: 0 22px 18px; }
  .content-grid { grid-template-columns: minmax(0, 1.35fr) minmax(285px, .95fr); }
  .map-wrap { height: 360px; }
  .metric-card { padding-left: 11px; padding-right: 11px; }
  .source-card { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 800px) {
  .sidebar { width: 60px; flex-basis: 60px; padding: 18px 8px; }
  .brand { padding: 0 4px 35px; }.brand > span:last-child,.nav-label,.nav-item:not(.active) { display: none; }
  .nav-item { justify-content: center; padding: 0; font-size: 0; }.nav-icon { font-size: 18px; }
  .nav-count { position: absolute; margin: -20px 0 0 25px; padding: 2px 4px; font-size: 8px; }
  .system-card,.operator > span:not(.avatar) { display: none; }
  .operator { justify-content: center; padding-top: 12px; }.avatar { width: 28px; height: 28px; }
  .main-content { width: calc(100% - 60px); padding: 0 17px 16px; }
  .content-grid { grid-template-columns: 1fr; }
  .alert-panel { min-height: initial; }.alert-list { max-height: none; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .source-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .source-card:nth-child(2) { border-right: 0; }.source-card:nth-child(1),.source-card:nth-child(2) { border-bottom: 1px solid #192a36; }
}
@media (max-width: 520px) {
  .main-content { padding-left: 11px; padding-right: 11px; }
  .topbar { height: 51px; }.topbar-right { gap: 8px; }.demo-pill { font-size: 7px; padding: 5px 6px; }.clock { display: none; }
  .settings-modal { padding: 18px 14px; }.settings-fields { grid-template-columns: 1fr; gap: 7px; }
  .page-heading { align-items: start; padding: 19px 1px 14px; }.updated-label { font-size: 7px; }.updated-label strong { font-size: 8px; }
  h1 { font-size: 21px; }.subheading { max-width: 280px; line-height: 1.5; }
  .notice-banner { align-items: start; }.notice-banner p { font-size: 9px; }
  .metric-card { min-height: 97px; padding: 10px; }.metric-top { font-size: 9px; }.metric-value { font-size: 21px; }
  .panel-header { padding: 11px; }.map-actions { gap: 5px; }
  .map-wrap { height: 310px; }.map-footer { font-size: 7px; padding: 0 7px; gap: 4px; }
  .ais-source-grid { grid-template-columns: 1fr; }
  .search-box { min-width: 125px; }.search-box input { font-size: 8px; }.table-heading { align-items: start; }
  .source-grid { grid-template-columns: 1fr 1fr; }.source-card { padding: 10px; }
  .footer { font-size: 7px; gap: 8px; }
  .disposition-actions { flex-wrap: wrap; }.button { padding: 8px; }
}
