/* LightKeeper 2 — single stylesheet. Dark, high-contrast, grid shell. */

@font-face { font-family: Inter; font-weight: 400; src: url(../vendor/fonts/inter-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Inter; font-weight: 500; src: url(../vendor/fonts/inter-500.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Inter; font-weight: 600; src: url(../vendor/fonts/inter-600.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Inter; font-weight: 700; src: url(../vendor/fonts/inter-700.woff2) format("woff2"); font-display: swap; }

:root {
  --bg: #0f1923;
  --bg-1: #141f2b;
  --bg-2: #1a2634;
  --bg-3: #223040;
  --line: #2b3a4c;
  --text: #e6edf5;
  --text-2: #a9b7c6;
  --text-3: #74859a;
  --accent: #4f9dff;
  --accent-2: #2f7be6;
  --green: #35c983;
  --yellow: #f5c542;
  --orange: #ff9a3c;
  --red: #ff5f6d;
  --cyan: #3ad0e8;
  --purple: #9b8cff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --top-h: 48px;
  --rail-w: 56px;
  --panel-w: 360px;
  --status-h: 24px;
  --font: Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 13px/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
  display: grid;
  grid-template-rows: var(--top-h) 1fr var(--status-h);
  grid-template-columns: var(--rail-w) var(--panel-w) 1fr;
  grid-template-areas: "top top top" "rail panel map" "status status status";
  overflow: hidden;
  user-select: none;
}
body.panel-hidden { grid-template-columns: var(--rail-w) 0 1fr; }
body.panel-hidden #panel { display: none; }
body.panel-hidden #progress { left: calc(var(--rail-w) + 14px); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg:not(.tchart) { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--line); }
[hidden] { display: none !important; }

/* ── Top bar ── */
#topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 16px;
  padding: 0 14px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  z-index: 1200;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.brand img { width: 24px; height: 24px; }
.brand-name { font-size: 16px; font-weight: 500; letter-spacing: .2px; }
.brand-name b { font-weight: 700; }
.brand-ver { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.search { position: relative; flex: 1; max-width: 520px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
#search {
  width: 100%; height: 32px; padding: 0 12px 0 32px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); outline: none;
}
#search:focus { border-color: var(--accent); }
#search::placeholder { color: var(--text-3); }
#search-results {
  position: absolute; top: 36px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  max-height: 60vh; overflow: auto; z-index: 1300;
}
#search-results li { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
#search-results li:hover, #search-results li.active { background: var(--bg-3); }
#search-results .kind { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); min-width: 56px; }
#search-results .sub { color: var(--text-3); font-size: 11px; margin-left: auto; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
#district-select, .select {
  height: 32px; padding: 0 28px 0 10px; border-radius: 8px;
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b7c6' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  border: 1px solid var(--line); appearance: none; -webkit-appearance: none; color: var(--text);
}
.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 6px; color: var(--text-2); }
.seg button.on { background: var(--bg-3); color: var(--text); }
.chips { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2);
  border-radius: 999px; padding: 5px 11px; font-weight: 500;
}
.chip.on { border-color: var(--accent); color: var(--text); background: rgba(79, 157, 255, .15); }
.chip-count { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Rail ── */
#rail {
  grid-area: rail;
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  padding: 8px 6px;
  background: var(--bg-1); border-right: 1px solid var(--line);
  z-index: 1100;
}
#rail button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-3);
  font-size: 10px; font-weight: 500;
}
#rail button:hover { background: var(--bg-2); color: var(--text-2); }
#rail button.on { background: rgba(79, 157, 255, .15); color: var(--accent); }
.rail-spacer { flex: 1; }
#rail-collapse svg { transition: transform .2s; }
body.panel-hidden #rail-collapse svg { transform: rotate(180deg); }

/* ── Panel ── */
#panel {
  grid-area: panel;
  background: var(--bg-1); border-right: 1px solid var(--line);
  overflow: hidden; display: flex; flex-direction: column; min-width: 0;
  z-index: 1000;
}
.view { display: none; flex: 1; flex-direction: column; min-height: 0; }
.view.on { display: flex; }
.view-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.view-head h2 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.view-head h2 .count { font-size: 11px; font-weight: 500; color: var(--text-3); }
.view-head p { margin: 4px 0 0; color: var(--text-3); font-size: 12px; }
.view-body { flex: 1; overflow: auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.view-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

/* ── Controls ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-weight: 500;
}
.btn:hover { background: var(--bg-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--red); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select, .field textarea {
  height: 34px; padding: 0 10px; border-radius: 8px; width: 100%;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); outline: none;
}
.field textarea { height: auto; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus { border-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.row > .btn { flex: 1 1 auto; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2);
  border-radius: 999px; padding: 4px 10px; font-size: 12px;
}
.pill.on { border-color: currentColor; background: var(--bg-3); color: var(--text); }
.pill .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.empty { padding: 28px 12px; text-align: center; color: var(--text-3); }
.empty b { display: block; color: var(--text-2); margin-bottom: 4px; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.switch input { width: 36px; height: 20px; appearance: none; background: var(--bg-3); border-radius: 999px; position: relative; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3); transition: .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 18px; background: #fff; }

/* ── Lists ── */
.list { display: flex; flex-direction: column; gap: 4px; }
.item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid transparent;
  cursor: pointer;
}
.item:hover { border-color: var(--line); }
.item.sel { border-color: var(--accent); background: rgba(79, 157, 255, .12); }
.item .ico { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .right { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.item input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.badge { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); }
.badge.light { color: var(--yellow); } .badge.buoy { color: var(--green); } .badge.daybeacon { color: var(--orange); }
.badge.bridge { color: var(--text-2); } .badge.ramp, .badge.marina { color: var(--cyan); } .badge.hotel, .badge.motel, .badge.resort, .badge.campground { color: var(--purple); }
.badge.park { color: var(--green); } .badge.dam { color: var(--red); } .badge.tide, .badge.current { color: var(--cyan); } .badge.gage { color: var(--accent); }

/* ── Cards (used by detail + trip days) ── */
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.box { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.box h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; }
.kv dt { color: var(--text-3); white-space: nowrap; }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { background: var(--bg-2); border-radius: 8px; padding: 8px; text-align: center; }
.stat b { display: block; font-size: 15px; }
.stat span { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }

/* ── Charts (detail card) ── */
.kv dd.wide, .kv dt.wide { grid-column: 1 / -1; }
.tchart { display: block; width: 100%; height: auto; margin: 2px 0 4px; overflow: visible; stroke: none; }
.tchart text { stroke: none; }
.tc-grid { stroke: var(--line); stroke-width: 1; }
.tc-zero { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.tc-axis { fill: var(--text-3); font-size: 9px; }
.tc-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tc-area { fill: var(--accent); opacity: .12; }
.tc-dot { fill: var(--bg-1); stroke: var(--accent); stroke-width: 2; }
.tc-label { fill: var(--text); font-size: 9.5px; font-weight: 600; }
.tc-now { stroke: var(--yellow); stroke-width: 1; stroke-dasharray: 2 3; }
.tc-cross { stroke: var(--text-3); stroke-width: 1; }
.tc-hover { fill: var(--accent); }
.tc-readout { fill: var(--text); font-size: 10px; font-weight: 600; paint-order: stroke; stroke: var(--bg-1); stroke-width: 3px; }
.tc-muted { fill: var(--text-3); font-size: 11px; }

/* Animated "loading…" dots for live cells */
.loading-dots { color: var(--text-3); }
.loading-dots::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ── Detail card ── */
#detail {
  position: absolute; right: 16px; bottom: calc(var(--status-h) + 16px);
  width: 360px; max-height: calc(100vh - var(--top-h) - var(--status-h) - 32px);
  display: flex; flex-direction: column; z-index: 900; overflow: hidden;
}
#detail .d-head { display: flex; gap: 10px; align-items: flex-start; padding: 14px 14px 8px; }
#detail .d-head h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
#detail .d-head .badge { margin-top: 2px; }
#detail .d-close { margin-left: auto; border: 0; background: transparent; color: var(--text-3); font-size: 20px; line-height: 1; padding: 0 2px; }
#detail .d-close:hover { color: var(--text); }
#detail .d-body { padding: 0 14px 12px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
#detail .d-photo { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; background: var(--bg-2); }
#detail .d-line { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; }
#detail .d-line svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: var(--text-3); }
#detail .d-line a { color: var(--accent); }
#detail .d-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0 2px; }
#detail .d-src { font-size: 11px; color: var(--text-3); }

/* ── Map ── */
#map { grid-area: map; position: relative; background: #0b1218; }
.leaflet-container { font: inherit; background: #0b1218; }
.leaflet-control-zoom a { background: var(--bg-2) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: rgba(15, 25, 35, .7) !important; color: var(--text-3) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg-1); color: var(--text); box-shadow: var(--shadow); }
.leaflet-tooltip { background: var(--bg-1); color: var(--text); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; padding: 3px 7px; }
.leaflet-tooltip-top::before { border-top-color: var(--line); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(79, 157, 255, .25); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: rgba(79, 157, 255, .8); color: #fff; font: 600 11px var(--font); }
.m { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .75); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55); }
.m.light { background: var(--yellow); }
.m.buoy { background: var(--green); }
.m.daybeacon { background: var(--orange); }
.m.bridge { background: #94a3b8; border-radius: 3px; }
.m.other { background: #64748b; }
.m.sel { box-shadow: 0 0 0 3px var(--accent), 0 0 0 5px rgba(79, 157, 255, .35); }
.m-poi { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; border: 2px solid rgba(255, 255, 255, .8); box-shadow: 0 2px 6px rgba(0, 0, 0, .6); background: var(--bg-3); }
.m-poi.ramp, .m-poi.marina { background: #0e7490; }
.m-poi.hotel, .m-poi.motel, .m-poi.resort, .m-poi.campground { background: #5b4bd6; }
.m-poi.park { background: #15803d; }
.m-poi.dam { background: #b91c1c; }
.m-poi.tide, .m-poi.current { background: #0891b2; }
.m-poi.gage { background: #2563eb; }
.m-poi.wp { width: 18px; height: 18px; font-size: 10px; font-weight: 700; background: var(--accent); color: #fff; }
.m-day { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 10px var(--font); color: #fff; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 800;
  background: rgba(20, 31, 43, .9); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 11px; color: var(--text-2); display: grid; grid-template-columns: auto auto; gap: 3px 12px; backdrop-filter: blur(4px);
}
.map-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--c); }
#map.measuring { cursor: crosshair; }
#map-veil { position: absolute; inset: 0; z-index: 700; display: flex; align-items: center; justify-content: center;
  background: rgba(11, 18, 24, .35); backdrop-filter: blur(2px); pointer-events: none; }
.veil-box { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 500; }
.veil-spin { width: 16px; height: 16px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
#ctx-menu {
  position: absolute; left: 0; top: 0; width: 230px; z-index: 950; padding: 4px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
}
#ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--text); padding: 6px 10px; border-radius: 6px; text-align: left; font-size: 12.5px; }
#ctx-menu button:hover { background: var(--bg-3); }
.ctx-glyph { width: 16px; text-align: center; color: var(--text-2); }
.ctx-sep { border-top: 1px solid var(--line); margin: 4px 6px; }
#hover-hint {
  position: absolute; left: 0; top: 0; max-width: 220px; z-index: 850; pointer-events: none;
  background: rgba(20, 31, 43, .92); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px;
  font-size: 11px; color: var(--text-2); backdrop-filter: blur(3px); box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.hh-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; color: var(--text); }
.hh-glyph { width: 14px; text-align: center; }
.hh-glyph.tide, .hh-glyph.current { color: var(--cyan); } .hh-glyph.gage { color: var(--accent); } .hh-glyph.dam { color: var(--red); }
.hh-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-dist { color: var(--text-3); }
.hh-tip { color: var(--text-3); font-size: 10.5px; }
.hh-row + .hh-tip { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 3px; }
.measure-label { background: var(--bg-1); color: var(--text); border: 1px solid var(--accent); border-radius: 6px; padding: 2px 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }

/* ── Progress strip ── */
#progress {
  position: absolute; left: calc(var(--rail-w) + var(--panel-w) + 14px); bottom: calc(var(--status-h) + 14px);
  width: min(460px, 45vw); z-index: 850;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 10px 14px 12px;
}
.progress-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.progress-row span { flex: 1; }
#progress-close { border: 0; background: transparent; color: var(--text-3); font-size: 18px; line-height: 1; }
.progress-track { height: 4px; background: var(--bg-3); border-radius: 2px; margin-top: 8px; overflow: hidden; }
#progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--cyan)); border-radius: 2px; transition: width .3s; }
#progress-fill.indeterminate { width: 35%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ── Status bar ── */
#statusbar {
  grid-area: status;
  display: flex; align-items: center; gap: 20px; padding: 0 14px;
  background: var(--bg-1); border-top: 1px solid var(--line);
  font-size: 11px; color: var(--text-3);
}
#sb-online { margin-left: auto; }
#sb-online.online::before, #sb-online.offline::before { content: "●"; margin-right: 5px; }
#sb-online.online { color: var(--green); }
#sb-online.offline { color: var(--yellow); }

.known-issues summary { cursor: pointer; font-weight: 600; color: var(--yellow); list-style: revert; }
.known-issues[open] summary { margin-bottom: 2px; }
.todo-list summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: revert; }

/* ── Modal ── */
.ps-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--cyan)); border-radius: 2px; transition: width .3s; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 3000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.modal { width: min(440px, calc(100vw - 32px)); background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 10px; font-size: 16px; }
.modal p { margin: 6px 0; font-size: 13px; color: var(--text-2); }

/* ── First-launch import screen ── */
#firstrun { position: fixed; inset: 0; z-index: 2500; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.fr-card { width: min(560px, calc(100vw - 32px)); background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; box-shadow: var(--shadow); text-align: center; }
.fr-card img { width: 48px; height: 48px; }
.fr-card h2 { margin: 8px 0 6px; font-size: 20px; }
.fr-card p { margin: 0 0 14px; color: var(--text-2); font-size: 13px; }
#fr-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--cyan)); border-radius: 2px; transition: width .3s; }
#fr-status { margin: 8px 0 10px; min-height: 16px; }
#fr-log { text-align: left; margin: 0; padding: 8px 10px 8px 34px; height: 180px; overflow: auto; background: var(--bg-2); border-radius: 8px; font-size: 11.5px; color: var(--text-2); font-family: Consolas, "Cascadia Mono", monospace; }
#fr-log li { padding: 1px 0; }
#fr-log li.ok { color: var(--green); }
#fr-log li.warn { color: var(--yellow); }
.fr-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }

/* ── Toasts ── */
#toasts { position: fixed; bottom: calc(var(--status-h) + 14px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 2000; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 500; animation: toast-in .2s ease; pointer-events: auto; }
.toast.ok { border-left: 3px solid var(--green); } .toast.warn { border-left: 3px solid var(--yellow); } .toast.err { border-left: 3px solid var(--red); } .toast.info { border-left: 3px solid var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Trip plan ── */
.day { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.day-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-2); cursor: pointer; }
.day-head .m-day { flex-shrink: 0; }
.day-head b { font-weight: 600; }
.day-head .sub { font-size: 11px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
.day-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.day.collapsed .day-body { display: none; }
.place { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; background: var(--bg-2); border-radius: 8px; cursor: pointer; }
.place:hover { background: var(--bg-3); }
.place .m-poi { flex-shrink: 0; width: 22px; height: 22px; font-size: 11px; }
.place .pl-main { min-width: 0; flex: 1; }
.place .pl-title { font-weight: 500; }
.place .pl-sub { font-size: 11px; color: var(--text-3); }
.place .pl-role { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); }
.aid-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.aid-table td { padding: 3px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.aid-table td:first-child { color: var(--text-3); width: 20px; }
.aid-table td.eta { color: var(--text-3); white-space: nowrap; text-align: right; }
.warn-list { color: var(--yellow); font-size: 12px; padding-left: 16px; margin: 0; }
.note-list { color: var(--text-2); font-size: 12px; padding-left: 16px; margin: 0; }

/* ── Weather ── */
.wx-period { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg-2); border-radius: 8px; }
.wx-period img { width: 36px; height: 36px; border-radius: 6px; }
.wx-period .wx-name { font-weight: 600; }
.wx-period .wx-temp { margin-left: auto; font-size: 18px; font-weight: 600; }
.wx-period .wx-sub { font-size: 11px; color: var(--text-3); }
.alert { padding: 8px 10px; border-radius: 8px; background: rgba(255, 95, 109, .12); border: 1px solid rgba(255, 95, 109, .4); font-size: 12px; }
.alert b { display: block; color: var(--red); }

/* ── Responsive ── */
@media (max-width: 1280px) { :root { --panel-w: 320px; } .chips .chip { padding: 5px 9px; } }
@media (max-width: 1100px) {
  .brand-ver, #rail button span { display: none; }
  :root { --rail-w: 46px; --panel-w: 300px; }
  .search { max-width: 360px; }
}
@media (max-width: 900px) {
  body { grid-template-columns: var(--rail-w) 0 1fr; }
  #panel { position: absolute; left: var(--rail-w); top: var(--top-h); bottom: var(--status-h); width: min(360px, calc(100vw - var(--rail-w))); box-shadow: var(--shadow); }
  body.panel-hidden #panel { display: none; }
body.panel-hidden #progress { left: calc(var(--rail-w) + 14px); }
  #detail { width: calc(100vw - 32px); right: 16px; }
  .chips { display: none; }
}
@media print {
  #topbar, #rail, #panel, #statusbar, #progress, #toasts, #detail { display: none !important; }
  body { display: block; background: #fff; color: #000; }
}

/* ── Aid card: light preview, glance tiles, sections, live tiles, action bar ── */
#detail .d-title { min-width: 0; }
.light-preview { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: #0b1218; border: 1px solid var(--line); display: grid; place-items: center; }
.lp-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px 2px var(--c), 0 0 18px 5px color-mix(in srgb, var(--c) 40%, transparent); transition: background-color 60ms, box-shadow 60ms; }
.lp-dot.off { background: #26313d; box-shadow: none; }
.light-preview.unlit .lp-dot { width: 10px; height: 10px; background: transparent; border: 2px solid var(--c); box-shadow: none; }

.ac-tiles { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 6px; }
.ac-tile { min-width: 0; padding: 8px 9px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.ac-v { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ac-v.none { color: var(--text-3); font-weight: 500; }
.ac-k { margin-top: 2px; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); }

.d-sec { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.d-sec h4 { margin: 0; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); }
.d-sec .kv { margin: 0; }
.ac-coords { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }

.lt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.live-tile { position: relative; display: flex; gap: 8px; align-items: flex-start; min-width: 0; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.lt-ico svg { width: 16px; height: 16px; margin-top: 1px; color: var(--accent); }
.lt-main { flex: 1; min-width: 0; padding-right: 10px; }
.lt-label { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); }
.lt-value { margin-top: 1px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.lt-value a { color: var(--accent); }
.lt-sub { margin-top: 2px; font-size: 11px; color: var(--text-3); overflow-wrap: anywhere; }
.live-tile.na .lt-value { color: var(--text-3); font-weight: 500; }
.fresh { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg-3); }
.fresh.ok { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.fresh.old { background: var(--yellow); }
.fresh.na { background: var(--text-3); opacity: .6; }
.skel { display: block; width: 75%; height: 12px; margin: 3px 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-3) 25%, #2e4053 50%, var(--bg-3) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

#detail .d-bar { flex-shrink: 0; display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg-1); }
#detail .d-bar .btn { flex: 1 1 auto; white-space: nowrap; }
#detail .d-bar .btn.icon { flex: 0 0 auto; width: 32px; padding: 0; display: inline-grid; place-items: center; }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .lp-dot { transition: none; } }

/* ── Discrepancy tracker ── */
.disc-tools { flex-wrap: wrap; gap: 6px; margin-bottom: 8px; } .disc-tools .btn { flex: 0 0 auto; }
.disc-item { display: flex; align-items: center; gap: 8px; } .disc-item .main { flex: 1; cursor: pointer; min-width: 0; }
.disc-item.corrected .title { color: var(--text-3); }
.badge.warn { background: rgba(255, 154, 60, .15); color: #ffb26b; } .badge.ok { background: rgba(53, 201, 131, .15); color: #5fe0a3; }
.disc-modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto; }
.disc-head { display: flex; align-items: center; justify-content: space-between; } .disc-head h3 { margin: 0; }
.disc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 12px; }
.disc-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); }
.disc-field input, .disc-field select, .disc-field textarea { width: 100%; font: inherit; font-size: 13.5px; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.disc-field textarea { resize: vertical; }
.disc-wide { grid-column: 1 / -1; }
.rail-badge { position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; border-radius: 8px; background: #ff5f6d; color: #fff; font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px; }
#rail button { position: relative; }
@media (max-width: 820px) { .disc-grid { grid-template-columns: 1fr; } }
.disc-views { display: flex; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.disc-views button { flex: 1; border: 0; background: transparent; color: var(--text-2); padding: 7px 0; font: inherit; font-weight: 600; }
.disc-views button.on { background: var(--bg-3); color: var(--text); }
.disc-bnm-head { align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; } .disc-bnm-head .muted { flex: 1 1 100%; }
.disc-bnm-item { display: flex; flex-direction: column; align-items: stretch; gap: 6px; } .disc-bnm-item.active { box-shadow: inset 3px 0 0 #ff9a3c; }
.disc-bnm-item .title { display: flex; gap: 6px; align-items: center; font-size: 12.5px; }
.bnm-text { font-size: 12.5px; color: var(--text-2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.disc-bnm-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }

/* BNM tab and the notice banner on aid cards */
.bnm-head { align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 6px; }
.bnm-item { cursor: pointer; box-shadow: inset 3px 0 0 #ff9a3c; display: flex; width: 100%; text-align: left; font: inherit; color: inherit; }
.bnm-item:hover, .bnm-item:focus-visible { background: rgba(255, 154, 60, .08); outline: none; }
.bnm-item .title { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bnm-banner { display: grid; gap: 6px; margin-bottom: 10px; }
.bnm-note { border: 1px solid rgba(255, 154, 60, .55); background: rgba(255, 154, 60, .12); border-radius: 8px; padding: 8px 10px; }
.bnm-what b { color: #ff9a3c; }
.bnm-text { margin-top: 4px; white-space: pre-line; max-height: 7.5em; overflow: auto; }
.bnm-marker { pointer-events: auto; }
.bnm-marker span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 3px solid #ff9a3c;
  background: rgba(255, 154, 60, .18); color: #ff9a3c; font: 800 15px/1 system-ui, sans-serif; text-shadow: 0 0 3px #000;
  box-shadow: 0 0 0 0 rgba(255, 154, 60, .7); animation: bnm-pulse 2s infinite; }
@keyframes bnm-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 154, 60, .7); } 70% { box-shadow: 0 0 0 12px rgba(255, 154, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 154, 60, 0); } }
@media (prefers-reduced-motion: reduce) { .bnm-marker span { animation: none; } }
.btn-spin { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* District picker drawn by the page (the desktop window can't open native drop-downs) */
.dsel { position: relative; }
.dsel-btn { height: 32px; min-width: 150px; padding: 0 28px 0 10px; border-radius: 8px; text-align: left; color: var(--text);
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b7c6' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  border: 1px solid var(--line); cursor: pointer; }
.dsel-btn:hover, .dsel-btn[aria-expanded="true"] { border-color: var(--accent); }
.dsel-menu { position: absolute; top: 36px; right: 0; min-width: 220px; max-height: 70vh; overflow: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 1300; }
.dsel-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; }
.dsel-menu button:hover, .dsel-menu button:focus-visible { background: var(--bg-3); outline: none; }
.dsel-menu button.on { color: var(--accent); font-weight: 600; }

/* ── Card pictures and contact (photo / satellite hero, call, website, hours) ── */
#detail .d-hero { position: relative; height: 168px; flex-shrink: 0; overflow: hidden; background: #0b1218; cursor: pointer; }
#detail .d-hero.small { height: 120px; }
#detail .d-sat, #detail .d-hero-img { position: absolute; inset: 0; }
#detail .d-sat img { position: absolute; width: 256px; height: 256px; max-width: none; }
#detail .d-hero-img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
#detail .d-hero.has-photo .d-hero-img { opacity: 1; }
#detail .d-hero.has-photo.show-sat .d-hero-img { opacity: 0; }
#detail .d-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 56px; background: linear-gradient(transparent, rgba(8, 14, 20, .75)); pointer-events: none; }
#detail .d-hero-pin { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #ff9a3c; border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(255, 154, 60, .35); z-index: 1; }
#detail .d-hero.has-photo:not(.show-sat) .d-hero-pin { display: none; }
#detail .d-hero-cap { position: absolute; right: 10px; bottom: 8px; z-index: 1; font-size: 10.5px; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
#detail .d-hero-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(8, 14, 20, .65); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
#detail .d-hero-close:hover { background: rgba(8, 14, 20, .9); }
#detail .d-hero + .d-head .d-close { display: none; }
#detail .d-contact { display: flex; flex-wrap: wrap; gap: 8px; }
#detail .d-contact .btn { display: inline-flex; align-items: center; gap: 6px; }
#detail .d-contact svg { width: 15px; height: 15px; }
#detail .d-hours { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); }
#detail .d-hours svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; color: var(--text-3); }
#detail .d-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#detail .d-chip { padding: 4px 9px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--text-2); }
#detail .d-chip b { color: var(--text); font-weight: 600; }
/* Desktop: a roomier card (everything inside about 10% larger). */
@media (min-width: 900px) {
  #detail { width: 400px; }
  #detail > .d-head, #detail > .d-body, #detail > .d-bar { zoom: 1.1; }
}

/* Aid card extras: characteristic in words, sun times */
.ac-plain { margin: -2px 0 2px; font-size: 12.5px; color: var(--text-2); }
.ac-sun { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.ac-sun b { color: var(--text); font-weight: 600; }

/* ── Trip planner: timeline, swaps, phone steps ── */
.trip-plan { display: flex; flex-direction: column; gap: 10px; }
.trip-title { display: flex; flex-direction: column; gap: 2px; }
.trip-title b { font-size: 15px; }
.day-head { width: 100%; border: 0; color: inherit; font: inherit; text-align: left; }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 46px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-2); padding-top: 1px; }
.tl-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-title { font-weight: 600; overflow-wrap: anywhere; }
.tl-title.link { background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.tl-title.link:hover { color: var(--accent); text-decoration: underline; }
.tl-sub { font-size: 11.5px; color: var(--text-3); }
.tl-row.ramp .tl-title, .tl-row.hotel .tl-title { color: var(--accent); }
.tl-row.drive .tl-title, .tl-row.done .tl-title { color: var(--text-2); font-weight: 500; }
.tl-swap { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 3px; }
.tl-swap .chip { font-size: 11px; padding: 3px 8px; }
.tl-note { font-size: 11.5px; color: var(--green, #35c983); padding: 6px 0 0 54px; }
.trip-more summary, .trip-why summary { cursor: pointer; color: var(--text-2); font-size: 12px; padding: 4px 0; }
.trip-more[open] { display: flex; flex-direction: column; gap: 8px; }
.trip-steps { display: flex; flex-direction: column; gap: 10px; }
.trip-step { display: flex; gap: 10px; align-items: flex-start; }
.trip-step > b { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
.trip-step .title { font-weight: 600; }
.btn.big { min-height: 48px; font-size: 15px; font-weight: 600; }
.trip-daypills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.trip-daypills button { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; font-weight: 600; box-shadow: inset 0 -3px 0 var(--c); }
.trip-daypills button.on { background: var(--c); color: #0b1218; }
#trip-pickbar { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tab-h, 64px) + var(--safe-b, 0px) + 12px); z-index: 1500; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; background: var(--bg-1); border: 1px solid var(--accent); box-shadow: var(--shadow); }
#trip-pickbar .tp-count { flex: 1; font-weight: 600; }
#trip-pickbar .btn { min-height: 40px; }
body.phone .tl-row { grid-template-columns: 50px 1fr; padding: 9px 0; }
body.phone .tl-title { font-size: 15px; }
body.phone .tl-sub { font-size: 12.5px; }
body.phone .tl-swap .chip { min-height: 34px; font-size: 12.5px; }

/* First-launch district question */
.district-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.district-pick .btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 8px 10px; text-align: left; height: auto; }
.district-pick .btn .muted { font-weight: 400; white-space: normal; }
.district-pick .btn.all { grid-column: 1 / -1; align-items: center; min-height: 44px; }
@media (max-width: 420px) { .district-pick { grid-template-columns: 1fr; } }

/* Aid names above the aids (zoomed in) */
.aid-label { pointer-events: none; }
.aid-label span { position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 9px)); white-space: nowrap;
  font: 600 10.5px/1.2 Inter, system-ui, sans-serif; color: #fff; padding: 1px 4px; border-radius: 4px; background: rgba(11, 18, 24, .62);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }

.tl-swap .chip.pick { border-style: dashed; }
.tl-swap .chip.pick.on { border-style: solid; border-color: var(--accent); color: var(--accent); }
body[data-pick-kind] #map { cursor: crosshair; }

/* Type pills: show what each kind looks like on the map (lights by their light color, marks red / green) */
.pill .dot.type-light { background: #fff4d6; box-shadow: 0 0 0 2px #f5c542; }
.pill .dot.type-buoy { background: linear-gradient(90deg, #ff4b4b 50%, #22c55e 50%); }
.pill .dot.type-daybeacon { background: linear-gradient(90deg, #ff4b4b 50%, #22c55e 50%); border-radius: 2px; }
.pill .dot.type-bridge { background: var(--c); }

/* ── Night watch theme (matches the website): black water, ice-blue highlight, white primary buttons,
      mono labels, squarer corners. Overrides only; the rules above keep the layout. ── */
:root {
  --bg: #03060b; --bg-1: #070d15; --bg-2: #0c1520; --bg-3: #142131; --line: #1c2b3b;
  --text: #eef3f8; --text-2: #a2b2c2; --text-3: #6a7d90;
  --accent: #6cc4ff; --accent-2: #9ad6ff;
  --green: #3be38a; --yellow: #ffd23f; --red: #ff4d5a; --cyan: #3ad0e8;
  --radius: 6px; --radius-sm: 4px;
  --shadow: 0 16px 44px rgba(0, 0, 0, .6);
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}
#map, .leaflet-container, .light-preview, #detail .d-hero { background: #03060b; }
#topbar, #rail, #statusbar { background: #050a11; }
#statusbar { font-family: var(--mono); letter-spacing: .02em; }
.brand-ver { font-family: var(--mono); }

/* Labels and headings in the website's voice */
.view-head h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.box h4, .d-sec h4, .field label, .lt-label, .ac-k, .stat span, .place .pl-role, #search-results .kind, .badge {
  font-family: var(--mono); letter-spacing: .08em; }
#detail .d-head h3, .modal h3, .fr-card h2 { letter-spacing: -.01em; }
.fr-card h2 { text-transform: uppercase; font-weight: 700; }

/* Buttons and fields: squarer, primary is white like the site */
.btn, #search, .field input, .field select, .field textarea, #district-select, .select, .seg, .dsel-btn, .disc-field input, .disc-field select, .disc-field textarea { border-radius: 4px; }
.seg button { border-radius: 3px; }
.btn.primary { background: var(--text); border-color: var(--text); color: #03060b; font-weight: 600; }
.btn.primary:hover { background: #fff; }
.item, .box, .stat, .place, .wx-period, .ac-tile, .live-tile, .day, .toast, .veil-box, #ctx-menu, .dsel-menu, #search-results, .map-legend, #hover-hint, .alert, .bnm-note { border-radius: 4px; }
.card, #progress, .modal, .fr-card { border-radius: 8px; }

/* Highlight tints follow the new accent */
.chip.on { background: rgba(108, 196, 255, .12); }
#rail button.on { background: rgba(108, 196, 255, .12); box-shadow: inset 2px 0 0 var(--accent); border-radius: 0 6px 6px 0; }
.item.sel { background: rgba(108, 196, 255, .1); }
.m.sel { box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px rgba(108, 196, 255, .3), 0 0 18px 6px rgba(108, 196, 255, .35); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(108, 196, 255, .2); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: rgba(14, 34, 52, .92); color: var(--text); border: 1.5px solid rgba(108, 196, 255, .8); box-sizing: border-box; }
.m-poi.wp, .trip-step > b { color: #03060b; }
.leaflet-control-attribution { background: rgba(3, 6, 11, .72) !important; }
.map-legend, #hover-hint { background: rgba(7, 13, 21, .92); }
#detail .d-hero::after { background: linear-gradient(transparent, rgba(3, 6, 11, .8)); }
.lp-dot.off { background: #1a2533; }
.skel { background: linear-gradient(90deg, var(--bg-3) 25%, #22344a 50%, var(--bg-3) 75%); background-size: 200% 100%; }

/* Checks on cards: Coast Guard notices, chart differences, place warnings, source count, report link */
.ac-checks:empty { display: none; }
.ac-checks { display: grid; gap: 6px; margin-bottom: 10px; }
.ac-flag { font-size: 12.5px; line-height: 1.4; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); }
.ac-flag.warn { border-color: rgba(255, 154, 60, .55); background: rgba(255, 154, 60, .10); }
.ac-flag.info { border-color: rgba(108, 196, 255, .35); background: rgba(108, 196, 255, .07); }
#detail .d-src.confirmed { color: var(--green); }
#detail .d-report { font-size: 11.5px; margin-top: 4px; }
#detail .d-report a { color: var(--text-3); }
