:root {
  --bg: #070b14;
  --card: rgba(12, 22, 40, 0.88);
  --text: #eaf0f8;
  --muted: #8aa0b8;
  --accent: #3b82f6;
  --line: rgba(59, 130, 246, 0.25);
  --link: #7dd3fc;
  --nav-bg: rgba(7, 11, 20, 0.9);
}
/* Theme values follow the site theme stylesheet. */
[data-theme="cyberpunk"] {
  --bg: #0a0a0f;
  --card: rgba(10, 10, 15, 0.8);
  --text: #f0f0ff;
  --muted: #8080a0;
  --accent: #00f3ff;
  --link: #00f3ff;
  --line: rgba(0, 243, 255, 0.15);
  --nav-bg: rgba(10, 10, 15, 0.9);
}
[data-theme="solar"] {
  --bg: #1a0f0a;
  --card: rgba(40, 25, 15, 0.8);
  --text: #f5e6d3;
  --muted: #b08a70;
  --accent: #ff6b35;
  --link: #ff6b35;
  --line: rgba(255, 107, 53, 0.15);
  --nav-bg: rgba(26, 15, 10, 0.9);
}
[data-theme="aurora"] {
  --bg: #0f0a1a;
  --card: rgba(15, 10, 26, 0.8);
  --text: #e8d5ff;
  --muted: #a38fc0;
  --accent: #7b2ffc;
  --link: #a78bfa;
  --line: rgba(123, 47, 252, 0.15);
  --nav-bg: rgba(15, 10, 26, 0.9);
}
[data-theme="dark"] {
  --bg: #0b1424;
  --card: rgba(11, 20, 36, 0.8);
  --text: #e8edf5;
  --muted: #8c9db8;
  --accent: #2563eb;
  --link: #60a5fa;
  --line: rgba(37, 99, 235, 0.12);
  --nav-bg: rgba(11, 20, 36, 0.9);
}
[data-theme="light"] {
  --bg: #f0f2f5;
  --card: rgba(255, 255, 255, 0.72);
  --text: #1a2332;
  --muted: #566474;
  --accent: #2563eb;
  --link: #1d4ed8;
  --line: rgba(0, 0, 0, 0.1);
  --nav-bg: rgba(255, 255, 255, 0.85);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--link); }
header.portal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 5;
}
header.portal strong { color: var(--accent); letter-spacing: 0.04em; }
nav a { margin-left: 14px; text-decoration: none; font-size: 0.85rem; }
nav a:hover { text-decoration: underline; }
.hero {
  position: relative;
  min-height: 220px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}
.hero .shade {
  width: 100%;
  padding: 28px 24px 22px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--bg) 92%, transparent));
}
.hero h1 { margin: 0 0 6px; font-size: 1.8rem; }
.hero p { margin: 0; color: var(--muted); max-width: 720px; }
main { padding: 24px; max-width: 1100px; margin: 0 auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.kpi b { display: block; font-size: 1.5rem; color: var(--accent); }
.kpi span { font-size: 0.75rem; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card img { width: 100%; height: 130px; object-fit: cover; display: block; }
.card .body { padding: 12px 14px 16px; }
.card h2 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.85rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.note { color: var(--muted); font-size: 0.82rem; border-left: 3px solid var(--accent); padding-left: 10px; }
footer.portal { padding: 20px 24px 40px; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); margin-top: 32px; }
footer.portal a { margin-right: 12px; }

.theme-group { display: inline-flex; gap: 4px; margin-left: 14px; vertical-align: middle; }
.theme-btn {
  background: transparent; border: 1px solid var(--line); border-radius: 40px; padding: 3px 10px;
  cursor: pointer; font-size: 0.7rem; color: var(--text); font-family: inherit;
}
.theme-btn:hover, .theme-btn.active { border-color: var(--accent); }
.theme-btn.active { background: var(--accent); color: var(--bg); }

html, body { max-width: 100%; overflow-x: hidden; }
main { width: 100%; max-width: 1100px; }
.hero { margin-top: 60px; max-width: 100%; }
.hub-nav { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 16px; }
.hub-nav a { text-decoration: none; }
.table-scroll { display: block; width: 100%; max-width: 100%; overflow-x: auto; }
.table-scroll table { margin: 0; width: 720px; max-width: none; }
caption { caption-side: bottom; text-align: left; color: var(--muted); font-size: 0.82rem; padding-top: 8px; }
th, td { white-space: normal; }
.note, .note a { overflow-wrap: anywhere; }
img { max-width: 100%; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 0 0 12px; }
.tools label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); max-width: 100%; }
.tools select, .tools input, .tools button {
  font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-height: 40px;
}
.countdown { font-variant-numeric: tabular-nums; font-size: 1.05rem; margin: 0 0 12px; }
.map-frame { height: 240px; width: 100%; max-width: 100%; overflow: hidden; border-radius: 12px; margin: 8px 0 12px; }
.maplibregl-map, .maplibregl-canvas { max-width: 100%; }
.chart { margin: 0 0 16px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; margin: 8px 0; font-size: 0.82rem; }
.bar-track { grid-column: 1 / -1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--accent); }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.45rem; }
  .hero .shade { padding: 18px 16px 16px; }
  main { padding: 16px; }
}
