/* Shared look for /stations and /stations/{n}: the homepage's paper chart. */
:root {
  --paper: #FAF6EC; --paper2: #F3EDDE; --card: #FFFFFF;
  --navy: #0B2545; --navy2: #17406B; --ink2: #34485E; --dim: #6A7A8C; --faint: #98A5B3;
  --yellow: #FFD60A; --red: #E63946; --green: #1FA34A; --green-bg: #E4F6EA;
  --orange: #F08A24; --sky: #C6D6EA; --hairline: #E8E0CC; --hair2: #F0EADB;
  --shadow: 0 1px 2px #0B25450A, 0 10px 30px #0B25450F;
  --shadow-up: 0 2px 4px #0B254512, 0 22px 50px #0B25451F;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--navy);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: var(--navy2); text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.tn { font-variant-numeric: tabular-nums; }

.overline { font-size: 12px; font-weight: 900; letter-spacing: 2.6px; color: var(--red); text-transform: uppercase; }
h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 900; letter-spacing: -1.2px; line-height: 1.02; }
.lede { color: var(--dim); font-size: 17px; max-width: 640px; }

section { padding: 30px 0 0; }
.shead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.shead h2 { font-size: 22px; font-weight: 900; letter-spacing: -0.3px; }
.shead p { color: var(--dim); font-size: 14px; }
.shead .right { margin-left: auto; }

.card { background: var(--card); border: 1px solid var(--hairline); border-radius: 22px; box-shadow: var(--shadow); }
.pad { padding: 22px 24px; }
.ctitle { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ctitle h3 { font-size: 13px; font-weight: 900; letter-spacing: 1.8px; color: var(--ink2); text-transform: uppercase; }
.ctitle small { color: var(--faint); font-size: 12.5px; font-weight: 650; }
.ctitle .right { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* Status + badges */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 900; letter-spacing: 1px;
  padding: 6px 12px 6px 10px; border-radius: 999px; background: #EEF1F5; color: var(--dim); text-transform: uppercase; white-space: nowrap; }
.status.on { background: var(--green-bg); color: #137A35; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #9AA6B3; display: inline-block; }
.status.on i { background: var(--green); box-shadow: 0 0 0 0 #1FA34A66; animation: ping 1.8s infinite; }
.status.deaf { background: #FFF0DD; color: #A35400; }
.status.deaf i { background: var(--orange); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 #1FA34A66; } 80%, 100% { box-shadow: 0 0 0 7px #1FA34A00; } }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 850; letter-spacing: .5px;
  padding: 5px 11px; border-radius: 999px; background: #FFF7CC; color: #6B5600; border: 1px solid #F3E28A; white-space: nowrap; }
.badge.rank { background: #FDE8EA; color: #A3222D; border-color: #F6C4C9; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.kpi { position: relative; overflow: hidden; padding: 18px 18px 16px; }
.kpi .lab { font-size: 11px; font-weight: 900; letter-spacing: 1.5px; color: var(--dim); text-transform: uppercase; }
.kpi .big { font-size: 34px; font-weight: 900; letter-spacing: -1px; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .big em { font-style: normal; font-size: 17px; color: var(--faint); font-weight: 800; letter-spacing: 0; }
.kpi .sub { color: var(--dim); font-size: 12.5px; margin-top: 3px; font-weight: 600; }
.kpi .accent { position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--yellow); }

/* Definitions */
.defs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.def { padding: 18px 20px; font-size: 14px; color: var(--dim); }
.def b { display: flex; align-items: center; gap: 8px; color: var(--navy); font-size: 15px; font-weight: 900; margin-bottom: 4px; }
.def b span { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper2); font-size: 14px; }

/* Charts */
.chart { display: block; overflow: visible; }
.chart text { fill: var(--faint); font: 700 10.5px -apple-system, sans-serif; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); margin-top: 10px; font-weight: 650; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.seg { display: inline-flex; background: var(--paper2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: none; border: none; color: var(--dim); font: 850 11.5px -apple-system, sans-serif;
  letter-spacing: .8px; padding: 6px 11px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--navy); box-shadow: 0 1px 3px #0B254522; }
#tipbox { position: fixed; z-index: 99; pointer-events: none; background: var(--navy); color: #FFF;
  border-radius: 11px; padding: 9px 12px; font-size: 12.5px; line-height: 1.45; box-shadow: 0 12px 30px #0B254540;
  display: none; max-width: 250px; }
#tipbox b { color: var(--yellow); }

/* Maps */
.maplibregl-ctrl-attrib { display: none !important; }
.maplibregl-ctrl-group { border-radius: 10px !important; box-shadow: 0 2px 10px #0B254526 !important; }
.maplibregl-popup-content { border-radius: 16px !important; padding: 14px 16px !important; box-shadow: var(--shadow-up) !important;
  font: 14px/1.45 -apple-system, sans-serif; color: var(--navy); }
.maplibregl-popup-close-button { font-size: 18px; color: var(--faint); padding: 2px 8px; }

/* Bottom */
.ctaband { margin-top: 56px; background: var(--navy); color: #FFF; border-radius: 28px; padding: 44px 36px;
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap; box-shadow: var(--shadow-up); position: relative; overflow: hidden; }
.ctaband::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  border: 2px solid #FFD60A33; box-shadow: 0 0 0 40px #FFD60A0D, 0 0 0 80px #FFD60A08; }
.ctaband h3 { font-size: 28px; font-weight: 900; letter-spacing: -0.5px; line-height: 1.15; }
.ctaband p { color: #C8D4E0; margin-top: 6px; max-width: 520px; }
.ctaband .btn { margin-left: auto; position: relative; z-index: 1; }
.btn { display: inline-block; background: var(--yellow); color: #201A00; font-weight: 900; padding: 15px 26px; border-radius: 14px;
  font-size: 15px; white-space: nowrap; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px #FFD60A40; }

footer { color: var(--dim); padding: 46px 0 40px; font-size: 13px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; border-top: 1px solid var(--hairline); padding-top: 26px; }
footer a { color: var(--ink2); font-weight: 700; }

.reveal { animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .defs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .grid2, .grid3, .defs { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px 14px 13px; }
  .kpi .big { font-size: 26px; }
  .pad { padding: 18px 16px; }
  .card { border-radius: 18px; }
  .ctaband { padding: 32px 22px; border-radius: 22px; }
  .ctaband .btn { margin-left: 0; width: 100%; text-align: center; }
}
