/* ==========================================================================
   LINEUP — swell-signal.com/lineup (docs/plans/2026-10-03-swell-underway.md §2.2, §6, §7.4)
   Swell's chrome (main.css tokens: near-black, Orbitron, mono, cyan) around
   the helm dashboard. Red is reserved for keep-out and warnings (§6).
   Night (`html[data-night]`, §7.4): red on #04070d, no cyan, the map under a
   red multiply scrim, warnings invert to black on red.
   ========================================================================== */

:root {
  --lu-bg: #04070d;
  --lu-surface: rgba(13,22,38,0.82);
  --lu-lift: #0a1a30;
  --lu-line: rgba(64,224,255,0.16);
  --lu-text: #d7e7f5;
  --lu-muted: #7f96ad;           /* main.css --dim-text: ≥ 4.5:1 on the panels */
  --lu-accent: #21e6ff;
  --lu-go: #2bffa8;
  --lu-danger: #ff5f56;          /* keep-out red, the only red on the page */
  --lu-on-danger: #04070d;
  --lu-you: #21e6ff;
  --lu-scrim: transparent;
  --lu-firing: #ff2d95; --lu-great: #ffb347; --lu-good: #2bffa8; --lu-weak: #6b8299;
  color-scheme: dark;
}
/* Swell is dark in both schemes; a forced light theme keeps the dark page (the map tiles are the dark ones). */
:root[data-theme="light"], :root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }

html[data-night] {
  --lu-bg: #04070d;
  --lu-surface: #140608;
  --lu-lift: #140608;
  --lu-line: rgba(255,95,86,0.22);
  --lu-text: #ff5f56;
  --lu-muted: #ff5f56;           /* night.muted is for rules only; secondary text keeps night.text at 400 */
  --lu-accent: #ff8a7a;
  --lu-go: #ff5f56;
  --lu-danger: #ff5f56;
  --lu-on-danger: #04070d;
  --lu-you: #ff8a7a;
  --lu-scrim: #3a0a05;
  --lu-firing: #ff5f56; --lu-great: #ff5f56; --lu-good: #ff5f56; --lu-weak: #8c2f2a;
  --text: #ff5f56; --dim: #8c2f2a; --dim-text: #ff5f56; --cyan: #ff8a7a;
}

body.lu-page {
  overflow: auto;
  overflow-x: hidden;
  min-height: 100%;
  height: auto;
  background: var(--lu-bg);
  color: var(--lu-text);
  font: 15px/1.45 var(--mono);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html[data-night] body.lu-page::before { display: none; }
/* above main.css's fixed vignette (body::before, z 0); the header and footer are sticky */
.lu-strip, .lu-notice, .lu-warn, .lu-main { position: relative; z-index: 1; }

.lu-skip { position: absolute; left: -9999px; top: 0; }
.lu-skip:focus { left: 12px; top: 12px; z-index: 2000; background: var(--lu-lift); color: var(--lu-text); padding: 10px 14px; border-radius: 8px; }
.lu-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; padding: 0; }

/* ---------- header ---------- */
.lu-top {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: rgba(6,12,22,0.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--lu-line);
}
html[data-night] .lu-top { background: #04070d; }
.lu-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lu-home { text-decoration: none; color: inherit; white-space: nowrap; }
html[data-night] .wordmark-main, html[data-night] .wordmark-main b { color: var(--lu-text); text-shadow: none; }
.lu-title h1 { font: 900 20px/1.1 var(--disp); letter-spacing: 0.12em; color: var(--lu-accent); }
.lu-sub { margin: 2px 0 0; font: 500 10px var(--disp); letter-spacing: 0.14em; text-transform: uppercase; color: var(--lu-muted); white-space: nowrap; }
.lu-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.lu-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 0 14px;
  font: 700 12px var(--disp); letter-spacing: 0.08em; text-decoration: none;
  color: var(--lu-text); background: var(--lu-surface);
  border: 1px solid var(--lu-line); border-radius: 999px; cursor: pointer;
}
.lu-btn:hover { border-color: var(--lu-accent); }
.lu-btn[disabled] { opacity: 0.45; cursor: default; }
.lu-btn[aria-pressed="true"] { background: var(--lu-accent); color: var(--lu-bg); border-color: var(--lu-accent); }
.lu-btn-go { background: var(--lu-accent); color: var(--lu-bg); border-color: var(--lu-accent); }
.lu-btn-end { border-color: var(--lu-danger); color: var(--lu-danger); }
.lu-btn-wide { width: 100%; }
.lu-btn[hidden] { display: none; }

/* ---------- strips ---------- */
.lu-strip {
  display: flex; justify-content: space-between; gap: 4px 14px; flex-wrap: wrap;
  padding: 6px 16px; font: 500 12px var(--mono); color: var(--lu-muted);
  border-bottom: 1px solid var(--lu-line);
}
.lu-strip span { min-width: 0; overflow-wrap: anywhere; }
.lu-notice { padding: 6px 16px; font: 600 13px var(--mono); }
.lu-notice p { margin: 2px 0; }
.lu-notice .is-warn { color: var(--lu-great); }
html[data-night] .lu-notice .is-warn { color: var(--lu-text); }
.lu-notice .is-info { color: var(--lu-muted); }

/* The warning banner (§2.1 item 3): red fill, black Orbitron. Night keeps it — it is the one inverted thing. */
.lu-warn {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center;
  margin: 10px 16px 0; padding: 12px 14px; border-radius: 12px;
  background: var(--lu-danger); color: var(--lu-on-danger);
}
.lu-warn[hidden] { display: none; }
.lu-warn .lu-warn-k { font: 900 16px var(--disp); letter-spacing: 0.08em; }
.lu-warn .lu-warn-t { font: 700 15px/1.3 var(--mono); }
.lu-warn.is-inside { animation: lu-pulse 1s ease-in-out infinite alternate; }
.lu-warn.is-inside .lu-warn-t { font-size: 17px; }
@keyframes lu-pulse { from { box-shadow: 0 0 0 0 rgba(255,95,86,0.6); } to { box-shadow: 0 0 0 8px rgba(255,95,86,0); } }

/* ---------- layout ---------- */
.lu-main { display: grid; gap: 12px; padding: 12px 16px; grid-template-columns: minmax(0, 1fr); }
.lu-map { position: relative; min-height: 360px; height: 52vh; border-radius: 12px; overflow: hidden; border: 1px solid var(--lu-line); background: #061120; }
#lu-map { position: absolute; inset: 0; }
.lu-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 900px) and (orientation: landscape), (min-width: 1200px) {
  .lu-main { grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); align-items: start; }
  .lu-map { position: sticky; top: 132px; height: calc(100vh - 190px); min-height: 420px; }
}

.lu-card { background: var(--lu-surface); border: 1px solid var(--lu-line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.lu-card[hidden] { display: none; }
.lu-eb { margin: 0 0 6px; font: 500 11px var(--disp); letter-spacing: 0.14em; text-transform: uppercase; color: var(--lu-muted); }

/* ---------- hero ---------- */
.lu-hero .lu-name { font: 700 22px/1.15 var(--disp); letter-spacing: 0.04em; margin-top: 2px; overflow-wrap: anywhere; }
.lu-hero .lu-time { font: 700 30px/1.15 var(--mono); margin-top: 4px; font-variant-numeric: tabular-nums; }
.lu-hero .lu-rel { font-size: 17px; color: var(--lu-go); font-weight: 600; }
.lu-hero .lu-faces { font: 600 15px var(--mono); margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lu-hero .lu-where { font-size: 14px; color: var(--lu-muted); margin-top: 6px; }
.lu-hero .lu-station { font-size: 14px; color: var(--lu-go); margin-top: 6px; }
.lu-hero .lu-msg { font: 700 18px/1.3 var(--disp); letter-spacing: 0.03em; margin: 2px 0 6px; }
.lu-hero .lu-msg-sub { font-size: 14px; color: var(--lu-muted); margin: 4px 0; }
.lu-hero .lu-btn { margin-top: 10px; }
.lu-hero.is-warning { border-color: var(--lu-danger); }
.lu-hero.is-warning .lu-eb { color: var(--lu-danger); }
.lu-hero .lu-instr { font: 700 17px/1.3 var(--mono); color: var(--lu-danger); margin-top: 6px; }

.lu-band {
  display: inline-block; font: 700 11px var(--disp); letter-spacing: 0.1em;
  padding: 3px 8px; border-radius: 4px; color: #04070d; background: var(--lu-weak);
}
.lu-band.b-FIRING { background: var(--lu-firing); }
.lu-band.b-GREAT { background: var(--lu-great); }
.lu-band.b-GOOD { background: var(--lu-good); }
.lu-band.b-WEAK { background: var(--lu-weak); color: #04070d; }
html[data-night] .lu-band { color: #04070d; }

/* ---------- region lines (the zone pack's safety lines, after the generic card) ---------- */
.lu-zone-strip { padding: 4px 6px 4px 14px; border-color: var(--lu-great); }
html[data-night] .lu-zone-strip { border-color: var(--lu-line); }
.lu-zone-head { display: flex; align-items: center; gap: 6px; }
.lu-zone-toggle {
  flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 44px; padding: 0; background: none; border: 0; cursor: pointer; text-align: left;
  font: 500 12px var(--disp); letter-spacing: 0.12em; color: var(--lu-great);
}
html[data-night] .lu-zone-toggle { color: var(--lu-text); }
.lu-zone-caret { font-size: 16px; line-height: 1; padding-right: 4px; }
.lu-zone-toggle[aria-expanded="true"] .lu-zone-caret { transform: rotate(180deg); }
.lu-zone-x { min-width: 44px; min-height: 44px; background: none; border: 0; color: var(--lu-muted); font-size: 16px; cursor: pointer; }
.lu-zone-strip ul { margin: 0 0 8px; padding-left: 18px; font-size: 14px; }
.lu-zone-strip ul[hidden] { display: none; }

/* ---------- timeline ---------- */
.lu-tl-svg { width: 100%; overflow: hidden; }
.lu-tl-svg svg { display: block; max-width: 100%; }
.lu-tl-svg text { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lu-tl-empty { font-size: 14px; color: var(--lu-muted); margin: 4px 0; }

/* ---------- list ---------- */
.lu-rows { list-style: none; margin: 0; padding: 0; }
.lu-rows li + li { border-top: 1px solid var(--lu-line); }
.lu-row {
  display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center;
  width: 100%; min-height: 48px; padding: 9px 2px; text-align: left;
  background: none; border: 0; color: inherit; cursor: pointer; font: inherit;
}
.lu-row[aria-expanded="true"] { background: rgba(33,230,255,0.06); }
html[data-night] .lu-row[aria-expanded="true"] { background: rgba(255,95,86,0.08); }
.lu-row-t { font: 700 15px var(--mono); font-variant-numeric: tabular-nums; }
.lu-row-n { display: block; font: 700 14px var(--disp); letter-spacing: 0.03em; overflow-wrap: anywhere; }
.lu-row-m { display: block; font-size: 13px; color: var(--lu-muted); }
.lu-row-side { text-align: right; }
.lu-row-w { display: block; font: 700 13px var(--mono); white-space: nowrap; }
.lu-row-w.is-warn { color: var(--lu-danger); }
.lu-row-a { display: block; font-size: 12px; color: var(--lu-muted); }
.lu-row-x { grid-column: 1 / -1; font-size: 13px; color: var(--lu-muted); padding-top: 4px; }
.lu-empty { font-size: 14px; color: var(--lu-muted); margin: 6px 0; }
.lu-empty[hidden] { display: none; }

.lu-feednote { font-size: 13px; color: var(--lu-muted); margin: 0 2px; }
.lu-foot {
  position: sticky; bottom: 0; z-index: 50;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  font: 600 13px var(--mono); color: var(--lu-text); text-align: center;
  background: rgba(4,7,13,0.94); border-top: 1px solid var(--lu-line);
}
.lu-foot a { color: var(--lu-muted); }

/* ---------- map furniture ---------- */
.lu-recentre { position: absolute; right: 10px; bottom: 30px; z-index: 900; }
.lu-map-key {
  position: absolute; left: 56px; top: 10px; z-index: 900; margin: 0; padding: 3px 8px; border-radius: 6px;
  font: 600 11px var(--mono); color: var(--lu-text); background: rgba(4,7,13,0.78);
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: calc(100% - 16px);
}
.lu-map-key i { display: inline-block; width: 12px; height: 9px; border-radius: 2px; }
.lu-map-key .k-keep { background: rgba(255,95,86,0.45); border: 1px solid var(--lu-danger); }
.lu-map-key .k-station { border: 1px dashed var(--lu-good); background: rgba(43,255,168,0.16); }
.lu-map-key .k-dot { width: 9px; border-radius: 50%; background: var(--lu-firing); }
/* the pane moves with every pan, so the wash is far larger than any screen */
.lu-night-wash { position: absolute; left: -20000px; top: -20000px; width: 40000px; height: 40000px; background: var(--lu-scrim); opacity: 0.85; }
html:not([data-night]) .lu-night-wash { display: none; }
.leaflet-container .lu-tip {
  background: rgba(4,7,13,0.86); color: var(--lu-text); border: 1px solid var(--lu-line);
  font: 700 12px var(--mono); padding: 2px 6px; box-shadow: none; border-radius: 6px;
}
.leaflet-container .lu-tip::before { display: none; }
.leaflet-container .lu-tip.is-warn { color: var(--lu-danger); border-color: var(--lu-danger); }
.lu-own { background: none; border: 0; }
.leaflet-control-attribution { font-size: 10px; background: rgba(4,7,13,0.7) !important; color: var(--lu-muted) !important; }
.leaflet-control-attribution a { color: var(--lu-muted) !important; }
.leaflet-bar a { background: var(--lu-lift); color: var(--lu-text); border-color: var(--lu-line); }

.lu-main[data-stale="1"] .lu-map, .lu-main[data-stale="1"] .lu-list { opacity: 0.55; }

/* ---------- sheets ---------- */
.lu-sheet {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  padding: 20px 20px 18px; border-radius: 18px;
  background: var(--lu-lift); color: var(--lu-text); border: 1px solid var(--lu-line-strong, var(--lu-line));
}
.lu-sheet::backdrop { background: rgba(4,7,13,0.78); }
.lu-sheet h2 { margin: 0 0 10px; font: 700 17px var(--disp); letter-spacing: 0.1em; color: var(--lu-accent); }
.lu-sheet p { margin: 8px 0; font-size: 15px; }
.lu-sheet p b { color: var(--lu-great); }
html[data-night] .lu-sheet p b { color: var(--lu-text); }
.lu-sheet .lu-fine { font-size: 13px; color: var(--lu-muted); }
.lu-sheet-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.lu-safety .lu-zone { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--lu-line); }
.lu-safety .lu-zone h3 { margin: 0 0 4px; font: 500 11px var(--disp); letter-spacing: 0.14em; text-transform: uppercase; color: var(--lu-muted); }
.lu-safety .lu-zone ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.lu-plan-row { display: flex; justify-content: space-between; font: 600 14px var(--mono); margin-top: 6px; }
#lu-plan-speed { width: 100%; min-height: 44px; accent-color: var(--lu-accent); }
.lu-check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 15px; }
.lu-check input { width: 22px; height: 22px; accent-color: var(--lu-accent); }
.lu-sheet-fs { margin-top: 8px; }

@media (max-width: 600px) {
  .lu-top { padding-left: 12px; padding-right: 12px; }
  .lu-brand { gap: 10px; }
  .lu-home .wordmark-main { font-size: 12px; letter-spacing: 2px; }
  .lu-title h1 { font-size: 17px; }
  .lu-sub { letter-spacing: 0.04em; font-size: 9.5px; }
  .lu-tools { width: 100%; justify-content: flex-end; }
  .lu-btn { padding: 0 11px; }
  .lu-wide-only { display: none; }
  .lu-strip, .lu-notice { padding-left: 12px; padding-right: 12px; }
  .lu-warn { margin: 8px 12px 0; }
  .lu-main { padding: 10px 12px; }
  .lu-map { height: 46vh; min-height: 300px; }
  .lu-hero .lu-time { font-size: 26px; }
  .lu-row { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .lu-foot { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .lu-warn.is-inside { animation: none; } }
