:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: #101c30;
  --panel-border: rgba(149, 173, 255, 0.16);
  --text: #ecf3ff;
  --muted: #9eb0cb;
  --accent: #4fd1ff;
  --accent-strong: #8d7bff;
  --good: #42d392;
  --bad: #ff8f70;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 209, 255, 0.18), transparent 22%),
    radial-gradient(circle at top right, rgba(141, 123, 255, 0.18), transparent 20%),
    var(--bg);
  color: var(--text);
}

.page-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero,
.panel {
  background: rgba(16, 28, 48, 0.9);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.hero {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1.2fr 1fr;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 0.75rem;
}

.hero-copy,
.panel p,
.stat-card span {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
  padding: 1.25rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card strong {
  display: block;
  margin-top: 0.6rem;
  font-size: 1.6rem;
}

.stat-meta {
  display: block;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.panel {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.range-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.range-link {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
}

.range-link.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #08111f;
  border-color: transparent;
}

.two-column {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.best-times-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plain-list li,
.forecast-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.forecast-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.timeseries-chart {
  margin-bottom: 1rem;
}

.timeseries-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.legend-pool {
  background: #4fd1ff;
}

.legend-aquapark {
  background: #8d7bff;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: center;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 68px;
}

.data-table th {
  position: sticky;
  left: 0;
  background: #0a1322;
}

.empty-state {
  color: var(--muted);
  padding: 1rem 0;
}

@media (max-width: 900px) {
  .hero,
  .two-column,
  .best-times-grid {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
