:root {
  color-scheme: light;
  --bg: #f9f9f9;
  --ink: #1b1b1b;
  --black: #000;
  --grey: #5d5f5f;
  --line: 2px solid #000;
  --red: #ba1a1a;
  --amber: #b45309;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: Inter, system-ui, -apple-system, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top bar */
#topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border-bottom: var(--line);
  background: var(--bg);
  z-index: 1200;
}
.brand {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 22px;
  color: var(--black);
  text-decoration: none;
  cursor: pointer;
}
a.brand:hover { opacity: 0.65; }
.tagline {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--grey);
}
.search { position: relative; margin-left: auto; }
.search input {
  font-family: var(--mono);
  font-size: 12px;
  border: 2px solid var(--black);
  background: var(--bg);
  padding: 7px 10px;
  width: 250px;
  outline: none;
}
.search input:focus { background: #fff; }
#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border: 2px solid var(--black);
  border-top: 0;
  z-index: 1500;
  max-height: 300px;
  overflow: auto;
}
#search-results button {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
}
#search-results button:hover { background: var(--black); color: #fff; }
.langs { display: flex; align-items: center; gap: 6px; }
.langs .sep { color: var(--grey); }
.lang-btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  background: none;
  border: 2px solid transparent;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--grey);
  transition: all 150ms;
}
.lang-btn.active { color: var(--black); border-color: var(--black); font-weight: 700; }
.lang-btn:hover { background: var(--black); color: #fff; }

.info-btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 2px solid var(--black);
  background: none;
  color: var(--black);
  padding: 6px 12px;
  cursor: pointer;
  transition: all 150ms;
}
.info-btn:hover { background: var(--black); color: #fff; }
a.info-btn { text-decoration: none; display: inline-flex; align-items: center; }

.stats {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--black);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

#about {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#about[hidden] { display: none; }
.about-box {
  background: var(--bg);
  border: 2px solid var(--black);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
}
.about-box header {
  background: var(--black);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.about-box header button {
  background: none;
  border: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.about-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.about-body p { font-size: 15px; line-height: 1.5; }
.about-body .dim { color: var(--grey); font-size: 13px; }

/* Stage & map */
#stage { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: #e8e8e8; }
.leaflet-tile { filter: grayscale(1) contrast(1.02); }
body.sat .leaflet-tile { filter: none; }
.leaflet-container { font-family: var(--mono); }
.leaflet-tooltip {
  background: #000;
  color: #fff;
  border: 0;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  box-shadow: none;
}
.leaflet-tooltip-top::before { border-top-color: #000; }
.leaflet-control-attribution {
  font-family: var(--mono);
  font-size: 10px;
  background: rgba(249, 249, 249, 0.9);
}
.leaflet-bar a {
  border-radius: 0 !important;
  color: var(--black);
}

/* Vessel markers: suunanooled */
.v-mark { background: none !important; border: 0 !important; }
.v-svg { display: block; }
.v-dark {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px dashed #000; box-sizing: border-box;
}
.v-stop { border: 2px solid #000; transform: rotate(45deg); box-sizing: border-box; }

/* Animeeritud teekonnajoon */
.track-anim { animation: track-dash 0.9s linear infinite; }
@keyframes track-dash { to { stroke-dashoffset: -20; } }

/* Legend */
#legend {
  position: absolute;
  left: 12px;
  bottom: 24px;
  z-index: 1000;
  background: var(--bg);
  border: var(--line);
  padding: 0;
  max-width: min(280px, 46vw);   /* pikk silt ("veealune taristu...") voolas varem laiali */
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#legend:not(.collapsed) { padding-bottom: 8px; }
#legend.collapsed > *:not(.legend-toggle) { display: none; }
#legend .row, #legend .toggle { margin-left: 10px; margin-right: 10px; }
/* Ajajoone-kerija ajal tõuseb legend sellest kõrgemale (varem kattusid).
   AINULT töölaual: mobiilis on legend üleval (top:8px) ja bottom'i lisamine venitaks
   kasti üle ekraani, isegi kokkuvolditult. */
@media (min-width: 641px) {
  body.scrubbing #legend { bottom: 100px; }
}
#legend .row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
/* Legend on kokkuvolditav KÕIGIL ekraanidel (varem ainult mobiilis) */
.legend-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--black);
  color: #fff;
  border: 0;
  padding: 8px 12px;
  cursor: pointer;
}
.lt-arrow { transition: transform 150ms; }
#legend.collapsed .lt-arrow { transform: rotate(-90deg); }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--black);
  background: var(--ink);
  display: inline-block;
}
.dot[data-status="sanctioned"] { background: var(--red); }
.dot[data-status="shadow"] { background: #eab308; }
.dot[data-status="dark"] { background: #fff; border-style: dashed; }
.dash { width: 16px; border-top: 2px dashed #555; display: inline-block; }
.warn-icon {
  background: #b45309;
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  border: 1px solid #000;
}
.warn-pop h3 { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.warn-pop .warn-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--grey);
  margin-bottom: 6px;
}
.warn-pop p { font-size: 13px; line-height: 1.4; white-space: pre-line; }
#foot a.mono { color: var(--grey); text-decoration: underline; }
#foot a.mono:hover { color: var(--black); }
.pulse-ring { animation: ringpulse 1.6s ease-in-out infinite; }
@keyframes ringpulse { 50% { stroke-opacity: 0.2; } }
#legend .toggle {
  cursor: pointer;
  border-top: 1px solid var(--black);
  padding-top: 8px;
  margin-top: 4px;
  gap: 8px;
}
#legend .toggle input { accent-color: var(--black); margin: 0; }
#empty {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: var(--bg);
  border: var(--line);
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* Panel */
#panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  background: var(--bg);
  border: var(--line);
  z-index: 1100;
  animation: slidein 180ms ease-out;
}
@keyframes slidein { from { transform: translateX(16px); opacity: 0; } }
#panel header {
  background: var(--black);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#panel-close {
  background: none;
  border: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
#panel-close:hover { color: #aaa; }
#panel .body { padding: 16px; }
#v-name {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: 24px;
  color: var(--black);
  overflow-wrap: anywhere;
}
.badge-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}
.badge-since { display: flex; flex-direction: column; line-height: 1.15; }
.badge-since .since-l {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--grey);
}
.badge-since .since-d { font-size: 19px; font-weight: 800; color: var(--black); }
.badge {
  display: inline-block;
  margin: 0;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid var(--black);
  color: var(--black);
}
.badge[data-status="sanctioned"] { background: var(--red); border-color: var(--red); color: #fff; }
.badge[data-status="shadow"] { background: #eab308; border-color: #eab308; color: #000; }
.badge[data-status="normal"] { background: var(--bg); }
#v-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  border-top: 1px solid var(--black);
  padding-top: 14px;
}
#v-fields dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 2px;
}
#v-fields dd { font-size: 15px; font-weight: 700; color: var(--black); }
#v-fields .wide { grid-column: 1 / -1; }
.exp { font-size: 13px; color: var(--grey); margin: -4px 0 14px; max-width: 46ch; }
/* Esiletõstetud hoiatus hazard-triibuga (DESIGN.md) */
.v-alert {
  border: 2px solid var(--black);
  border-left: 10px solid var(--black);
  background:
    repeating-linear-gradient(45deg, #000 0 8px, #ffd400 8px 16px) left / 10px 100% no-repeat,
    var(--bg);
  padding: 10px 12px 10px 16px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.35;
}
.v-alert[hidden] { display: none; }

/* Sanktsiooniplokk / omanik / ajalugu */
.sx-box { border: 2px solid var(--black); padding: 12px; margin-bottom: 14px; }
.sx-box.owner { border-style: solid; }
.sx-box.hist { border-width: 1px; }
.sx-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; align-items: baseline; }
.sx-l {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey);
  white-space: nowrap;
}
.sx-v { font-weight: 700; font-size: 14px; text-align: right; }
.sx-why { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--outline-variant, #cfc4c5); }
.sx-prog { font-size: 13px; line-height: 1.5; margin-top: 4px; white-space: pre-line; }
.more-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--black);
  padding: 0 0 1px;
  cursor: pointer;
  color: var(--black);
  white-space: nowrap;
}
.more-btn:hover { background: var(--black); color: #fff; }
#v-sanction { border-color: var(--red); }
#v-sanction .sx-v { color: var(--black); }
.owner-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid var(--outline-variant, #cfc4c5);
}
.owner-row:last-child { border-bottom: 0; }
.owner-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.owner-since { font-family: var(--mono); font-size: 11px; color: var(--grey); white-space: nowrap; }
.rel-left { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rel-role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grey);
}
.hist-note { font-size: 11px; color: var(--grey); margin-top: 8px; line-height: 1.4; }

/* Timeline-log (lipud/nimed): joon vasakul, punktid, praegune esile */
.tl-block + .tl-block { margin-top: 14px; }
.tl {
  border-left: 2px solid var(--black);
  margin: 8px 0 0 5px;
  padding-left: 14px;
}
.tl-item { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; position: relative; }
.tl-dot {
  position: absolute;
  left: -20px;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--black);
  box-sizing: border-box;
}
.tl-item.current .tl-dot { background: var(--black); }
.tl-txt { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.tl-item.current .tl-txt { font-weight: 800; }
.tl-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--black);
  padding: 1px 5px;
  white-space: nowrap;
}
.trackinfo {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--black);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#v-links { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
#v-links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 2px solid var(--black);
  color: var(--black);
  padding: 5px 10px;
  text-decoration: none;
  transition: all 150ms;
}
#v-links a:hover { background: var(--black); color: #fff; }

/* Satelliidivaate juhtpaneel */
#sat-ctl {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  background: var(--bg);
  border: var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  max-width: calc(100vw - 24px);
  flex-wrap: wrap;
  justify-content: center;
}
#sat-ctl[hidden] { display: none; }
#sat-ctl button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  background: none;
  border: 2px solid var(--black);
  color: var(--black);
  padding: 4px 8px;
  cursor: pointer;
}
#sat-ctl button:hover:not(:disabled) { background: var(--black); color: #fff; }
#sat-ctl button:disabled { opacity: 0.3; cursor: default; }
#sat-ctl .sat-lyr.active { background: var(--black); color: #fff; font-weight: 700; }
.sat-date { font-family: var(--mono); font-size: 12px; font-weight: 700; min-width: 84px; text-align: center; }
.sat-sep { width: 1px; height: 18px; background: var(--black); }
.sat-hint { font-family: var(--mono); font-size: 9px; letter-spacing: 0.03em; color: var(--grey); max-width: 200px; }

/* Ajajoone-kerija */
#scrubber {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 24px));
  background: var(--bg);
  border: var(--line);
  z-index: 1080;
  padding: 8px 12px 10px;
}
#scrubber[hidden] { display: none; }
.scrub-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.scrub-name {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scrub-read {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scrub-btn {
  font-family: var(--mono);
  font-size: 12px;
  border: 2px solid var(--black);
  background: var(--bg);
  color: var(--black);
  cursor: pointer;
  padding: 3px 8px;
  flex: none;
}
.scrub-btn:hover { background: var(--black); color: #fff; }
.scrub-range { width: 100%; margin: 2px 0; accent-color: #ba1a1a; }
.scrub-axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--grey);
}
@media (max-width: 640px) {
  /* Ajajoon peab jääma infopaneeli (bottom-sheet) KOHALE ja sellest kõrgemale — muidu
     paneel kattis selle ära ja mobiilis ei saanud teekonda ajaliselt kerida.
     --sheet-h = paneeli tegelik kõrgus, mille seab JS (syncSheetH). */
  #scrubber {
    left: 8px;
    right: 8px;
    width: auto;
    transform: none;
    bottom: calc(var(--sheet-h, 0px) + 8px);
    padding: 6px 10px 8px;
    z-index: 1120;
  }
  .scrub-name { font-size: 12px; max-width: 90px; }
  .scrub-read { font-size: 11px; }
  /* Kui ajajoon on lahti, ei tohi paneel tervet ekraani võtta */
  body.scrubbing #panel { max-height: 46%; }
}

/* Lohistatavad paneelid (töölaual) */
@media (min-width: 641px) {
  #legend-toggle, #panel-head { cursor: grab; touch-action: none; }
  #legend.dragging, #panel.dragging { opacity: 0.92; }
  #legend.dragging #legend-toggle, #panel.dragging #panel-head { cursor: grabbing; }
}

/* --- Ühine navigatsioon (nav.js) --- */
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-burger { display: none; }
.info-btn.active { background: var(--black); color: #fff; }
.nav-more { position: relative; }
.nav-more-btn::after { content: " ▾"; font-size: 9px; }
.nav-drop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  display: none;
  flex-direction: column;
  min-width: 150px;
  background: var(--bg);
  border: 2px solid var(--black);
  z-index: 1400;
}
.nav-more.open .nav-drop { display: flex; }
.nav-drop .info-btn {
  border: 0;
  border-bottom: 1px solid #ddd;
  text-align: left;
  padding: 9px 12px;
}
.nav-drop .info-btn:last-child { border-bottom: 0; }

/* --- Skeleton-laadijad --- */
.sk {
  background: #e6e6e6;
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: sk-shimmer 1.25s infinite;
}
@keyframes sk-shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; margin-bottom: 8px; }
.sk-lines .sk-line:last-child { margin-bottom: 0; }
.sk-title { height: 22px; margin-bottom: 12px; }
.sk-chip { height: 16px; }
.sk-img { width: 100%; aspect-ratio: 1 / 1; border-bottom: 2px solid var(--black); }
.sk-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sk-card { pointer-events: none; }
.sk-card .sk-row:last-child { margin-bottom: 0; }
.sat-card.sk-card { padding: 0; }
.sat-card.sk-card .sk-row { padding: 8px; margin-bottom: 0; }
.sk-tr td { padding: 10px 8px; }
/* Pildid: hoia koht ja näita helendust, kuni päris pilt jõuab kohale */
.sat-card img { background: #e6e6e6; }
@media (prefers-reduced-motion: reduce) {
  .sk::after { animation: none; }
}

/* --- Loo põhinäitajad: suur number + väike silt, mitte mõistetamatu sildi/väärtuse rida --- */
.story-figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0;
  border: 2px solid var(--black);
  margin: 22px 0;
}
.fig {
  padding: 14px 16px;
  border-right: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}
.fig-n {
  display: block;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.fig-u { font-size: 14px; font-weight: 400; color: var(--grey); }
.fig-l {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--grey);
  margin-top: 5px;
}

/* --- Pildivaataja (suumitav/liigutatav) --- */
body.lb-open { overflow: hidden; }
.lb {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
}
.lb[hidden] { display: none; }
.lb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--black);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
}
.lb-cap { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-btn {
  font-family: var(--mono);
  font-size: 13px;
  min-width: 34px;
  height: 30px;
  background: none;
  border: 2px solid #fff;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}
.lb-btn:hover { background: #fff; color: var(--black); }
.lb-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}
.lb-stage:active { cursor: grabbing; }
.lb-img {
  max-width: 96%;
  max-height: 96%;
  image-rendering: pixelated;   /* 10 m piksel: näita ausalt, ära pehmenda välja */
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-src {
  padding: 9px 12px;
  background: var(--black);
  color: #cfcfcf;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.03em;
}
.sat-card img { cursor: zoom-in; }
.sat-src {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--grey);
  letter-spacing: 0.03em;
  margin-top: 3px;
}

/* Tabelite kerimiskast (omanike lehed). Ilma selleta voolas 4-veeruline tabel
   mobiilis üle ekraani ja lükkas kogu lehe laiemaks. */
.f-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.f-wrap .f-table { min-width: 520px; }

/* --- Lood (news) --- */
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.n-card {
  display: block;
  border: 2px solid var(--black);
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  background: var(--bg);
}
.n-card:hover { background: var(--black); color: #fff; }
.n-card:hover .n-dim, .n-card:hover .n-fact { color: #fff; border-color: #fff; }
.n-title { font-size: 20px; margin: 0 0 8px; letter-spacing: -0.01em; }
.n-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.n-badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 700; padding: 2px 6px; background: var(--red); color: #fff;
}
.n-badge[data-kind="shadow"] { background: #eab308; color: var(--black); }
.n-dim { font-family: var(--mono); font-size: 10px; color: var(--grey); }
.n-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.n-fact {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em;
  border: 1px solid var(--grey); padding: 1px 6px;
}
.n-para { line-height: 1.65; margin: 0 0 14px; max-width: 68ch; }
.n-back { display: inline-block; margin-bottom: 16px; }

/* Satelliidipiltide ruudustik aluse profiilil */
.sat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.sat-card { margin: 0; border: 2px solid var(--black); background: var(--bg); }
.sat-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: 2px solid var(--black);
}
.sat-card figcaption {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 6px 8px;
}
.sat-kind {
  background: var(--black);
  color: #fff;
  padding: 1px 5px;
  font-weight: 700;
}
.sat-dim { color: var(--grey); }

/* Omanike profiilid */
.owner-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.owner-link:hover { background: var(--black); color: #fff; text-decoration: none; }
.o-vessels { line-height: 1.7; }
.o-vessels .f-name.sm { font-size: 12px; font-weight: 400; }
/* NB: olemasolev reegel on ".f-name a" (link f-name SEES). Siin on link ISE .f-name,
   seepärast vajab oma reeglit — muidu jäid lingid brauseri siniseks ja lõhkusid mustvalge stiili. */
a.f-name {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a.f-name:hover { background: var(--black); color: #fff; text-decoration: none; }

/* Ajajoone-kerija kokkuvoltimine: jääb alles nimi + kellaaeg + nupud, kaob riba ja teljed */
#scrubber.collapsed .scrub-range, #scrubber.collapsed .scrub-axis { display: none; }
#scrubber.collapsed .scrub-top { margin-bottom: 0; }
.scrub-min { transition: transform 150ms; }
#scrubber.collapsed .scrub-min { transform: rotate(-90deg); }

/* Info-tabi muudatuste logi */
.about-h {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--black);
}
.chlog { list-style: none; margin: 0 0 4px; padding: 0; }
.chlog li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #e2e2e2;
}
.chlog li:last-child { border-bottom: 0; }
.chlog-d {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--grey);
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 74px;
}

/* Paneelide kokkuvoltimine — kaart on peategelane. Paneel kattis 657px laiusel 52% kaardist;
   klikk päisel voldib selle ribaks kokku. Olek püsib localStorage'is. */
#panel header, #feed header { cursor: pointer; user-select: none; }
.hdr-right { display: flex; align-items: center; gap: 10px; }
.hdr-arrow { font-size: 10px; line-height: 1; transition: transform 150ms; }
#panel.collapsed .hdr-arrow, #feed.collapsed .hdr-arrow { transform: rotate(-90deg); }
#panel.collapsed .body, #feed.collapsed #feed-body { display: none; }
#panel.collapsed, #feed.collapsed { max-height: none; overflow: visible; }
/* Kokkuvolditult näita aluse NIME — muidu ei tea kasutaja, kes ribas peidus on */
.hdr-name { display: none; font-weight: 700; letter-spacing: 0.04em; }
#panel.collapsed .hdr-title { display: none; }
#panel.collapsed .hdr-name { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel header { gap: 10px; }

/* Feed panel */
#feed {
  position: absolute;
  top: 16px;
  left: 16px;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100% - 32px);
  background: var(--bg);
  border: var(--line);
  z-index: 1150;
  display: flex;
  flex-direction: column;
  animation: slidein 180ms ease-out;
}
#feed[hidden] { display: none; }
#feed header {
  background: var(--black);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#feed header button { background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; }
#feed-body { overflow: auto; }
.feed-empty {
  padding: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--grey);
  line-height: 1.5;
}
.feed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--outline-variant, #cfc4c5);
  padding: 10px 12px;
  cursor: pointer;
}
.feed-row:hover { background: #eee; }
.feed-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 5px;
  border: 1px solid var(--black);
  white-space: nowrap;
}
.feed-tag[data-type="dark"] { background: #000; color: #fff; }
.feed-tag[data-type="enter"] { background: var(--red); color: #fff; border-color: var(--red); }
.feed-name { flex: 1; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-time { font-family: var(--mono); font-size: 10px; color: var(--grey); white-space: nowrap; }

/* Loader / täisekraani ASCII-hero */
#loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  overflow: hidden;
  transition: opacity 700ms;
  cursor: pointer;
}
#loader.done { opacity: 0; pointer-events: none; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}
.hero-title {
  font-family: Inter, system-ui, sans-serif;
  font-weight: 800;
  /* alampiir 44px ajas pikema teksti ("СЛАВА УКРАЇНІ!") telefonis üle serva */
  font-size: clamp(30px, 9.5vw, 130px);
  max-width: 100%;
  padding: 0 12px;
  box-sizing: border-box;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.35);
  opacity: 0;
  animation: herofade 1.2s ease-out 0.4s forwards;
}
.hero-sub {
  font-family: var(--mono);
  font-size: clamp(10px, 1.6vw, 14px);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #999;
  opacity: 0;
  animation: herofade 1.2s ease-out 0.9s forwards;
}
@keyframes herofade { to { opacity: 1; } }
/* Vene/Valgevene külastajale: Ukraina-solidaarsuse ava (teadlik erand mustvalgest) */
#loader.ua { background: #0057b7; }
#loader.ua .hero-title { color: #ffd700; text-shadow: 0 0 26px rgba(255, 215, 0, 0.45); }
#loader.ua .hero-sub { color: #ffffff; }
#loader.ua #hero-canvas { opacity: 0.16; }
.load-line {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #777;
}
.cursor {
  display: inline-block;
  width: 8px;
  height: 12px;
  background: #fff;
  vertical-align: -2px;
  margin-left: 6px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Live activity ticker */
#ticker {
  display: flex;
  align-items: stretch;
  border-top: var(--line);
  background: var(--bg);
  height: 34px;
  overflow: hidden;
  z-index: 1200;
}
#ticker[hidden] { display: none; }
.ticker-label {
  background: var(--black);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  padding: 0 12px;
  white-space: nowrap;
  flex: none;
}
.ticker-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  margin-right: 7px;
  animation: tickpulse 1.4s ease-in-out infinite;
}
@keyframes tickpulse { 50% { opacity: 0.25; } }
.ticker-view { flex: 1; overflow: hidden; position: relative; }
.ticker-track { display: inline-flex; white-space: nowrap; height: 100%; }
.ticker-track.scroll { animation: ticker-scroll 60s linear infinite; }
.ticker-view:hover .ticker-track.scroll { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  border-right: 1px solid var(--outline-variant, #cfc4c5);
  padding: 0 18px;
  height: 100%;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.ticker-item:hover { background: var(--black); color: #fff; }
.ticker-time { font-family: var(--mono); font-size: 11px; color: var(--grey); }
.ticker-item:hover .ticker-time { color: #bbb; }
.ticker-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 5px;
  border: 1px solid currentColor;
}
.ticker-tag[data-type="dark"] { background: #000; color: #fff; }
.ticker-tag[data-type="enter"] { background: var(--red); color: #fff; border-color: var(--red); }

/* Switch-stiilis lülitid legendis */
#legend .toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 30px;
  height: 16px;
  border: 2px solid var(--black);
  background: var(--bg);
  position: relative;
  cursor: pointer;
  flex: none;
  margin: 0;
  transition: background 150ms;
}
#legend .toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  background: var(--black);
  transition: transform 150ms, background 150ms;
}
#legend .toggle input[type="checkbox"]:checked { background: var(--black); }
#legend .toggle input[type="checkbox"]:checked::after { transform: translateX(14px); background: #fff; }
#legend .toggle input[type="checkbox"]:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Aluste alamleht */
/* Alamlehed kerivad dokumendina; body kõrgus PEAB olema auto, muidu sticky
   jääb 100vh "kasti" lõksu ja lakkab kerimisel toimimast */
.fleet-page {
  display: block;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}
.fleet-page #topbar { position: sticky; top: 0; z-index: 600; }
.fleet-main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  /* MITTE overflow:auto — see looks scroll-konteineri, mis rikub sticky-päised */
}
.fleet-tabs { display: flex; gap: 0; border: 2px solid var(--black); width: fit-content; }
.fleet-tab {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 18px;
  background: var(--bg);
  border: 0;
  cursor: pointer;
  color: var(--black);
}
.fleet-tab + .fleet-tab { border-left: 2px solid var(--black); }
.fleet-tab.active { background: var(--black); color: #fff; font-weight: 700; }
.fleet-note { font-size: 13px; color: var(--grey); margin: 14px 0 18px; max-width: 72ch; }
/* NB: overflow-x tohib olla ainult mobiilis — muidu tekib scroll-konteiner,
   mis püüab sticky-päiserea lõksu ega lase tal viewporti külge kleepuda */
.fleet-wrap { border: 2px solid var(--black); }
.fleet-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fleet-table th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  background: var(--black);
  color: #fff;
  padding: 8px 10px;
  position: sticky;
  top: 58px; /* kleepub kohe sticky-topbari alla */
  z-index: 10;
}
.fleet-table td { padding: 7px 10px; border-bottom: 1px solid var(--outline-variant, #cfc4c5); }
.fleet-table tr:hover td { background: #ececec; }
.f-name { font-weight: 700; }
.f-live {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 2px solid var(--red);
  color: var(--red);
  padding: 2px 7px;
  text-decoration: none;
  white-space: nowrap;
}
.f-live:hover { background: var(--red); color: #fff; }
.fleet-count { font-family: var(--mono); font-size: 11px; color: var(--grey); margin-top: 12px; }

/* Statistikaleht */
.stat-cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.stat-card {
  border: 2px solid var(--black);
  padding: 16px 22px;
  min-width: 150px;
  flex: 1;
  max-width: 240px;
}
.stat-n { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.stat-l {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--grey);
  margin-top: 8px;
}
.stat-sec { margin-bottom: 26px; }
.stat-h {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--black);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.stat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 130px; }
.bar-col { flex: 1; max-width: 46px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.bar { background: var(--black); width: 100%; }
.bar-l {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--grey);
  text-align: center;
  margin-top: 4px;
  overflow: hidden;
  white-space: nowrap;
}
.rank { display: flex; flex-direction: column; gap: 6px; }
.rank-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.3fr) 1fr auto;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  padding: 2px 0;
}
a.rank-row:hover .rank-label { text-decoration: underline; }
.rank-label { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { height: 10px; background: #e4e4e4; border: 1px solid var(--black); }
.rank-fill { height: 100%; background: var(--black); }
.rank-n { font-family: var(--mono); font-size: 12px; font-weight: 700; min-width: 28px; text-align: right; }
.rank-empty { font-size: 12px; color: var(--grey); font-style: italic; }

/* Aluse profiilileht */
.p-name {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: clamp(30px, 5vw, 46px);
  margin-bottom: 6px;
}
.p-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-top: 18px; }
@media (max-width: 800px) { .p-grid { grid-template-columns: 1fr; } }
.p-dl { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 18px; }
.p-dl dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 2px;
}
.p-dl dd { font-size: 17px; font-weight: 700; }
.p-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.p-links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 2px solid var(--black);
  color: var(--black);
  padding: 6px 10px;
  text-decoration: none;
  transition: all 150ms;
}
.p-links a:hover { background: var(--black); color: #fff; }
.f-live.big { font-size: 12px; padding: 5px 12px; }
.f-name a { color: var(--ink); }

/* Profiili teekonna replay */
.p-sec-h {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--black);
  padding-bottom: 6px;
  margin: 28px 0 8px;
}
.p-sec-note { font-size: 13px; color: var(--grey); margin-bottom: 12px; max-width: 74ch; }
#rmap { height: 400px; border: 2px solid var(--black); background: #e8e8e8; }
#rmap .leaflet-tile { filter: grayscale(1) contrast(1.02); }
#rmap.rsat .leaflet-tile { filter: none; }
#rmap .leaflet-container, #rmap { font-family: var(--mono); }
.rctl { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.rctl .scrub-range { flex: 1; min-width: 160px; }
.rctl .scrub-read { flex: none; min-width: 150px; }
.r-satlabel {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.r-satlabel input { accent-color: var(--black); }
.rsat-when { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { #rmap { height: 300px; } .rctl .scrub-read { min-width: 0; } }

/* Viibimislogi (klikitavad read) */
.fleet-table tr.has-log { cursor: pointer; }
.fleet-table tr.has-log .f-name::after {
  content: "▸";
  font-family: var(--mono);
  font-size: 10px;
  margin-left: 8px;
  color: var(--grey);
}
.fleet-table tr.has-log.open .f-name::after { content: "▾"; color: var(--black); }
.fleet-table tr.has-log .f-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
tr.log-row td { background: #efefef; border-bottom: 2px solid var(--black); padding: 12px 14px; }
.log-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 8px;
}
.log-list { display: flex; flex-direction: column; gap: 4px; }
.log-entry {
  font-family: var(--mono);
  font-size: 12px;
  border-left: 3px solid var(--black);
  padding-left: 10px;
}
.log-entry.current { font-weight: 700; border-left-color: var(--red); }
.log-note { font-size: 11px; color: var(--grey); margin-top: 10px; font-style: italic; }
.mt-note { font-size: 11px; color: var(--grey); margin-top: 6px; font-style: italic; }

/* Footer */
#foot {
  border-top: var(--line);
  background: var(--bg);
  padding: 6px 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  z-index: 1200;
}
#foot .mono {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--grey);
}
#foot .src { margin-left: auto; }

/* Tahvel / kitsas töölaud: topbar ei tohi üle voolata */
@media (max-width: 1020px) {
  .tagline { display: none; }
  .search input { width: 180px; }
  .info-btn { padding: 6px 9px; font-size: 11px; }
}

@media (max-width: 640px) {
  /* MOBIILIMENÜÜ: bränd + keel + ☰ ühel real, otsing teisel. Kõik lingid peituvad
     ☰ taha — varem võttis menüü kolm rida ja sõi kaardilt ~115 px. */
  #topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 6px 10px;
    gap: 6px 8px;
    align-items: center;
  }
  .brand { font-size: 16px; }
  .tagline { display: none; }
  .nav-burger {
    display: block;
    order: 3;
    margin-left: auto;
    background: var(--black);
    color: #fff;
    border: 0;
    font-size: 16px;
    line-height: 1;
    padding: 7px 11px;
    cursor: pointer;
  }
  .langs { order: 2; margin-left: auto; }
  .nav-burger + .nav-links { margin-left: 0; }
  .nav-links {
    order: 5;
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 2px solid var(--black);
    margin-top: 4px;
  }
  #topbar.open .nav-links { display: flex; }
  .nav-links .info-btn {
    border: 0;
    border-bottom: 1px solid #ddd;
    text-align: left;
    padding: 11px 4px;      /* mugav puutesihtmärk */
    font-size: 12px;
  }
  .nav-links .info-btn:last-child { border-bottom: 0; }
  /* Mobiilis pole ripploendil mõtet — ☰ sees on niikuinii loetelu */
  .nav-more { position: static; }
  .nav-more-btn { display: none; }
  .nav-drop {
    position: static; display: flex; border: 0; min-width: 0;
    border-top: 1px solid #ddd;
  }
  .search { order: 4; flex-basis: 100%; margin-left: 0; }
  .search input { width: 100%; padding: 7px 9px; }
  #search-results { max-height: 240px; }

  /* Legend: kokkuvolditav, üleval-vasakul (ei põrku alumise paneeliga) */
  #legend {
    top: 8px;
    bottom: auto;
    left: 8px;
    right: 8px;
    max-width: none;   /* mobiilis annavad laiuse left/right; töölaua 280px piir venitaks kasti */
    padding: 0;
    gap: 4px;
    max-height: 70vh;
    overflow: auto;
    font-size: 10px;
  }
  .legend-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    background: var(--black);
    color: #fff;
    border: 0;
    padding: 8px 12px;
    cursor: pointer;
    position: sticky;
    top: 0;
  }
  #legend.collapsed { border: 2px solid var(--black); }
  #legend.collapsed > *:not(.legend-toggle) { display: none; }
  #legend:not(.collapsed) { padding-bottom: 8px; }
  #legend .row, #legend .toggle { margin-left: 10px; margin-right: 10px; }
  #legend .row, #legend .toggle { font-size: 10px; }

  /* Ajajoone-kerija TÖÖTAB nüüd ka mobiilis: paneelipõrge on lahendatud (--sheet-h
     hoiab kerija täpselt bottom-sheeti kohal, z-index 1120 > paneeli 1100). */

  /* Valitud aluse paneel = alumine leht */
  #panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: auto;
    max-width: none;
    max-height: 60%;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  /* Sündmuste voog täislaiuses */
  #feed {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    max-height: 65%;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  #ticker { height: 30px; }
  .ticker-item { font-size: 12px; padding: 0 12px; }
  #foot { padding: 5px 10px; gap: 4px 10px; }
  #foot .mono { font-size: 9px; }
  #foot .src { display: none; }
  #foot .updated, #foot #updated { margin-left: auto; }

  /* Satelliidi juhtpaneel mobiilis */
  #sat-ctl { top: 8px; padding: 5px 8px; gap: 6px; }
  #sat-ctl button { padding: 3px 6px; font-size: 10px; }
  .sat-date { font-size: 11px; min-width: 72px; }
  .sat-hint { flex-basis: 100%; text-align: center; max-width: none; }
  .sat-sep { display: none; }

  /* Aluste alamleht mobiilis */
  .fleet-main { padding: 14px 8px 30px; }
  .fleet-wrap { overflow-x: auto; }
  .fleet-table th { top: 0; }
  .fleet-tabs { width: 100%; }
  .fleet-tab { flex: 1; padding: 8px 6px; font-size: 10px; }
  .fleet-table { font-size: 12px; }
  .fleet-table th, .fleet-table td { padding: 6px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  #panel { animation: none; }
  .pulse-ring { animation: none; }
  .waves { animation: none; }
  .track-anim { animation: none; }
  .ticker-track.scroll { animation: none; }
  .ticker-label::before { animation: none; }
}
