/* gangway.app/ais: the live chart. Tokens come from ../css/site.css; this file lays out one full-screen page. */
html, body { height: 100%; overflow: hidden; }
body { font-size: 15px; line-height: 1.45; }
button { font: inherit; color: inherit; }
.chart-stage { position: fixed; inset: 64px 0 0 0; }
/* The chart's own sea colour behind the tiles, so water the tiles leave out (the Arctic at world scale, a tile
   still loading) reads as sea, never as a hole. */
#map { position: absolute; inset: 0; background: #0a1424; }
:root[data-theme="light"] #map { background: #c3d9f3; }
#map canvas { outline: none; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-logo { display: none !important; }
.maplibregl-canvas-container.maplibregl-interactive { cursor: default; }
.maplibregl-canvas-container.maplibregl-interactive.grabbing { cursor: grabbing; }

/* ---------- top bar ---------- */
.bar { position: fixed; inset: 0 0 auto 0; height: 64px; z-index: 40; display: flex; align-items: center; gap: 18px; padding: 0 18px;
  background: var(--nav-bg); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); }
.bar .brand { font-size: 24px; gap: 10px; flex: none; }
.bar .brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand-sub { font: 600 11px/1 var(--mono); letter-spacing: 0.16em; color: var(--gold); margin-left: 2px; padding: 5px 7px; border: 1px solid var(--line-2); border-radius: 6px; transform: translateY(1px); }
.bar-right { display: flex; align-items: center; gap: 12px; flex: none; margin-left: auto; }
.bar .btn { height: 38px; padding: 0 16px; font-size: 14px; }
.bar .btn .short { display: none; }
.theme-btn { width: 38px; height: 38px; }

.search { position: relative; flex: 1 1 160px; min-width: 0; max-width: 560px; margin: 0 auto; display: flex; align-items: center; height: 40px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--line-2); transition: border-color 0.2s, box-shadow 0.2s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search > svg { width: 18px; height: 18px; margin-left: 12px; color: var(--dim); flex: none; }
.search input { all: unset; flex: 1; min-width: 0; height: 100%; padding: 0 10px; font-size: 15px; color: var(--text); }
.search input::placeholder { color: var(--dim); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-key { flex: none; margin-right: 10px; font: 600 11px/1 var(--mono); color: var(--dim); border: 1px solid var(--line-2); border-radius: 5px; padding: 4px 6px; }
.search:focus-within .search-key { display: none; }
.results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 18px 50px var(--shadow); overflow: hidden; z-index: 60; }
.results[hidden] { display: none; }
.result { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; cursor: pointer; }
.result:hover, .result.on { background: var(--panel-2); }
.result + .result { border-top: 1px solid var(--line); }
.result .flag { font: 600 11px/1 var(--mono); color: var(--soft); border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 0; text-align: center; }
.result b { display: block; color: var(--text); font-weight: 650; letter-spacing: -0.01em; }
.result small { color: var(--dim); font-size: 13px; }
.result .ago { color: var(--dim); font-size: 13px; white-space: nowrap; }
.results .none { padding: 14px; color: var(--dim); }

.live { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--soft); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.live:hover { border-color: var(--line-3); color: var(--text); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 0 transparent; }
.live.ok .live-dot { background: var(--mint); animation: pulse 2.4s infinite; }
.live.warn .live-dot { background: var(--gold); }
.live.down .live-dot { background: var(--red); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 50%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- over the chart ---------- */
.controls { position: absolute; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 1px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 8px 30px var(--shadow); z-index: 5; }
.controls button { all: unset; box-sizing: border-box; width: 40px; height: 40px; display: grid; place-items: center; background: var(--panel); color: var(--soft); cursor: pointer; }
.controls button:hover { color: var(--text); background: var(--panel-2); }
.controls svg { width: 18px; height: 18px; }

.hint { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 5; padding: 9px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); color: var(--soft); font-size: 13px; box-shadow: 0 8px 30px var(--shadow); white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.hint[hidden] { display: none; }
.hint b { color: var(--text); font-weight: 650; }

.legend { position: absolute; left: 16px; bottom: 40px; z-index: 5; display: flex; flex-wrap: nowrap; gap: 2px; max-width: calc(100% - 32px); overflow-x: auto; scrollbar-width: none; padding: 4px 8px; border-radius: 10px; background: color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid var(--line); }
.legend::-webkit-scrollbar { display: none; }
.leg { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; color: var(--soft); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: opacity 0.2s, background 0.15s; }
.leg:hover { background: var(--panel-2); }
.leg:hover { color: var(--text); }
.leg.off { opacity: 0.45; }
.leg .hull { width: 11px; height: 11px; flex: none; }
svg.hull { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin-right: 6px; }
svg.hull path { fill: var(--c); stroke: rgba(255,255,255,0.7); stroke-width: 1.4; stroke-linejoin: round; }
.leg .hull { margin-right: 0; }
.leg.off .hull path { fill: transparent; stroke: var(--c); }
.chip .hull { width: 10px; height: 10px; margin-right: 0; }


.credit { position: absolute; left: 16px; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); color: var(--dim); font-size: 11.5px; line-height: 1.3; }
.credit-btn { all: unset; box-sizing: border-box; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--soft); cursor: pointer; background: var(--panel); }
.credit-btn:hover { color: var(--text); }
.credit-btn svg { width: 13px; height: 13px; }
.credit-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px var(--bg); max-width: 900px; transition: opacity .6s ease, max-width .6s ease; }
/* the credits show for a while, then fold behind the (i); hovering or tapping it brings them back */
.credit.folded .credit-text { opacity: 0; max-width: 0; }
.credit.folded:hover .credit-text, .credit.folded:focus-within .credit-text { opacity: 1; max-width: 900px; }

/* ---------- the ship card ---------- */
.panel { position: absolute; top: 16px; right: 16px; bottom: 16px; width: 380px; z-index: 10; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 24px 60px var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.panel[hidden] { display: none; }
.panel-handle { display: none; }
.panel-inner { overflow: auto; padding: 18px 20px 20px; -webkit-overflow-scrolling: touch; }
.p-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--soft); }
.chip.flag { font-family: var(--mono); letter-spacing: 0.04em; }

.p-close { all: unset; box-sizing: border-box; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--soft); cursor: pointer; flex: none; }
.p-close:hover { background: var(--panel-2); color: var(--text); }
.p-close svg { width: 16px; height: 16px; }
.p-name { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); line-height: 1.1; overflow-wrap: anywhere; }
.p-sub { margin-top: 6px; color: var(--dim); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.p-sub b { color: var(--soft); font-weight: 600; }
.p-status { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.p-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.p-status.still i { background: var(--gold); }
.p-status.old i { background: var(--dim); }
.p-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tile small { display: block; font: 600 10.5px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 5px; }
.tile b { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.tile b small { display: inline; font: 600 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--dim); margin-left: 3px; }
.p-rows { margin-top: 16px; border-top: 1px solid var(--line); }
.row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.row span { color: var(--dim); flex: none; }
.row b { color: var(--text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.row b small { display: block; font-size: 12px; color: var(--dim); font-weight: 500; }
.p-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.p-actions .btn.wide { flex: 1 1 44%; }
.p-actions .btn { height: 42px; padding: 0 14px; font-size: 13.5px; flex: 1; justify-content: center; white-space: nowrap; gap: 8px; }
.p-actions .btn svg { width: 17px; height: 17px; flex: none; }
.p-actions .btn.on { background: var(--accent); color: #fff; }
.p-source { margin-top: 14px; font-size: 12px; color: var(--dim); line-height: 1.45; }
.p-source b { color: var(--soft); font-weight: 600; }

/* ---------- the track player ---------- */
.player { position: absolute; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; z-index: 12; max-width: 760px; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 10px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 18px 50px var(--shadow); }
.player[hidden] { display: none; }
.player-play { all: unset; box-sizing: border-box; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--text); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.player-play svg { width: 20px; height: 20px; }
.player-play .ic-pause { display: none; }
.player.playing .player-play .ic-play { display: none; }
.player.playing .player-play .ic-pause { display: block; }
.player-mid { flex: 1; min-width: 0; }
.player-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 2px; }
.player-name { color: var(--soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-time { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-ends { display: flex; justify-content: space-between; gap: 10px; font: 500 11px var(--mono); color: var(--dim); margin-top: 2px; }
.player-ends span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.player-ends span:last-child { text-align: right; }
#scrub { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer; }
#scrub::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--p, 100%), var(--line-2) var(--p, 100%)); }
#scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 3px solid var(--panel); box-shadow: 0 1px 6px var(--shadow); margin-top: -7px; }
#scrub::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
#scrub::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
#scrub::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 3px solid var(--panel); }
.player-speed { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); flex: none; }
.player-speed button { all: unset; box-sizing: border-box; padding: 6px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--dim); cursor: pointer; white-space: nowrap; }
.player-speed button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px var(--shadow); }
.player-close { all: unset; box-sizing: border-box; flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--soft); cursor: pointer; }
.player-close:hover { background: var(--panel-2); color: var(--text); }
.player-close svg { width: 16px; height: 16px; }

body.has-player .legend { display: none; }
@media (min-width: 761px) { body.has-panel .player { right: 412px; } body.has-panel .hint { left: calc((100% - 396px) / 2); } }

/* ---------- about sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; background: var(--floor); display: grid; place-items: center; padding: 20px; }
.sheet[hidden] { display: none; }
.sheet-card { position: relative; width: min(620px, 100%); max-height: calc(100% - 40px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 20px; padding: 26px 28px 28px; box-shadow: 0 30px 80px var(--shadow); }
.sheet-card h2 { font-size: 24px; letter-spacing: -0.03em; color: var(--text); margin-bottom: 8px; }
.sheet-card h3 { font-size: 15px; color: var(--text); margin: 20px 0 6px; }
.sheet-card p { color: var(--soft); font-size: 14.5px; margin: 0 0 8px; }
.sheet-card p.credit-line { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--soft); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.sheet-close { all: unset; box-sizing: border-box; position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--soft); cursor: pointer; }
.sheet-close:hover { background: var(--panel-2); color: var(--text); }
.sheet-close svg { width: 16px; height: 16px; }
.feeds { display: grid; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.feeds li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; color: var(--text); }
.feeds i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); flex: none; }
.feeds li.quiet i { background: var(--gold); }
.feeds li.down i { background: var(--red); }
.feeds span { margin-left: auto; color: var(--dim); font-size: 13px; white-space: nowrap; }

/* ---------- the chart's own marks (HTML markers) ---------- */
.ghost-mark { width: 26px; height: 26px; }
.ghost-mark svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .bar { gap: 10px; padding: 0 12px; height: 58px; }
  .chart-stage { inset: 58px 0 0 0; }
  .bar .brand { font-size: 0; gap: 0; }                 /* the icon alone; the name is in the page title */
  .bar .brand img { width: 34px; height: 34px; border-radius: 9px; }
  .brand-sub { display: none; }
  .search { max-width: none; height: 38px; }
  .search-key { display: none; }
  .live .live-text { display: none; }
  .live { padding: 0 10px; width: 38px; justify-content: center; }
  .app-link { display: none; }
  .controls { top: 12px; right: 12px; }
  .legend { left: 12px; right: 12px; bottom: 36px; max-width: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .legend::-webkit-scrollbar { display: none; }
  .leg { flex: none; }
  .credit { left: 12px; bottom: 8px; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62%; border-radius: 20px 20px 0 0; border-bottom: 0; }
  .panel-handle { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-3); margin: 10px auto 0; }
  .panel-inner { padding: 12px 18px 24px; }
  .p-name { font-size: 23px; }
  .p-tiles { gap: 6px; }
  .tile b { font-size: 17px; }
  .player { bottom: 8px; left: 8px; right: 8px; gap: 10px; padding: 8px; flex-wrap: wrap; }
  .player-speed { order: 3; }
  .player-close { position: absolute; top: 6px; right: 6px; }
  .player-top { padding-right: 34px; }
  .player-mid { flex-basis: calc(100% - 64px); }
  .player-speed { margin-left: 54px; }
  body.has-panel .legend, body.has-panel .credit, body.has-panel .hint { display: none; }
  body.has-player .legend { display: none; }
  body.has-player .panel { display: none; }              /* the track player takes the card's place; closing it brings the card back */
  .sheet { padding: 0; align-items: end; }
  .sheet-card { border-radius: 20px 20px 0 0; max-height: 88%; padding: 22px 20px 30px; }
}

/* ---------- the numbers strip ---------- */
.strip { position: absolute; left: 16px; top: 16px; z-index: 5; display: flex; align-items: center; gap: 0; max-width: calc(100% - 300px); height: 38px; padding: 0 6px 0 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 8px 30px var(--shadow); font-size: 13px; color: var(--soft); white-space: nowrap; overflow: hidden; }
.strip:empty { display: none; }
.strip .st { display: inline-flex; align-items: baseline; gap: 5px; padding-right: 14px; margin-right: 14px; border-right: 1px solid var(--line); }
.strip .st:last-of-type { border-right: 0; margin-right: 0; }
.strip b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.strip .st.port b { font-size: 15px; letter-spacing: -0.01em; }
.strip .st.port { padding-left: 2px; }
.strip .strip-link { all: unset; box-sizing: border-box; height: 28px; padding: 0 11px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 12.5px; cursor: pointer; margin-left: 4px; }
.strip .strip-link:hover { border-color: var(--line-3); }
.strip .anchor { width: 13px; height: 13px; color: var(--accent); margin-right: 6px; align-self: center; }
@media (min-width: 761px) { body.has-panel .strip { max-width: calc(100% - 700px); } }
.hint { top: auto; bottom: 44px; left: auto; right: 16px; transform: none; }
@media (min-width: 761px) { body.has-panel .hint { left: auto; right: 412px; } }

/* ---------- hover card ---------- */
.hover { position: absolute; z-index: 20; pointer-events: none; padding: 7px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 8px 30px var(--shadow); font-size: 12.5px; color: var(--soft); white-space: nowrap; transform: translate(14px, 14px); }
.hover[hidden] { display: none; }
.hover b { display: block; color: var(--text); font-size: 13.5px; font-weight: 700; }


/* ---------- cursor position and scale ---------- */
.readout { position: absolute; right: 16px; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 14px; font: 500 11.5px var(--mono); color: var(--dim); text-shadow: 0 1px 2px var(--bg); }
.readout .scale { display: inline-flex; align-items: center; gap: 8px; }
.readout .scale i { display: block; height: 5px; border: 1.5px solid var(--soft); border-top: 0; width: 80px; }
body.has-player .readout { display: none; }
@media (min-width: 761px) { body.has-panel .readout { right: 412px; } }

/* ---------- the ticker ---------- */
.tickbar { position: absolute; left: 16px; bottom: 82px; z-index: 5; max-width: min(560px, calc(100% - 32px)); }
.tickbar[hidden] { display: none; }
.tickbar-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px 0 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 8px 30px var(--shadow); color: var(--soft); font-size: 13px; cursor: pointer; max-width: 100%; }
.tickbar-btn:hover { color: var(--text); border-color: var(--line-3); }
.tickbar-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 2.4s infinite; }
.tickbar-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tickbar-text b { color: var(--text); font-weight: 650; }
.tickbar-text .when { color: var(--dim); margin-left: 6px; }
body.has-player .tickbar { display: none; }

/* ---------- layers menu ---------- */
.layers-wrap { position: relative; }
.icon-btn { all: unset; box-sizing: border-box; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--soft); cursor: pointer; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--text); border-color: var(--line-3); }
.icon-btn svg { width: 18px; height: 18px; }
.layers { position: absolute; top: calc(100% + 10px); right: 0; width: 300px; padding: 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 18px 50px var(--shadow); z-index: 70; }
.layers[hidden] { display: none; }
.layers label { display: grid; grid-template-columns: 18px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.layers label:hover { background: var(--panel-2); }
.layers input { grid-row: 1 / span 2; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.layers span { color: var(--text); font-weight: 600; font-size: 14px; }
.layers small { color: var(--dim); font-size: 12px; }

/* ---------- events list and port card (in the panel) ---------- */
.ev-list { margin: 0; padding: 0; list-style: none; }
.ev { display: grid; grid-template-columns: 8px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ev:hover b { text-decoration: underline; }
.ev i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--mint); }
.ev.left i { background: var(--gold); }
.ev.quiet i { background: var(--dim); }
.ev.note i { background: var(--accent); }
.ev.pilot i { background: #c084fc; }
.ev b { color: var(--text); font-weight: 650; }
.ev small { display: block; color: var(--dim); font-size: 12.5px; margin-top: 1px; }
.ev .when { color: var(--dim); font-size: 12px; white-space: nowrap; margin-top: 2px; font-variant-numeric: tabular-nums; }
.p-section { margin-top: 18px; display: flex; align-items: baseline; justify-content: space-between; }
.p-section h3 { font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 650; white-space: nowrap; }
.p-section small { text-align: right; }
.p-section small { color: var(--dim); font-size: 12px; }
.ship-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ship-row:hover b { text-decoration: underline; }
.ship-row b { color: var(--text); font-weight: 650; display: block; }
.ship-row small { color: var(--dim); font-size: 12.5px; }
.ship-row .r { text-align: right; color: var(--soft); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ship-row .r small { display: block; }
.p-tiles.four { grid-template-columns: repeat(4, 1fr); }
.p-tiles.four .tile { padding: 9px 10px; }
.p-tiles.four .tile b { font-size: 17px; }
.empty { color: var(--dim); font-size: 13.5px; padding: 10px 0; }
@media (max-width: 760px) {
  .strip { left: 12px; right: 12px; top: 12px; max-width: none; height: 34px; font-size: 12px; padding-left: 12px; }
  .strip .st { padding-right: 10px; margin-right: 10px; }
  .strip .st.hide-sm { display: none; }
  .readout { display: none; }
  .tickbar { left: 12px; bottom: 70px; max-width: calc(100% - 24px); }
  .layers { position: fixed; top: 66px; left: 12px; right: 12px; width: auto; }
  .hint { bottom: 36px; right: 12px; max-width: calc(100% - 24px); }
  .controls { top: 54px; }
}

.controls .tilt-btn span { font: 700 12px var(--mono); letter-spacing: 0.04em; }
.controls .tilt-btn.on { color: var(--accent); }
.controls .tilt-btn.dim { opacity: 0.4; }
.wx-legend { position: absolute; right: 16px; bottom: 36px; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-2); font-size: 11.5px; color: var(--soft); }
.wx-legend[hidden] { display: none; }
.wx-legend i { display: block; width: 46px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(90,169,255,0.15), #45d0b5, #f5c56b, #d9503a); }
@media (min-width: 761px) { body.has-panel .wx-legend { right: 412px; } }
@media (max-width: 760px) { .wx-legend { display: none; } }

/* ---------- the ship's story ---------- */
.photo { position: relative; margin-top: 16px; border-radius: 14px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); aspect-ratio: 16 / 9; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo small { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 10px 7px; font-size: 11px; color: #e8edf5; background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); }
.photo small a { color: inherit; text-decoration: underline; }
.spark { margin-top: 8px; }
.spark svg { width: 100%; height: 64px; display: block; overflow: visible; }
.spark .axis { display: flex; justify-content: space-between; font: 500 10.5px var(--mono); color: var(--dim); margin-top: 4px; }
.spark .max { position: absolute; }
.spark-wrap { position: relative; }
.spark-max { font: 500 10.5px var(--mono); color: var(--dim); text-align: right; }
.gap-note { color: var(--dim); font-size: 12.5px; margin-top: 6px; }
.related { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.related button { all: unset; box-sizing: border-box; height: 28px; padding: 0 11px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.related button:hover { border-color: var(--line-3); }
.p-actions .btn.sq { flex: 0 0 42px; padding: 0; }
.p-actions .btn.sq svg { width: 18px; height: 18px; }
.p-actions .btn.sq.on { background: var(--gold); color: var(--ink); border-color: transparent; }
.bell { position: relative; }
.bell .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: var(--ink); font: 700 11px/18px var(--sans); text-align: center; }
.bell .badge[hidden] { display: none; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; max-width: min(520px, calc(100% - 32px)); padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--ink); font-size: 14px; font-weight: 600; box-shadow: 0 18px 50px var(--shadow); }
.toast[hidden] { display: none; }
.toast b { font-weight: 800; }
.watch-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.watch-row b { color: var(--text); font-weight: 650; display: block; cursor: pointer; }
.watch-row small { color: var(--dim); font-size: 12.5px; }
.watch-row .r { text-align: right; color: var(--soft); font-size: 13px; }
.watch-row .x { all: unset; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--dim); cursor: pointer; }
.watch-row .x:hover { background: var(--panel-2); color: var(--text); }
.watch-row .x svg { width: 14px; height: 14px; }
@media (max-width: 760px) { .bell { display: none; } }

@media (min-width: 761px) and (max-width: 1180px) { body.has-panel .strip .hide-sm { display: none; } }

.chipbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.chipbtn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--soft); font-size: 12px; font-weight: 600; cursor: pointer; }
.chipbtn:hover { color: var(--text); }
.chipbtn.on { background: var(--text); color: var(--ink); border-color: transparent; }
.chipbtn i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.fmore { padding: 8px 14px 0; color: var(--dim); font-size: 12px; }

.ahead { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--soft); line-height: 1.5; }
.ahead b { color: var(--text); font-weight: 650; }
.ahead small { display: block; color: var(--dim); font-size: 12px; margin-top: 6px; line-height: 1.45; }
.ghost-mark.est svg path { fill: rgba(10,20,40,0.35); stroke-dasharray: 3 2; }
.player.ahead .player-play { background: var(--gold); }

.p-wx { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--soft); }
.p-wx:empty { display: none; }
.p-wx b { color: var(--text); font-weight: 650; }
.p-wx small { flex-basis: 100%; color: var(--dim); font-size: 12px; }
.p-wait { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; color: var(--soft); }
.p-wait:empty { display: none; }
.p-wait b { color: var(--text); font-weight: 650; }
.p-wait small { display: block; margin-top: 4px; color: var(--dim); font-size: 12px; }
.sheet-card p a { color: var(--accent); }

.p-sum { margin: 12px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--soft); }
.p-sum:empty { display: none; }
.ptabs { display: flex; gap: 2px; margin-top: 18px; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.ptabs button { all: unset; box-sizing: border-box; flex: 1; text-align: center; padding: 7px 4px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--dim); cursor: pointer; }
.ptabs button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px var(--shadow); }
.pfilters { padding: 8px 0 4px; border-bottom: 0; align-items: center; }
.pfilters select, .pfilters input { height: 26px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: 600 12px var(--sans); }
.pfilters input { width: 64px; }
.fleet-sort { padding: 10px 0 4px; }

/* ---------- filters and tools ---------- */
.layers.filters { width: 330px; max-height: calc(100vh - 90px); overflow: auto; }
.f-grid { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 6px 8px 2px; }
.layers.filters label.f-field { display: flex; flex-direction: column; gap: 5px; padding: 2px 2px; }
.layers.filters label.f-field:hover { background: none; }
.f-field > span:first-child { font: 600 12px var(--sans); color: var(--soft); }
.f-field select, .f-field input { height: 30px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: 600 13px var(--sans); min-width: 0; width: 100%; }
.f-pair { display: flex; gap: 6px; }
.f-note { font-size: 11.5px; color: var(--dim); }
.f-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 8px 4px; }
.f-actions select { height: 26px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: 600 12px var(--sans); }
.f-count { padding: 4px 8px 6px; color: var(--dim); font-size: 12px; }
.tool-row { all: unset; box-sizing: border-box; display: grid; gap: 2px; width: 100%; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.tool-row:hover { background: var(--panel-2); }
.tool-row span { color: var(--text); font-weight: 600; font-size: 14px; }
.tool-row small { color: var(--dim); font-size: 12px; }
.wx-bar { position: absolute; right: 16px; bottom: 44px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 8px 30px var(--shadow); font-size: 12.5px; color: var(--soft); }
.wx-bar[hidden] { display: none; }
.wx-bar select { height: 26px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: 600 12px var(--sans); }
.wx-bar input[type="range"] { width: 160px; accent-color: var(--accent); }
.wx-when { font-weight: 700; color: var(--text); white-space: nowrap; min-width: 92px; }
.wx-scale { display: inline-flex; align-items: center; gap: 6px; font: 500 11px var(--mono); color: var(--dim); }
.wx-scale i { display: block; width: 56px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(90,169,255,0.15), #45d0b5, #f5c56b, #d9503a); }
@media (min-width: 761px) { body.has-panel .wx-bar { right: 412px; } }
@media (max-width: 760px) { .wx-bar { left: 12px; right: 12px; bottom: 36px; flex-wrap: wrap; } .wx-bar input[type="range"] { flex: 1; } .layers.filters { width: auto; } .f-grid { grid-template-columns: 1fr; } }
.measure-label { background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; font: 600 11px var(--mono); color: var(--text); white-space: nowrap; pointer-events: none; }
.measure-pt { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid var(--panel); }
.rp-field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.rp-field > span { font: 600 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.rp-field input { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: 600 14px var(--sans); }
.rp-sugg { display: grid; gap: 2px; }
.rp-sugg button { all: unset; box-sizing: border-box; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 13px; }
.rp-sugg button:hover { background: var(--panel-2); }
.rp-sugg button small { color: var(--dim); margin-left: 6px; }

/* ---------- the workbench layout: a rail of tools on the left, controls on the right ---------- */
.rail { position: absolute; left: 0; top: 0; bottom: 0; width: 60px; z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; background: var(--nav-bg); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-right: 1px solid var(--line); }
.rail-gap { flex: 1; }
.rail-btn { all: unset; box-sizing: border-box; position: relative; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--soft); cursor: pointer; transition: background 0.15s, color 0.15s; }
.rail-btn:hover, .rail-btn[aria-expanded="true"], .rail-btn.on { background: var(--panel-2); color: var(--text); }
.rail-btn.active { color: var(--accent); }
.rail-btn svg { width: 21px; height: 21px; }
.rail-btn .badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--gold); color: var(--ink); font: 700 10.5px/16px var(--sans); text-align: center; }
.rail-btn .badge[hidden] { display: none; }
.rail-btn::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); padding: 5px 9px; border-radius: 8px; background: var(--text); color: var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.rail-btn:hover::after { opacity: 1; }
.rail .layers-wrap { position: static; }
.flyout { position: absolute; left: 70px; top: 12px; right: auto; }
.layers h4 { margin: 4px 10px 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); font-weight: 650; }
.layers.filters.flyout { width: 330px; }
.strip { left: 76px; }
.legend { left: 76px; max-width: calc(100% - 420px); }
.credit { left: 76px; }
.tickbar { left: 76px; bottom: 82px; }
.hint { right: 16px; }
.controls { top: 16px; }
.controls button.on { color: var(--accent); }
.controls .on-light, .controls .on-dark { width: 18px; height: 18px; }
.bar .bar-right { gap: 12px; }
@media (min-width: 761px) { body.has-panel .strip { max-width: calc(100% - 760px); } }
@media (max-width: 760px) {
  .rail { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 56px; flex-direction: row; justify-content: space-around; padding: 0 6px; border-right: 0; border-top: 1px solid var(--line); }
  .rail-gap { display: none; }
  .rail-btn::after { display: none; }
  .flyout { left: 12px; right: 12px; top: auto; bottom: 66px; }
  .strip { left: 12px; }
  .legend { left: 12px; right: 12px; bottom: 96px; max-width: none; }
  .credit { left: 12px; bottom: 64px; }
  .tickbar { left: 12px; bottom: 128px; }
  .hint { bottom: 96px; }
  .readout { display: none; }
  .wx-bar { bottom: 96px; }
  .player { bottom: 64px; }
  .panel { max-height: 62%; }
  body.has-panel .rail { display: none; }
}

/* ---------- depth legend ---------- */
.depth-bar { position: absolute; right: 16px; bottom: 44px; z-index: 6; display: grid; gap: 4px; width: 260px; padding: 8px 12px 9px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 8px 30px var(--shadow); font-size: 11.5px; color: var(--soft); }
.depth-bar[hidden] { display: none; }
.depth-title { font-weight: 700; color: var(--text); font-size: 12px; }
.depth-scale { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #b3001b 0%, #ff4d00 7%, #ffd400 20%, #27c93f 38%, #00c2d6 52%, #1b4fff 68%, #2a0fa8 85%, #8a2be2 100%); }
.depth-ticks { display: flex; justify-content: space-between; font: 500 10.5px var(--mono); color: var(--dim); }
.depth-bar small { color: var(--dim); font-size: 11px; line-height: 1.35; }
@media (min-width: 761px) { body.has-panel .depth-bar { right: 412px; } }
@media (max-width: 760px) { .depth-bar { display: none !important; } }
.readout .depth { color: var(--text); font-weight: 600; }

.feeds li.station { margin-left: 22px; background: transparent; border-style: dashed; }
.feeds li.station a { color: var(--accent); text-decoration: none; }
.feeds li.station a:hover { text-decoration: underline; text-underline-offset: 3px; }


/* ---------- the ship card, in sections ---------- */
.p-topbtns { display: flex; gap: 2px; }
.p-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.pb { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 11px 4px 9px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--soft); font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; }
.pb svg { width: 20px; height: 20px; color: var(--text); }
.pb:hover { border-color: var(--line-2); color: var(--text); }
.pb.on { background: color-mix(in srgb, var(--gold) 16%, var(--panel-2)); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); color: var(--text); }
.pb.on svg { color: var(--gold); }
.p-sec { margin-top: 18px; }
.p-sec h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 8px; font: 600 10.5px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.p-sec h4 span { font-weight: 500; letter-spacing: 0.04em; text-transform: none; color: var(--dim); text-align: right; }
.p-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 14px; }
.p-box b { display: block; color: var(--text); font-weight: 650; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.p-box small { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--dim); }
.p-box small a { color: var(--text); font-weight: 600; }
.p-box.pos { display: flex; gap: 12px; align-items: flex-start; }
.p-box.pos > svg { width: 22px; height: 22px; flex: none; color: var(--gold); margin-top: 1px; }
.p-box.pos b { font-family: var(--mono); font-size: 14px; letter-spacing: 0.02em; }
.p-box.code code { display: block; font: 12px/1.5 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.p-trackmeta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--dim); }
.p-trackmeta b { color: var(--text); font-weight: 650; }
.p-trackmeta a { color: var(--text); font-weight: 600; }
.p-sec .spark { margin-top: 0; }
.dims { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 4px; }
.dims svg { width: 100%; height: auto; display: block; }
.dim-arrows path { stroke: var(--dim); stroke-width: 1; fill: none; }
.dim-t { font: 600 11px var(--mono); fill: var(--soft); }
.dim-hull path, .dim-hull rect, .dim-hull circle { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; }
.dim-hull rect, .dim-hull circle { stroke-width: 1.1; opacity: 0.8; }
.dim-wl { fill: none; stroke: var(--mint, #45d0b5); stroke-width: 1.2; opacity: 0.6; }
.p-source { margin-top: 14px; }
.p-gapnote { display: block; margin-top: 8px; color: var(--dim); font-size: 12px; line-height: 1.45; }
/* the simpler card: a folded lower half, the hours picker, the mark that follows the mouse along a track */
.p-more { margin-top: 18px; border-top: 1px solid var(--line); }
.p-more > summary { list-style: none; cursor: pointer; padding: 12px 0; font: 600 10.5px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; justify-content: space-between; }
.p-more > summary::-webkit-details-marker { display: none; }
.p-more > summary::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--dim); border-bottom: 1.5px solid var(--dim); transform: rotate(45deg); transition: transform 0.15s; margin-right: 3px; }
.p-more[open] > summary::after { transform: rotate(-135deg); }
.p-more > summary:hover { color: var(--text); }
#p-hours { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: var(--dim); font: 500 10.5px/1.2 var(--mono); letter-spacing: 0.04em; cursor: pointer; padding: 0 12px 0 0; text-align: right; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: right 4px top 3px, right 0 top 3px; background-size: 4px 4px; background-repeat: no-repeat; }
#p-hours:hover { color: var(--text); }
#p-hours option { color: #000; }
.track-hover { pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.track-hover i { display: block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; background: var(--accent); box-shadow: 0 0 0 3px rgba(90, 169, 255, 0.25); order: 2; }
.track-hover span { background: rgba(7, 13, 25, 0.92); color: var(--text); font: 500 11px/1.2 var(--mono); padding: 5px 8px; border-radius: 6px; white-space: nowrap; border: 1px solid var(--line); }
.track-hover.est i { background: var(--gold); box-shadow: 0 0 0 3px rgba(245, 197, 107, 0.25); }
/* the ship under the mouse or in replay is lit: a halo ring that breathes */
.ghost-mark { position: relative; }
.ghost-mark::before { content: ''; position: absolute; inset: -11px; border-radius: 50%; border: 2px solid rgba(90, 169, 255, 0.9); box-shadow: 0 0 0 6px rgba(90, 169, 255, 0.18), 0 0 22px rgba(90, 169, 255, 0.7); animation: halo 1.6s ease-in-out infinite; }
.ghost-mark.est::before { border-color: rgba(245, 197, 107, 0.9); box-shadow: 0 0 0 6px rgba(245, 197, 107, 0.18), 0 0 22px rgba(245, 197, 107, 0.7); }
.track-hover i { width: 14px; height: 14px; border-width: 2.5px; box-shadow: 0 0 0 7px rgba(90, 169, 255, 0.22), 0 0 24px rgba(90, 169, 255, 0.85); animation: halo 1.6s ease-in-out infinite; }
.track-hover.est i { box-shadow: 0 0 0 7px rgba(245, 197, 107, 0.22), 0 0 24px rgba(245, 197, 107, 0.85); }
@keyframes halo { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: 0.8; } }
@media (prefers-reduced-motion: reduce) { .ghost-mark::before, .track-hover i { animation: none; } }
/* the play buttons in the card */
.p-play { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-right: 10px; vertical-align: middle; border-radius: 50%; border: 0; background: var(--accent); color: #0b1220; cursor: pointer; padding: 0; box-shadow: 0 0 0 3px rgba(90, 169, 255, 0.18); }
.p-play svg { width: 16px; height: 16px; margin-left: 2px; }
.p-play:hover { filter: brightness(1.12); box-shadow: 0 0 0 4px rgba(90, 169, 255, 0.3); }
.p-play.est { background: var(--gold); box-shadow: 0 0 0 3px rgba(245, 197, 107, 0.18); float: left; margin: 2px 12px 6px 0; }
.p-play.est:hover { box-shadow: 0 0 0 4px rgba(245, 197, 107, 0.3); }
.spark svg .spark-cur, .spark svg .spark-dot { pointer-events: none; }
/* the replayed ship: larger, named */
.ghost-mark { width: 34px; height: 34px; }
.ghost-name { white-space: nowrap; font: 600 11.5px/1.2 var(--sans); color: var(--text); text-shadow: 0 0 3px rgba(7, 13, 25, 1), 0 0 6px rgba(7, 13, 25, 0.9); pointer-events: none; }
.ghost-mark::before { inset: -13px; }
.sheet-card p.credit-line.plain { background: none; border: 0; padding: 0; font-family: var(--sans); font-size: 12px; line-height: 1.55; color: var(--dim); }
.sheet-card p.credit-line.plain + p.credit-line.plain { margin-top: 6px; }
/* the card's play buttons show pause while playing */
.p-play.on svg { display: none; }
.p-play.on::before, .p-play.on::after { content: ''; width: 3px; height: 12px; background: #0b1220; border-radius: 1px; margin: 0 2px; }
.spark svg { cursor: ew-resize; }
/* the port watch bell and the watched-ports list */
.p-bell.on { color: var(--gold); border-color: var(--gold); }
.fleet-ports { list-style: none; margin: 8px 0 0; padding: 0; }
.fleet-ports li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.fleet-ports li b { cursor: pointer; }
.fleet-ports li span { color: var(--dim); font: 500 11px var(--mono); flex: 1; }

/* ships remembered lying in a port, not heard for over 6 hours: listed apart, faded (11 Oct 2026) */
.known .ship-row { opacity: .62; }

/* ---------- phones: nothing on top of anything (Erdem, 14 Oct 2026) ---------- */
.strip .lbl-short { display: none; }
@media (max-width: 760px) {
  .controls { top: 56px; }                                   /* the buttons start under the numbers strip, never across it */
  .strip { right: 12px; }
  .strip .lbl-long { display: none; }
  .strip .lbl-short { display: inline; }
  .hint { left: 12px; right: 12px; bottom: 140px; max-width: none; text-align: center; white-space: normal; border-radius: 16px; line-height: 1.35; }   /* above the legend, not on it */
  .credit { max-width: calc(100% - 24px); }
  .chart-stage { bottom: env(safe-area-inset-bottom, 0); }
}
@media (max-width: 760px) and (orientation: landscape) {
  .legend, .hint { display: none; }                          /* a phone on its side keeps the map; the legend is in Layers */
}


/* ---------- phones: the cleanest chart (Erdem, 14 Oct 2026) ----------
   no ship-count note, and the ship kinds behind their own button at the foot of the right-hand stack */
.controls .key-btn { display: none; }
@media (max-width: 760px) {
  .hint.count { display: none; }
  .controls .key-btn { display: grid; }
  .legend, body.has-player .legend { display: none; }
  .legend.open { display: flex; flex-direction: column; align-items: stretch; gap: 0; left: auto; right: 60px; top: 56px; bottom: auto; max-width: none; max-height: calc(100% - 70px); overflow-y: auto; padding: 6px; border-radius: 12px; background: var(--panel); border-color: var(--line-2); box-shadow: 0 8px 30px var(--shadow); }
  .legend.open .leg { height: 34px; padding: 0 10px; font-size: 13px; }
}
@media (max-width: 760px) and (orientation: landscape) {
  .legend.open { display: flex; }
}
@media (max-width: 760px) {
  .controls { border-radius: 10px; }
  .controls button { width: 34px; height: 34px; }
  .controls svg, .controls .on-light, .controls .on-dark { width: 15px; height: 15px; }
  .controls .tilt-btn span { font-size: 10px; }
  .legend.open { right: 54px; }
}

/* ---------- the route planner ---------- */
.rp-launch { all: unset; box-sizing: border-box; position: absolute; top: 16px; right: 66px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 8px 30px var(--shadow); color: var(--text); font-size: 13.5px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.rp-launch:hover { background: var(--panel-2); }
.rp-launch svg { width: 18px; height: 18px; color: var(--gold); flex: none; }
.rp-nfn { position: sticky; top: -18px; z-index: 3; margin: -18px -20px 12px; padding: 9px 20px; background: var(--panel-2); border-bottom: 1px solid var(--line-2); color: var(--text); font-size: 12.5px; font-weight: 650; }
#rp-panel .rp-field > span { font: 600 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.rp-end { display: flex; gap: 6px; align-items: center; }
.rp-end input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: 600 14px var(--sans); }
.rp-end .chipbtn { height: 36px; border-radius: 10px; padding: 0 10px; }
.rp-end .chipbtn svg, .chipbtn svg { width: 14px; height: 14px; }
.rp-sugg button small { margin-left: 8px; }
.rp-ship { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.rp-ship summary { cursor: pointer; font: 600 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.rp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 8px; }
.rp-grid.two { margin-top: 12px; }
.rp-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rp-f.wide { grid-column: 1 / -1; }
.rp-f > span { font-size: 12px; color: var(--dim); font-weight: 600; }
.rp-f select, .rp-f input, .rp-in { box-sizing: border-box; width: 100%; height: 34px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: 600 14px var(--sans); }
.rp-f select, .rp-f > input { padding: 0 8px; }
.rp-in { display: flex; align-items: center; padding: 0 8px 0 0; }
.rp-in input { all: unset; flex: 1; min-width: 0; height: 100%; padding: 0 8px; font-variant-numeric: tabular-nums; }
.rp-in input::placeholder { color: var(--dim); font-weight: 500; font-size: 12.5px; }
.rp-in i { font-style: normal; color: var(--dim); font-size: 12px; }
#rp-panel .p-actions { display: flex; gap: 8px; margin-top: 14px; }
#rp-msg:not(:empty) { margin-top: 8px; }
.rp-warn { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--text); font-size: 13px; line-height: 1.4; }
.rp-warn svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--gold); }
.rp-last { margin-top: 12px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line-3); color: var(--soft); font-size: 13px; }
#rp-result .p-tiles { margin-top: 14px; }
.rp-t { font-size: 15px !important; }
.rp-when { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.rp-when div { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); }
.rp-when span { font: 600 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.rp-when b { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.rp-when small { color: var(--dim); font-size: 12px; }
#rp-panel .p-sec { margin-top: 18px; }
#rp-panel .p-sec h4 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 6px; font: 600 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
#rp-panel .p-sec h4 span { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-weight: 500; }
.rp-legs { border-top: 1px solid var(--line); }
.rp-leg { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 1fr 48px 68px 84px; gap: 2px 6px; width: 100%; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; cursor: pointer; }
.rp-leg > span:not(:first-child) { text-align: right; }
.rp-leg > span small { display: block; color: var(--dim); font-size: 11.5px; }
.rp-leg.head { cursor: default; color: var(--dim); font-size: 11.5px; font-weight: 600; }
.rp-leg.total { cursor: default; font-weight: 700; }
.rp-leg:not(.head):not(.total):hover { background: var(--panel-2); }
.rp-leg.on { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.rp-leg.inland > span:first-child { color: var(--accent); }
.rp-find { grid-column: 1 / -1; color: var(--dim); font-size: 11.5px; line-height: 1.35; }
.rp-find .w { color: var(--gold); font-weight: 650; }
.rp-edit { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rp-edit .chipbtn { height: 28px; padding: 0 11px; }
.rp-edit .chipbtn[disabled] { opacity: 0.45; cursor: default; }
.rp-notes { margin: 0; padding-left: 18px; color: var(--soft); font-size: 12.5px; line-height: 1.45; }
.rp-notes li + li { margin-top: 4px; }
.rp-rules .row b small { max-width: 220px; margin-left: auto; }
.p-plan { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 20px 1fr; gap: 0 10px; align-items: center; width: 100%; margin-top: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer; }
.p-plan:hover { background: var(--panel-2); }
.p-plan svg { width: 19px; height: 19px; color: var(--gold); grid-row: span 2; }
.p-plan span { color: var(--text); font-weight: 650; font-size: 14px; }
.p-plan small { color: var(--dim); font-size: 12px; }
.rp-pin { display: flex; flex-direction: column; align-items: center; pointer-events: auto; cursor: default; }
.rp-pin svg { width: 24px; height: 32px; }
.rp-pin svg path { fill: var(--gold); stroke: var(--panel); stroke-width: 1.6; }
.rp-pin.to svg path { fill: var(--accent); }
.rp-pin svg circle { fill: var(--panel); }
.rp-pin-label { margin-bottom: 3px; padding: 2px 7px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line-2); color: var(--text); font-size: 12px; font-weight: 650; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.rp-wp { box-sizing: border-box; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; display: grid; place-items: center; background: var(--panel); border: 2px solid var(--gold); color: var(--text); font: 700 10.5px/1 var(--sans); cursor: grab; }
.rp-wp.fixed { border-color: var(--accent); border-style: dashed; cursor: default; }
@media (max-width: 760px) {
  .rp-launch { top: 62px; left: 12px; right: auto; height: 38px; }
  body.has-panel .rp-launch { display: none; }
  .rp-nfn { top: -12px; margin: -12px -18px 10px; padding: 8px 18px; }
  body.rp-picking .panel { max-height: 30%; }
  .rp-leg { grid-template-columns: 1fr 44px 62px 78px; font-size: 12.5px; }
}
.rp-leg.gap > span:first-child { color: var(--dim); }
.rp-leg .nc { color: var(--dim); font-size: 11.5px; }
/* a sea mark's card (lib/seamarks.js): name, what it is, its light as charted, region, source */
.sm-card { position: absolute; z-index: 21; max-width: 260px; padding: 8px 11px 7px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 8px 30px var(--shadow); font-size: 12.5px; line-height: 1.4; color: var(--soft); }
.sm-card b { display: block; color: var(--text); font-size: 13.5px; font-weight: 700; margin-bottom: 1px; }
.sm-card span { display: block; }
.sm-card .sm-lt { color: var(--text); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; margin: 2px 0; }
.sm-card small { display: block; margin-top: 4px; font-size: 11px; opacity: 0.8; }
.sm-card a { color: inherit; }

/* the link from a ship or port card to its own page (29 Oct 2026) */
.p-sub a.p-pagelink { color: var(--gold); font-weight: 600; text-decoration: none; }
.p-sub a.p-pagelink:hover { text-decoration: underline; }

/* the Gangway AIS logo in the top bar (29 Oct 2026) */
.bar .brand img.ais-logo { width: auto; height: 36px; border-radius: 0; }
.ais-logo-l { display: none; }
:root[data-theme="light"] .ais-logo-d { display: none; }
:root[data-theme="light"] .ais-logo-l { display: block; }
@media (max-width: 760px) { .bar .brand img.ais-logo { height: 28px; } }
