:root {
  --bg: #071017;
  --panel: rgba(7, 18, 27, 0.78);
  --panel-strong: rgba(6, 16, 25, 0.93);
  --line: rgba(255,255,255,0.10);
  --line-soft: rgba(255,255,255,0.06);
  --text: #f5f7f9;
  --muted: #a9b6c0;
  --cyan: #55e4ff;
  --cyan-2: #1da7d7;
  --orange: #ff9b4a;
  --red: #ff4f5e;
  --green: #65e6a6;
  --shadow: 0 16px 50px rgba(0,0,0,0.38);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.app-shell { position: relative; width: 100vw; height: 100dvh; overflow: hidden; background: #061019; }
.map { position: absolute; inset: 0; }
.maplibregl-canvas { filter: saturate(.98) brightness(1.02) contrast(1.01); }
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { opacity: .72; }
.maplibregl-ctrl-attrib {
  background: rgba(4,12,18,.72) !important;
  color: #b9c4cc !important;
  border-radius: 8px 0 0 0;
}
.maplibregl-ctrl-attrib a { color: #dce4e9 !important; }

.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 52% 42%, transparent 32%, rgba(2,9,15,.02) 64%, rgba(2,7,12,.16) 100%),
    linear-gradient(to bottom, rgba(5,12,18,.12), transparent 18%, transparent 82%, rgba(5,12,18,.22));
  z-index: 2;
}
.scanline {
  position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: .035;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 100% 4px;
  mix-blend-mode: overlay;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.topbar {
  position: absolute;
  z-index: 20;
  top: 18px; left: 18px; right: 18px;
  min-height: 78px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 12px 16px;
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark {
  width: 46px; height: 46px; flex: 0 0 auto;
  border: 1px solid rgba(85,228,255,.32);
  border-radius: 50%;
  position: relative;
  display: grid; place-items: center;
  background: radial-gradient(circle, rgba(85,228,255,.18), rgba(85,228,255,.02) 60%);
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; border: 1px solid rgba(85,228,255,.28); border-radius: 50%;
}
.brand-mark::before { inset: 7px; }
.brand-mark::after { inset: 14px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }

.eyebrow {
  display: block;
  color: #8ba3b2;
  font-weight: 700;
  letter-spacing: .15em;
  font-size: 10px;
  line-height: 1.3;
}
.brand h1, .panel-section h2, .timeline-head h2 {
  margin: 2px 0 0;
  font-size: 17px;
  letter-spacing: -.02em;
}
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.top-actions { display: flex; align-items: center; gap: 9px; }
.status-pill {
  height: 38px; border: 1px solid var(--line-soft); border-radius: 999px;
  padding: 0 13px; display: flex; align-items: center; gap: 8px;
  color: #c8d3da; background: rgba(255,255,255,.035); font-size: 12px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--orange);
  box-shadow: 0 0 12px rgba(255,155,74,.7);
}
.status-pill.ok .status-dot { background: var(--green); box-shadow: 0 0 12px rgba(101,230,166,.7); }
.status-pill.warn .status-dot { background: var(--orange); }
.status-pill.error .status-dot { background: var(--red); box-shadow: 0 0 12px rgba(255,79,94,.65); }

.icon-btn {
  height: 38px; min-width: 42px; padding: 0 11px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.045);
  cursor: pointer; font-weight: 800;
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.icon-btn:hover { background: rgba(255,255,255,.10); border-color: rgba(85,228,255,.32); transform: translateY(-1px); }
.icon-btn[aria-pressed="true"] { color: var(--cyan); }

.left-panel {
  position: absolute; z-index: 15;
  left: 18px; top: 110px; bottom: 156px;
  width: 314px; overflow-y: auto; overflow-x: hidden;
  border-radius: var(--radius);
  transition: width .28s ease, transform .28s ease;
}
.left-panel.collapsed { transform: translateX(calc(-100% - 26px)); }
.panel-section { padding: 17px; border-bottom: 1px solid var(--line-soft); }
.panel-section:last-child { border-bottom: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading.compact { align-items: center; margin-bottom: 10px; }
.collapse-btn {
  width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 9px;
  background: rgba(255,255,255,.035); cursor: pointer; font-size: 20px; line-height: 1;
}
.left-panel.collapsed + * {}
#magOutput { color: var(--cyan); font-weight: 800; font-size: 14px; }

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi {
  min-height: 88px; padding: 11px 12px;
  border: 1px solid var(--line-soft); border-radius: 13px;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
}
.kpi-label { display: block; color: #8ea1ad; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.kpi strong { display: block; font-size: 25px; line-height: 1.1; margin: 6px 0 3px; letter-spacing: -.04em; }
.kpi small { display: block; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.range { width: 100%; accent-color: var(--cyan); }
.range-scale { display: flex; justify-content: space-between; color: #718795; font-size: 10px; margin-top: 4px; }

.layer-list { display: grid; gap: 8px; margin-top: 10px; }
.layer-toggle {
  min-height: 42px; padding: 0 11px; border-radius: 11px; border: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255,255,255,.025);
}
.layer-toggle > span { display: flex; align-items: center; gap: 9px; color: #d4dde3; font-size: 12px; }
.layer-toggle input { accent-color: var(--cyan); width: 16px; height: 16px; }
.legend { width: 12px; height: 12px; display: inline-block; }
.legend.earthquake { border-radius: 50%; background: var(--orange); box-shadow: 0 0 10px rgba(255,155,74,.75); }
.legend.fault { height: 3px; border-radius: 3px; background: var(--red); }
.legend.geology { border-radius: 3px; background: linear-gradient(135deg,#f0cb86,#889d8b); }

.note-card { display: flex; align-items: flex-start; gap: 10px; color: #9eb0bb; font-size: 11px; line-height: 1.5; }
.note-card p { margin: 0; }
.note-icon {
  width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(85,228,255,.30); color: var(--cyan); font-weight: 800;
}

.inspector {
  position: absolute; z-index: 16;
  right: 18px; top: 110px; width: 286px;
  padding: 19px; border-radius: var(--radius);
  transform: translateX(calc(100% + 28px));
  opacity: 0;
}
.inspector.open { pointer-events: auto; }
.close-inspector {
  position: absolute; right: 11px; top: 10px; width: 30px; height: 30px;
  border: 0; background: transparent; color: #93a7b4; cursor: pointer; font-size: 22px;
}
.magnitude-orb {
  width: 116px; height: 116px; margin: 19px auto;
  border-radius: 50%; display: grid; place-items: center; align-content: center;
  background: radial-gradient(circle, rgba(255,155,74,.25), rgba(255,79,94,.06) 56%, transparent 58%);
  border: 1px solid rgba(255,155,74,.40);
  box-shadow: inset 0 0 28px rgba(255,155,74,.08), 0 0 34px rgba(255,105,72,.13);
  position: relative;
}
.magnitude-orb::before, .magnitude-orb::after {
  content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,155,74,.25);
}
.magnitude-orb::before { inset: 9px; }
.magnitude-orb::after { inset: 22px; }
.magnitude-orb span { color: #d8b89b; font-size: 11px; z-index: 1; }
.magnitude-orb strong { font-size: 38px; line-height: 1; z-index: 1; letter-spacing: -.06em; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-grid > div, .event-id {
  border: 1px solid var(--line-soft); border-radius: 11px; padding: 10px;
  background: rgba(255,255,255,.025); min-width: 0;
}
.detail-grid span, .event-id span { display: block; color: #8095a2; font-size: 9px; text-transform: uppercase; letter-spacing: .09em; margin-bottom: 4px; }
.detail-grid strong { display: block; font-size: 12px; line-height: 1.3; }
.event-id { margin-top: 8px; }
.event-id code { display: block; color: #c7d3da; font-size: 10px; word-break: break-all; }
.primary-btn {
  width: 100%; margin-top: 12px; height: 42px; border-radius: 11px; cursor: pointer;
  border: 1px solid rgba(85,228,255,.28); color: #d9fbff;
  background: linear-gradient(135deg, rgba(34,174,210,.25), rgba(18,104,144,.24));
}

.timeline-shell {
  position: absolute; z-index: 14;
  left: 348px; right: 18px; bottom: 18px;
  height: 124px; border-radius: var(--radius);
  padding: 13px 14px 12px;
  overflow: hidden;
}
.timeline-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 12px; }
.timeline-head h2 { font-size: 14px; }
.play-btn {
  height: 32px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); cursor: pointer; padding: 0 11px;
  display: inline-flex; gap: 7px; align-items: center; font-size: 11px;
}
.play-btn.playing { color: var(--cyan); border-color: rgba(85,228,255,.30); }
.play-icon { font-size: 9px; }

.timeline {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
  padding-bottom: 7px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent;
}
.timeline-empty { color: #8195a1; font-size: 11px; padding: 8px 2px; }
.event-chip {
  flex: 0 0 auto; min-width: 122px; height: 49px;
  border: 1px solid var(--line-soft); background: rgba(255,255,255,.026);
  border-radius: 11px; cursor: pointer; padding: 7px 9px;
  display: grid; grid-template-columns: 36px 1fr; gap: 7px; text-align: left;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.event-chip:hover { background: rgba(255,255,255,.07); transform: translateY(-1px); }
.event-chip.active { border-color: rgba(255,155,74,.62); background: rgba(255,119,69,.09); }
.event-mag {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(255,155,74,.35), rgba(255,79,94,.08));
  border: 1px solid rgba(255,155,74,.35); font-weight: 800; font-size: 12px;
}
.event-meta { min-width: 0; align-self: center; }
.event-meta strong, .event-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-meta strong { font-size: 10px; color: #e5ebef; }
.event-meta span { font-size: 9px; color: #8297a4; margin-top: 2px; }

.map-hint {
  position: absolute; z-index: 12; right: 18px; bottom: 151px;
  border-radius: 999px; padding: 7px 12px; color: #91a4af; font-size: 10px;
  box-shadow: 0 8px 25px rgba(0,0,0,.24);
}
.sep { opacity: .35; margin: 0 5px; }

.noscript {
  position: fixed; inset: 20px; z-index: 99; padding: 20px; border-radius: 16px;
  background: #121c24; color: white; border: 1px solid rgba(255,255,255,.12);
}

@media (max-width: 980px) {
  .left-panel { width: 276px; bottom: 148px; }
  .timeline-shell { left: 310px; }
  .inspector { width: 260px; }
  .status-pill { display: none; }
}

@media (max-width: 760px) {
  .topbar { top: 10px; left: 10px; right: 10px; min-height: 68px; }
  .brand-mark { width: 39px; height: 39px; }
  .brand h1 { font-size: 15px; }
  .brand p { display: none; }
  .left-panel {
    left: 10px; top: 88px; bottom: 142px; width: min(286px, calc(100vw - 20px));
  }
  .left-panel:not(.collapsed) { transform: translateX(0); }
  .timeline-shell { left: 10px; right: 10px; bottom: 10px; height: 122px; }
  .inspector { top: 88px; right: 10px; width: min(286px, calc(100vw - 20px)); }
  .map-hint { display: none; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 430px) {
  .top-actions .icon-btn:first-of-type { display: none; }
  .brand .eyebrow { font-size: 9px; }
  .timeline-head .eyebrow { display: none; }
  .timeline-head h2 { margin: 0; }
}

.legend.ring {
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: transparent;
  box-shadow: 0 0 9px rgba(85,228,255,.45);
}


.builder-credit {
  display: block;
  margin-top: 4px;
  max-width: 560px;
  color: #8fa3af;
  font-size: 9px;
  line-height: 1.35;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.nav-btn {
  color: #d4dde3;
}

.magnitude-legend {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mag-legend-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
}

.mag-legend-row > span:last-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.mag-legend-row strong {
  font-size: 11px;
  font-weight: 750;
}

.mag-legend-row small {
  color: #8296a2;
  font-size: 9px;
}

.mag-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px currentColor;
}
.mag-low  { background: #ffad4f; color: #ffad4f; }
.mag-mid  { background: #ff7a4c; color: #ff7a4c; }
.mag-high { background: #ff4f5e; color: #ff4f5e; }

.met-credit p {
  margin: 7px 0 2px;
  font-size: 13px;
}
.met-credit small {
  display: block;
  color: #93a7b3;
  line-height: 1.45;
  font-size: 10px;
}

@media (max-width: 760px) {
  .builder-credit { display: none; }
  .timeline-controls { gap: 5px; }
  .nav-btn span:nth-child(2) { display: none; }
  .nav-btn { min-width: 32px; padding: 0 9px; }
}


/* v2.0 — integrated news chronology */
.inspector {
  max-height: calc(100dvh - 284px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}

.source-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 10px 0 8px;
}
.source-secondary { margin-top: 0 !important; }

.related-news-block {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}
.related-news-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.related-news-head > strong {
  min-width: 23px;
  height: 23px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(85,228,255,.08);
  border: 1px solid rgba(85,228,255,.18);
  font-size: 10px;
}
.related-news-list {
  display: grid;
  gap: 7px;
}
.related-news-empty {
  color: #8195a1;
  font-size: 10px;
  line-height: 1.45;
  padding: 5px 0;
}
.related-news-item {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,.025);
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  text-align: left;
}
.related-news-item strong,
.related-news-item small {
  display: block;
}
.related-news-item strong {
  font-size: 10px;
  line-height: 1.35;
  color: #e6edf1;
}
.related-news-item small {
  margin-top: 4px;
  color: #8095a2;
  font-size: 9px;
}
.related-news-item:hover {
  background: rgba(255,255,255,.055);
  border-color: rgba(85,228,255,.18);
}

.news-inspector-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 10px;
}
.source-badge,
.official-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
}
.source-badge.source-jmg {
  color: #8cf1ff;
  border-color: rgba(85,228,255,.26);
  background: rgba(85,228,255,.08);
}
.source-badge.source-met {
  color: #93edbd;
  border-color: rgba(101,230,166,.25);
  background: rgba(101,230,166,.08);
}
.source-badge.source-gov {
  color: #ffd38e;
  border-color: rgba(255,155,74,.25);
  background: rgba(255,155,74,.08);
}
.source-badge.source-media {
  color: #cbd7de;
  background: rgba(255,255,255,.04);
}
.official-badge {
  color: #b9c7cf;
  background: rgba(255,255,255,.035);
}
.official-badge.verified {
  color: var(--green);
  border-color: rgba(101,230,166,.23);
  background: rgba(101,230,166,.07);
}
.news-inspector-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.news-inspector-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 8px;
  color: #8195a1;
  font-size: 10px;
}
.news-inspector-summary {
  color: #b8c5cd;
  font-size: 11px;
  line-height: 1.58;
  margin: 14px 0 0;
}
.news-linked-event {
  margin-top: 14px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255,255,255,.025);
}
.linked-event-btn {
  width: 100%;
  margin-top: 7px;
  min-height: 36px;
  border: 1px solid rgba(255,155,74,.20);
  border-radius: 9px;
  color: #f4dcc8;
  background: rgba(255,155,74,.06);
  cursor: pointer;
  font-size: 10px;
}
.link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.timeline-shell {
  height: 148px;
}
.timeline {
  align-items: stretch;
}
.event-chip,
.news-chip {
  flex: 0 0 auto;
  height: 63px;
}
.event-chip {
  min-width: 132px;
}
.news-chip {
  min-width: 190px;
  max-width: 230px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,.026);
  border-radius: 11px;
  cursor: pointer;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  text-align: left;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.news-chip:hover {
  background: rgba(255,255,255,.065);
  transform: translateY(-1px);
}
.news-chip.active {
  border-color: rgba(85,228,255,.50);
  background: rgba(85,228,255,.075);
}
.news-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  align-self: center;
  border: 1px solid rgba(85,228,255,.18);
  background: rgba(85,228,255,.07);
  color: var(--cyan);
  font-size: 15px;
}
.news-chip.source-met .news-icon {
  color: var(--green);
  border-color: rgba(101,230,166,.20);
  background: rgba(101,230,166,.07);
}
.news-chip.source-gov .news-icon {
  color: var(--orange);
  border-color: rgba(255,155,74,.20);
  background: rgba(255,155,74,.07);
}
.news-chip.source-media .news-icon {
  color: #c0ccd3;
  border-color: rgba(255,255,255,.11);
  background: rgba(255,255,255,.035);
}
.news-chip-meta {
  min-width: 0;
  align-self: center;
}
.news-chip-meta strong,
.news-chip-meta span,
.news-chip-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-chip-meta strong {
  color: #e7edf1;
  font-size: 10px;
}
.news-chip-meta span {
  color: #a7bac5;
  font-size: 9px;
  margin-top: 2px;
}
.news-chip-meta small {
  color: #718793;
  font-size: 8px;
  margin-top: 2px;
}
.timeline-type-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  color: #7f949f;
  font-size: 9px;
}
.timeline-type-key i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.timeline-type-key .quake-key { background: var(--orange); }
.timeline-type-key .news-key { background: var(--cyan); }

.map-hint {
  bottom: 175px;
}

@media (max-width: 980px) {
  .left-panel { bottom: 172px; }
}

@media (max-width: 760px) {
  .left-panel { bottom: 166px; }
  .timeline-shell { height: 146px; }
  .inspector { max-height: calc(100dvh - 260px); }
  .news-chip { min-width: 174px; }
}


/* =========================================================
   v2.1 — clean non-overlapping UI
   ========================================================= */

/* Header is intentionally minimal. */
.brand > div:last-child > .eyebrow,
.brand > div:last-child > p {
  display: none !important;
}

.brand h1 {
  margin: 0;
}

.top-actions {
  flex-wrap: nowrap;
}

.summary-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: #d7e2e8;
  cursor: pointer;
  font-weight: 700;
  font-size: 11px;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.summary-btn:hover,
.summary-btn[aria-expanded="true"] {
  background: rgba(85,228,255,.08);
  border-color: rgba(85,228,255,.30);
  color: var(--cyan);
}

/* Status pill removed from the header in v2.1. */
.status-pill {
  display: none !important;
}

/*
 * Timeline gets its own dedicated bottom band.
 * Summary and inspector end above this band, so panels never sit on top
 * of the chronology.
 */
.timeline-shell {
  left: 18px !important;
  right: 18px !important;
  bottom: 18px !important;
  height: 148px !important;
  z-index: 15;
}

/* Right-side summary drawer. Hidden by default. */
.left-panel {
  left: auto !important;
  right: 18px !important;
  top: 110px !important;
  bottom: 184px !important;
  width: 314px !important;
  max-height: none !important;
  transform: translateX(0);
  transition: transform .3s ease, opacity .25s ease;
  z-index: 18;
}

.left-panel.collapsed {
  transform: translateX(calc(100% + 28px)) !important;
  opacity: 0;
  pointer-events: none;
}

/* Detail/news inspector uses the same reserved right drawer area. */
.inspector {
  right: 18px !important;
  top: 110px !important;
  bottom: 184px !important;
  width: 314px !important;
  max-height: none !important;
  height: auto;
  z-index: 19;
}

/* Keep map helper above the chronology, not underneath any panel. */
.map-hint {
  bottom: 178px !important;
  right: 18px !important;
}

/* No panel should cover another panel. */
.left-panel,
.inspector,
.timeline-shell,
.topbar {
  isolation: isolate;
}

@media (max-width: 980px) {
  .timeline-shell {
    left: 12px !important;
    right: 12px !important;
  }

  .left-panel,
  .inspector {
    right: 12px !important;
    width: min(314px, calc(100vw - 24px)) !important;
    bottom: 178px !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .summary-btn {
    min-width: 42px;
    padding: 0 10px;
  }

  .summary-btn span {
    display: none;
  }

  .summary-btn::before {
    content: "☰";
    font-size: 16px;
  }

  .timeline-shell {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    height: 146px !important;
  }

  .left-panel,
  .inspector {
    top: 88px !important;
    right: 10px !important;
    bottom: 166px !important;
    width: min(314px, calc(100vw - 20px)) !important;
  }

  .map-hint {
    display: none !important;
  }
}


/* =========================================================
   v2.2 — fixed Ringkasan + ON/OFF Kronologi + numbered quakes
   ========================================================= */

/* Keep Ringkasan on the LEFT and visible by default. */
.left-panel {
  left: 18px !important;
  right: auto !important;
  top: 110px !important;
  bottom: 184px !important;
  width: 314px !important;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 18;
  transition: transform .28s ease, opacity .22s ease;
}

.left-panel.collapsed {
  transform: translateX(calc(-100% - 30px)) !important;
  opacity: 0;
  pointer-events: none;
}

/* A slim handle remains when Ringkasan is hidden. */
.summary-edge-btn {
  position: absolute;
  z-index: 20;
  left: 8px;
  top: 126px;
  width: 32px;
  height: 54px;
  display: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0 12px 12px 0;
  background: rgba(7,18,27,.90);
  color: var(--cyan);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 22px;
}

body.summary-collapsed .summary-edge-btn {
  display: grid;
}

/* Inspector stays right; no overlap with left summary. */
.inspector {
  left: auto !important;
  right: 18px !important;
  top: 110px !important;
  bottom: 184px !important;
  width: 314px !important;
  height: auto;
  z-index: 19;
}

/* Chronology has a reserved lower band and can be completely hidden. */
.timeline-shell {
  left: 348px !important;
  right: 18px !important;
  bottom: 18px !important;
  height: 148px !important;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 16;
  transition: transform .30s ease, opacity .24s ease;
}

body.summary-collapsed .timeline-shell {
  left: 18px !important;
}

.timeline-shell.timeline-hidden {
  transform: translateY(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
}

.chronology-toggle[aria-expanded="true"] {
  color: var(--cyan);
  border-color: rgba(85,228,255,.32);
  background: rgba(85,228,255,.07);
}

.chronology-close {
  min-width: 32px;
  width: 32px;
  padding: 0;
  font-size: 17px;
}

/* Timeline group divider. */
.timeline-section-divider {
  flex: 0 0 auto;
  min-width: 92px;
  height: 54px;
  border-radius: 11px;
  border: 1px dashed rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  padding: 7px 9px;
  color: #8ea3af;
  background: rgba(255,255,255,.018);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

/* GEMPA: stronger orange treatment, numbered. */
.event-chip.event-earthquake {
  position: relative;
  min-width: 154px;
  height: 56px;
  grid-template-columns: 42px 1fr;
  border-color: rgba(255,155,74,.34);
  background: linear-gradient(145deg, rgba(255,155,74,.13), rgba(255,255,255,.025));
  box-shadow:
    inset 3px 0 0 rgba(255,155,74,.78),
    0 5px 16px rgba(0,0,0,.14);
}

.event-chip.event-earthquake:hover,
.event-chip.event-earthquake.active {
  border-color: rgba(255,155,74,.78);
  background: linear-gradient(145deg, rgba(255,155,74,.22), rgba(255,255,255,.05));
}

.quake-sequence {
  position: absolute;
  left: 3px;
  top: 3px;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f6f7f8;
  color: #18222a;
  border: 1px solid rgba(255,255,255,.9);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  z-index: 2;
}

.event-chip.event-earthquake .event-mag {
  width: 38px;
  height: 38px;
  margin-left: 3px;
  font-size: 13px;
}

/* BERITA / KENYATAAN: cyan rectangular card, source-led. */
.news-chip.event-news {
  min-width: 196px;
  height: 56px;
  border-color: rgba(85,228,255,.22);
  background: linear-gradient(145deg, rgba(85,228,255,.07), rgba(255,255,255,.018));
  box-shadow:
    inset 3px 0 0 rgba(85,228,255,.48),
    0 5px 16px rgba(0,0,0,.12);
}

.news-chip.event-news:hover,
.news-chip.event-news.active {
  border-color: rgba(85,228,255,.56);
  background: linear-gradient(145deg, rgba(85,228,255,.12), rgba(255,255,255,.04));
}

.event-kind {
  display: block;
  margin-top: 1px;
  color: #718893;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.map-hint {
  bottom: 178px !important;
}

@media (max-width: 980px) {
  .left-panel {
    left: 12px !important;
    width: 286px !important;
  }

  .timeline-shell {
    left: 310px !important;
    right: 12px !important;
  }

  body.summary-collapsed .timeline-shell {
    left: 12px !important;
  }

  .inspector {
    right: 12px !important;
    width: 286px !important;
  }
}

@media (max-width: 760px) {
  .left-panel {
    left: 10px !important;
    right: auto !important;
    top: 88px !important;
    bottom: 166px !important;
    width: min(286px, calc(100vw - 20px)) !important;
  }

  .summary-edge-btn {
    left: 0;
    top: 102px;
  }

  .inspector {
    right: 10px !important;
    top: 88px !important;
    bottom: 166px !important;
    width: min(286px, calc(100vw - 20px)) !important;
  }

  .timeline-shell,
  body.summary-collapsed .timeline-shell {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    height: 146px !important;
  }

  .chronology-toggle span {
    display: none;
  }

  .chronology-toggle::before {
    content: "◫";
    font-size: 15px;
  }
}


/* =========================================================
   v2.3 — panel interaction + opacity fix
   ========================================================= */

/* Ensure visible panels are solid enough and clickable. */
.left-panel,
.timeline-shell {
  background: rgba(7, 18, 27, 0.94) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  backdrop-filter: blur(18px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(125%) !important;
}

.left-panel:not(.collapsed) {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.timeline-shell:not(.timeline-hidden) {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

/* Keep hidden states truly hidden. */
.left-panel.collapsed {
  pointer-events: none !important;
}

.timeline-shell.timeline-hidden {
  pointer-events: none !important;
}

/* Make all controls inside visible panels clickable. */
.left-panel:not(.collapsed) button,
.left-panel:not(.collapsed) input,
.left-panel:not(.collapsed) label,
.timeline-shell:not(.timeline-hidden) button,
.timeline-shell:not(.timeline-hidden) [tabindex] {
  pointer-events: auto !important;
}

/* Remove the thick side accent from earthquake cards. */
.event-chip.event-earthquake {
  box-shadow: 0 5px 16px rgba(0,0,0,.14) !important;
  border: 1px solid rgba(255,155,74,.34) !important;
}

.event-chip.event-earthquake:hover,
.event-chip.event-earthquake.active {
  border: 1px solid rgba(255,155,74,.72) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.16) !important;
}


/* =========================================================
   v2.4 — interleaved chronology + MyGEMS lithology
   ========================================================= */

/* No thick side accents on either card type. */
.event-chip.event-earthquake,
.news-chip.event-news {
  box-shadow: 0 4px 14px rgba(0,0,0,.13) !important;
  border-width: 1px !important;
  border-style: solid !important;
}

.event-chip.event-earthquake {
  grid-template-columns: 28px 40px 1fr !important;
  min-width: 174px !important;
  padding: 7px 9px !important;
  border-color: rgba(255,155,74,.34) !important;
}

.event-chip.event-earthquake:hover,
.event-chip.event-earthquake.active {
  border-color: rgba(255,155,74,.65) !important;
  box-shadow: 0 5px 16px rgba(0,0,0,.16) !important;
}

/* Number is its own column and never overlaps magnitude. */
.quake-sequence {
  position: static !important;
  width: 26px !important;
  min-width: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  align-self: center;
  border-radius: 8px !important;
  background: rgba(255,255,255,.08) !important;
  color: #dbe4e9 !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: none !important;
  font-size: 9px !important;
}

.event-chip.event-earthquake .event-mag {
  margin-left: 0 !important;
}

/* News cards: no icon column, no thick border. */
.news-chip.event-news {
  grid-template-columns: 1fr !important;
  min-width: 210px !important;
  padding: 8px 10px !important;
  border-color: rgba(85,228,255,.20) !important;
}

.news-chip.event-news:hover,
.news-chip.event-news.active {
  border-color: rgba(85,228,255,.48) !important;
  box-shadow: 0 5px 16px rgba(0,0,0,.15) !important;
}

.news-chip .news-chip-meta {
  min-width: 0;
}

/* Chronology is one continuous interleaved flow: no section divider. */
.timeline-section-divider {
  display: none !important;
}

.timeline-type-key {
  display: none !important;
}

/* Replace X with subtle chevron collapse control. */
.chronology-collapse {
  min-width: 32px;
  width: 32px;
  padding: 0;
  font-size: 15px;
}

/* Reopen chronology from a small bottom tab, not the top bar. */
.chronology-edge-btn {
  position: absolute;
  z-index: 17;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  min-width: 92px;
  height: 28px;
  padding: 0 13px;
  display: none;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: rgba(7,18,27,.94);
  color: #c8d6dd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  cursor: pointer;
  box-shadow: 0 -4px 16px rgba(0,0,0,.18);
}

body.chronology-collapsed .chronology-edge-btn {
  display: grid;
}

/* MyGEMS lithology legend. */
.legend.lithology {
  border-radius: 3px;
  background:
    linear-gradient(135deg,
      rgba(150,105,220,.9) 0 33%,
      rgba(219,159,88,.9) 33% 66%,
      rgba(90,166,132,.9) 66%);
  border: 1px solid rgba(255,255,255,.18);
}

/* Keep visible panels solid/clickable. */
.left-panel:not(.collapsed),
.timeline-shell:not(.timeline-hidden) {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.left-panel,
.timeline-shell {
  background: rgba(7,18,27,.94) !important;
}


/* =========================================================
   v2.9 — MyGEMS opacity + faults + cleaner chronology cards
   ========================================================= */

/* Chronology stays permanently visible; no hide/reopen affordance. */
.chronology-collapse,
.chronology-edge-btn {
  display: none !important;
}

/* Remove bottom category labels from both earthquake and news cards. */
.event-kind {
  display: none !important;
}

/* Remove heavy card treatment. */
.event-chip.event-earthquake,
.news-chip.event-news {
  border-width: 1px !important;
  box-shadow: 0 3px 12px rgba(0,0,0,.10) !important;
}

/* Keep quake number away from magnitude. */
.event-chip.event-earthquake {
  grid-template-columns: 28px 40px 1fr !important;
  min-width: 178px !important;
  padding: 7px 9px !important;
}
.quake-sequence {
  position: static !important;
  width: 26px !important;
  min-width: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  align-self: center;
  border-radius: 8px !important;
  background: rgba(255,255,255,.065) !important;
  color: #dce6eb !important;
  border: 1px solid rgba(255,255,255,.11) !important;
  box-shadow: none !important;
}
.event-chip.event-earthquake .event-mag {
  margin-left: 0 !important;
}

/* News has no icon column and remains visually distinct without thick borders. */
.news-chip.event-news {
  grid-template-columns: 1fr !important;
  min-width: 210px !important;
  padding: 8px 10px !important;
  border-color: rgba(85,228,255,.20) !important;
  box-shadow: 0 3px 12px rgba(0,0,0,.10) !important;
}
.news-chip.event-news:hover,
.news-chip.event-news.active {
  border-color: rgba(85,228,255,.46) !important;
}

.opacity-control {
  margin: 8px 0 4px;
  padding: 8px 10px 9px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
}
.opacity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #9eb0ba;
  font-size: 9px;
}
.opacity-row output {
  color: var(--cyan);
  font-weight: 800;
}
.opacity-control input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.legend.fault {
  width: 18px;
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: #ff667a;
  box-shadow: 0 0 0 1px rgba(255,102,122,.15);
}

.event-location {
  display:block;
  margin-top:2px;
  color:#9aabb5;
  font-size:8px;
  line-height:1.2;
  max-width:150px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}


/* =========================================================
   v3.0 - MyGEMS official renderer + fault visibility fix
   ========================================================= */

.mygems-overlay-status {
  display: block;
  margin-top: 4px;
  color: #8297a2;
  font-size: 8px;
  line-height: 1.3;
}

.legend.fault {
  background: #000 !important;
}

/* Remove old hide-related chronology UI permanently. */
.chronology-collapse,
.chronology-edge-btn,
.chronology-toggle {
  display: none !important;
}

/* Compact source note: show only official verification guidance. */
.note-card p {
  margin: 0;
}

/* Compact latest list inside the Summary panel. */
.latest-heading { margin-bottom: 10px; }
.latest-heading h2 { font-size: 15px; }
.latest-events-list { display: grid; gap: 7px; }
.latest-event-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 55px;
  padding: 8px 9px;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(255,155,74,.18);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255,155,74,.10), rgba(255,255,255,.025));
}
.latest-event-item:hover,
.latest-event-item:focus-visible {
  border-color: rgba(255,155,74,.58);
  background: linear-gradient(145deg, rgba(255,155,74,.18), rgba(255,255,255,.04));
}
.latest-event-rank {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: #dce6eb;
  background: rgba(255,255,255,.065);
  font-size: 9px;
  font-weight: 850;
}
.latest-event-content { min-width: 0; }
.latest-event-content strong,
.latest-event-content small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.latest-event-content strong { color: #f5f7f9; font-size: 11px; }
.latest-event-content small { margin-top: 4px; color: #91a5b1; font-size: 9px; }
.latest-empty { color: #8195a1; font-size: 11px; padding: 8px 2px; }

/* The latest list now lives inside the Summary panel, below its note. */
.left-panel .latest-panel {
  position: static;
  width: auto;
  max-height: none;
  top: auto;
  right: auto;
  bottom: auto;
  padding: 17px;
  overflow: visible;
  border-radius: 0;
  background: transparent !important;
  border-left: 0 !important;
  border-right: 0 !important;
  box-shadow: none !important;
}
.left-panel .latest-panel .latest-heading .collapse-btn { transform: none; }
.left-panel .latest-panel.collapsed {
  max-height: 62px;
  transform: none !important;
  opacity: 1 !important;
  overflow: hidden;
  pointer-events: auto;
}
.left-panel .latest-panel.collapsed .latest-events-list { display: none; }
.left-panel .latest-panel.collapsed .latest-heading .collapse-btn { transform: rotate(180deg); }
