:root {
  --bg: #070b12;
  --panel: #0d1520;
  --panel-on: #172434;
  --line: #1a2531;
  --line-on: #2b3a4a;
  --text: #eef4f8;
  --soft: #b8c6d2;
  --muted: #9fb0bf;
  --quake: #ffb020;
  --strong: #ff6b5b;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--text); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--quake); outline-offset: 2px; }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -.01em;
}
.status { margin: 0 0 0 auto; font-size: 14px; color: var(--soft); }
.status.live::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: #4be08a;
}
.status.bad { color: var(--strong); }

.layout { flex: 1; display: flex; flex-wrap: wrap; align-items: stretch; }
.rail {
  flex: 1 1 260px;
  max-width: 340px;
  padding: 36px 0 28px 32px;
}
h1 { margin: 0; font-size: 44px; line-height: 1.05; letter-spacing: -.02em; }
.lead { margin: 16px 0 28px; font-size: 16px; line-height: 1.5; color: var(--soft); }
.rail h2 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.layers { display: flex; flex-direction: column; gap: 6px; }
.layer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  width: 100%;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
.layer.on { background: #121c28; border-color: var(--line-on); color: var(--text); }
.layer small { margin-left: auto; font-size: 13px; font-weight: 400; }
.dot { flex: 0 0 11px; height: 11px; border-radius: 50%; background: #3a4754; }
.layer.on .dot.quake { background: var(--quake); }
.home {
  margin-top: 14px;
  min-height: 44px;
  padding: 0 14px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--line-on);
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
}
.home:hover { background: var(--panel); }

.stage {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 12px;
}
.globebox {
  position: relative;
  width: 100%;
  max-width: 860px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  scroll-margin-top: 12px;
}
.globebox canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#globe { touch-action: none; cursor: grab; }
.controls {
  position: absolute;
  z-index: 3;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.controls button {
  pointer-events: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  background: rgba(13, 21, 32, .86);
  border: 1px solid var(--line-on);
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
}
.controls button:not(.wide) { font-size: 22px; line-height: 1; }
.controls button:hover { background: var(--panel-on); }
.controls button.on { background: var(--quake); border-color: var(--quake); color: #1d1200; }
.loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: auto;
  height: 1.5em;
  text-align: center;
  color: var(--soft);
  pointer-events: none;
}
body.fullglobe { overflow: hidden; }
body.fullglobe .globebox { position: fixed; inset: 0; z-index: 50; max-width: none; aspect-ratio: auto; background: #03060b; }
.stage { flex-direction: column; align-items: center !important; justify-content: flex-start !important; }
/* On a desktop the globe fits the window and stays in view while the side columns scroll. */
@media (min-width: 1101px) {
  .stage { position: sticky; top: 0; align-self: flex-start; }
  /* The map fills the whole space between the columns, so a zoomed-in globe is not cut off in a square. */
  .globebox { max-width: none; width: 100%; aspect-ratio: auto; height: calc(100vh - 150px); min-height: 420px; }
  .timebar { max-width: min(860px, calc(100vh - 150px)); }
  body.fullglobe .globebox { width: auto; height: auto; min-height: 0; }
  body.fullglobe .timebar { max-width: none; }
  .rail, .feed { flex: 0 0 330px !important; max-width: 330px !important; }  /* equal columns keep the globe centred on the page */
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 14px;
  color: var(--muted);
}
.chip.on { background: var(--quake); border-color: var(--quake); color: #1d1200; font-weight: 600; }
.chip:hover:not(.on) { color: var(--text); border-color: var(--line-on); }
.timebar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 860px;
  padding: 10px 4px 0;
}
.timebar button {
  flex: 0 0 44px;
  height: 44px;
  background: var(--panel);
  border: 1px solid var(--line-on);
  border-radius: 6px;
  font-size: 16px;
}
.timebar input { flex: 1; min-width: 0; height: 44px; accent-color: var(--quake); }
.timebar span { flex: 0 0 auto; min-width: 118px; font-size: 14px; font-weight: 500; text-align: right; }
.legend {
  position: absolute;
  z-index: 3;
  left: 10px;
  top: 10px;
  width: 210px;
  padding: 8px 10px;
  background: rgba(13, 21, 32, .86);
  border: 1px solid var(--line-on);
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
}
.radartime {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 10px;
  background: rgba(13, 21, 32, .86);
  border: 1px solid var(--line-on);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
body.stream .radartime { top: 16vh; font-size: 2.2vh; }
@media (max-width: 600px) { .radartime { top: auto; bottom: 112px; } }
.legend p { margin: 0 0 5px; font-size: 13px; font-weight: 600; }
.lbar { height: 10px; border-radius: 3px; }
.lticks { display: flex; justify-content: space-between; margin-top: 3px; color: var(--soft); font-variant-numeric: tabular-nums; }
.point {
  position: absolute;
  z-index: 4;
  right: 10px;
  top: 10px;
  width: 236px;
  max-height: calc(100% - 76px);
  overflow-y: auto;
  padding: 10px 12px;
  background: rgba(13, 21, 32, .94);
  border: 1px solid var(--line-on);
  border-radius: 6px;
  font-size: 13px;
}
.point h3 { margin: 0 26px 2px 0; font-size: 14px; }
.point .ptime { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.point .ptemp { margin: 0 0 6px; font-size: 30px; font-weight: 700; line-height: 1.1; }
.point dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 0; }
.point dt { color: var(--soft); }
.point dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
.point .close { position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; background: transparent; border: 0; font-size: 20px; color: var(--soft); }
body.stream .timebar, body.stream .legend, body.stream .point { display: none !important; }
body.fullglobe .timebar { position: fixed; z-index: 60; left: 50%; bottom: 64px; transform: translateX(-50%); width: min(720px, 94vw); padding: 6px 10px; background: rgba(13, 21, 32, .9); border-radius: 8px; }
@media (max-width: 600px) { .legend { width: 160px; } .point { width: 200px; } }
.lang { display: flex; gap: 2px; }
.lang button {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.lang button.on { border-color: var(--line-on); background: #121c28; color: var(--text); }
body.stream .lang { display: none; }
.topnav { display: flex; gap: 20px; font-size: 15px; }
.topnav a { padding: 12px 0; color: var(--soft); text-decoration: none; }
.topnav a:hover { color: var(--text); }

.forecast { padding: 32px; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.fhead { max-width: 900px; }
.fkicker { margin: 0; font-size: 14px; font-weight: 600; color: var(--quake); }
.forecast h2 { margin: 8px 0 0; font-size: 32px; line-height: 1.15; letter-spacing: -.01em; }
.fissued { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.ftext { margin: 14px 0 0; font-size: 17px; line-height: 1.55; color: var(--soft); }
.fdays { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 24px; }
.fday { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.fday h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--soft); }
.fday p { margin: 0; }
.fdtitle { margin-top: 4px !important; font-size: 16px; font-weight: 600; line-height: 1.3; }
.fdtemp { margin-top: 10px !important; font-size: 16px; color: var(--muted); }
.fdtemp b { font-size: 32px; color: var(--text); }
.fdmeta { margin-top: 3px !important; font-size: 14px; color: var(--soft); }
.fdtext { margin-top: 10px !important; font-size: 14px; line-height: 1.5; color: var(--soft); }
.fconf { margin-top: 10px !important; font-size: 13px; font-weight: 600; }
.c-high { color: #4be08a; }
.c-medium { color: #ffd23f; }
.c-low { color: #ff9a2e; }
.fdmodels { margin-top: 10px; font-size: 13px; color: var(--soft); }
.fdmodels summary, .fwhy summary { cursor: pointer; min-height: 32px; padding: 6px 0; }
.fdmodels table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fdmodels th { text-align: left; color: var(--muted); font-weight: 500; }
.fdmodels td, .fdmodels th { padding: 3px 4px 3px 0; }
.dec { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.dec h2 { font-size: 26px; }
.dintro { margin: 10px 0 0; max-width: 820px; font-size: 16px; line-height: 1.55; color: var(--soft); }
.dtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-top: 18px; }
.dtile { padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.dtile b { display: block; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dtile span { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; line-height: 1.3; }
.dtile small { display: block; margin-top: 4px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.dtable { margin-top: 16px; overflow-x: auto; }
.dtable table { border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--soft); }
.dtable th { text-align: left; font-weight: 500; color: var(--muted); }
.dtable th, .dtable td { padding: 6px 18px 6px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable td:first-child { font-weight: 600; color: var(--text); }
.fwhy { margin-top: 20px; max-width: 900px; color: var(--soft); font-size: 15px; line-height: 1.55; }
.fmodels { font-size: 14px; color: var(--muted); }
.fnote { margin: 18px 0 0; font-size: 13px; color: var(--muted); }
[hidden] { display: none !important; }
#globe.drag { cursor: grabbing; }

.feed { flex: 1 1 320px; max-width: 380px; padding: 36px 32px 28px 0; }
.feedtitle { margin: 0; font-size: 24px; }
.summary { margin: 6px 0 16px; font-size: 14px; line-height: 1.45; color: var(--soft); }
.events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.event {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.event:hover { background: var(--panel-on); }
.event.sel { background: var(--panel-on); border-color: var(--quake); }
.mag {
  flex: 0 0 44px;
  font-size: 19px;
  font-weight: 700;
  color: var(--quake);
  font-variant-numeric: tabular-nums;
}
.mag.strong { color: var(--strong); }
.place { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; font-weight: 500; }
.ago { font-size: 13px; color: var(--muted); white-space: nowrap; }

.bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 28px;
  padding: 14px 32px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.bottom a { color: var(--soft); }

.rail h2.second { margin-top: 22px; }
.tabs { display: flex; gap: 6px; margin-top: 12px; }
.tab {
  flex: 1;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}
.tab.on { background: #121c28; border-color: var(--line-on); color: var(--text); }
.summary { margin-top: 12px; }
.events { max-height: 640px; overflow-y: auto; }
.place b { display: block; font-size: 14px; font-weight: 600; }
.place small { display: block; font-size: 13px; color: var(--soft); font-weight: 400; }
.mark { flex: 0 0 44px; display: flex; align-items: center; }
.mark i { display: block; width: 13px; height: 13px; border-radius: 50%; margin-left: 4px; }
.cities { display: grid; gap: 4px; margin-bottom: 14px; }
.cities[hidden] { display: none; }
.city {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 12px;
  background: var(--panel);
  border-radius: 6px;
  font-size: 14px;
}
.city span { flex: 0 0 96px; font-weight: 600; }
.city small { flex: 1; color: var(--soft); font-size: 13px; }
.city b { font-size: 16px; font-variant-numeric: tabular-nums; }
.livebadge, .clock, .focus, .bnl, .ticker { display: none; }

/* 24/7 broadcast view: restlessglobe.com/?stream=1 at 1920x1080 */
body.stream { overflow: hidden; height: 100vh; min-height: 0; }
body.stream .rail, body.stream .feed, body.stream .bottom, body.stream .status, body.stream .topnav, body.stream .controls, body.stream .forecast { display: none !important; }
body.stream .top { position: absolute; z-index: 3; left: 0; right: 0; top: 0; border: 0; padding: 3vh 2.5vw; }
body.stream .brand { font-size: 3.6vh; }
body.stream .brand svg { width: 5vh; height: 5vh; }
body.stream .livebadge {
  display: inline-block;
  margin-left: 1vh;
  padding: .5vh 1.3vh;
  background: #ff5247;
  color: #1b0705;
  font-style: normal;
  font-size: 2vh;
  border-radius: .6vh;
}
body.stream .clock {
  display: block;
  margin: 0 0 0 auto;
  font-size: 3.6vh;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
body.stream .layout { display: block; }
body.stream .stage { position: absolute; left: 2vw; top: -9vh; padding: 0; display: block; }
body.stream .globebox { width: 122vh; height: 122vh; max-width: none; aspect-ratio: auto; }
body.stream #globe { cursor: default; }
body.stream .focus, body.stream .bnl {
  display: block;
  position: absolute;
  z-index: 2;
  right: 2.5vw;
  width: 27vw;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1vh;
  padding: 2.4vh 2vw;
}
body.stream .focus { top: 12vh; border-color: var(--quake); }
body.stream .focus p, body.stream .bnl p { margin: 0; }
.fkick { font-size: 2.2vh; font-weight: 600; color: var(--quake); }
.fbig { margin-top: .8vh !important; font-size: 6vh; font-weight: 700; line-height: 1.1; }
.fplace { margin-top: 1vh !important; font-size: 2.9vh; font-weight: 600; line-height: 1.25; }
.fwhen { margin-top: .6vh !important; font-size: 2.3vh; color: var(--soft); }
body.stream .bnl { top: 53vh; }
.bh { font-size: 2.2vh; font-weight: 600; color: var(--muted); }
.bw { margin: .6vh 0 1.2vh !important; font-size: 3vh; font-weight: 600; }
.br { display: flex; justify-content: space-between; font-size: 2.5vh; padding: .35vh 0; }
.br b { font-variant-numeric: tabular-nums; }
body.stream .ticker {
  display: flex;
  align-items: center;
  gap: 2vw;
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8vh;
  padding: 0 2.5vw;
  background: var(--panel);
  border-top: 1px solid var(--line-on);
  overflow: hidden;
  font-size: 2.6vh;
}
.tbox { flex: 1; min-width: 0; overflow: hidden; }
.tmove { display: inline-block; white-space: pre; animation: rgticker 120s linear infinite; }
.turl { font-weight: 700; white-space: nowrap; }
@keyframes rgticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (max-width: 1100px) {
  .layout { justify-content: center; }
  .stage { order: -1; flex-basis: 100%; }
  .rail, .feed { max-width: none; padding: 20px 32px; }
}
@media (max-width: 600px) {
  .top, .bottom { padding-left: 16px; padding-right: 16px; }
  .status { margin-left: 0; width: 100%; }
  .stage { padding: 4px; }
  .rail, .feed { flex-basis: 100%; padding: 16px; }
  h1 { font-size: 36px; }
}
