/* Heliograph — design tokens
   Palette: deep-indigo night sky; four domain accents that encode meaning on the map and in badges
   (sun/x-ray = chromosphere orange, aurora = oxygen green, geomagnetic = violet, radio = amber).
   Chart series use the validated categorical slots (--s1..--s6), never the accents. */
:root {
  --bg: #0a0e17;
  --panel: #111726;
  --panel-2: #171f31;
  --panel-3: #1e2840;
  --line: rgba(170, 190, 230, 0.12);
  --line-2: rgba(170, 190, 230, 0.24);
  --ink: #e9edf5;
  --ink-2: #a3aec6;
  --ink-3: #6b778f;

  --sun: #ff8a3d;
  --aurora: #5ce8a5;
  --geo: #b79cff;
  --radio: #ffd166;
  --wind: #5fb2ff;

  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9;

  --ok: #0ca30c; --warn: #fab219; --serious: #ec835a; --crit: #d03b3b; --extreme: #b04fd6;

  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, 'Courier New', monospace;

  --radius: 12px;
  --rail-w: 400px;
  --top-h: 56px;
  --tl-h: 104px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: var(--wind); }
button { font: inherit; color: inherit; cursor: pointer; }
h2, h3 { margin: 0; font-weight: 600; }
h2 { font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); margin: 18px 0 8px; }
.h3-note { text-transform: none; letter-spacing: 0; color: var(--ink-3); font-weight: 400; margin-left: 6px; }

#app {
  display: grid;
  grid-template-rows: var(--top-h) 1fr var(--tl-h);
  height: 100%;
}

/* ---------- top bar ---------- */
#topbar {
  display: grid;
  grid-template-columns: auto minmax(200px, 320px) 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand-mark { position: relative; display: inline-block; width: 22px; height: 22px; align-self: center; }
.brand-disc {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #ffd9a8 0%, var(--sun) 45%, #b3361e 100%);
  box-shadow: 0 0 14px 2px rgba(255, 138, 61, 0.45);
}
.brand-name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand-tag { color: var(--ink-3); font-size: 12px; }

.search { position: relative; display: flex; align-items: center; gap: 6px; }
.search input {
  flex: 1; min-width: 0;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font: inherit; outline: none;
}
.search input:focus { border-color: var(--line-2); box-shadow: 0 0 0 3px rgba(95, 178, 255, 0.18); }
.search button {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); display: grid; place-items: center; color: var(--ink-2);
}
.search button:hover { color: var(--ink); border-color: var(--line-2); }
.search-results {
  position: absolute; top: 40px; left: 0; right: 0;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px;
  max-height: 280px; overflow: auto; z-index: 50; box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}
.search-results[hidden] { display: none; }
.search-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.search-item:last-child { border-bottom: 0; }
.search-item:hover, .search-item.is-active { background: var(--panel-3); }
.search-item small { display: block; color: var(--ink-3); }

.now-strip { display: flex; gap: 4px; overflow: hidden; align-items: center; min-width: 0; }
.ns-item {
  display: flex; flex-direction: column; padding: 4px 10px; border-radius: 8px;
  cursor: pointer; white-space: nowrap; border: 1px solid transparent;
}
.ns-item:hover { background: var(--panel-2); border-color: var(--line); }
.ns-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.ns-value { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.ns-value .unit { color: var(--ink-3); font-size: 11px; margin-left: 2px; }
.ns-scales { display: flex; gap: 4px; margin-right: 6px; }
.scale-badge {
  font-family: var(--mono); font-weight: 500; font-size: 12px; padding: 3px 7px; border-radius: 6px;
  background: var(--panel-3); color: var(--ink-2); border: 1px solid var(--line);
}
.scale-badge.lv1 { background: rgba(250,178,25,0.18); color: var(--warn); border-color: rgba(250,178,25,0.4); }
.scale-badge.lv2 { background: rgba(236,131,90,0.2); color: var(--serious); border-color: rgba(236,131,90,0.45); }
.scale-badge.lv3 { background: rgba(208,59,59,0.22); color: #ff7b7b; border-color: rgba(208,59,59,0.5); }
.scale-badge.lv4 { background: rgba(208,59,59,0.35); color: #ffb3b3; border-color: rgba(208,59,59,0.7); }
.scale-badge.lv5 { background: rgba(176,79,214,0.3); color: #e6b3ff; border-color: rgba(176,79,214,0.6); }

.top-right { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 3px rgba(107,119,143,0.2); }
.status-dot.ok { background: var(--aurora); box-shadow: 0 0 0 3px rgba(92,232,165,0.2); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(250,178,25,0.2); }
.status-dot.err { background: var(--crit); box-shadow: 0 0 0 3px rgba(208,59,59,0.2); }
.status-text { font-size: 11px; color: var(--ink-3); }
.btn-rail { display: none; }

/* ---------- main ---------- */
#main { display: grid; grid-template-columns: 1fr var(--rail-w); min-height: 0; }
#map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #070a12; z-index: 0; }
.leaflet-container { font-family: var(--body); }
.leaflet-control-attribution { background: rgba(10,14,23,0.7) !important; color: var(--ink-3) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.leaflet-bar a { background: var(--panel-2) !important; color: var(--ink) !important; border-bottom-color: var(--line) !important; }
.leaflet-bar a:hover { background: var(--panel-3) !important; }
.leaflet-bar { border: 1px solid var(--line-2) !important; box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important; }
.hg-overlay { image-rendering: auto; }
.hg-overlay-crisp { image-rendering: pixelated; }

.loc-marker { position: relative; width: 22px; height: 22px; }
.loc-marker::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--sun); box-shadow: 0 0 0 2px rgba(10,14,23,0.7), 0 0 18px rgba(255,138,61,0.7);
  animation: pulse 2.4s ease-out infinite;
}
.loc-marker::after {
  content: ''; position: absolute; left: 7px; top: 7px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 0 2px rgba(10,14,23,0.85);
}
@keyframes pulse { 0% { transform: scale(0.7); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .loc-marker::before { animation: none; } }

#layer-rail {
  position: absolute; top: 12px; left: 12px; z-index: 20;
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(17,23,38,0.88); backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 6px;
}
.layer-btn {
  display: flex; align-items: center; gap: 8px; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  padding: 6px 10px 6px 8px; color: var(--ink-2); font-size: 13px;
}
.layer-btn:hover { background: var(--panel-3); color: var(--ink); }
.layer-btn.is-on { background: var(--panel-3); color: var(--ink); border-color: var(--line); }
.swatch { width: 10px; height: 10px; border-radius: 3px; opacity: 0.45; }
.is-on .swatch { opacity: 1; }
.sw-aurora { background: var(--aurora); box-shadow: 0 0 8px var(--aurora); }
.sw-radio { background: var(--radio); box-shadow: 0 0 8px var(--radio); }
.sw-night { background: #2b3a66; }
.sw-geo { background: var(--geo); box-shadow: 0 0 8px var(--geo); }
.sw-quake { background: #ff5a3c; border-radius: 50%; box-shadow: 0 0 8px #ff5a3c; }
.sw-iss { background: #e9edf5; box-shadow: 0 0 8px #e9edf5; }
.legend-dots { display: inline-flex; gap: 3px; align-items: center; width: 28px; }
.legend-dots i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.iss-marker { width: 18px; height: 18px; position: relative; }
.iss-marker::before { content: ''; position: absolute; left: 6px; top: 6px; width: 6px; height: 6px; background: #e9edf5; box-shadow: 0 0 10px 2px rgba(233,237,245,0.8); }
.iss-marker::after { content: ''; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: rgba(233,237,245,0.8); }
.iss-marker.lit::before { background: #fff4c2; box-shadow: 0 0 12px 3px rgba(255,244,194,0.9); }
.leaflet-popup-content-wrapper { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; }
.leaflet-popup-tip { background: var(--panel-2); }
.leaflet-popup-content a { color: var(--wind); }
.pill.mag-s { color: var(--ink-2); }
.pill.mag-m { background: rgba(255,138,61,0.2); color: var(--sun); }
.pill.mag-l { background: rgba(236,131,90,0.28); color: #ffb58f; }
.pill.mag-x { background: rgba(208,59,59,0.35); color: #ffb3b3; }
.row > span:first-child + span { min-width: 0; }
#base-select {
  margin-top: 4px; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 8px; font: inherit; font-size: 12px;
}

.map-legend {
  position: absolute; left: 12px; bottom: 28px; z-index: 20;
  background: rgba(17,23,38,0.88); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 11px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px;
}
.map-legend:empty { display: none; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-bar { width: 120px; height: 8px; border-radius: 4px; }
.legend-title { font-weight: 600; color: var(--ink); }
.legend-line { width: 28px; height: 0; border-top: 2px dashed var(--geo); }

.map-time {
  position: absolute; right: 12px; top: 12px; z-index: 20;
  background: rgba(17,23,38,0.88); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
}
.map-time.is-scrub { color: var(--geo); border-color: rgba(183,156,255,0.5); }
.map-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 20;
  background: rgba(17,23,38,0.85); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; color: var(--ink-2); pointer-events: none;
  transition: opacity 0.6s;
}
.map-hint.is-hidden { opacity: 0; }

/* ---------- rail ---------- */
#rail {
  overflow-y: auto; overflow-x: hidden; background: var(--bg);
  border-left: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 16px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-sub { font-size: 11px; color: var(--ink-3); text-align: right; }

.card-local { border-color: rgba(183,156,255,0.22); background: linear-gradient(180deg, #151c30 0%, var(--panel) 60%); }
.card-sun { border-color: rgba(255,138,61,0.3); background: linear-gradient(180deg, #1a1526 0%, var(--panel) 55%); }

/* flare headline */
.headline { margin: 2px 0 12px; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.headline strong { display: block; font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; line-height: 1.1; }
.headline span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.headline.tone-crit { border-color: rgba(208,59,59,0.55); background: linear-gradient(90deg, rgba(208,59,59,0.22), var(--panel-2)); }
.headline.tone-crit strong { color: #ff8a8a; }
.headline.tone-warn { border-color: rgba(255,138,61,0.5); background: linear-gradient(90deg, rgba(255,138,61,0.18), var(--panel-2)); }
.headline.tone-warn strong { color: var(--sun); }
.headline.tone-sun strong { color: var(--radio); }
.headline.tone-muted strong { color: var(--ink); }
.headline .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff5a3c; margin-right: 8px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(255,90,60,0.25); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .headline .live-dot { animation: none; } }

/* frame player (animated products) */
.img-player { position: relative; }
.player {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 8px; padding: 22px 8px 6px;
  background: linear-gradient(transparent, rgba(10,14,23,0.88) 45%); font-size: 11px; color: var(--ink-2);
}
.player button {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); flex: none;
  background: rgba(17,23,38,0.92); color: var(--ink); display: grid; place-items: center; font-size: 11px;
}
.player button:hover { border-color: var(--sun); color: var(--sun); }
.player input[type=range] { flex: 1; min-width: 0; accent-color: var(--sun); height: 4px; }
.player .p-label { font-family: var(--mono); white-space: nowrap; }
.player .p-live { width: auto; border-radius: 6px; padding: 0 8px; font-size: 11px; }
.is-playing .p-live { color: var(--sun); border-color: rgba(255,138,61,0.5); }
.sun-img-wrap { margin-bottom: 8px; }
.local-hero { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 8px; }
#tonight-dial { width: 300px; height: 300px; max-width: 100%; }
.tonight-text { text-align: center; font-size: 13px; color: var(--ink-2); }
.tonight-text strong { color: var(--ink); font-family: var(--display); font-size: 16px; font-weight: 700; display: block; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; min-width: 0;
}
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; line-height: 1.15; margin-top: 2px; white-space: nowrap; }
.stat-value.stat-long { font-size: 15px; white-space: normal; line-height: 1.25; min-height: 25px; }
.stat-value .unit { font-family: var(--body); font-size: 11px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }
.stat-note { font-size: 11px; color: var(--ink-2); margin-top: 2px; line-height: 1.3; }
.stat.wide { grid-column: span 3; }
.stat.tone-sun .stat-value { color: var(--sun); }
.stat.tone-aurora .stat-value { color: var(--aurora); }
.stat.tone-geo .stat-value { color: var(--geo); }
.stat.tone-radio .stat-value { color: var(--radio); }
.stat.tone-wind .stat-value { color: var(--wind); }
.stat.tone-warn .stat-value { color: var(--warn); }
.stat.tone-crit .stat-value { color: #ff7b7b; }
.stat.tone-muted .stat-value { color: var(--ink-2); }

.chart { position: relative; width: 100%; }
.chart-sm { height: 140px; }
.chart-md { height: 190px; }
.chart canvas { position: absolute; inset: 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; margin-top: 10px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12.5px; }
.kv dd.soft { font-family: var(--body); color: var(--ink-2); }

.list { display: flex; flex-direction: column; gap: 4px; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; }
.row .mono { font-family: var(--mono); color: var(--ink-2); }
.pill { font-family: var(--mono); font-weight: 500; font-size: 12px; padding: 2px 7px; border-radius: 5px; background: var(--panel-3); border: 1px solid var(--line); }
.pill.cls-X { background: rgba(208,59,59,0.3); color: #ffb3b3; }
.pill.cls-M { background: rgba(255,138,61,0.25); color: var(--sun); }
.pill.cls-C { background: rgba(250,178,25,0.18); color: var(--radio); }
.pill.cls-B, .pill.cls-A { color: var(--ink-2); }
.pill.k-ALERT, .pill.k-WARNING, .pill.k-EXTENDED { background: rgba(208,59,59,0.25); color: #ffb3b3; }
.pill.k-WATCH { background: rgba(250,178,25,0.2); color: var(--radio); }
.pill.k-SUMMARY { color: var(--ink-2); }
.pill.k-CANCEL { color: var(--ink-3); }
.alert { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.alert-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); }
.alert-title { font-size: 13px; }
.alert details { font-size: 12px; color: var(--ink-2); }
.alert summary { cursor: pointer; color: var(--ink-3); }
.alert pre { white-space: pre-wrap; font-family: var(--mono); font-size: 11px; margin: 6px 0 0; color: var(--ink-2); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink-3); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
td.num { font-family: var(--mono); text-align: right; }
th.num { text-align: right; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tab { background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; font-size: 12px; color: var(--ink-2); }
.tab:hover { color: var(--ink); border-color: var(--line-2); }
.tab.is-on { background: var(--panel-3); color: var(--ink); border-color: var(--line-2); }
.sun-img-wrap { position: relative; width: 100%; aspect-ratio: 1; background: #000; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.sun-img-wrap img, .sun-img-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sun-img-wrap canvas { pointer-events: none; }
.sun-img-wrap.ratio-wide { aspect-ratio: 850 / 475; }
.caption { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.img-wrap { border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.img-wrap img { display: block; width: 100%; height: auto; }

.moon-wrap { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.moon-wrap canvas { width: 120px; height: 120px; }
.moon-wrap .kv { margin-top: 0; font-size: 12px; gap: 3px 8px; }
.moon-wrap .kv dd { font-size: 12px; white-space: nowrap; }

.prose { font-size: 13px; color: var(--ink-2); }
.prose h4 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.prose p { margin: 0 0 8px; }
.prose .fc { color: var(--ink); }
.ch-note { background: rgba(92,232,165,0.08); border: 1px solid rgba(92,232,165,0.25); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin-top: 8px; }
.ch-note.none { background: var(--panel-2); border-color: var(--line); color: var(--ink-2); }

.outlook-table td.kp { font-family: var(--mono); }
.kp-cell { display: inline-block; min-width: 36px; text-align: center; border-radius: 4px; padding: 1px 4px; }

.rail-foot { font-size: 11px; color: var(--ink-3); padding: 4px 4px 20px; }

.empty { color: var(--ink-3); font-size: 12.5px; padding: 6px 0; }
.muted { color: var(--ink-3); }

/* ---------- timeline ---------- */
#timeline-wrap { background: var(--panel); border-top: 1px solid var(--line); padding: 6px 14px 8px; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.tl-head { display: flex; align-items: center; gap: 10px; }
.tl-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.tl-sub { font-size: 11px; color: var(--ink-3); flex: 1; }
.btn-now { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; font-size: 12px; color: var(--ink-2); }
.btn-now.is-on { color: var(--geo); border-color: rgba(183,156,255,0.5); }
.timeline { position: relative; flex: 1; display: flex; align-items: flex-end; gap: 2px; min-height: 56px; }
.tl-day { position: absolute; top: 0; font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; border-left: 1px solid var(--line-2); padding-left: 4px; height: 100%; pointer-events: none; }
.tl-slot { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: pointer; border-radius: 3px; position: relative; }
.tl-slot:hover { background: rgba(255,255,255,0.04); }
.tl-bar { width: 100%; border-radius: 3px 3px 0 0; min-height: 2px; opacity: 0.9; transition: height 0.2s; }
.tl-slot.predicted .tl-bar { opacity: 0.55; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.18) 0 3px, transparent 3px 6px); }
.tl-slot.is-sel { background: rgba(183,156,255,0.16); outline: 1px solid rgba(183,156,255,0.6); }
.tl-slot.is-now::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--sun); }
.tl-slot .tl-val { position: absolute; top: 0; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 10px; color: var(--ink-3); opacity: 0; }
.tl-slot:hover .tl-val, .tl-slot.is-sel .tl-val { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --rail-w: 360px; }
  .brand-tag { display: none; }
}
@media (max-width: 900px) {
  #topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 0 10px; }
  #topbar > * { min-width: 0; }
  .brand { gap: 6px; }
  .brand-name { font-size: 17px; }
  .search input { min-width: 0; width: 100%; }
  .now-strip { display: none; }
  .status-text { display: none; }
  .top-right { gap: 6px; }
  .btn-rail { display: inline-block; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .btn-rail.is-open { color: var(--sun); border-color: rgba(255,138,61,0.5); }
}
@media (max-width: 520px) {
  .brand-name { display: none; }
  #topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .search input { padding: 7px 8px; font-size: 13px; }
  .search button { width: 30px; height: 30px; }
  #layer-rail { gap: 3px; padding: 4px; }
  .layer-btn { padding: 5px 7px; font-size: 11px; }
  #base-select { font-size: 11px; padding: 4px 6px; }
  #main { grid-template-columns: 1fr; position: relative; overflow: hidden; }
  .leaflet-control-zoom { display: none; }
  .map-time { font-size: 11px; padding: 4px 8px; }
  #rail {
    position: absolute; inset: 0; z-index: 25; transform: translateY(100%); transition: transform 0.3s ease;
    background: rgba(10,14,23,0.97); border-left: 0;
  }
  #rail.is-open { transform: translateY(0); }
  #layer-rail { flex-direction: row; flex-wrap: wrap; top: auto; bottom: 12px; left: 12px; right: 12px; }
  .layer-btn { padding: 6px 8px; font-size: 12px; }
  .map-legend { display: none; }
  .map-hint { bottom: 70px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat.wide { grid-column: span 2; }
}

/* ---------- embed mode (?embed=1): map + layer controls only, used by the alert.vegas homepage hero ---------- */
html.embed #topbar, html.embed #rail, html.embed #timeline-wrap, html.embed .btn-rail { display: none !important; }
html.embed #app { grid-template-rows: 1fr; }
html.embed #main { grid-template-columns: 1fr; }
html.embed #map-hint { display: none; }
