:root {
  --bg: #e9f3ef;
  --panel-soft: rgba(255, 255, 255, 0.9);
  --text: #10212a;
  --text-soft: #52626d;
  --light: #f5fbf8;
  --accent: #0f8c7b;
  --accent-2: #f0b45d;
  --accent-3: #0f4c81;
  --border: rgba(16, 33, 42, 0.12);
  --shadow: 0 20px 60px rgba(13, 42, 51, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 140, 123, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(240, 180, 93, 0.22), transparent 28%),
    linear-gradient(180deg, #f4fbf7 0%, #e5f1ef 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 76, 129, 0.36) transparent;
}

body {
  padding: 24px;
}

body::-webkit-scrollbar,
.timeline::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body::-webkit-scrollbar-track,
.timeline::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb,
.timeline::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.28);
}

body::-webkit-scrollbar-thumb:hover,
.timeline::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 76, 129, 0.42);
}

a {
  color: var(--accent-3);
}

.page-shell {
  max-width: 1500px;
  margin: 0 auto;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px 0 6px;
}

.footer-status {
  margin: 0;
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.3;
  white-space: nowrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(16, 33, 42, 0.08);
  box-shadow: 0 12px 28px rgba(13, 42, 51, 0.08);
  color: var(--accent-3);
  font-weight: 700;
  text-decoration: none;
}

.footer-link:hover {
  transform: translateY(-1px);
}

.hero {
  margin-bottom: 14px;
}

.hero-copy,
.hero-controls,
.map-panel,
.insight-panel,
.timeline-panel {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 12px 30px 14px;
  border-radius: var(--radius-xl);
  background: linear-gradient(130deg, rgba(12, 41, 46, 0.95), rgba(15, 76, 129, 0.88));
  color: var(--light);
}

.panel-kicker,
.status-label,
.metric-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
}

.hero h1,
.map-panel h2,
.timeline-panel h2,
.summary-card h2 {
  margin: 0;
  font-family: "Archivo", sans-serif;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  max-width: none;
  white-space: nowrap;
  line-height: 1.02;
}

.hero-controls {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: rgba(245, 251, 248, 0.86);
  backdrop-filter: blur(18px);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.mode-button,
.refresh-button,
.timeline-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.mode-button {
  padding: 14px 16px;
  border-radius: 999px;
  background: rgba(16, 33, 42, 0.06);
  color: var(--text);
  font-weight: 600;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.mode-button:hover,
.refresh-button:hover,
.timeline-button:hover {
  transform: translateY(-1px);
}

.mode-button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: white;
}

.status-card,
.summary-card {
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  padding: 18px;
}

.status-card {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.status-value,
.source-note,
#algorithmNote,
#selectedTimeSubtitle,
.risk-text {
  margin: 8px 0 0;
  line-height: 1.6;
  color: var(--text-soft);
}

.refresh-button {
  align-self: flex-start;
  margin-top: 16px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #3c2d0d;
  font-weight: 700;
}

.refresh-button--mini {
  margin-top: 0;
  padding: 9px 12px;
  flex: 0 0 auto;
  font-size: 0.82rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.72fr);
  gap: 22px;
  align-items: start;
}

.map-panel,
.insight-panel,
.timeline-panel {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.map-panel,
.timeline-panel {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 22px 24px 18px;
}

.panel-head--compact {
  padding: 12px 18px 8px;
}

.panel-head--map {
  align-items: center;
  gap: 14px;
  padding: 14px 18px 12px;
}

.panel-meta,
.timeline-caption {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.panel-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.panel-meta--single {
  min-width: 0;
  flex: 1 1 auto;
  display: block;
}

#modeDescription {
  display: block;
  width: 100%;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
}

.mode-switch--inline {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 8px;
  margin-bottom: 0;
  padding: 6px;
  border-radius: 999px;
  background: rgba(16, 33, 42, 0.05);
}

.mode-switch--inline .mode-button {
  padding: 10px 14px;
  white-space: nowrap;
  font-size: 0.9rem;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: rgba(16, 33, 42, 0.05);
  border: 1px solid rgba(16, 33, 42, 0.06);
}

.status-chip__label {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.status-chip__value {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-canvas {
  width: 100%;
  height: 68vh;
  min-height: 520px;
  background: #dbe8f2;
}

.map-stage {
  position: relative;
  isolation: isolate;
}

