:root {
  --ink: #0a0a0a; --panel: #111; --line: #2a2a2a; --paper: #f4f1ea; --muted: #9a9a9a; --red: #e3261a;
  --cat-A: #ff3b30; --cat-B: #ff8a00; --cat-C: #ffd600; --cat-D: #b8ff3a; --cat-E: #3adbff; --cat-F: #b98cff; --cat-G: #ff6bd6;
  --rail-w: 340px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ink); color: var(--paper); font: 14px/1.45 "IBM Plex Mono", ui-monospace, monospace; display: flex; flex-direction: column; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { display: flex; align-items: center; gap: 1.25rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); background: var(--ink); }
.wordmark { font-family: Anton, Impact, sans-serif; font-size: 1.15rem; line-height: 0.95; letter-spacing: 0.02em; text-decoration: none; text-transform: uppercase; white-space: nowrap; }
.wordmark .x { color: var(--red); }
.caveat { margin: 0; color: var(--muted); font-size: 0.8rem; max-width: 60ch; }
.caveat strong { color: var(--paper); font-weight: 500; }

/* Site nav: the WordPress header menu on noharbourforgenocide.com, reproduced to its computed styles:
   Fjalla One 17px, 0.85px tracking, uppercase, #f4f2e6, 25px gaps, 12px stroke chevron, red submenu with black text. */
.sitenav { display: flex; align-items: center; gap: 0 25px; flex: 0 0 auto; font-family: "Fjalla One", Anton, Impact, sans-serif; font-size: 17px; font-weight: 400; letter-spacing: 0.85px; text-transform: uppercase; line-height: 1.9; color: #f4f2e6; }
.sitenav > a, .sitenav summary { color: inherit; text-decoration: none; white-space: nowrap; cursor: pointer; list-style: none; display: inline-flex; align-items: center; }
.sitenav summary::-webkit-details-marker { display: none; }
.sitenav summary::after { content: ""; width: 12px; height: 12px; margin-left: 4.25px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M1.5 4L6 8L10.5 4' stroke='%23f4f2e6' stroke-width='1.5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.sitenav > a:hover, .sitenav summary:hover { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.sitenav > a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
.sitenav .sub { position: relative; }
.sitenav .sub > div { position: absolute; top: 100%; left: 0; z-index: 1200; display: flex; flex-direction: column; background: #fb0207; color: #010000; border: 1px solid rgba(0, 0, 0, 0.15); }
.sitenav .sub > div a { color: inherit; text-decoration: none; white-space: nowrap; padding: 8.5px 17px; }
.sitenav .sub > div a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
@media (max-width: 820px) {
  .sitenav { font-size: 15px; gap: 0 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -1rem; padding: 0 1rem; max-width: 100vw; }
  .sitenav::-webkit-scrollbar { display: none; }
  .sitenav .sub > div { position: fixed; left: 0; right: 0; top: auto; }
}

.rail-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--paper); color: var(--paper); font: inherit; padding: 0.35rem 0.75rem; text-transform: uppercase; }

.demo-banner { background: var(--red); color: #fff; padding: 0.4rem 1rem; font-size: 0.8rem; text-align: center; }
.demo-banner a { color: #fff; }

/* Headline figures from NHG's port factsheet. Numerals in Anton, like the wordmark. */
.stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1.75rem; padding: 0.45rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 0.78rem; color: var(--muted); }
.stats b { font-family: Anton, Impact, sans-serif; font-weight: 400; font-size: 1.35rem; line-height: 1; letter-spacing: 0.02em; color: var(--paper); margin-right: 0.15rem; }
.stats .hot b { color: var(--red); }
.stats .note { flex-basis: 100%; font-size: 0.72rem; }
.stats .note a { color: var(--muted); }

.stage { flex: 1; display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 0; position: relative; }
.rail { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.tabs button, .tabs > span { background: none; border: 0; color: var(--muted); font: inherit; padding: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button[aria-selected="true"], .tabs > span { color: var(--paper); border-bottom-color: var(--red); }
.count { color: var(--muted); font-size: 0.75rem; }
.filters { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
.search input { width: 100%; background: var(--ink); border: 1px solid var(--line); color: var(--paper); font: inherit; padding: 0.45rem 0.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.chip { background: none; border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 0.72rem; padding: 0.2rem 0.5rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; }
.chip[aria-pressed="true"] { color: var(--paper); border-color: var(--paper); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--c); }
.legend-line { margin: 0.5rem 0 0; font-size: 0.72rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; }
.legend-line .pt { margin-right: 0.3rem; }
.legend-line span:not(.pt) { white-space: nowrap; }
/* Ports are a red X, after the X in the wordmark. Status changes its strength. */
.pt, .port-marker { --x: var(--red); --s: 12px; position: relative; display: inline-block; width: var(--s); height: var(--s); vertical-align: -1px; }
.pt::before, .pt::after, .port-marker::before, .port-marker::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 140%; height: max(3px, calc(var(--s) / 5)); background: var(--x);
  transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 0 0 1px var(--ink);
}
.pt::after, .port-marker::after { transform: translate(-50%, -50%) rotate(-45deg); }
.pt-action, .port-marker.action, .pt-both, .port-marker.both { --x: var(--red); }
.pt-quiet, .port-marker.quiet { --x: var(--muted); }
/* Documented transfers but no public action yet: off-white, so the traffic is visible without colouring the port red. */
.pt-doc, .port-marker.doc { --x: var(--paper); }
.pt-both, .port-marker.both { box-shadow: 0 0 0 2px var(--paper); border-radius: 50%; }
.port-marker { --s: 18px; }
.chip-sort { margin-left: auto; }
.routes-toggle { margin-top: 0.5rem; }

.list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.list li { border-bottom: 1px solid var(--line); }
.list button { width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; padding: 0.6rem 0.75rem; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: center; }
.list button:hover, .list button[aria-current="true"] { background: #1a1a1a; }
.list .name { font-weight: 500; }
.list .sub { color: var(--muted); font-size: 0.75rem; }
.list .tag { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.list .tag.unplotted { color: var(--red); }
.list .sub .n { color: var(--paper); }
.empty { padding: 1rem 0.75rem; color: var(--muted); }

#map { min-height: 0; background: #0b0f14; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { background: rgba(10,10,10,0.8) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-control-zoom a { background: var(--panel) !important; color: var(--paper) !important; border-color: var(--line) !important; }

.ship-marker { width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid #000; box-shadow: 0 0 0 2px var(--c), 0 0 12px var(--c); }
.ship-marker.committed { opacity: 0.35; box-shadow: none; }
.port-marker { width: 18px; height: 18px; display: block; }
.leaflet-marker-icon.is-active .ship-marker, .leaflet-marker-icon.is-active .port-marker { transform: scale(1.5); }

.detail { position: absolute; right: 0; top: 0; bottom: 0; width: min(420px, 100%); background: var(--panel); border-left: 1px solid var(--line); overflow: auto; padding: 1rem 1.25rem 2rem; z-index: 500; }
.detail .close { position: absolute; top: 0.5rem; right: 0.75rem; background: none; border: 0; color: var(--paper); font-size: 1.5rem; cursor: pointer; }
.detail h2 { font-family: Anton, Impact, sans-serif; font-weight: 400; font-size: 1.9rem; line-height: 1; margin: 0.25rem 3rem 0.25rem 0; text-transform: uppercase; letter-spacing: 0.01em; }
.detail .kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; }
.detail h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1.4rem 0 0.4rem; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.9rem; margin: 0.5rem 0 0; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.detail p { margin: 0.5rem 0; }
.detail .quiet { color: var(--muted); }
.detail .small { font-size: 0.78rem; }
.detail ul.calls { list-style: none; padding: 0; margin: 0.4rem 0; }
.detail ul.calls li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-bottom: 1px solid var(--line); }
.detail ul.calls a { color: var(--paper); }
.detail ul { padding-left: 1.1rem; margin: 0.4rem 0; }
.detail .todo { color: var(--muted); font-style: italic; }
/* One block per flow: label, NHG's count in Anton, the factsheet text verbatim. */
.flow { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; margin: 0.7rem 0 0; padding-top: 0.6rem; border-top: 1px dashed var(--line); }
.flow-k { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); align-self: end; }
.flow-k small { text-transform: none; letter-spacing: 0; display: block; margin-top: 0.1rem; }
.flow-n { grid-column: 2; grid-row: 1 / 3; font-family: Anton, Impact, sans-serif; font-size: 2rem; line-height: 0.9; color: var(--red); text-align: right; }
.flow-n small { display: block; font: 0.62rem/1.2 "IBM Plex Mono", ui-monospace, monospace; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.flow p { grid-column: 1; margin: 0.3rem 0 0; }
.flow .srcs { grid-column: 1; margin-top: 0.2rem; }
.srcs a { color: var(--muted); }
.news { list-style: none; padding: 0; margin: 0.4rem 0; }
.news li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.news a { color: var(--paper); }
.news span { color: var(--muted); }
.btn { display: inline-block; margin: 0.6rem 0.4rem 0 0; padding: 0.5rem 0.8rem; border: 1px solid var(--paper); text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.status-committed { color: var(--muted); }

@media (max-width: 820px) {
  .top { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .caveat { order: 3; flex-basis: 100%; }
  .sitenav { order: 1; flex-basis: 100%; }
  .rail-toggle { order: 2; }
  .rail-toggle { display: inline-block; }
  .stage { grid-template-columns: 1fr; }
  .rail { position: absolute; inset: 0; z-index: 1100; transform: translateX(-100%); transition: transform 0.2s; }
  .caveat { font-size: 0.72rem; }
  .stats { font-size: 0.68rem; padding: 0.3rem 1rem; }
  .rail.open { transform: none; }
  .detail { width: 100%; top: 35%; border-top: 1px solid var(--line); }
  .stats { gap: 0.2rem 1rem; padding: 0.4rem 1rem; font-size: 0.72rem; }
  .stats b { font-size: 1.15rem; }
  .stats .note { display: none; }
}
.ship-marker.live { box-shadow: 0 0 0 3px rgba(244, 241, 234, 0.35); animation: live 2s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(244, 241, 234, 0.6); } 100% { box-shadow: 0 0 0 9px rgba(244, 241, 234, 0); } }
@media (prefers-reduced-motion: reduce) { .ship-marker.live { animation: none; } }
