:root {
  --ink: #0e2a33;
  --muted: #4f6b75;
  --line: #c9dde4;
  --paper: #f3f8fa;
  --card: rgba(255, 255, 255, 0.82);
  --teal-deep: #0a3d4a;
  --teal: #1a6b7a;
  --teal-light: #3aa0b0;
  --sand: #f4efe6;
  --warn: #b42318;
  --watch: #b54708;
  --ok: #0f6a3c;
  --shadow: 0 18px 40px rgba(10, 61, 74, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: "Sora", system-ui, sans-serif;
  background: #e8f2f5;
  min-height: 100%;
}

.bg-wash {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(58, 160, 176, 0.35), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(244, 239, 230, 0.9), transparent 55%),
    linear-gradient(180deg, #d7ecef 0%, #eef5f7 45%, #e7eef1 100%);
}

.hero {
  position: relative;
  overflow: hidden;
  color: #f7fcff;
  min-height: clamp(420px, 62vh, 560px);
  display: flex;
  align-items: flex-end;
  border-bottom: 0;
}
.hero-media {
  position: absolute;
  inset: 0;
  background:
    url("/static/img/hero-lake.jpg") center / cover no-repeat;
  transform: scale(1.02);
  animation: hero-soft-zoom 18s ease-in-out infinite alternate;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      105deg,
      rgba(8, 42, 52, 0.88) 0%,
      rgba(10, 61, 74, 0.72) 42%,
      rgba(26, 107, 122, 0.28) 72%,
      rgba(58, 160, 176, 0.08) 100%
    ),
    linear-gradient(180deg, rgba(8, 42, 52, 0.25) 0%, rgba(8, 42, 52, 0.55) 100%);
}
@keyframes hero-soft-zoom {
  from { transform: scale(1.02); }
  to { transform: scale(1.06); }
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4.2rem 1.4rem 3rem;
}
.brand {
  margin: 0 0 0.85rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.6rem, 5.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}
.hero h1 {
  margin: 0;
  max-width: 18em;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.55rem, 3.1vw, 2.35rem);
  line-height: 1.28;
  letter-spacing: -0.02em;
}
.headline-break {
  display: block;
}
.lede {
  margin: 1.05rem 0 0;
  max-width: 42ch;
  color: rgba(247, 252, 255, 0.92);
  font-size: 1.04rem;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.45rem;
}
.hero-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1.2rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}
.hero-btn:hover { transform: translateY(-1px); }
.hero-btn.primary {
  background: linear-gradient(135deg, #1a6b7a, #3aa0b0);
  color: #fff;
  box-shadow: 0 10px 24px rgba(10, 61, 74, 0.28);
}
.hero-btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(6px);
}
.hero-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.4rem;
}
.hero-meta span {
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.1);
  padding: 0.38rem 0.75rem;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.shell {
  max-width: 1120px;
  margin: -1.8rem auto 0;
  padding: 0 1.2rem 2.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.1rem;
  align-items: start;
  position: relative;
  z-index: 2;
}

.panel, .chart-card, .table-card, .stat-card, .narrative, .status-banner {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.site-panel {
  padding: 1.1rem;
  position: sticky;
  top: 1rem;
}
.site-panel h2,
.chart-head h2,
.table-card h2 {
  margin: 0 0 0.8rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
}
.site-tabs {
  display: grid;
  gap: 0.55rem;
}
.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.85rem;
}
.mode-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.4rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.mode-btn.active {
  background: linear-gradient(135deg, var(--teal-deep), var(--teal));
  border-color: transparent;
  color: #fff;
}
.mode-row.hidden { display: none; }
.site-tab {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.site-tab:hover { transform: translateY(-1px); }
.site-tab.active {
  border-color: var(--teal);
  box-shadow: inset 3px 0 0 var(--teal-light);
  background: linear-gradient(90deg, rgba(58,160,176,0.12), #fff 45%);
}
.site-tab strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.site-tab span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.mal-controls {
  margin-top: 1rem;
  display: grid;
  gap: 0.45rem;
}
.mal-controls.hidden { display: none; }
.mal-controls label { font-size: 0.82rem; color: var(--muted); }
.mal-controls input[type="date"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink) !important;
}
.btn {
  margin-top: 0.25rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-light));
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.note { font-size: 0.78rem; color: var(--muted); line-height: 1.4; margin: 0.2rem 0 0; }

.disclaimer {
  margin-top: 1.1rem;
  padding: 0.8rem 0.85rem;
  border-radius: 12px;
  background: var(--sand);
  border: 1px solid #e4d7c2;
  color: #5b4a2c;
  font-size: 0.78rem;
  line-height: 1.45;
}

.content { display: grid; gap: 1rem; min-width: 0; }

.status-banner {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}
.status-banner.loading { color: var(--teal); }
.status-banner.error {
  color: var(--warn);
  background: #fff1f0;
  border-color: #f0c2bc;
}
.status-banner.ok { color: var(--ok); }

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}
.stat-card { padding: 1rem; }
.stat-card .label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat-card .value {
  margin: 0.35rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stat-card .sub {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.badge {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-family: "Sora", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}
.badge.ok { background: #d8f3e4; color: var(--ok); }
.badge.watch-high { background: #ffe8c8; color: var(--watch); }
.badge.warn-high { background: #ffd4ce; color: var(--warn); }
.badge.watch-low { background: #dce9ff; color: #1d4f9c; }
.badge.warn-low { background: #e4ddff; color: #3d2f8f; }

.narrative {
  padding: 1rem 1.1rem;
  border-left: 5px solid var(--teal);
  line-height: 1.5;
  font-size: 0.98rem;
}
.narrative strong { font-weight: 700; }

.chart-card { padding: 1rem 1.1rem 0.6rem; }
.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.chart-wrap { position: relative; min-height: 320px; }

.table-card { padding: 1rem 1.1rem 1.1rem; }
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0 1rem 2rem;
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .site-panel { position: static; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .status-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 3.2rem 1.1rem 2.4rem; }
  .hero h1 { max-width: none; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-btn { width: 100%; text-align: center; }
}

.site-panel.pulse-focus {
  box-shadow: 0 0 0 3px rgba(58, 160, 176, 0.45), var(--shadow);
  transition: box-shadow 0.25s ease;
}
