/* EveOnline Heatmap viewer — dark theme, no external assets. */

:root {
  --bg: #0b0e14;
  --bg-panel: #12161f;
  --bg-hover: #1b2230;
  --border: #232b3a;
  --text: #c8d2e0;
  --text-dim: #7f8b9e;
  --accent: #4da3ff;
  --jspace: #c07bff;
  /* Single source of truth for text label colors (contrast vs --bg):
   * gold for entities (~13.9:1), silver for measurement infrastructure
   * (~13.1:1). Shared by all labels in both views. */
  --label-gold: #ffd75e;
  --label-silver: #cdd5e0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

body { display: flex; flex-direction: column; }

/* --- Top bar --- */

#topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 44px;
  flex: none;
  padding: 0 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  white-space: nowrap;
  text-decoration: none;
}

/* The brand mark (inline SVG, glass-orbit favicon artwork — hardening
 * session 2026-09-22): decorative, baseline-aligned with the wordmark.
 * The product name is a proper noun — deliberately NOT data-i18n. */
.brand-mark {
  vertical-align: -4px;
  margin-right: 7px;
  border-radius: 5px;
}

#breadcrumb {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

/* Quick-nav (owner request 2026-09-15; GLOBAL 2026-09-29 — "available in
 * all pages on the top header", superseding the home-only scoping): jump
 * buttons in the topbar — Universe View, The Heat! (the six hot pages),
 * The Maps (universe/region/system shortcuts). Map views keep the breadcrumb for
 * the contextual path; the quicknav is the global shortcut strip beside
 * it. Anchors styled like the topbar buttons. */
#home-quicknav {
  display: flex;
  flex: none;
  gap: 8px;
}

.topbar-link {
  flex: none;
  padding: 5px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- The Heat! dropdown (owner request 2026-09-29): the six hot pages
 * group behind ONE trigger carrying the hot-flair treatment. Overlay
 * discipline: the panel is display:none when closed (never in
 * elementsFromPoint). Esc closes it at the LOWEST key-arbitration layer
 * (palette > context menu > heat menu). 2026-09-29 round 2: TWO dropdowns
 * (The Heat! + The Maps), mutually exclusive, shared wiring. */
.heat-menu {
  position: relative;
  flex: none;
}

.heat-menu > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  white-space: nowrap;
}

.heat-menu > button:hover {
  border-color: var(--accent);
}

.heat-menu > button[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(77, 163, 255, 0.12);
}

/* UI icon system (owner visual review 2026-11-03): one stroke vocabulary for
 * every chrome glyph — Lucide's 24-unit box, 2px stroke, round caps. Size comes
 * from the width/height attributes the helper writes, so a chevron and a
 * toolbar button share geometry. Map and legend art stay bespoke (it is data). */
/* Keyboard focus is a first-class state (owner visual review 2026-11-03): the
 * sheet carried exactly ONE :focus-visible rule (the panel resize handle), so
 * every button, chip, toggle and link was invisible to keyboard users. One
 * global ring, 2px accent, 2px offset — the app's own accent, not a new hue. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.ui-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.15em;
  flex: none;
}

.heat-chevron {
  font-size: 10px;
  color: var(--text-dim);
  transition: transform 0.15s ease;
}

.heat-menu > button[aria-expanded="true"] .heat-chevron {
  transform: rotate(180deg);
}

.heat-menu > div[hidden] {
  display: none;
}

.heat-menu > div {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 176px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  z-index: 70; /* over the page content below the bar */
}

.heat-menu > div .topbar-link {
  display: block;
  border: none;
  background: transparent;
  padding: 8px 10px;
}

.heat-menu > div .topbar-link:hover {
  background: rgba(77, 163, 255, 0.12);
}

.heat-menu > div .topbar-link.heat-active {
  background: rgba(77, 163, 255, 0.16);
  color: var(--accent);
}

html[dir="rtl"] .heat-menu > div {
  left: auto;
  right: 0;
}

/* "The Heat!" — FIRE (owner ruling 2026-09-30, supersedes the 2026-09-29
 * "rising desert heat — the letters don't move" clarification: the letters
 * now WAVE left and right, like a fire in the shape of the words).
 * Per-letter <b> spans (the hot-flair grammar, index.html): each letter
 * sways + rotates from its BASE — transform-origin bottom center, flames
 * bend at the bottom while the tips flicker furthest. AMENDED later the
 * same day (owner: "wiggle in unison") — ALL letters share one phase (no
 * staggered delays) so the word sways as ONE flame. Fill = a flame
 * gradient clipped to the letters (deep-red tips -> white-hot base) + the
 * rising wisp retained per letter (background-position is still the only
 * way to move a layer INSIDE clipped text). The wrapper carries ONE
 * drop-shadow glow — text-shadow would show THROUGH the transparent
 * fill; drop-shadow applies to the rendered glyphs. Transform-only
 * animation (composited, no layout cost); prefers-reduced-motion
 * disables both sway and rise. */
.heat-word {
  display: inline-block;
  font-style: italic;
  font-weight: 700;
  filter: drop-shadow(0 0 5px rgba(255, 110, 30, 0.45));
}

.heat-word b {
  display: inline-block;
  font-style: italic;
  font-weight: 700;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 220, 150, 0) 0px,
      rgba(255, 225, 160, 0.85) 14px,
      rgba(255, 170, 90, 0) 30px
    ),
    linear-gradient(180deg, #d92b16 0%, #ff7a1a 38%, #ffc93c 68%, #fff3c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: underline;
  text-decoration-color: rgba(255, 77, 77, 0.55);
  text-underline-offset: 3px;
  transform-origin: bottom center;
  animation:
    heat-flame 1.4s ease-in-out infinite,
    heat-rise 1.1s linear infinite;
}

/* The rising wisp: one stripe period per cycle — seamless rise (retained
 * from the 2026-09-29 rising-heat build, now running per letter). */
@keyframes heat-rise {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 -30px, 0 0;
  }
}

/* The flame sway: bend from the base, tips sweeping left and right with a
 * slight stretch/compress flicker. */
@keyframes heat-flame {
  0%,
  100% {
    transform: translateX(0) rotate(0deg) scaleY(1);
  }
  25% {
    transform: translateX(-1.3px) rotate(-2.6deg) scaleY(1.05);
  }
  55% {
    transform: translateX(1.2px) rotate(2.4deg) scaleY(0.96);
  }
  80% {
    transform: translateX(-0.6px) rotate(-1.2deg) scaleY(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .heat-word b {
    animation: none;
  }
}

/* "The Maps" — VERTICAL YELLOW GRADIENT with a ground-style texture
 * clipped to the letters (owner request 2026-09-29): sediment strata
 * lines + a faint vertical grain composited over the gold gradient.
 * GLEAM SWEEP (owner ruling 2026-09-30 — "an animation ... not a flame
 * style ... something different", chose the golden gleam + gentle
 * periodic loop; supersedes "Static — no animation"): a diagonal
 * white-gold band travels across the letters ONCE per ~5s cycle and
 * rests off-text the rest of the time — like light glinting off a
 * treasure map. Pattern: background-position sweep INSIDE clipped text
 * (the heat-rise trick family — background-position is the only way to
 * move a layer inside background-clip:text). The band lives on a 300%
 * wide top layer (no-repeat); percentage positions with an oversized
 * layer put the band fully off-text at BOTH ends (0% = off right,
 * 100% = off left), so the cycle-boundary jump is invisible and the
 * reduced-motion static state never freezes a white streak on the word.
 * The three texture layers keep `auto` sizing — identical look. */
.maps-word {
  font-style: italic;
  font-weight: 700;
  background-image:
    linear-gradient(
      115deg,
      rgba(255, 255, 255, 0) 42%,
      rgba(255, 255, 255, 0.85) 50%,
      rgba(255, 255, 255, 0) 58%
    ),
    repeating-linear-gradient(
      180deg,
      rgba(97, 61, 6, 0.32) 0 1px,
      rgba(97, 61, 6, 0) 1px 3px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 244, 200, 0.14) 0 2px,
      rgba(255, 244, 200, 0) 2px 5px
    ),
    linear-gradient(180deg, #ffe08a 0%, #f0c041 45%, #8a5a0a 100%);
  background-size: 300% 100%, auto, auto, auto;
  background-position: 0 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat, repeat, repeat, repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: underline;
  text-decoration-color: rgba(230, 180, 60, 0.55);
  text-underline-offset: 3px;
  animation: maps-gleam 5s ease-in-out infinite;
}

/* Gentle periodic loop: the band rests off-text (0%) for most of the
 * cycle, sweeps once right -> left across the word, then rests off-text
 * again (100%) before the invisible jump home. */
@keyframes maps-gleam {
  0%,
  58% {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }
  82% {
    background-position: 100% 0, 0 0, 0 0, 0 0;
  }
  100% {
    background-position: 100% 0, 0 0, 0 0, 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .maps-word {
    animation: none;
  }
}

/* Phase 8b-sov staleness disclosure (ruling 3): subtle, non-occluding —
 * a dim inline label in the topbar between breadcrumb and actions. */
#live-staleness {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
  margin-right: 10px;
  /* CLS reserve (2026-10-12 health pass — "reserve space for async
   * content"): the disclosure fills after the first sov fetch and its
   * late arrival re-wrapped the phone topbar (0.038 measured). The empty
   * slot holds the widest common string so the row wraps ONCE at first
   * paint; the box stays at the reserve when the text is shorter. */
  display: inline-block;
  min-width: 170px;
}
/* The [hidden] state paints nothing but KEEPS the slot (this is inline
 * flow content, not an overlay — the overlay display:none discipline does
 * not apply). */
#live-staleness[hidden] { visibility: hidden; }

#breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

#breadcrumb a:hover { text-decoration: underline; }
#breadcrumb .sep { margin: 0 6px; color: var(--text-dim); }
#breadcrumb .current { color: var(--text); }

/* Export button (SVG-to-PNG screenshot). */
#export-btn {
  flex: none;
  padding: 5px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
}

#export-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* EXPORT PNG exports the map canvas — hidden on views without one
 * (home/about) instead of a silent dead button (housekeeping session
 * 2026-09-22). View-scoped chrome grammar: body[data-view] carries the
 * route; universe/region/planet/system keep the button. */
body[data-view="home"] #export-btn,
body[data-view="about"] #export-btn {
  display: none;
}

/* --- Search palette (Ctrl+K) — single search surface --- */

#search-btn {
  flex: none;
  padding: 5px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
}

/* Narrow-topbar icon (2026-09-22): hidden at wide widths; the media query
 * below swaps the text label for the icon. Inline SVG — no external assets
 * (theme rule). */
.btn-icon { display: none; }

/* --- Language dropdown (owner request 2026-09-21): custom select-only
 * combobox (W3C APG) styled to match the topbar buttons; options render in
 * their NATIVE names. 2026-10-21 (owner: "the dropdown always goes down
 * from the button"): the native <select> is gone — its popup was
 * UA-positioned around the SELECTED option and could open past the top of
 * the window. The panel uses the .heat-menu grammar (top:
 * calc(100% + 6px) — ALWAYS downward, never flips) and scrolls internally
 * (max-height) on short viewports. RTL note: the menu always reads LTR
 * (native names in their own script). --- */

#lang-select {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: normal; /* .heat-menu buttons carry 1px — it would crowd the pinned label fit */
  cursor: pointer;
  direction: ltr;
  /* Fixed width (CLS pass 2026-10-12 — "reserve space for async content"):
   * the empty select painted 30px and grew to its populated width when the
   * i18n options landed (~0.1 CLS in the topbar). The populated width was
   * already the cap — pinning it makes the box constant from first paint. */
  width: 130px;
}

#lang-select .lang-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

#lang-select:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Always-down panel: the .heat-menu wrapper supplies position/z-index/
 * hidden-discipline; this adds the long-list scroll + row width. */
#lang-select-panel {
  min-width: 210px;
  width: max-content;
  max-width: min(320px, calc(100vw - 20px));
  max-height: min(60vh, 430px); /* 16 rows — scrolls rather than ever flipping up */
  overflow-y: auto;
  direction: ltr;
}

#lang-select-panel [role="option"] {
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#lang-select-panel [role="option"]:hover {
  background: rgba(77, 163, 255, 0.12);
}

/* Visual focus (aria-activedescendant — DOM focus stays on the trigger). */
#lang-select-panel [role="option"].lang-active {
  background: rgba(77, 163, 255, 0.14);
  outline: 1px solid var(--accent);
}

#lang-select-panel [role="option"][aria-selected="true"] {
  background: rgba(77, 163, 255, 0.16);
  color: var(--accent);
}

/* --- Flag emoji, deterministic everywhere (owner request 2026-10-10):
 * Windows Chrome renders regional-indicator flag pairs as LETTER PAIRS
 * (Segoe UI Emoji ships no flag glyphs — the flags broke "on other PCs").
 * A bundled subset of Noto Color Emoji (SIL OFL 1.1 — see
 * fonts/OFL-NotoColorEmoji.txt; generated by scripts/make_flag_font.py)
 * carries only the 26 regional indicators + the globe + our 14 flag
 * ligatures. "EveFlags" is listed FIRST and unicode-range-restricted to
 * those codepoints, so the flags come from OUR font on every platform
 * while the text stack after it is byte-identical to before.
 * font-display: block — the flag glyph appears when the subset loads
 * (123KB, local origin) rather than flashing the letter-pair fallback. */
@font-face {
  font-family: "EveFlags";
  src: url("fonts/noto-emoji-flags-subset.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F310;
  font-display: block;
}

#lang-select,
#lang-select-panel [role="option"] {
  font-family: "EveFlags", "Segoe UI", system-ui, sans-serif;
}

/* --- Arabic RTL (i18n owner request 2026-09-21): text surfaces flip; the
 * SVG map, scale bar and sliders stay direction-neutral/LTR. Panels dock
 * left by design (owner ruling 2026-09-10: ONE corner) — the dock column
 * stays on the left; only text alignment and inline flows mirror. --- */

html[dir="rtl"] #detail-panel,
html[dir="rtl"] #kills-panel,
html[dir="rtl"] #sov-panel,
html[dir="rtl"] #legend,
html[dir="rtl"] .node-tooltip,
html[dir="rtl"] #home,
html[dir="rtl"] #about,
html[dir="rtl"] #search-palette,
html[dir="rtl"] .context-menu,
html[dir="rtl"] #sidebar {
  text-align: right;
}

html[dir="rtl"] .tt-row,
html[dir="rtl"] .kill-row,
html[dir="rtl"] .home-kill,
html[dir="rtl"] .home-hot-row,
html[dir="rtl"] .home-market-row,
html[dir="rtl"] .faction-row,
html[dir="rtl"] .about-row {
  flex-direction: row-reverse;
}

/* The kill-window slider stays LTR (numeric range — min on the left is the
 * universal slider convention). */
html[dir="rtl"] .kill-window-row {
  direction: ltr;
}

#search-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Narrow topbar (2026-09-22): below ~1080px the action row overflowed
 * the fixed 44px bar and clipped with NO scrollbar (measured: #export-btn
 * right edge 1068 at a 1010px viewport — SEARCH/EXPORT unreachable). The
 * bar wraps: the breadcrumb takes a full-width second row, SEARCH/EXPORT
 * PNG collapse to icon-only (screen readers keep the labels via aria-label
 * + the i18n title), and every control stays reachable. RTL-safe: the flex
 * order is direction-neutral; the dir attribute mirrors the row. --- */
@media (max-width: 1080px) {
  #topbar {
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 6px 10px;
  }
  #breadcrumb {
    flex-basis: 100%;
    order: 10;
  }
  .btn-icon { display: inline-block; }
  #search-btn .btn-label,
  #export-btn .btn-label { display: none; }
  #search-btn,
  #export-btn { padding: 5px 8px; }
}

/* Regions drawer + phone tier: the rules live at the END of this file —
 * same-specificity overrides of #sidebar/.home-kill* must win by ORDER
 * (the 2026-09-30 mobile session: placing them here lost to the later
 * base rules and shipped a fixed sidebar over the map). */

/* Backdrop traps pointer events while the palette is open; both layers are
 * display:none ([hidden]) when closed so they never appear in
 * elementsFromPoint. */
.search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.45);
}
.search-backdrop[hidden] { display: none; }

.search-palette {
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 61;
  width: 460px;
  max-width: calc(100vw - 40px);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.search-palette[hidden] { display: none; }

#search-palette-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}

#search-palette-results {
  margin: 0;
  padding: 6px 0;
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  cursor: pointer;
}

.search-result.active, .search-result:hover { background: var(--bg-hover); }

.search-sec-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
}

.search-name { color: var(--text); font-weight: 600; }
.search-meta { color: var(--text-dim); font-size: 12px; margin-left: auto; white-space: nowrap; }
.search-empty { padding: 10px 14px; color: var(--text-dim); }

/* --- Context menu (right-click orbit context, system view) --- */
.context-menu {
  position: fixed;
  z-index: 70;
  min-width: 220px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  padding: 4px;
}
.context-menu[hidden] { display: none; }

.ctx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 6px 10px;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.ctx-row:hover { background: var(--bg-hover); }
.ctx-name { font-weight: 600; }
.ctx-type { color: var(--text-dim); font-size: 11px; }

/* --- Banner (stale container / errors) --- */

#banner {
  flex: none;
  padding: 10px 16px;
  background: #4a1d1d;
  border-bottom: 1px solid #7a2e2e;
  color: #ffd9d9;
  font-weight: 600;
}

#banner code {
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 6px;
  border-radius: 3px;
}

/* --- Layout --- */

#content { display: flex; flex: 1 1 auto; height: auto; min-height: 0; }

#sidebar {
  width: 220px;
  flex: none;
  /* Column flex: title + controls are ALWAYS-VISIBLE chrome above the list
   * (sidebar-controls reachability fix, owner report 2026-09-24) — the
   * SCROLLER is #region-list below. Before this, #sidebar itself was the
   * scroller and its only snap areas were the region rows, so scrollTop 0
   * (controls visible) was not a legal rest position under
   * scroll-snap-type: y mandatory: the initial layout snapped to the first
   * row (measured scrollTop 152) and every upward scroll re-snapped back
   * down — the toggles were unreachable ("scroll up, it drops down a little
   * afterwards"). Scoping the scroller to the list makes the snap-area set
   * and the scroller identical (the 2026-09-11 row-alignment ruling is
   * preserved 1:1 — rows rest row-aligned 8px below the list's visible top)
   * while the controls sit structurally outside any scroll. */
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 8px 0;
}

.sidebar-title {
  padding: 4px 14px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.region-section {
  padding: 10px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  margin-top: 8px;
  /* Headings are SNAP STOPS too (2026-10-12): without one, the mandatory
   * snap rests the list at the first ROW's start (scrollTop 30) and the
   * load position cut "K-SPACE" ~75% out of view. Snap-aligning the
   * heading makes the rest position its own start — fully visible. */
  scroll-snap-align: start;
}

.region-section.jspace { color: var(--jspace); }

#region-list a {
  display: block;
  padding: 3px 14px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  scroll-snap-align: start;
}

/* The LIST is the sidebar's scroller (owner report 2026-09-24): the snap
 * grammar moved here verbatim from #sidebar — snap to row tops (2026-09-11
 * ruling: the fractional ~24.85px rows must rest row-aligned, never
 * mid-row; scroll-padding matches the 8px padding so rows rest flush below
 * the visible top). The title + controls above are outside this scroller
 * and therefore always reachable. */
#region-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 8px;
}

#region-list a:hover { background: var(--bg-hover); }
#region-list a.current { background: var(--bg-hover); border-left: 3px solid var(--accent); padding-left: 11px; }
#region-list a.jspace { color: var(--jspace); }
#region-list a .count { color: var(--text-dim); font-size: 11px; float: right; }

/* --- Stage / SVG --- */

#stage { position: relative; flex: 1; min-width: 0; }

/* --- Viewer loading indicator (load-perf pass 2026-11-11, owner request:
 * "a loading bar or loading notification for when the viewer is still
 * loading") ---
 * ONE element, two modes:
 *   overlay — centered card when NO scene is painted (boot, or arriving
 *     from home/hot: the stage is blank until the fetch+build lands);
 *   bar — a 3px strip at the top of the stage when build-then-swap keeps
 *     the previous scene painted (covering it would be worse than a quiet
 *     progress line).
 * The carrier is compositor-only (transform sweep, opacity fade-in), so the
 * bar keeps moving while the main thread is blocked by a scene build — the
 * whole reason an indicator exists here. It never receives pointer events
 * and is display:none when idle (overlay discipline; the [hidden] UA rule
 * LOSES to the display:flex base rule, so the scoped rule is explicit —
 * the .hot-trend[hidden] lesson). Reduced motion freezes the sweep. */
#viewer-loading {
  position: absolute;
  inset: 0;
  z-index: 30; /* above the panel dock (10), below the topbar (70) */
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  animation: viewer-loading-in 160ms ease-out 120ms forwards;
  /* Overlay mode means NO scene is painted, so the field is the app
   * background: an opaque wash hides stale HTML panels left by the previous
   * view (a home -> universe hop can leave the sov panel behind) and the
   * inert center-cursor reticle. Bar mode clears it. */
  background: var(--bg);
}
#viewer-loading[hidden] { display: none; }
.viewer-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(18, 22, 31, 0.82);
}
.viewer-loading-bar {
  position: relative;
  width: 190px;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(127, 139, 158, 0.18);
}
/* TWO segments, half a cycle apart: one is always on the track, so the bar
 * never reads as a dead line at a wrap boundary. Both animate on the
 * COMPOSITOR (transform only) and survive a blocked main thread. */
.viewer-loading-bar > span {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 42%;
  max-width: 260px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--label-gold));
  transform: translateX(-110%);
  animation: viewer-loading-sweep 1.15s ease-in-out infinite;
}
.viewer-loading-bar > span:nth-child(2) {
  animation-delay: -0.575s;
}
.viewer-loading-label {
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.viewer-loading-slow { color: var(--text-dim); font-size: 11px; opacity: 0.8; }
/* Route mode: the previous scene stays painted under a slim top strip. */
#viewer-loading[data-mode="bar"] {
  inset: 0 0 auto 0;
  height: 3px;
  align-items: flex-start;
  background: transparent;
}
#viewer-loading[data-mode="bar"] .viewer-loading-inner {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#viewer-loading[data-mode="bar"] .viewer-loading-bar {
  width: 100%;
  height: 3px;
  border-radius: 0;
  background: rgba(127, 139, 158, 0.14);
}
#viewer-loading[data-mode="bar"] .viewer-loading-label,
#viewer-loading[data-mode="bar"] .viewer-loading-slow { display: none; }
@keyframes viewer-loading-sweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}
@keyframes viewer-loading-in {
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #viewer-loading { animation: none; opacity: 1; }
  .viewer-loading-bar > span {
    width: 60%;
    transform: none;
    animation: none;
  }
  .viewer-loading-bar > span:nth-child(2) { display: none; }
}

/* --- Panel dock (flex-column replacement for the measured gBCR walk) ---
 * #panel-dock is a full-stage overlay (pointer-events:none — its empty
 * area must never block the map); detail/kills/legend are its flex
 * children and stack in ONE browser-managed column (owner ruling
 * 2026-09-10: detail > kills > legend, condensed tabs, no open panel over
 * a minimized one). The padding-bottom reserves the scale-bar zone for
 * the whole column — the expanded-kills clamp and the region-view
 * overflow fix in one rule. The EXPANDED legend is position:absolute
 * (bottom-right of the dock == the stage, since the dock spans it) and
 * out of the column flow; collapsed tabs are static children. This
 * deletes the repositionLeftPanels gBCR walk and the stage-relative
 * conversion bug class with it. */
#panel-dock {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-bottom: 70px; /* scale-bar zone (~60px tall) + breathing room */
  pointer-events: none;
}
#panel-dock > * {
  pointer-events: auto;
  /* Width cap (mobile 2026-09-30): a panel never exceeds the screen. */
  max-width: calc(100vw - 20px);
}

/* Open panels inset from the viewer's top-left (the old CSS anchor);
 * collapsed tabs stay FLUSH to the corner (the dock aesthetic). */
#panel-dock > :not(.collapsed) { margin-left: 10px; }
#panel-dock > #legend:not(.collapsed) { margin: 0; } /* absolute bottom-right: margins would offset it */

/* Vertical slots: open panel 8px below whatever precedes it; collapsed
 * tab 4px (the condensed tab stack). The 10px TOP inset moves to the
 * first VISIBLE member per view (body[data-view] — the old CSS anchors):
 * system view insets the detail box, region view the kills panel; a
 * first TAB still sits flush at the corner in every view. */
#panel-dock > * + :not(.collapsed) { margin-top: 8px; }
#panel-dock > * + *.collapsed { margin-top: 4px; }
body[data-view="system"] #panel-dock > #detail-panel:not(.collapsed),
body[data-view="planet"] #panel-dock > #detail-panel:not(.collapsed),
body[data-view="region"] #panel-dock > #kills-panel:not(.collapsed) { margin-top: 10px; }
/* First-visible TAB per view stays flush (region: the kills tab has no
 * visible predecessor — detail is hidden there; universe: the legend tab
 * is alone). */
body[data-view="region"] #panel-dock > #kills-panel.collapsed { margin-top: 0; }
body[data-view="universe"] #panel-dock > #legend.collapsed { margin-top: 0; }

/* Narrow stage (owner report 2026-09-11: at portrait/narrow window sizes
 * the EXPANDED legend — bottom-right, out of the column by design —
 * covers the viewer completely). The sidebar is fixed 220px, so a
 * viewport media query at 1100px ≈ stage <= 880px: the expanded legend
 * JOINS the dock column (below kills, same 8px slot + 10px inset), its
 * body scrolling within the column bounds above the reserved scale-bar
 * zone. Above the breakpoint the bottom-right anchor is unchanged —
 * including the spec-suite viewport (1280). */
@media (max-width: 1100px) {
  #panel-dock > #legend:not(.collapsed) {
    position: relative; /* static in the flex flow; still the handles' anchor */
    flex: 0 1 auto; /* flex child of the dock — the column stacks it */
    min-height: 0;
    margin: 8px 0 0 10px;
  }
  #panel-dock > #legend:not(.collapsed):first-child { margin-top: 10px; }
}

/* --- Panel resize handles (2026-09-22, owner request) ---
 * Dock-aware strips appended by js/panelresize.js: left-column panels grow
 * right/down (e/s/se), the bottom-right-anchored legend grows left/up
 * (w/n/nw — its CSS anchors keep the opposite edges fixed). The strips sit
 * on the panel's stable visual box (the scroll lives in the inner bodies),
 * are 2px outset for grabbability, and hide with the panel ([hidden]
 * subtree — overlay discipline) and on collapsed tabs (a slim tab has no
 * shape worth resizing). Keyboard: focusable separator handles, arrows
 * nudge, Enter resets. */
.panel-rz {
  position: absolute;
  z-index: 6;
  touch-action: none;
  background: transparent;
  border-radius: 3px;
}
.panel-rz:hover { background: rgba(77, 163, 255, 0.28); }
.panel-rz:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  background: rgba(77, 163, 255, 0.28);
}
.panel-rz-e { top: 10px; bottom: 10px; right: -2px; width: 7px; cursor: ew-resize; }
.panel-rz-s { left: 10px; right: 10px; bottom: -2px; height: 7px; cursor: ns-resize; }
.panel-rz-se { right: -2px; bottom: -2px; width: 13px; height: 13px; cursor: nwse-resize; }
.panel-rz-w { top: 10px; bottom: 10px; left: -2px; width: 7px; cursor: ew-resize; }
.panel-rz-n { left: 10px; right: 10px; top: -2px; height: 7px; cursor: ns-resize; }
.panel-rz-nw { left: -2px; top: -2px; width: 13px; height: 13px; cursor: nwse-resize; }
.collapsed .panel-rz { display: none; }

/* Faction territory vignette: a viewport-fixed border accent over the canvas,
 * below the UI chrome (legend, scale bar, detail panel) and pointer-events:none.
 * Its gradient is set inline per view from the faction wash color. */
#vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* Center cursor (js/centerhover.js — owner request 2026-10-16): the inert
 * hover proxy reticle (ring + ticks, label gold) pinned to the viewer
 * CENTER. Carrier pin: this div inside #stage — #canvas fills the stage
 * exactly (width/height 100%), so 50%/50% IS the camera's center point,
 * the same point the driver hit-tests. pointer-events:none (never steals
 * clicks), and it hides with #stage on non-map views. The .moving dim
 * applies while the map slides under it (the driver toggles it per tick). */
#center-cursor {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  color: var(--label-gold);
  opacity: 0.9;
}
#center-cursor.moving { opacity: 0.45; }
#center-cursor[hidden] { display: none; }

#canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  /* F1 REVERTED 2026-09-14 (deep-zoom flicker, Wave 1): the will-change
   * promotion was a mitigation for a diagnosis that didn't hold — the
   * flash is a Chromium present-path shared-image race that blanks the
   * WHOLE window (identical before/after promotion; chrome://gpu mailbox
   * errors, no GPU reset). A permanently promoted canvas layer cannot
   * confine it and only adds a standing composited layer to the churn
   * surface. Camera writes remain viewBox-only (zoompan._apply). */
  background:
    radial-gradient(ellipse at 30% 20%, rgba(40, 60, 110, 0.18), transparent 60%),
    var(--bg);
}

#canvas.dragging { cursor: grabbing; }

/* The canvas is the search palette's Esc-return focus target (tabindex in
 * index.html); suppress the default focus ring so it looks unfocused even
 * while it holds keyboard focus. */
#canvas:focus { outline: none; }

/* (The stage.deep-zoom filter cull was REMOVED 2026-09-11 — under the
 * viewBox camera the filter costs it trimmed are viewport-bounded, and
 * the class flip at the 1e4 boundary caused a one-frame repaint pop
 * mid-zoom. Kill-glyph glow runs at every scale again; the legend frost
 * was removed outright 2026-09-14 — flicker Wave 1.) */

/* --- Detail panel (system drill-down header) ---
 * Flex child of #panel-dock: the dock owns the 10px inset and the column
 * slotting (no absolute anchor here anymore). */

#detail-panel {
  flex: none; /* never squeezed — it caps at the dock and scrolls */
  min-height: 0;
  max-width: 380px;
  max-height: 100%; /* of the dock's content box (scale-bar zone reserved) */
  /* Panel clips, the BODY scrolls (2026-09-22 resize restructure): the
   * resize handles live on the panel's stable visual box — they must not
   * sit in a scroll container (abs-positioned handles would resolve
   * against the scrolled padding box and drift away). Same structure the
   * legend already had (overflow:hidden panel + scrolling #legend-body). */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative; /* anchor for the resize handles */
  padding: 0; /* header + body own the padding (sticky header mask) */
  background: rgba(18, 22, 31, 0.97); /* was 0.92 — map glyphs ghosted through (owner report 2026-09-11) */
  border: 1px solid var(--border);
  border-radius: 6px;
}

#detail-panel .panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  flex: none;
  /* Title row (owner ruling: title + collapse icon stay visible while the
   * body scrolls) — since the 2026-09-22 resize restructure the header is a
   * flex sibling OUTSIDE the scrolling body, so it stays put structurally.
   * The header owns the panel padding and its opaque background. */
  background: #12161f; /* opaque — rows must not ghost through */
  padding: 12px 14px 6px;
}
#detail-panel .panel-collapse {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 14px; padding: 0 2px; line-height: 1;
}
#detail-panel .panel-collapse:hover { color: var(--text); }
#detail-panel.collapsed .panel-body { display: none; }
#detail-panel.collapsed .panel-header { padding: 2px 0; } /* slim tab (panel padding rule wraps it) */
#detail-panel h2 { margin: 0; font-size: 16px; }
#detail-panel .panel-body {
  margin-top: 0; padding: 6px 14px 12px;
  /* The scrolling region (2026-09-22 resize restructure): the panel is a
   * flex column and clips; the body shrinks under the cap and scrolls. */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
#detail-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 8px; }
#detail-panel dt { color: var(--text-dim); }
#detail-panel dd { margin: 0; }
#detail-panel .neighbors { display: flex; flex-wrap: wrap; gap: 4px; }
#detail-panel .neighbors a {
  padding: 1px 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
}
#detail-panel .neighbors a:hover { border-color: var(--accent); }

/* Anchored HTML tooltip (region-view node hover). pointer-events:none so it
 * never blocks hover or elementsFromPoint click-cycling; positioned fixed by
 * JS from the node's getBoundingClientRect, translated above + centered. */
.node-tooltip {
  position: fixed;
  z-index: 50;
  transform: translate(-50%, -100%);
  pointer-events: none;
  background: rgba(18, 22, 31, 0.97); /* was 0.95 — hull/label ghosting through rows */
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
}
/* Position-aware flip (owner request 2026-09-10): when the above-position
 * would cross the stage's top edge, the tooltip flips BELOW the anchor and
 * tops out there instead (api.js showTooltip decides; the class only
 * carries the transform). */
.node-tooltip.below { transform: translate(-50%, 0); }
.node-tooltip[hidden] { display: none; }
/* v5 §14 interactive battle tooltips: pointer-events on the tooltip
 * element ONLY (no hit buffer — camera-drag starts near the tooltip are
 * never swallowed); the hover-bridge lives in api.js. */
.node-tooltip.interactive { pointer-events: auto; }
.node-tooltip .tt-name { font-weight: 700; margin-bottom: 2px; }
.node-tooltip .tt-row { display: flex; gap: 8px; }
.node-tooltip .tt-key { color: var(--text-dim); }
.node-tooltip .tt-special { color: var(--jspace); margin-top: 2px; font-weight: 600; }
.node-tooltip .tt-note { color: var(--accent); margin-top: 2px; }
.node-tooltip .tt-chip { align-self: center; }
/* Phase 8b-sov block (rulings 2+3): alliance row mirrors .faction-row, plus
 * the primary-color swatch and the per-record staleness line. */
.node-tooltip .tt-sov { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 4px; }
.node-tooltip .tt-sov .sov-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex: none;
}
.node-tooltip .tt-sov .tt-staleness { color: var(--text-dim); font-size: 11px; margin-top: 2px; }
/* Kill rows inside the shared tooltip (spec 29 v2): reuse the panel's
 * .kill-* spans (one builder feeds panel + tooltip). Per-anchor expanded
 * scope: up to 200 rows — the list scrolls inside the tooltip (the
 * interactive bridge keeps it open while the pointer works the list). */
.node-tooltip .tt-kills {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  max-height: 50vh;
  overflow-y: auto;
}
.node-tooltip .tt-kills a { color: var(--text); text-decoration: none; display: flex; gap: 6px; }
.node-tooltip .tt-kills a:hover .kill-victim { color: var(--accent); }
.node-tooltip .tt-kills .kill-ship { color: var(--text-dim); }
.node-tooltip .tt-kills .kill-isk { color: var(--text-dim); margin-left: auto; white-space: nowrap; }
/* Region kill icon tooltip (spec 29 v2 owner spec: simply the count). */
.node-tooltip .tt-killcount { color: var(--text); font-size: 12px; margin-top: 2px; }
/* List totals (2026-10-01): the per-object row count + the truncation
 * honesty line — dimmer than the windowed total so the hierarchy reads
 * total → list scope → rows. */
.node-tooltip .tt-subcount { color: var(--text-dim); font-size: 11px; margin-top: 1px; }
.node-tooltip .tt-shown { color: var(--text-dim); font-size: 11px; margin-top: 2px; font-style: italic; }
/* ESI serves arbitrarily long player-created alliance names (real: 50
 * chars) — the name truncates with ellipsis, full name on the title attr. */
.faction-row .sov-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Info-box Sovereignty row (batch 3): mirrors the faction row sizing; the
 * staleness span rides inside the shared row builder. */
#detail-panel .sov-info-asof { color: var(--text-dim); font-size: 11px; }

/* --- Kills panel (spec 29 v2, owner ruling 2026-09-09) ---
 * One HTML overlay for BOTH kill surfaces: region view (latest 200
 * region-wide) and system view (that system's latest 200). LEFT-anchored
 * in both views (layout resolution, measured 2026-09-03): BOTH legends
 * span the entire right edge at 720p, so the right edge is legend-only.
 * Flex child of #panel-dock: slots below the detail panel automatically
 * (uniform behavior in BOTH views — the old region-view CSS top:10 anchor
 * with no scale-bar clamp shipped the under-the-bar overlap), scrolls
 * within the space the dock leaves above the reserved scale-bar zone.
 * display:none when hidden (overlay discipline); the panel never
 * interacts with the camera. NO age filter: the 72h window was
 * battle-scoped and is gone. */
#kills-panel {
  flex: 0 1 auto; /* shrink to the remaining column space, then scroll */
  min-height: 0;
  /* Wider for the centered kill-row grid (owner request 2026-09-16: "if
   * the kill list needs to be made wider to fit everything, then do so"):
   * 4 columns (system/planet) at 380px; the region view's 5th (System)
   * column widens further below. Sized so the COMMON values fit unclipped
   * (timestamps fixed-track, "Gallente Shuttle", "New Caldari"); only
   * genuinely long names ellipsize. */
  width: 380px;
  max-height: 100%;
  /* Panel clips, the BODY scrolls (2026-09-22 resize restructure — see
   * #detail-panel): header/body/footer are flex rows, the body is the
   * scrolling region, the attribution footer pins to the panel bottom. */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative; /* anchor for the resize handles */
  padding: 0; /* header + body own the padding (sticky header mask) */
  background: rgba(18, 22, 31, 0.97); /* was 0.92 — map glyphs ghosted through rows */
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}
/* Region view: the System column needs room to stay readable and centered
 * (same view-scoped mechanism as the margin rules above). */
body[data-view="region"] #panel-dock > #kills-panel:not(.collapsed) { width: 460px; }
#kills-panel[hidden] { display: none; }

/* Sovereignty panel (owner request 2026-09-24): UNIVERSE-only — the
 * region/system views carry the legend's Sovereignty section instead.
 * Same panel grammar as #kills-panel (flex column, opaque bg, collapsible
 * header; body scrolls). The legend is REMOVED from the universe view
 * (owner request: it doesn't earn its place there) — the panel is the
 * universe sovereignty surface. */
#sov-panel {
  flex: 0 1 auto;
  min-height: 0;
  width: 300px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  padding: 0;
  background: rgba(18, 22, 31, 0.97);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}
body[data-view="universe"] #panel-dock > #sov-panel:not(.collapsed) { margin-top: 10px; }
body[data-view="universe"] #panel-dock > #sov-panel.collapsed { margin-top: 0; }
#sov-panel[hidden] { display: none; }
body[data-view="universe"] #panel-dock > #legend { display: none; }
/* The panel is UNIVERSE-only (owner request 2026-09-24: system/planet
 * views don't need it) — declarative hide on every other view: the
 * universe builder unhides the element and nothing re-hides it on route
 * change, so the leak fix lives here (the overlay-discipline rule). */
body:not([data-view="universe"]) #panel-dock > #sov-panel { display: none; }
#sov-panel .sov-header {
  flex: none;
  background: #12161f;
  padding: 10px 12px 6px;
}
#sov-panel .sov-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
#sov-panel .sov-title {
  flex: 1;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 11px;
  color: var(--text);
}
#sov-panel .sov-count {
  color: var(--text-dim);
  font-size: 11px;
}
#sov-panel .sov-collapse {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
}
#sov-panel .sov-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 12px 10px;
}
#sov-panel .sov-none {
  color: var(--text-dim);
  font-style: italic;
  padding: 6px 0;
}
#sov-panel .sov-more {
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 5px 0 2px;
  border-top: 1px solid var(--border);
}
/* "Under attack now" showcase (owner request 2026-09-28): active campaigns
 * above the region groups, newest start first; the region tag replaces the
 * badge (the section header carries the state). */
#sov-panel .sov-under-attack {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e0856d;
  padding: 4px 0 3px;
}
#sov-panel .sov-region-tag {
  flex: 1;
  color: var(--text-dim);
  font-size: 11px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#sov-panel .sov-region {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}
#sov-panel .sov-region:first-of-type { margin-top: 2px; }
#sov-panel .sov-region-name {
  flex: 1;
  color: var(--label-gold);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
#sov-panel .sov-region-name:hover { color: var(--accent); }
#sov-panel .sov-region-count {
  color: var(--text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
#sov-panel .sov-system {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0 3px 10px;
  cursor: pointer;
}
#sov-panel .sov-system:hover { background: var(--bg-hover); }
#sov-panel .sov-system-name {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
#sov-panel .sov-system-name:hover { color: var(--accent); }
#sov-panel .sov-badge {
  flex: none;
  color: #ffd75e;
  font-size: 10px;
  border: 1px solid rgba(255, 215, 94, 0.4);
  border-radius: 3px;
  padding: 0 4px;
}
#sov-panel .sov-when {
  flex: none;
  color: var(--text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
/* display:flex on the panel would beat the UA [hidden] rule (author >
 * user-agent) — the explicit rule keeps the overlay discipline. */
#detail-panel[hidden] { display: none; }
#kills-panel .kill-header {
  /* Header block = title row + column-head row (owner request 2026-09-16:
   * top headers telling the user what the columns are). Since the
   * 2026-09-22 resize restructure the header is a flex sibling OUTSIDE the
   * scrolling body — it stays visible structurally (no sticky needed);
   * the opaque background stands. */
  flex: none;
  background: #12161f; /* opaque — rows must not ghost through */
  padding: 10px 12px 6px; /* replaces the old margin-bottom gap */
}
/* The old header flex row, now the title row inside the sticky block. */
#kills-panel .kill-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
/* Column headers (owner request 2026-09-16): the SAME grid template as
 * the body rows below (straight centered columns, home-kill grid pattern
 * 6bdcdf5/c8921f6) so the labels sit exactly over their columns; the
 * view-scoped 5-col override mirrors the row override. */
#kills-panel .kill-cols {
  display: grid;
  /* Time is a FIXED track: timestamps never truncate (11px tabular
   * "Sep 12 14:39" ≈ 68px + headroom); the rest share the fr slots. */
  grid-template-columns: 76px 1.5fr 1.5fr 1fr;
  gap: 4px 8px;
  justify-items: center;
  color: var(--text-dim);
  font-size: 11px;
  padding-top: 4px;
  margin-top: 2px;
  border-bottom: 1px solid var(--border);
}
/* Sortable header buttons (2026-10-16, hot.js .hot-sort grammar): bare
 * button reset inside the same grid cell slot the spans occupied — the
 * cells stay centered (justify-items) and ellipsize like the rows. */
#kills-panel .kill-cols .kill-sort {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
#kills-panel .kill-cols .kill-sort:hover { color: var(--text); }
#kills-panel .kill-title { font-weight: 700; letter-spacing: 0.04em; }
/* Window-total chip (owner request 2026-09-15): region sum / system count
 * inside the freshest-anchored window — gold label color, tabular digits. */
#kills-panel .kill-total {
  color: var(--label-gold);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#kills-panel .kill-total[hidden] { display: none; }
/* Staleness follows #live-staleness: dim, small, hidden until first success. */
#kills-panel #kills-staleness { color: var(--text-dim); font-size: 11px; }
#kills-panel #kills-staleness[hidden] { display: none; }
#kills-panel .kill-none { color: var(--text-dim); padding: 2px 0 4px; }
#kills-panel .kill-body {
  padding: 0 12px;
  /* The scrolling region (2026-09-22 resize restructure — see
   * #detail-panel): grows to fill the panel and scrolls under the cap;
   * the attribution footer pins to the panel bottom. */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
#kills-panel a.kill-row {
  /* Straight centered columns (owner request 2026-09-16; pattern:
   * home-kill grid, 6bdcdf5/c8921f6): ONE shared fr template per view so
   * the columns align across rows, content centered per column. Cell
   * order: Time | Ship type | Player name | ISK lost (region adds
   * System via the view-scoped 5-col override). */
  display: grid;
  grid-template-columns: 76px 1.5fr 1.5fr 1fr;
  gap: 4px 8px;
  align-items: baseline;
  justify-items: center;
  color: var(--text);
  text-decoration: none;
  padding: 2px 0;
  min-width: 0;
}
/* One line per kill (owner ruling 2026-09-16): long pilot/ship names
 * ellipsize — the full value rides the cell's title attribute. */
#kills-panel a.kill-row > span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
#kills-panel a.kill-row + a.kill-row { border-top: 1px solid var(--border); }
#kills-panel a.kill-row:hover .kill-victim { color: var(--accent); }
#kills-panel .kill-time { color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 11px; }
#kills-panel .kill-victim { color: var(--text); }
#kills-panel .kill-ship { color: var(--text-dim); }
#kills-panel .kill-isk { color: var(--text-dim); font-variant-numeric: tabular-nums; }
#kills-panel .kill-system { color: var(--text-dim); }
/* Region view rows gain the System column (home page's 5th slot). */
body[data-view="region"] #kills-panel a.kill-row,
body[data-view="region"] #kills-panel .kill-cols {
  grid-template-columns: 76px 1.5fr 1.5fr 1fr 1.1fr;
}
#kills-panel .kill-collapse {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  /* Shared collapse-button metrics (owner request 2026-09-11): detail,
   * kills, and legend chevrons are one size/shape — the info panel's. */
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}
#kills-panel .kill-collapse:hover { color: var(--text); }
#kills-panel .kill-body[hidden] { display: none; }
#kills-panel .kill-attribution[hidden] { display: none; }
#kills-panel .kill-attribution {
  color: var(--text-dim);
  font-size: 10px;
  border-top: 1px solid var(--border);
  margin: 6px 12px 10px;
  padding-top: 4px;
  flex: none; /* pinned above the panel's bottom edge (flex-column panel) */
}

/* --- SVG element styling --- */

/* Gate lines keep a constant 1.5 screen px regardless of zoom (the line
 * length still scales with the camera; only the stroke width is pinned). */
.edge { stroke: #3a4a63; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
/* Inter-constellation edges (region routes crossing a constellation boundary)
 * are the structural backbone — brighter + slightly wider than intra edges. */
.edge.edge-inter { stroke: #6a86b5; stroke-width: 2; }
.edge.jspace_stargate { stroke: var(--jspace); stroke-dasharray: 5 4; }

.node { cursor: pointer; }
/* Region node icon (icon-swap program batch 1, 2026-10-22): the node is
 * the owner's system-diagram art (icons.js regionNodeGlyph) — the
 * per-node sec tint rides fill ATTRIBUTES from secColor() (single palette
 * source; the expectSecFill oracle), geometry lives in the hoisted
 * #node-region-art group. The far state IS the .node-core disc; the near
 * state fades node-core to an INVISIBLE ANCHOR (opacity keeps its rect —
 * the tooltip anchor + every size pin are LOD-agnostic; display:none
 * would zero the gBCR). The holographic-orb layers (glow/rim/highlight)
 * retired with the art.
 *
 * 2026-11-13: the opacity is written INLINE per live node by region.js's
 * cull (setNear/leaveNearLod) — there is deliberately NO canvas-wide
 * `#canvas.icon-near .node .node-core` rule. A root-class flip invalidates
 * every matched descendant in Blink (measured 13ms on a 4x-throttled
 * phone), which was the owner-reported lag at the LOD transition. */
/* INSTANT since 2026-10-24 (no transition): an opacity transition on this
 * outgoing far state is the exact shape that blanked the canvas for a
 * frame at high zoom (the cross-fade's far animation). The anchor only
 * needs to be invisible in the near state — it keeps its rect either way. */
/* Dark translucent chip backing for the right-zone station/belt markers.
 * The marker layers are DECORATIVE — never hover/click surfaces (a chip or
 * glyph pixel must not steal a neighbor node's hover; pointer-events:none
 * on the layer disables the whole subtree). */
.marker-chip {
  fill: rgba(11, 14, 20, 0.78);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
}
.marker-layer,
.right-marker-layer { pointer-events: none; }
.node text {
  fill: var(--label-gold);
  font-size: 11px;
  font-weight: 600;
  /* Hover surface (hover-stability fix): the label text must answer the
   * pointer so moving between disc and label never drops the system's
   * highlight (it used to be pointer-events:none, and the pass-through
   * unhighlighted the system mid-hover — measured 2 enter/2 leave churn on
   * a single wiggle). */
  pointer-events: auto;
  transition: opacity 0.15s ease;
}

/* Ranked-label LOD: labels below the current zoom threshold fade out. */
.node text.dim-label { opacity: 0; }

/* Label declutter (2026-10-12, hide + reveal on zoom): the hidden
 * labels' carrier — visibility, NOT display (the flicker Wave 3 class:
 * display toggles churn the render tree) — composing with the LOD's
 * opacity gate and the universe cull's display:none. */
.declutter-hidden { visibility: hidden; }

.node.focus circle {
  /* Focus ring (owner request 2026-09-24: purple GRADIENT + glow — the
   * old flat white read harsh; the gradient rides the sov amethyst
   * family, #focus-grad is a STATIC defs child of #canvas so it survives
   * world rebuilds and PNG export). The drop-shadow glow is the "texture"
   * depth — feTurbulence noise was rejected (per-frame re-raster on a
   * moving element, jank risk). */
  stroke: url(#focus-grad);
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(153, 102, 204, 0.75));
}

/* Hovered system: the dark disc rim is dropped — the aura replaces it as
 * the highlight (owner ruling: no black circle, aura only). */
#canvas.has-hover .node.hl circle:not(.hit) { stroke: none; }

/* Faction line on hover (owner ruling): ": [logo] Full Name" extends the
 * system label to the right on hover. The logo rides the same hover surface
 * (clicking any ink navigates). Hidden at rest (display:none via JS). */
.faction-logo { pointer-events: auto; }

/* Hover highlight (aura redesign — the 0.18 shade-out is REMOVED: fast
 * pointer movement made the whole-map dim cycle read as strobing). The
 * hovered system + its gate-connected neighbours carry pre-rendered halo
 * geometry instead (radial-gradient circles — no SVG filters on the hover
 * path). Connected edges keep their accent highlight. */
#canvas.has-hover .edge.hl { stroke: var(--accent); stroke-width: 2.5; }

.hover-aura {
  pointer-events: none;
}
.hover-aura.aura-hover { fill: url(#aura-grad-hover); }
.hover-aura.aura-neighbor { fill: url(#aura-grad-neighbor); }

/* Universe view */
.u-node { cursor: pointer; }
/* Visual LOD (owner request 2026-10-20): the dot group carries both states,
 * one #canvas class flips which child paints. display:none drops the hidden
 * state from paint, layout AND getBoundingClientRect — so the group's bbox
 * follows the VISIBLE state and every size pin is LOD-agnostic. Hysteresis
 * on the rendered dot size lives in universe.js updateIconLod (the deep-
 * zoom-flash lesson). */
/* Visual-LOD state table — INSTANT SWAP since 2026-10-24. NO animations
 * here, ever (measured): an opacity animation on either state — the
 * outgoing far glyph or the incoming near art — stalled the compositor
 * 90-190ms and presented ONE canvas-blanked frame at planet-view scale,
 * reported by the owner as "the whole viewer flickers black". Same class
 * as the 2026-08 fixes (c9aff74/6641a31: opacity transitions on SVG under
 * a mutating counter-scale transform churn the layer; e508332: a promoted
 * layer at extreme scale falls back to software and flashes black). The
 * 2026-10-22 cross-fade ruling is SUPERSEDED (icons.js flipIconLod is a
 * plain class toggle now); a future transition affordance must not animate
 * the SVG LOD states.
 * The STEADY states keep the hidden state display:none — the measured perf
 * fix (hidden/`off-screen <use>` shadow trees leave paint AND layout
 * entirely; opacity alone would regress the universe lag). */
#canvas .lod-far { opacity: 1; }
#canvas .lod-near { display: none; opacity: 0; }
#canvas.icon-near .lod-far { display: none; opacity: 0; }
#canvas.icon-near .lod-near { display: unset; opacity: 1; }
/* Hover brightens the outline. Per-child stroke-width: the art use is in
 * the icon's viewBox units (2x its authored 12), the far disc in world
 * units (the pre-icon 1.5). CSS beats the carriers' presentation attributes
 * — the carrier-pinning rule: computed style is the oracle.
 * 2026-11-13: universe dots use their OWN carriers (`u-dot` far / `u-art`
 * near) — the canvas-wide `.lod-*` rules above must never match them, or
 * every LOD crossing would recalc all 5,485 far dots (measured 5.5-6ms
 * desktop / 22-23ms phone; the owner-reported transition lag). */
.u-node:hover .u-art { stroke: #fff; stroke-width: 24; }
.u-node:hover .u-dot { stroke: #fff; stroke-width: 1.5; }

/* System drill-down icons */
.cel-label {
  fill: var(--label-gold);
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* System view: colliding lower-priority labels fade out. The GATE label has
 * its own class (it never took part in collisions before 2026-11-03), so it
 * needs the same rule or a "dimmed" gate label stays fully painted — four
 * gate names overprinted each other in Jita. */
/* A HIDDEN label must not be a hit target (2026-11-09). The declutter hides
 * with opacity 0, and an opacity-0 element still receives the pointer — so a
 * dimmed star label sitting over a planet's ink swallowed the planet's click
 * (measured: a planet click landed on the star's invisible "Jita" label after
 * the panel-aware fit pulled the cluster together). Visible labels keep their
 * hover target; only the hidden state opts out. */
.cel-label.dim-label { opacity: 0; }
.gate-label {
  fill: var(--label-gold);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.gate-label.dim-label { opacity: 0; }

/* Camera-motion transition suppression (flicker root fix): while the
 * camera animates (ZoomPan adds .zooming), the dim-label/cel opacity
 * TRANSITIONS are off — the collision flips then apply instantly, with no
 * composited-layer churn per frame (the tile manager's memory spike at
 * fast zoom). The 150ms fades return the moment the camera rests. */
#canvas.zooming .cel,
#canvas.zooming .cel-label,
#canvas.zooming .node text {
  transition: none !important;
}

.cel { cursor: default; transition: opacity 0.15s ease; }
.cel.gate { cursor: pointer; }
.cel.gate:hover .gate-icon { stroke: #fff; }

/* Celestial ink answers the pointer (tooltip reliability, follow-up
 * ITEM 5): the icon glyph AND the name label are hover surfaces for the
 * body's tooltip. Scoped to .cel so region-view decorative glyphs stay
 * pass-through. Outguns the .glyph PE:none rule (id + two classes). */
#canvas .cel .glyph,
#canvas .cel .cel-label,
#canvas .cel .gate-label { pointer-events: auto; }

/* …EXCEPT a HIDDEN label (2026-11-09). The declutter hides with opacity 0, and
 * an opacity-0 element still receives the pointer, so a dimmed label could
 * swallow a click meant for the body underneath it — measured: the star's
 * invisible "Jita" label ate a planet's click once the panel-aware fit pulled
 * the inner cluster together. Scoped with the same id depth as the rule above
 * (it outguns `.cel-label.dim-label`). Visible labels keep their hover. */
#canvas .cel .cel-label.dim-label { pointer-events: none; }

/* PARENT-body art stays out of hit-testing (owner rulings 2026-10-27 — the
 * planet/station stack, then "the moons also overlap the stations like the
 * planets"): a parent body paints ABOVE the stations that orbit it, so as a
 * hit surface it would claim the whole shared point — and the planet's art
 * grows 18px -> 36px at deep zoom, swallowing the station's 30px art outright
 * (measured: the station's tooltip and its market rows were unreachable).
 * The base-tier .hit disc still answers for the parent; the ring outside that
 * disc belongs to the station's rescue disc. Scopes to the glyph only —
 * labels stay live and every other celestial tier is untouched. */
#canvas .cel .glyph.art-passthrough { pointer-events: none; }

/* Celestial icon shapes — original geometry, fixed screen-px (billboard).
 * Stroke widths are in screen px because the glyph is counter-scaled by the
 * camera; colors reuse the existing viewer palette. */
/* Star colour method (owner ruling 2026-10-27): the star paints with
 * `currentColor` so ONE `color` write per glyph carries the system's in-game
 * stellar colour (deep red M-class through blue-white O-class). The fallback
 * gold lives on the glyph (STAR_FALLBACK_COLOR, icons.js) — never here, so the
 * absent-data state and the tinted state share one path. */
.icon-star-ray { fill: currentColor; }
.icon-star-core { fill: currentColor; }
/* Fixed near-white hot centre: keeps a tinted star reading as a star at
 * 32px instead of a flat coloured blob (and still works on the gold fallback). */
.icon-star-glow { fill: #ffffff; opacity: 0.38; }
/* Star corona + hot core (owner request 2026-11-06: "a bit more dramatic and
 * vibrant"). The corona is 1.3x the art radius, so it MUST NOT hit-test — a
 * halo that answers the pointer would steal hover from the planets beside the
 * star. The interactive target stays the `.hit` disc. */
.star-corona,
.star-core { pointer-events: none; }
.icon-planet-disc { fill: #73b8ff; }
.icon-planet-ring { fill: none; stroke: #4da3ff; stroke-width: 1.5; }
/* Planet-type palette (color-only biome tint; 5h silhouettes unchanged).
 * One distinct tint per SDE planet type so no two adjacent-rendered types are
 * confusable. Keys match PLANET_BIOMES in icons.js. */
.biome-temperate .icon-planet-disc { fill: #57b76a; }
.biome-temperate .icon-planet-ring { stroke: #3e9552; }
.biome-ice .icon-planet-disc { fill: #bfe4f2; }
.biome-ice .icon-planet-ring { stroke: #8fc8e0; }
.biome-gas .icon-planet-disc { fill: #d9b96a; }
.biome-gas .icon-planet-ring { stroke: #b8944a; }
.biome-oceanic .icon-planet-disc { fill: #4a8fd9; }
.biome-oceanic .icon-planet-ring { stroke: #2e6ab0; }
.biome-lava .icon-planet-disc { fill: #e0613a; }
.biome-lava .icon-planet-ring { stroke: #c04826; }
.biome-barren .icon-planet-disc { fill: #c9a27a; }
.biome-barren .icon-planet-ring { stroke: #a5815c; }
.biome-storm .icon-planet-disc { fill: #8f7ae0; }
.biome-storm .icon-planet-ring { stroke: #6e5ac0; }
.biome-plasma .icon-planet-disc { fill: #d95ac4; }
.biome-plasma .icon-planet-ring { stroke: #b03a9e; }
.biome-shattered .icon-planet-disc { fill: #9aa7b8; }
.biome-shattered .icon-planet-ring { stroke: #7a8698; }
.biome-scorched .icon-planet-disc { fill: #8f5032; }
.biome-scorched .icon-planet-ring { stroke: #6e3a20; }
.biome-default .icon-planet-disc { fill: #9aa7b8; }
.biome-default .icon-planet-ring { stroke: #7a8698; }
.icon-moon-crescent { fill: #9aa7b8; }
.icon-moon-disc { fill: #9aa7b8; }
/* The moon's LOD-far limb: fills the crescent's bite so the parent OCCLUDES the
 * station/gate far glyphs painted behind it (owner report 2026-10-27 — a
 * transparent bite made a child's bright cross read as "on top of the moon").
 * A darker step of the moon hue, never the background colour (the map field is
 * not flat; a bg disc would show a seam). */
.icon-moon-limb { fill: #3f4855; }
.icon-station-bar { fill: currentColor; } /* faction tint rides the glyph's color (icon-swap batch 5) */
.icon-gate-chevron { fill: none; stroke: #4da3ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-belt-dot { fill: #b7a24a; }

/* Regional visual-effect markers (Thera, Pochven, shattered, Concord): small
 * billboard glyphs above such systems, one distinct silhouette + color per
 * effect (5h art refresh). Decorative only — pointer-events:none so they
 * never shadow the node's hit target or hover. */
.ve-marker { pointer-events: none; }
.ve-shattered { fill: #6ba7c4; }
.ve-triglavian { fill: #c07bff; }
.ve-concord { fill: #4da3ff; }
.ve-thera { fill: #ffd75e; }
.ve-fallback { fill: #c07bff; }

/* --- W-space EFFECT glyphs (owner request 2026-09-29) ---
 * ONE starburst shape; the FILL carries the effect identity (the
 * kill-tier-ladder grammar: this block is the single source of truth —
 * the region map and the legend row reuse the same classes). Colors are
 * dark-theme-legible and mutually distinct; the tooltip + legend name
 * each effect, so color is a hint, never the only carrier. The unknown
 * fallback is a hollow neutral diamond — never a wrong identity. */
.wh-effect { pointer-events: none; stroke: rgba(10, 14, 18, 0.6); stroke-width: 0.6; }
.wh-effect-pulsar { fill: #4fc3f7; }
.wh-effect-magnetar { fill: #f5c542; }
.wh-effect-black-hole { fill: #a06de8; }
.wh-effect-red-giant { fill: #e25822; }
.wh-effect-wolf-rayet { fill: #58c98f; }
.wh-effect-cataclysmic-variable { fill: #ef6ea8; }
.wh-effect-unknown { fill: none; stroke: #9aa3ad; stroke-width: 1; }

/* --- Hot Market trend deltas (owner request 2026-09-29) ---
 * Signed ISK deltas vs the slider's baseline day: green up / red down
 * (universal market convention); no baseline renders a dim dash. */
.hot-delta-up { color: #6fcf8f; }
.hot-delta-down { color: #e2694f; }
.hot-delta-none { color: var(--text-dim, #9aa3ad); }
.hot-trend { display: flex; align-items: center; gap: 8px; }
/* display:flex beats the UA [hidden] rule (author > UA — the
 * #detail-panel lesson): without this guard the market-only slider
 * leaked onto EVERY Heat page (owner report 2026-09-30). */
.hot-trend[hidden] { display: none; }
.hot-trend-label { color: var(--text-dim, #9aa3ad); font-size: 12px; white-space: nowrap; }
#hot-trend-slider { width: 140px; accent-color: #c8a548; }
#hot-trend-slider:disabled { opacity: 0.45; }

/* --- Hot Market tools row (owner request 2026-09-29): the item-name
 * filter + watchlist-only + top-movers controls, market-only. --- */
.hot-market-tools { display: flex; align-items: center; gap: 8px; }
.hot-market-tools[hidden] { display: none; }

/* Load historical data (owner request 2026-09-30): button + coverage
 * note + transient status, same inline grammar as the trend slider. */
.hot-load { display: flex; align-items: center; gap: 8px; }
.hot-load[hidden] { display: none; }
#hot-market-filter {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border, #2a2f36);
  border-radius: 4px;
  color: var(--text, #d6dae0);
  font: inherit;
  font-size: 12px;
  padding: 4px 8px;
  width: 180px;
}
#hot-market-filter:focus { outline: 1px solid #c8a54866; border-color: #c8a54866; }
#hot-market-filter::placeholder { color: var(--text-dim, #9aa3ad); }

/* --- Hot Market sparkline drill-down (Phase 2, owner request
 * 2026-09-29): the expansion row under the item — the 90-day price
 * history, world of its own below the grid row. --- */
.hot-item-toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--label-gold, #e6c46a);
  cursor: pointer;
  text-align: left;
}
.hot-item-toggle:hover { text-decoration: underline; }
.hot-row.hot-spark-row {
  /* Overrides the .hot-row grid (the compound selector wins the cascade
   * regardless of order): the expansion is a full-width block of its
   * own below the item row. */
  display: block;
  grid-template-columns: none;
}
.hot-spark { padding: 4px 8px 8px 36px; }
.hot-spark-wrap { border: 1px solid var(--border, #23272d); border-radius: 4px; padding: 8px 10px; }
.hot-spark-header { color: var(--text-dim, #9aa3ad); font-size: 11px; margin-bottom: 6px; }
.hot-spark-svg { width: 100%; height: 110px; display: block; }
.spark-grid { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-sell { stroke: #e2694f; }
.spark-buy { stroke: #6fcf8f; }
.spark-region { stroke: #c8a548; stroke-dasharray: 6 4; }
/* ESI daily TRADED prices (Phase 7) — a third dimension (trades, never
 * the book): dashed + a distinct hue so it can never read as a book line
 * (the never-conflate rule). */
.spark-traded { stroke: #9b7fe8; stroke-dasharray: 2 4; }
.hot-spark-legend { display: flex; gap: 14px; margin-top: 6px; color: var(--text-dim, #9aa3ad); font-size: 11px; }
.hot-spark-key { font-weight: 700; }
.hot-spark-key.spark-sell { color: #e2694f; }
.hot-spark-key.spark-buy { color: #6fcf8f; }
.hot-spark-key.spark-region { color: #c8a548; }
.hot-spark-key.spark-traded { color: #9b7fe8; }

/* --- Item page (#/item/<type_id>, Phase 3) --- */
.item-back { margin: 0 0 6px; }
.item-back a { color: var(--text-dim, #9aa3ad); text-decoration: none; font-size: 13px; }
.item-back a:hover { color: var(--text, #d6dae0); }
.item-book {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.item-stat {
  border: 1px solid var(--border, #23272d);
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.item-stat-key { color: var(--text-dim, #9aa3ad); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
/* Chart range chips (audit #11, 2026-10-12) — the hot-chip grammar reused
 * on the item page's price chart (client-side x-domain slice). */
.item-chart-ranges { margin: 2px 0 8px; }
.item-stat-val { color: var(--text, #d6dae0); font-size: 18px; font-weight: 700; }
.item-sub {
  color: var(--text, #d6dae0);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 22px 0 8px;
}
.item-chart .hot-spark-svg { height: 220px; }
.item-spread-table { border: 1px solid var(--border, #2a2f36); border-radius: 4px; overflow-x: auto; }
.item-spread-row {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) repeat(5, 1fr);
  gap: 10px;
  padding: 6px 12px;
  border-top: 1px solid var(--border, #23272d);
  font-size: 13px;
}
.item-spread-head {
  color: var(--text-dim, #9aa3ad);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: none;
  background: rgba(255, 255, 255, 0.02);
}
.item-spread-day { color: var(--text-dim, #9aa3ad); font-size: 11px; padding: 6px 12px; }
.item-loss-time { color: var(--text-dim, #9aa3ad); white-space: nowrap; }

/* --- Map-anchored kill markers (spec 29 v2, owner ruling 2026-09-09) ---
 * Scene objects in BOTH views: system view just NORTH of the kill's anchor
 * object (edge-anchored offset, never overlapping it), region view in the
 * TOP anchor zone stacked ABOVE the node (owner ruling 2026-09-10). The
 * glyph's FILL is set per mark
 * from the KILL_TIER ladder (kills.js — 10 bands, yellow → deepest red,
 * >200 = deepest red); the dark ring keeps pale tiers visible on the dark
 * map; a soft self-colored glow halo is the far-zoom visibility carrier
 * (battle-marker precedent; PAINTED since 2026-09-14 — a gradient circle,
 * not the old drop-shadow filter). The INTERACTIVE target is the painted
 * skull silhouette itself (visiblePainted default) — no invisible hit disc
 * (owner ruling 2026-09-10: the mark only blocks what it actually covers).
 * Counter-scale/offset transforms are
 * owned by kills.js (appliers event-driven; the camera pass only
 * transforms existing marks). */
.kill-mark { cursor: pointer; }
/* The tier fill is the INLINE STYLE on .kill-glyph (beats this fallback). */
.kill-glyph {
  fill: #b52d24;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 0.7;
}
/* Painted glow halo (2026-09-14 flicker Wave 2): replaced the .kill-glyph
 * drop-shadow FILTER — a filter re-rasterizes on every camera frame (the
 * marks' counter-scale transforms never stop changing), and that per-frame
 * GPU churn presents as the whole-window deep-zoom flash (chrome://gpu
 * mailbox errors). The gradient def (#kill-glyph-halo, icons.js) is
 * currentColor-based: the tier color rides the SCALE WRAP's inline
 * style.color (the halo is the wrap's first child, sibling of the glyph —
 * the skull sprite's rect stays the e2e size pin). pointer-events:none
 * keeps the INTERACTIVE target the painted skull silhouette (no hit-disc
 * regression); stroke:none — the glyph group's dark ring must not ring the
 * glow. */
.kill-halo {
  stroke: none;
  pointer-events: none;
}

/* Kill-window slider (owner request 2026-09-10): narrows the server's
 * count window (1–24h); lives in the legend kills section it governs. */
.kill-window-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 6px;
}
.kill-window-name {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: none;
}
.kill-window-chip {
  flex: none;
  min-width: 26px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 6px;
  line-height: 16px;
}
#kill-window-slider {
  flex: 1;
  min-width: 0;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* PVE styles REMOVED (owner ruling 2026-09-10: PVE teardown — the R2Z2
 * feed carries no rat kills). */

/* Market icons (owner request 2026-09-10; metric ruling 2026-09-16: the
 * ACTIVE buy-order level replaces the difference): LEFT-zone region
 * marker for systems with a non-zero book. Glyph = opposing triangles,
 * ALWAYS in the neutral dim state (a level is never signed — the
 * green/red tinting died with the difference metric); the unsigned count
 * rides BELOW the chip (billboard text, compact form for big books). */
.market-mark { cursor: pointer; }
/* MARKET ICON LOD (owner ruling 2026-11-09): below a legible node spacing the
 * whole layer hides — display:none, so the marks also leave hit-testing and
 * gBCR (overlay discipline) and the flip costs one class write. NO animation
 * or transition may sit here (the 2026-10-24 LOD flicker ruling). */
.market-layer.market-lod-off { display: none; }
.market-up { fill: var(--text-dim); opacity: 0.8; }
.market-down { fill: var(--text-dim); opacity: 0.8; }
.market-count {
  font-size: 10px;
  font-weight: 700;
  fill: var(--text);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.65);
  stroke-width: 2px;
  pointer-events: none;
}

/* Sovereignty-change marks (owner request 2026-09-24): BOTTOM-zone
 * transfer glyph (region + universe views), one per system with a recent
 * transition or an active campaign. Neutral dim arrows (a transition
 * carries no direction tint — the tooltip names the sides); tooltip-only
 * surface, so no pointer cursor. */
.sov-change-mark { cursor: default; }
/* The FILLS are per-mark gradient defs (icons.js) — CSS carries the disc
 * stroke and hover feedback only. */
.sov-change-chip { stroke: rgba(201, 160, 238, 0.55); stroke-width: 1; }
.sov-change-mark:hover .sov-change-glyph { filter: brightness(1.25); }
.sov-hit { fill: transparent; pointer-events: all; }
.tt-sov-changes { min-width: 220px; }
.tt-sov-changes .sov-swatch { margin-right: 5px; }
/* Per-station breakdown rows inside the market mark tooltip. Interactive
 * (owner request 2026-09-17): rows are click targets — the station's
 * planet view; hover accent mirrors the kill list's row links. */
.tt-market {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  max-height: 180px;
  overflow-y: auto;
}

.node-tooltip .tt-market .tt-row { cursor: pointer; }
.node-tooltip .tt-market .tt-row:hover .tt-key { color: var(--accent); }

/* Kill-tier legend swatches (single source of truth: kills.js KILL_TIER
 * builds the rows; the swatch color rides inline background/fill). */
/* Kill-tier legend: ONE segmented yellow→red bar with boundary tick
 * labels (single source of truth: kills.js KILL_TIER builds it; the
 * swatch color rides inline background). */
#kill-tier-scale { margin: 2px 0 6px; }
.kill-tier-bar {
  display: flex;
  height: 10px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.55);
}
.kill-tier-seg { flex: 1; }
.kill-tier-ticks { display: flex; margin-top: 3px; }
.kill-tier-tick {
  flex: 1;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-dim);
  white-space: nowrap;
}

/* --- Collapsed panels dock to the screen edge (owner ruling 2026-09-10:
 * collapsed overlays must not linger near the map center; owner request
 * 2026-09-10: ALL collapsed tabs minimize to the SAME corner — the
 * top-left stack — condensed 4px apart, never random locations) ---
 * Flex edition: the tabs are STATIC children of #panel-dock, so the
 * column walk is the browser's — order detail > kills > legend, tabs
 * flush to the left edge (squared corners), 4px slot margins via the
 * dock rules. No measured inline tops, no coordinate conversion. */
#kills-panel.collapsed,
#detail-panel.collapsed,
#sov-panel.collapsed,
#legend.collapsed {
  position: static; /* flex child of the dock — auto-stacked */
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 5px 8px;
  width: auto;
  max-width: 220px;
  max-height: none; /* the tab needs no clamp */
  min-height: 0;
  flex: none;
}
#kills-panel.collapsed #kills-staleness { display: none; }
/* Collapsed = header-only tab: the column-head row hides with the body. */
#kills-panel.collapsed .kill-cols { display: none; }
#detail-panel.collapsed .panel-header h2 { font-size: 14px; }
/* Collapsed = header-only tabs: the sticky headers hand their padding to the
 * slim panel padding above (no double padding on the docked tab). */
#kills-panel.collapsed .kill-header { padding: 2px 0; background: none; }
#detail-panel.collapsed .panel-header { background: none; }
#legend.collapsed .legend-header { padding: 2px 0; }
#sov-panel.collapsed .sov-header { padding: 2px 0; background: none; }

.orbit-ring {
  fill: none;
  /* Rings recede (owner visual review 2026-11-03): they were the strongest
   * mark in the system view — brighter than the planets they orbit. Lower
   * opacity and a finer dash let the bodies carry the composition. */
  stroke: rgba(160, 180, 220, 0.22);
  stroke-width: 1.25;
  stroke-dasharray: 2 6;
  /* stroke stays 1.5 screen px while the ring radius scales with zoom */
  vector-effect: non-scaling-stroke;
  /* Decorative: a 1px ring line must never interpose between the pointer
   * and a celestial behind it (cursor re-diagnosis, follow-up ITEM 3). */
  pointer-events: none;
}

/* Range rings (adaptive-scale grid): faint solid distance rings centered on
 * the star. Same non-scaling-stroke so they stay 1.5 screen px at any zoom. */
.range-ring {
  fill: none;
  stroke: rgba(160, 180, 220, 0.22);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.range-ring-label {
  fill: var(--label-silver);
  font-weight: 600;
  pointer-events: none;
}

/* Loading / empty states */
.stage-message {
  fill: var(--text-dim);
  font-size: 14px;
  text-anchor: middle;
}

/* Invisible click targets (larger than the visible node/icon). */
.hit {
  fill: #000;
  fill-opacity: 0;
  stroke: none;
  pointer-events: all;
}

/* ZOOM-GATED INTERACTIVITY (owner ruling 2026-10-15; main.js setInteractFar):
 * from a distance the map anchors paint but DON'T respond — hit-testing
 * unlocks on zoom-in. carrier = pointer-events (hit-testing only: listeners
 * stay attached, the dispatchEvent entry path and keyboard nav are
 * untouched, and NOTHING hides — kill icons stay always-visible per the
 * standing ruling). The .hit rule above sets pointer-events:all explicitly,
 * so the gate needs descendant specificity to beat it; tiles carve back in
 * (universe drill-down = the at-fit interactive surface). */
#canvas.interact-far #world *:not(.tile) {
  pointer-events: none;
}
/* The carve-out is EXPLICIT: pointer-events is inherited, so a tile nested
 * in a gated wrapper would inherit none — this declaration re-enables it
 * (explicit beats inherited; source-order after the gate). */
#canvas.interact-far #world .tile {
  pointer-events: auto;
}

/* Universe tiling */
.tile {
  fill: rgba(255, 255, 255, 0.015);
  stroke: #1d2635;
  stroke-width: 2;
}

/* Universe region-name box (backed billboard): quiet dark plate so the name
 * reads over tiles/tints at every zoom; pointer-events pass through to the
 * tile hover. Transition-free (see the perf note in universe.js). */
.tile-label-box {
  fill: rgba(10, 14, 22, 0.78);
  stroke: #1d2635;
  stroke-width: 1;
  pointer-events: none;
}

.tile-label {
  fill: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  pointer-events: none;
}

/* Universe schematic gate edges: one batched path for the whole stargate
 * network; non-scaling-stroke keeps it a constant 1 screen px at every zoom. */
.galactic-edges {
  fill: none;
  stroke: rgba(140, 170, 210, 0.16);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

/* Universe schematic hover ring (owner request 2026-09-28): gradient-hued
 * accent ring + dashed texture rotating (compositor-only transform;
 * reduced-motion disables) + painted glow halo. ONE element repositioned
 * per hover — dies on camera movement with the tooltip. */
.uni-hover-layer { pointer-events: none; }
.uni-hover-ring {
  fill: none;
  stroke: url(#uni-hover-grad);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}
.uni-hover-texture {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.2px;
  stroke-dasharray: 3 5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  animation: uni-ring-spin 7s linear infinite;
}
@keyframes uni-ring-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .uni-hover-texture { animation: none; }
}
.uni-hover-halo { fill: url(#uni-hover-halo-grad); }

/* Constellation hulls (region view) — stroke/fill colors are assigned inline
 * per constellation by the deterministic palette (region.js); these rules keep
 * the shape/stroke geometry only. */
.constellation-hull {
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.constellation-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  pointer-events: none;
  /* NO opacity transition: measured (follow-up ITEM 2) — with the transition
   * present, zooming flips hull-threshold opacities with up to 13 labels
   * transitioning at once and produces periodic 33ms frames; transition-free
   * flips measure a flat 17.7ms (same root cause as the universe view,
   * c9aff74). */
}

/* Viewport-clamped mode (pattern: viewport-clamped context label): the label
 * has detached from its culled/offscreen hull and pinned to the viewport edge
 * nearest its centroid, at sub-prominent inline opacity. Decorative only —
 * never interactive, never blocking (pointer-events above). */
.constellation-label.ctx-clamped { letter-spacing: 0.5px; }

/* Node glyphs */
.glyph { pointer-events: none; }
.glyph.station { fill: #e8ecf3; stroke: #0b0e14; stroke-width: 1; }
.glyph.belts { fill: #b7a24a; stroke: #0b0e14; stroke-width: 1; }

/* Sidebar controls */
.sidebar-controls {
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-controls label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.sidebar-controls input { accent-color: var(--accent); }

/* Constellation boundaries are a REGION-view surface (the hull layer only
 * exists there) — the toggle row hides on the universe view (owner request
 * 2026-09-28: a control that does nothing in the current view is noise). */
body[data-view="universe"] #constellation-toggle-label { display: none; }

/* Galactic layout toggle (owner override 2026-09-24): REGION-VIEW ONLY —
 * the universe surface is parked (universe.js GALACTIC_UNIVERSE flag,
 * owner decision 2026-09-24) and system/planet never read the layout; a
 * hidden control cannot lie. FULLY PARKED same day (api.js GALACTIC_LAYOUT =
 * false — "even the k-space maps don't look like how they should in the
 * ingame map right now"): main.js hides the row via inline style, which
 * beats this reveal; the rules stay for the re-enable. */
#layout-galactic-label { display: none; }
/* Visible on BOTH map layouts' surfaces (bug 5, 2026-10-11): the toggle
 * used to be region-only while the universe supports the schematic too. */
body[data-view="region"] #layout-galactic-label,
body[data-view="universe"] #layout-galactic-label { display: flex; }
/* J-space regions: the payload-space gate disables the input; the row dims
 * and the title carries the reason. */
#layout-galactic-label.jspace-disabled { opacity: 0.45; }
#layout-galactic-label.jspace-disabled input { cursor: not-allowed; }

/* Scale bar (system drill-down) */
#scale-bar {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(18, 22, 31, 0.85);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* display:flex above would otherwise defeat the hidden attribute. */
#scale-bar[hidden] { display: none; }

#scale-bar-line {
  height: 0;
  border-top: 2px solid var(--label-silver);
  position: relative;
  min-width: 20px;
}

#scale-bar-line::before, #scale-bar-line::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 0;
  height: 8px;
  border-left: 2px solid var(--label-silver);
}

#scale-bar-line::after { right: 0; border-left: none; border-right: 2px solid var(--label-silver); }

#scale-bar-label { color: var(--label-silver); font-weight: 600; min-width: 52px; }

/* Legend panel — capped + scrollable so a long legend (security + faction
 * scales) never overflows the stage and covers the topbar buttons.
 * Redesign 2026-09-10: frosted glass surface, softer radius/shadow, hairline
 * section dividers.
 * 2026-09-14 (deep-zoom flicker, Wave 1): the frost (backdrop-filter) is
 * REMOVED — it ran at every scale, INCLUDING collapsed (the tab still
 * frosted), and re-sampled the canvas layer on EVERY zoom frame. Diagnosis
 * (docs/ARCHITECTURE.md, camera section): the whole-window black flash is a
 * Chromium present-path shared-image lifetime race fed by exactly that
 * per-frame GPU churn (chrome://gpu mailbox errors). Plain translucent
 * surface now — same pattern as the detail/kills panels. */
#legend {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 10;
  width: 248px;
  max-height: calc(100% - 28px);
  display: flex;
  flex-direction: column;
  background: rgba(16, 20, 29, 0.96);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* Legend header (owner request 2026-09-10): a titled header row like the
 * detail/kills panels — title left, collapse chevron right. */
.legend-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px 2px;
}
.legend-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text);
  text-transform: uppercase;
}

#legend-toggle {
  flex: none;
  /* Shared collapse-button metrics (owner request 2026-09-11): match the
   * detail/kills panel chevrons — one size and shape across all three. */
  padding: 0 2px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

#legend-toggle:hover { color: var(--text); }

#legend-body { padding: 2px 12px 10px; overflow-y: auto; min-height: 0; }
#legend.collapsed #legend-body { display: none; }
#legend.collapsed #legend-toggle { color: var(--text-dim); }

/* View-scoped legend: each section carries data-view (region | system).
 * The shell sets #legend's data-view to the active view, revealing only that
 * view's sections (no duplicate markup). Universe view shows no sections. */
/* Per-view not-contains: each section lists the views it applies to
 * (multi-value data-view — the planet view reuses the kills/drill-down
 * sections; the planet rule below hides the rest). */
#legend[data-view="region"] .legend-section:not([data-view~="region"]) { display: none; }
#legend[data-view="system"] .legend-section:not([data-view~="system"]) { display: none; }
#legend[data-view="universe"] .legend-section:not([data-view~="universe"]) { display: none; }
/* Planet view: the kills ladder + the body glyphs apply; the star row and
 * the planet-types section do not (one planet, owner directive 2026-09-14). */
#legend[data-view="planet"] .legend-section:not([data-view~="planet"]) { display: none; }
#legend[data-view="planet"] .legend-star-row { display: none; }
/* The faction wash is a region/universe notion, not the system drill-down. */
#legend[data-view="region"] .faction-section { display: none; }
#legend[data-view="system"] .faction-section { display: none; }

.legend-section { margin-top: 10px; padding-top: 10px; }
.legend-section + .legend-section { border-top: 1px solid rgba(255, 255, 255, 0.05); }
/* Hover tip (owner request 2026-10-01): the "how does this work" note —
 * dim + italic so it reads as a footnote, not a legend row. No border/
 * padding-top: it is the legend's opening line, not a keyed section. */
.legend-tip {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  color: var(--text-dim);
  font-size: 11px;
  font-style: italic;
  line-height: 1.5;
}
.legend-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.legend-section > div:not(.legend-heading):not(.sec-scale):not(.kill-tier-scale):not(.kill-window-row) {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  color: var(--text);
  font-size: 12px;
}

.sw {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 2px;
}

/* Inline SVG legend glyphs (system drill-down silhouettes). */
.li {
  width: 16px;
  height: 16px;
  flex: none;
}

.glyph-sq { background: #e8ecf3; }
.glyph-tri {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 11px solid #b7a24a;
  background: none;
  border-radius: 0;
}

/* Legend chip samples mirror the region view's right-zone marker chips
 * (dark translucent circle carrying the glyph). */
.marker-chip-sample {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(11, 14, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.marker-chip-sample .glyph-sq {
  width: 5px;
  height: 5px;
  border-radius: 1px;
}
.marker-chip-sample .glyph-tri {
  border-left-width: 4px;
  border-right-width: 4px;
  border-bottom-width: 7px;
}

/* Security scale strip (generated from SEC_COLORS in js/main.js): ONE
 * segmented bar (owner legend redesign 2026-09-10) with tick labels under
 * the 1.0 / 0.5 / 0.0 / -0.5 / -1.0 buckets; exact value on cell hover. */
.sec-scale { display: block; }
.sec-strip {
  display: flex;
  height: 10px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.55);
}
.sec-scale .sec-step { flex: 1; }
.sec-ticks { position: relative; height: 13px; margin-top: 2px; }
.sec-scale .sec-tick {
  position: absolute;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Faction territory scale strip (generated from FACTION_COLORS in js/api.js). */
.faction-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.faction-scale .faction-step {
  display: flex;
  align-items: center;
  gap: 4px;
}
.faction-scale .faction-swatch {
  width: 10px;
  height: 10px;
}
.faction-scale .faction-name {
  font-size: 10px;
  color: var(--text);
  white-space: nowrap;
}

/* Faction tint + faction badge are decorative — never intercept pointer events
 * (clicks/hover pass through to nodes; region labels no longer carry badges,
 * so this now guards only the universe tile badges). */
.faction-tint,
.faction-badge {
  pointer-events: none;
}

/* A missing asset file (before the owner drops in the logo bundle) hides the
 * universe badge outright. */
.faction-badge-missing { display: none; }

/* Short faction-name suffix after a system/region label (text fallback). */
.faction-suffix {
  fill: var(--text-dim);
  font-size: 11px;
  pointer-events: auto;
}
.faction-suffix.dim-label { opacity: 0; }

/* Faction row in the HTML surfaces (pattern: tooltip faction row / panel
 * faction row): logo + full name at a readable size — the room a map label
 * could never give a badge. One builder (js/api.js factionRow) feeds both. */
.faction-row { display: flex; align-items: center; gap: 8px; }
.node-tooltip .faction-row img { width: 24px; height: 24px; }
#detail-panel .faction-row img { width: 28px; height: 28px; }
.faction-row .faction-row-name { font-weight: 600; white-space: nowrap; }
/* Missing asset file hides the whole row (mirror of .faction-badge-missing). */
.faction-row.faction-missing { display: none; }

/* Trade-hub tag (pattern: trade-hub badge overlay, text form). A plain
 * billboard text tag riding the name's edge-anchored baseline at a fixed gap
 * below (region.js) — it claims no anchor zone. Solid --label-gold, no halo
 * (label paint cleanup convention). Decorative: pointer-events pass through;
 * declutter dim and the disc-size visibility floor apply like any label. */
/* Trade-hub coin glyphs (owner request 2026-09-10: hub identification is an
 * icon in the region view's RIGHT anchor zone — solid gold coin for the
 * curated tier-1 hubs, hollow cyan coin for the data-derived tier-2 set;
 * the "Main Hub" text tag is gone). Circles are the one shape unused in the
 * right zone (station = square, belts = triangle), so the family reads. */
.glyph.hub-major {
  fill: var(--label-gold);
  stroke: #0b0e14;
  stroke-width: 1.2;
}
.glyph.hub-major-core { fill: rgba(11, 14, 20, 0.5); stroke: none; }
.glyph.hub-derived {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
}

/* The faction toggle controls the universe region tint only — hide it where
 * that tint never renders (region/system views). */
body:not([data-view="universe"]) #faction-toggle-label { display: none; }

/* --- Attribution footer (CCP Developer License 7.1) --- */
#attribution {
  flex: none;
  padding: 3px 10px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-dim);
  text-align: center;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
}

/* Walker health dot (js/health.js): kill-feed lag badge. Palette reuses the
 * SEC_COLORS anchors (0.6 green / 0.1 amber / -0.8 red) — no new hues. */
#walker-health {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--border);
}
#walker-health.walker-green { background: #3fbf5f; }
#walker-health.walker-amber { background: #ddaa36; }
#walker-health.walker-red { background: #b44229; }

/* --- Home dashboard (#/home, owner request 2026-09-15) ---
 * The legend's view-scoping grammar (body[data-view]) hides ALL map chrome
 * and reveals the scrolling HTML dashboard in the stage's place. The
 * sidebar hides too: the home page is a standalone site front page, not a
 * map view (region navigation is the card links + brand/breadcrumb). */
#home {
  display: none;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

body[data-view="home"] #sidebar,
body[data-view="home"] #stage {
  display: none;
}

body[data-view="home"] #home {
  display: block;
}

body[data-view="hot"] #sidebar,
body[data-view="hot"] #stage {
  display: none;
}

/* The hot views scroll THEMSELVES (html/body overflow:hidden — each view
 * owns its scroller, the #home grammar); without this a long table is cut
 * off at the viewport (owner report 2026-09-25). */
body[data-view="hot"] #hot {
  display: block;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* The NPC Activity page (Task 2): its own view value — never co-displayed
 * with the hot section — same self-scrolling grammar. */
body[data-view="npc"] #sidebar,
body[data-view="npc"] #stage {
  display: none;
}

body[data-view="npc"] #hot {
  display: none;
}

/* The Item page (Phase 3, owner request 2026-09-29): its own view value —
 * never co-displayed with the hot section (the hot CSS rule would
 * otherwise force-display #hot for view="hot"), same self-scrolling
 * grammar. */
body[data-view="item"] #sidebar,
body[data-view="item"] #stage {
  display: none;
}

body[data-view="item"] #hot {
  display: none;
}

body[data-view="item"] #item-view {
  display: block;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

body[data-view="npc"] #npc {
  display: block;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Quicknav buttons visible on the hot + about pages as on home (owner
 * request 2026-09-25). The per-view scoping was REMOVED 2026-09-29 (the
 * quicknav is global now — visible on every view including the maps). */

/* Full browser width (owner request 2026-09-25 — the table must use the
 * whole screen, not the home dashboard's 1680px cap). */
.hot-inner {
  max-width: none;
  margin: 0 auto;
  padding: 22px 24px 36px;
}

/* The "Hot" nav flair: red gradient + italic (owner request 2026-09-25). */
/* The "Hot" nav flair: VERTICAL red gradient + heat-shimmer — the letters
 * ripple vertically like desert heat haze (owner request 2026-09-25:
 * "the word Hot itself should wiggle vertically, like the wavy heat
 * effect on an object in a desert environment"). Straight underline;
 * staggered per-letter phase; transform-only (composited, no layout
 * cost); prefers-reduced-motion disables the animation. The noun beside
 * the flair carries data-i18n so it survives language switching. */
.hot-flair {
  display: inline-block;
}

.hot-flair b {
  display: inline-block;
  font-style: italic;
  font-weight: 700;
  background: linear-gradient(180deg, #ff6b6b 0%, #ff4d4d 55%, #b91c1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: underline;
  text-decoration-color: rgba(255, 77, 77, 0.55);
  text-underline-offset: 3px;
  animation: hot-shimmer 1.6s ease-in-out infinite;
}

/* The staggered per-letter delays: the hot-flair ITEMS only. The Heat!
 * flame letters move in UNISON (owner ruling 2026-09-30, later same day:
 * "wiggle in unison") — every letter keeps animation-delay 0 (default),
 * so the word sways and its wisps rise as one. */
.hot-flair b:nth-child(1) {
  animation-delay: 0s;
}

.hot-flair b:nth-child(2) {
  animation-delay: 0.22s;
}

.hot-flair b:nth-child(3) {
  animation-delay: 0.44s;
}

/* The staggered wave continues past the 3-letter Hot word. */
.hot-flair b:nth-child(4) {
  animation-delay: 0.66s;
}

.hot-flair b:nth-child(5) {
  animation-delay: 0.88s;
}

.hot-flair b:nth-child(6) {
  animation-delay: 1.1s;
}

.hot-flair b:nth-child(7) {
  animation-delay: 1.32s;
}

.hot-flair b:nth-child(8) {
  animation-delay: 1.54s;
}

.hot-flair b:nth-child(9) {
  animation-delay: 1.76s;
}

@keyframes hot-shimmer {
  0%,
  100% {
    transform: translateY(0) scaleY(1);
  }
  30% {
    transform: translateY(-1.5px) scaleY(1.04);
  }
  65% {
    transform: translateY(1.5px) scaleY(0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hot-flair b {
    animation: none;
  }
}

/* --- Hot surfaces (#/hot-moons, #/hot-planets; owner request 2026-09-24) --- */

.hot-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
}

.hot-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
/* Same author>UA guard as .hot-trend below — [hidden] must MEAN hidden
 * even on flex rows (the overlay-discipline grammar). */
.hot-chip-row[hidden] { display: none; }

.hot-chip {
  background: none;
  border: 1px solid var(--border, #333);
  color: var(--text-dim, #9aa3ad);
  border-radius: 3px;
  padding: 2px 8px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.hot-chip-on {
  color: var(--label-gold, #e6c46a);
  border-color: var(--label-gold, #e6c46a);
}

.hot-region-label {
  color: var(--text-dim, #9aa3ad);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hot-controls select,
.hot-controls button {
  font: inherit;
  font-size: 12px;
}

.hot-meta {
  color: var(--text-dim, #9aa3ad);
  font-size: 12px;
  margin: 6px 0 10px;
}

.hot-table {
  border: 1px solid var(--border, #2a2f36);
  border-radius: 4px;
  overflow-x: auto; /* minmax floors engage with a scroll on narrow pages — never clip */
  overflow-y: hidden;
}

.hot-row {
  display: grid;
  /* Moons/planets: 8 tracks — star, object, system, constellation, region,
   * owner, kills, isk. The old template had 10 tracks for 8 cells: the two
   * empty fr tracks sat dead at the right, so the columns never filled the
   * row (owner report 2026-09-28). fr tracks stretch to the page width;
   * the minmax floors keep labels readable (the table scrolls at the floor). */
  grid-template-columns: 28px minmax(180px, 1.5fr) 1.1fr 0.9fr 0.9fr 1fr 0.7fr 0.9fr;
  gap: 10px;
  padding: 6px 12px;
  border-top: 1px solid var(--border, #23272d);
  align-items: baseline;
  font-size: 13px;
}

/* Stars + the other compact scopes: 6 content tracks — the row IS the
 * system, the OWNER column is retired client-side (owner request
 * 2026-09-28; the payload field is retained additively, pve_kills
 * precedent). */
.hot-table-inner[data-scope="system"] .hot-row,
.hot-table-inner[data-scope="capitals"] .hot-row,
.hot-table-inner[data-scope="structures"] .hot-row {
  grid-template-columns: 28px minmax(150px, 1.5fr) 1.1fr 1.1fr 0.7fr 0.9fr;
}

/* Hot Market (owner request 2026-09-29): 5 tracks — star, item, volume,
 * buy, sell. The item column dominates (long item names); the priced
 * columns stretch evenly. */
/* Hot Market (owner request 2026-09-29; trend columns same day; Filled
 * (7d) Phase 5 2026-09-30): 9 tracks — star, item, volume, buy, sell,
 * spread, buy Δ, sell Δ, filled. The item column dominates (long item
 * names); the priced columns stretch evenly. */
.hot-table-inner[data-scope="market"] .hot-row {
  grid-template-columns: 28px minmax(180px, 2fr) 1fr 0.75fr 0.75fr 0.75fr 0.75fr 0.75fr 0.75fr;
}

/* Hot Rats (npc) rows carry 10 cells (★ · System · Sec · Constellation ·
 * Region · Owner · NPC Kills · Player Kills · ISK Lost · Est. Bounty) —
 * NO template existed and the base 8-track row wrapped the last two
 * columns onto a second grid line at ANY width (owner report 2026-10-01
 * with screenshot). Tracks must EQUAL the row's cell count — the
 * dead-tracks lesson inverted: too many tracks die at the right, too few
 * wrap the row. */
.hot-table-inner[data-scope="npc"] .hot-row {
  grid-template-columns: 28px minmax(150px, 1.5fr) 0.7fr 1.1fr 1.1fr 1fr 0.9fr 0.9fr 1fr 1fr;
}

.hot-row:first-child {
  border-top: none;
}

.hot-head {
  color: var(--text-dim, #9aa3ad);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.02);
}

.hot-head .hot-sort {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.hot-head .hot-sort:hover {
  color: var(--text, #d6dae0);
}

.hot-head .hot-count .hot-sort {
  text-align: center;
}

.hot-object,
.hot-system {
  color: var(--label-gold, #e6c46a);
  text-decoration: none;
}

.hot-system {
  color: var(--text, #d6dae0);
}

.hot-object:hover,
.hot-system:hover {
  text-decoration: underline;
}

.hot-star {
  background: none;
  border: none;
  color: var(--text-dim, #6b7688);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.hot-star-on {
  color: var(--label-gold, #e6c46a);
}

.hot-head .hot-sort-center {
  text-align: center;
}

.hot-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border, #23272d);
}

.hot-pager-indicator {
  color: var(--text-dim, #9aa3ad);
  font-size: 12px;
}

.hot-count {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.hot-breakdown {
  display: block;
  text-align: center;
  color: var(--text-dim, #8a93a0);
  font-size: 11px;
}

/* NPC page: incursion badge + sec dot (Task 2, owner request 2026-09-25). */
.hot-incursion-badge {
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #7ee0a3;
  border: 1px solid rgba(126, 224, 163, 0.55);
}

.hot-sec {
  display: flex;
  align-items: center;
  gap: 6px;
}

.npc-sec-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

/* Round 7: click-to-expand sparkline row + the EST. bounty column. */
.hot-npc-count {
  cursor: pointer;
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
}

.hot-npc-count:hover {
  color: var(--label-gold, #e6c46a);
}

.hot-spark-row .hot-spark {
  padding: 4px 0;
}

.hot-spark-svg {
  width: 100%;
  height: 44px;
  display: block;
}

html[dir="rtl"] .hot-row {
  direction: rtl;
}

.home-inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 22px 24px 36px;
}

/* Brand marks (owner's 2026-10-07 logo, image-gen original art). The
   shipped logo.png carries REAL alpha (the near-black field is
   transparent — processed once in Python): a seam is impossible on any
   backdrop, unlike blend-mode tricks which depend on the backdrop
   color (screen lifted the field; lighten still tinted under JPEG). */
.home-title {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: 2px;
  /* Brand, not chrome (owner visual review 2026-11-03): the wordmark shared
   * --accent with every LINK in the app, so the identity read as a hyperlink
   * sitting beside an amber emblem. The brand family is the label gold; blue
   * is reserved for navigable things. */
  color: var(--label-gold);
}

/* Owner layout ruling 2026-10-07: the logo sits RIGHT of the intro
   paragraph on wide screens and stacks ABOVE it when the row can't fit
   (the <=640 block at the END of this file flips it via column-reverse).
   AMENDED 2026-10-08 (owner): tight-cropped square asset + negative
   block margins — the box hugs the emblem (no transparent air), and the
   bleed opts the circle into the neighbouring whitespace so the
   paragraph's above/below gaps stay small (the row is sized by the
   item's OUTER cross size). */
.home-intro-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.home-intro-row .home-intro {
  flex: 1 1 auto;
  min-width: 0;
}

/* Bug-1 fix (owner request 2026-10-11): the logo is CENTERED in a
 * flexible box that adjusts to screen size — it was a bare rigid image
 * with the round-4 -56px bleed hack. AMENDED same day (owner: "leaning
 * to the left — more centered in the space it has on all aspect ratios"):
 * the box now CLAIMS the right-hand space (flex-grow, not a fixed width
 * — flex packs left otherwise, and the paragraph's 120ch cap left slack
 * to park the logo left-of-center at wide aspects) and the ART centers
 * inside it (width min(100%, 300px) — the size cap moved from the box
 * to the image). The round-4 vertical condensing survives as a SYMMETRIC
 * box bleed (center-neutral — the row's align-items:center keeps the
 * image centered on the paragraph). */
.home-logo-box {
  flex: 1 1 30%;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-block: -56px;
}

.home-logo {
  display: block;
  width: min(100%, 300px);
  height: auto;
}

.home-intro {
  margin: 0 0 14px;
  max-width: 120ch;
  line-height: 1.55;
  color: var(--text);
}

/* ISK-donation note (owner request 2026-10-07, zkillboard message
   format) — a quiet line under the intro row. */
.home-support {
  margin: 2px 0 14px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

.home-meta {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-dim);
  /* Reserved line (CLS pass 2026-10-12): #home-meta fills when the payload
   * lands — the line box exists from first paint so the fill-in never
   * pushes the grid below it. */
  min-height: 16px;
}

.home-grid {
  display: grid;
  /* min(440px, 100%) — fluid grid fix (mobile 2026-09-30): the hard 440px
   * floor overflowed viewports narrower than the card. */
  grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr));
  gap: 12px;
  align-items: start;
}

.home-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 0;
}

.home-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.home-card-region {
  color: var(--label-gold);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-card-region:hover { text-decoration: underline; }

.home-card-count {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Kill rows as a 5-COLUMN GRID (owner request 2026-09-15: straight
 * columns, content centered in each column — the old flex row slanted
 * because ship/victim lengths varied). Every row uses the SAME fr template
 * and the same card width, so the columns align across rows. The zkb
 * anchor goes display:contents (boxless) — its cells participate directly
 * in the row grid and clicks/hover still resolve through the DOM subtree;
 * text-decoration is pinned off on the cells (no anchor box to carry it). */
.home-kill {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1.5fr 1fr 1fr;
  gap: 4px 10px;
  align-items: baseline;
  justify-items: center;
  padding: 3px 0;
  font-size: 12px;
  min-width: 0;
}

.home-kill > * {
  min-width: 0;
  max-width: 100%;
}

.home-kill-main {
  display: contents;
}

.home-kill-main > span {
  text-decoration: none;
  text-align: center;
  overflow-wrap: anywhere;
}

.home-kill-time {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.home-kill-ship {
  color: var(--label-silver);
}

.home-kill-victim {
  color: var(--text);
}

.home-kill-main:hover .home-kill-victim,
.home-kill-victim:hover { color: var(--accent); }

.home-kill-isk {
  color: var(--label-gold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.home-kill-system {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
}

.home-kill-system:hover { text-decoration: underline; }

/* Column headers (owner request 2026-09-15): the SAME 5-column template as
 * the kill rows — dim, separator under (hot-systems header mirror). */
.home-kill-head {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.03em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.home-kill-none {
  color: var(--text-dim);
  font-style: italic;
  font-size: 12px;
}

.home-loading {
  color: var(--text-dim);
  padding: 28px 0;
}

/* Render-cost containment (mobile-load pass 2026-10-12, the
 * content-visibility pattern): the home page's long repeating blocks skip
 * layout + paint until they approach the viewport. `auto Npx` reserves the
 * estimated size (a scroll into view re-renders within the input window,
 * so an intrinsic-size mismatch never scores CLS). */
.home-region-card,
.home-region-grid,
.home-hot-list,
.home-market-list,
.home-latest-list,
.home-sov-list {
  content-visibility: auto;
  contain-intrinsic-size: auto 160px;
}

.home-error {
  color: #e0613a;
  padding: 28px 0;
}

/* Home revision (owner request 2026-09-15): the page opens with a
 * name-only rectangle grid covering EVERY region (universe-grid order),
 * followed by the top-20 kill-card dashboard. */
.home-section-title {
  margin: 18px 0 10px;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--label-silver);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

/* Collapsible home sections (owner request 2026-09-24): the whole header
 * row is the toggle (the viewer-panel collapse grammar — chevron flips
 * ▾/▸, aria-expanded tracks the state); the collapsed BODY hides via
 * .home-body-collapsed (display:none — survives the streaming renders'
 * [hidden] unhide). */
.home-collapse {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}
.home-collapse:hover { color: var(--accent); }
.home-collapse-chev {
  color: var(--text-dim);
  font-size: 11px;
  width: 10px;
  flex: none;
}
.home-body-collapsed { display: none !important; }

.home-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.home-region-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  text-align: center;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-region-tile:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Home v3 (owner request 2026-09-15): UNIVERSE PULSE (stat strip +
 * biggest kills with CCP-CDN ship renders), HOT SYSTEMS (killdaily),
 * ABOUT THE DATA (closing section). ------------------------------------- */
.home-sub-title {
  margin: 16px 0 8px;
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.home-pulse-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.home-pulse-stat {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 0;
}

.home-pulse-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--label-gold);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-pulse-label {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-big-kills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.home-big-kill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.home-big-kill:hover { border-color: var(--accent); }

.home-big-kill-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 6px;
}

.home-big-kill-ship {
  font-weight: 700;
  color: var(--label-silver);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-big-kill-victim {
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-big-kill-isk {
  color: var(--label-gold);
  font-variant-numeric: tabular-nums;
}

.home-big-kill-where {
  font-size: 11px;
  color: var(--text-dim);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-hot-list {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.home-hot-row {
  display: grid;
  grid-template-columns: 32px minmax(120px, 2fr) 1fr 1fr 1.4fr;
  gap: 10px;
  align-items: baseline;
  padding: 7px 14px;
  font-size: 12px;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.home-hot-row:first-child { border-top: none; }

.home-hot-head {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 1px;
  background: var(--bg-hover);
}

.home-hot-rank { color: var(--text-dim); }

.home-hot-system {
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-hot-system:hover { color: var(--accent); }

.home-hot-isk { color: var(--label-gold); }

/* Home v5 (owner request 2026-09-24): MOST ACTIVE MARKETS — the
 * universe-wide busiest NPC stations by the snapshot-day buy-order LEVEL
 * (/live/market/top). Same panel-row grammar as .home-hot-*; 8 columns:
 * rank, station, system, sec (dot + value), constellation, region, kills,
 * orders. */
.home-market-list {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.home-market-row {
  display: grid;
  grid-template-columns: 28px minmax(130px, 1.7fr) minmax(80px, 1fr) 56px minmax(90px, 1.1fr) minmax(90px, 1.1fr) 56px minmax(150px, 1.1fr);
  gap: 10px;
  align-items: baseline;
  padding: 7px 14px;
  font-size: 12px;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.home-market-row:first-child { border-top: none; }

/* MARKET PULSE item rows (Phase 6): 4 tracks — rank, item, volume,
 * book value. The 8-track market template would leave 4 dead tracks
 * (the dead-tracks lesson) — this row shape gets its own grid. */
.home-market-row.home-pulse-row {
  grid-template-columns: 28px minmax(130px, 2fr) minmax(80px, 1fr) minmax(90px, 1.1fr);
}

.home-market-head {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 1px;
  background: var(--bg-hover);
}

.home-market-rank { color: var(--text-dim); }

.home-market-station,
.home-market-system,
.home-market-region {
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-market-station { font-weight: 600; }
.home-market-station:hover,
.home-market-system:hover,
.home-market-region:hover { color: var(--accent); }

.home-market-con {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-market-sec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
}

.home-market-sec-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.home-market-orders { color: var(--label-gold); }

/* SOVEREIGNTY CHANGES (owner request 2026-09-24): the latest 20 sov
 * events — system/region/constellation, kicked out -> coming in, began,
 * ended ("Ongoing" badge while the contest runs). Same panel-row grammar
 * as .home-market-*; 7 columns. */
.home-sov-list {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.home-sov-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.1fr) minmax(100px, 1.1fr) minmax(100px, 1.1fr) minmax(160px, 1.9fr) minmax(105px, 0.9fr) minmax(105px, 0.9fr);
  gap: 10px;
  align-items: baseline;
  padding: 7px 14px;
  font-size: 12px;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.home-sov-row:first-child { border-top: none; }

.home-sov-head {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 1px;
  background: var(--bg-hover);
}

.home-sov-system,
.home-sov-region,
.home-sov-con,
.home-sov-change {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-sov-system {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.home-sov-system:hover { color: var(--accent); }

.home-sov-region,
.home-sov-con,
.home-sov-change { color: var(--text-dim); }

.home-sov-ended {
  color: var(--text-dim);
  text-align: center;
}
.home-sov-row.home-sov-ongoing .home-sov-ended,
.home-sov-row.home-sov-scheduled .home-sov-ended {
  color: #ffd75e;
  font-weight: 700;
}
.home-sov-began { color: var(--text-dim); text-align: center; }
.home-sov-head .home-sov-center { text-align: center; }

.home-unavailable {
  color: var(--text-dim);
  font-style: italic;
  font-size: 12px;
  padding: 6px 0;
}

/* Home v4 (owner request 2026-09-15): LATEST KILLS — the universe-wide
 * newest-kill feed (rows reuse .home-kill inside a panel card). */
.home-latest-list {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
}

/* EXPLORE closing cards (owner request 2026-09-15): static, defined in
 * index.html — replaced the ABOUT THE DATA block (its data-provenance
 * content now lives on #/about, owner requests 2026-09-15 + 2026-09-17). */
.home-explore {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.home-explore-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

a.home-explore-card:hover { border-color: var(--accent); }

.home-explore-title {
  font-weight: 700;
  color: var(--label-silver);
}

.home-explore-card kbd {
  font: inherit;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  background: var(--bg-hover);
}

.home-explore-sub {
  font-size: 12px;
  color: var(--text-dim);
}

/* --- About page (#/about, owner request 2026-09-17) ---
 * The home teardown reserved this page (2026-09-15): the data-provenance
 * block and the static sections live here now. View-scoped exactly like
 * home: body[data-view="about"] hides ALL map chrome (sidebar + stage)
 * and reveals the scrolling section in the stage's place. Prose reuses
 * the .home-inner/.home-intro/.home-section-title classes. */
#about {
  display: none;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

body[data-view="about"] #sidebar,
body[data-view="about"] #stage {
  display: none;
}

body[data-view="about"] #about {
  display: block;
}

.about-prose {
  margin: 0 0 14px;
  max-width: 120ch;
  line-height: 1.55;
  color: var(--text);
}

.about-prose p { margin: 0 0 8px; }
.about-prose p:last-child { margin-bottom: 0; }

/* Labeled rows (dotlan contact-block analog): the static CONTACT/LINKS
 * blocks and the live #about-provenance rows share the template. */
.about-rows {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  margin: 0 0 14px;
  max-width: 120ch;
}

.about-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 3px 0;
  font-size: 12px;
  min-width: 0;
}

.about-row-label {
  color: var(--text-dim);
  font-weight: 600;
}

.about-row-value {
  color: var(--text);
  overflow-wrap: anywhere;
}

.about-row-value a {
  color: var(--accent);
  text-decoration: none;
}

.about-row-value a:hover { text-decoration: underline; }

/* Footer About link (zkillboard/dotlan footer precedent): the only global
 * entry point — every view's attribution line links the page. */
#attribution a {
  color: var(--text-dim);
  text-decoration: underline;
}

#attribution a:hover { color: var(--accent); }

/* --- Regions drawer + phone tier (mobile, owner request 2026-09-30 —
 * "display properly on a mobile device"; pattern: off-canvas navigation
 * drawer). #regions-btn is desktop-hidden (the sidebar is always visible
 * there); at <=1024px the sidebar becomes the drawer and the button
 * appears (home/about keep its PAINT hidden — no sidebar on those views;
 * the slot itself stays, see the box-discipline note below). Overlay discipline:
 * closed = display:none + the backdrop is [hidden] — never in
 * elementsFromPoint. The drawer slides UNDER the topbar (z-index) so the
 * bar stays reachable; RTL mirrors via inset-inline-start. These rules
 * live at the END of the file: same-specificity overrides of #sidebar and
 * .home-kill* must win by ORDER (placing them mid-file lost to the later
 * base rules and shipped a fixed sidebar over the map — measured 2026-09-30). */
#regions-btn {
  display: none;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  white-space: nowrap;
}

#regions-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Box discipline (CLS pass 2026-10-12): at compact tiers the button KEEPS
 * its slot in the topbar row and toggles PAINT only (visibility), so the
 * body[data-view] settle at ~90ms can never re-wrap the topbar — the old
 * display:none removed a 98px item from the row and shifted every topbar
 * element left (CLS 0.10 compact / 0.04 phone, measured). The pre-route
 * state (no data-view yet) matches home/about, the default landing, so
 * deep links paint the button IN without moving anything. The :not()
 * grammar grants paint to every non-home view — future views get the
 * button by default (drift-safe). */

@media (max-width: 1024px) {
  #regions-btn { display: inline-flex; visibility: hidden; }
  body[data-view]:not([data-view="home"]):not([data-view="about"]) #regions-btn {
    visibility: visible;
  }

  #sidebar {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(280px, 85vw);
    z-index: 75;
    box-shadow: 0 0 32px rgba(0, 0, 0, 0.6);
  }
  #sidebar.open { display: flex; }

  #regions-backdrop {
    position: fixed;
    inset: 0;
    z-index: 74;
    background: rgba(0, 0, 0, 0.45);
  }
  #regions-backdrop[hidden] { display: none; }

  #topbar {
    position: relative;
    z-index: 80; /* the drawer slides under the bar */
  }
}

/* --- Phone tier (<=640px, mobile 2026-09-30): the wordmark collapses to
 * the mark (aria-label keeps the name), the drawer button goes icon-only,
 * home padding tightens, the kill rows STACK (time · ISK / player ship /
 * system — the 5-column template crushed below readability; the header
 * row goes with the columns it labels), and the dense home tables ride the
 * hot-table grammar: floors engage with a horizontal scroll on the list
 * box (never clip, never page-overflow). */
@media (max-width: 640px) {
  .brand-name { display: none; }
  .brand-mark { margin-right: 0; }
  #regions-btn .btn-label { display: none; }
  #regions-btn .btn-icon { display: inline-block; }
  #regions-btn { padding: 5px 8px; }
  #lang-select { width: 132px; }
  #home-quicknav { gap: 6px; }
  .topbar-link { padding: 5px 8px; }

  .home-inner { padding: 14px 12px 28px; }
  .home-kill-head { display: none; }
  .home-kill { grid-template-columns: auto 1fr auto; }
  .home-kill-time { grid-area: 1 / 1; }
  .home-kill-isk { grid-area: 1 / 3; }
  .home-kill-victim { grid-area: 2 / 1 / 3 / 3; }
  .home-kill-ship { grid-area: 2 / 3; }
  .home-kill-system { grid-area: 3 / 1 / 4 / 4; }

  .home-hot-list,
  .home-market-list,
  .home-sov-list {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .node-tooltip {
    max-width: min(300px, calc(100vw - 16px));
  }

  /* 2026-10-07 home brand layout (owner ruling): when the intro row
     can't fit, the logo stacks ABOVE the paragraph — column-reverse
     (DOM order is paragraph -> image). At file END on purpose: a
     same-specificity media override mid-file loses the cascade to the
     later base rules (the mobile-pass lesson). */
  .home-intro-row {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 12px;
  }

  .home-intro-row .home-logo-box {
    flex: 0 0 auto;
    width: min(180px, 60%);
    min-width: 0;   /* the base 200px floor serves the row layout only */
    margin-block: 0;   /* stacked layout: no optical bleed */
  }
}

/* --- Touch target enlargement (owner audit 2026-11-11) ---
 * WCAG 2.2 target-size minimum is 24x24 CSS px; the icon toggles render
 * 14-18px and the hot table controls sit at 16-23px. The COMPACT tier
 * (<=1024px — the drawer/phone tier) gets an INVISIBLE hit ring around the
 * icon toggles and a 24px floor on the small controls: the visual boxes and
 * the desktop layout are untouched. Pseudo-element insets are used where a
 * box change would move the header/rows; min-height where a row can breathe. */
@media (max-width: 1024px) {
  #detail-panel .panel-collapse,
  #kills-panel .kill-collapse,
  #sov-panel .sov-collapse,
  #legend-toggle,
  .brand {
    position: relative;
  }
  #detail-panel .panel-collapse::after,
  #kills-panel .kill-collapse::after,
  #sov-panel .sov-collapse::after,
  #legend-toggle::after,
  .brand::after {
    content: "";
    position: absolute;
    inset: -5px;
  }
  .hot-head { min-height: 28px; align-items: center; }
  .hot-head .hot-sort { min-height: 24px; }
  .hot-chip,
  .hot-star,
  .hot-item-caret,
  .hot-controls select {
    min-height: 24px;
  }
}
