/* ============================================================
   Station network — Fair Finance Pakistan
   Follows the conventions of aqi-map.css: same hero, card, badge
   and band-colour language, so the two pages read as one platform.
   ============================================================ */

.stn-hero {
    background: linear-gradient(135deg, var(--color-charcoal) 0%, var(--color-charcoal-light) 100%);
    color: var(--color-white);
    padding: var(--spacing-lg) 0 var(--spacing-md);
    text-align: center;
}
.stn-hero h1 { color: var(--color-white); font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.5rem; }
.stn-hero p { color: var(--color-grey-light); max-width: 760px; margin: 0 auto; }

.stn-live-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(28,138,106,0.18); border: 1px solid var(--color-green-accent);
    color: var(--color-green-accent-light); font-weight: 700; font-size: 0.78rem;
    letter-spacing: 0.08em; text-transform: uppercase; padding: 0.3rem 0.9rem;
    border-radius: 999px; margin-bottom: 0.9rem;
}
.stn-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-green-accent-light); animation: aqi-pulse 1.8s infinite; }

.stn-page { background: var(--color-off-white); padding: var(--spacing-md) 0 var(--spacing-xl); }

.stn-card {
    background: var(--color-white); border: 1px solid var(--color-grey-light);
    border-radius: 18px; box-shadow: 0 10px 26px rgba(19,33,38,0.06);
    overflow: hidden; margin-bottom: var(--spacing-md);
}

/* ---------- Summary counters ---------- */
.stn-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem; margin-bottom: var(--spacing-md);
}
.stn-stat {
    background: var(--color-white); border: 1px solid var(--color-grey-light);
    border-left: 3px solid var(--color-green-accent);
    border-radius: 14px; padding: 1rem 1.15rem;
}
.stn-stat .k { font-family: var(--font-serif); font-size: 1.9rem; line-height: 1.1; display: block; }
.stn-stat .l { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-grey-dark); font-weight: 700; }
.stn-stat .m { font-size: 0.86rem; color: var(--color-grey-dark); display: block; margin-top: 0.2rem; }

/* ---------- Filters ---------- */
.stn-filters {
    display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--color-grey-light);
}
.stn-filters input[type="search"], .stn-filters select {
    font-family: inherit; font-size: 0.95rem; color: var(--color-charcoal);
    padding: 0.55rem 0.8rem; border: 1px solid var(--color-grey-light);
    border-radius: 10px; background: #fff; min-width: 170px;
}
.stn-filters input[type="search"] { flex: 1 1 240px; }
.stn-filters input:focus, .stn-filters select:focus {
    outline: none; border-color: var(--color-green-accent);
    box-shadow: 0 0 0 3px rgba(28,138,106,0.14);
}
.stn-check { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.92rem; color: var(--color-grey-dark); cursor: pointer; }
.stn-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--color-green-accent); }
.stn-filters .stn-count { margin-left: auto; font-size: 0.9rem; color: var(--color-grey-dark); }

/* ---------- Table ---------- */
.stn-table-wrap { overflow-x: auto; }
.stn-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.stn-table th {
    text-align: left; white-space: nowrap; background: #f8faf9;
    font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
    font-weight: 700; color: var(--color-grey-dark);
    padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--color-grey-light);
}
.stn-table td { padding: 0.75rem 1.1rem; border-bottom: 1px solid #eef2f0; vertical-align: middle; }
.stn-table tbody tr:hover { background: #f8faf9; }
.stn-table tbody tr:last-child td { border-bottom: 0; }
.stn-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stn-table a { font-weight: 600; }
.stn-sub { display: block; font-size: 0.84rem; color: var(--color-grey-dark); }

.stn-aqi {
    display: inline-block; min-width: 3.1rem; text-align: center;
    padding: 0.2rem 0.55rem; border-radius: 8px; font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.stn-aqi.none { background: #eef2f0; color: var(--color-grey-dark); font-weight: 600; }

.stn-pill {
    display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px;
    font-size: 0.76rem; font-weight: 600; border: 1px solid var(--color-grey-light);
    background: #f6f8f7; color: var(--color-grey-dark); white-space: nowrap;
}
.stn-pill.live { color: #14654e; background: #eaf6f2; border-color: #c3e3d8; }
.stn-pill.offline { color: #8a6100; background: #fdf4e3; border-color: #eedfb8; }
.stn-pill.ref { color: #1b4a7a; background: #eaf1f8; border-color: #c6d9ec; }

.stn-empty, .stn-loading { padding: 2.5rem 1.25rem; text-align: center; color: var(--color-grey-dark); }

.stn-more { display: flex; justify-content: center; padding: 1.1rem; }
.stn-more button {
    font-family: inherit; font-weight: 600; font-size: 0.95rem;
    padding: 0.6rem 1.4rem; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--color-grey-light); background: #fff; color: var(--color-charcoal);
}
.stn-more button:hover { border-color: var(--color-green-accent); color: var(--color-green-accent); }

/* ---------- Note / credits ---------- */
.stn-note {
    border-left: 3px solid var(--color-green-accent);
    background: #f3f7f5; padding: 1.1rem 1.25rem; border-radius: 0 12px 12px 0;
    font-size: 0.92rem; color: var(--color-charcoal); line-height: 1.75;
}
.stn-note b { font-weight: 700; }
.stn-credit { font-size: 0.86rem; color: var(--color-grey-dark); margin-top: 0.6rem; }

/* ---------- Detail page ---------- */
.stn-detail-head { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; padding: 1.5rem 1.35rem; }
.stn-detail-head .stn-aqi-big {
    display: grid; place-items: center; width: 92px; height: 92px; border-radius: 16px;
    font-family: var(--font-serif); font-size: 2.1rem; font-weight: 700; flex-shrink: 0;
}
.stn-detail-head h1 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 0.25rem; }
.stn-detail-head .stn-meta { color: var(--color-grey-dark); font-size: 0.95rem; }
.stn-detail-head .stn-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

.stn-readings { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; padding: 0 1.35rem 1.5rem; }
.stn-reading { border: 1px solid var(--color-grey-light); border-radius: 12px; padding: 0.9rem 1rem; }
.stn-reading .l { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-grey-dark); font-weight: 700; }
.stn-reading .v { font-family: var(--font-serif); font-size: 1.7rem; line-height: 1.2; }
.stn-reading .u { font-size: 0.85rem; color: var(--color-grey-dark); }
.stn-reading .t { font-size: 0.8rem; color: var(--color-grey-dark); display: block; margin-top: 0.2rem; }

.stn-kv { display: grid; grid-template-columns: minmax(130px, 210px) 1fr; gap: 0.5rem 1rem; padding: 1.25rem 1.35rem; font-size: 0.94rem; margin: 0; }
.stn-kv dt { font-weight: 600; color: var(--color-grey-dark); }
.stn-kv dd { margin: 0; overflow-wrap: anywhere; }

.stn-back { display: inline-block; margin-bottom: 1rem; font-size: 0.92rem; font-weight: 600; }

@media (max-width: 640px) {
    .stn-kv { grid-template-columns: 1fr; gap: 0.1rem; }
    .stn-kv dt { margin-top: 0.5rem; }
    .stn-filters .stn-count { margin-left: 0; width: 100%; }
}


/* ---------- Map ---------- */
.stn-map-card { position: relative; padding: 0; }
.stn-map { height: 600px; width: 100%; border-radius: 18px; }
@media (max-width: 700px) { .stn-map { height: 440px; } }

/* A marker carries no inline size: the map container's zoom class sizes every
   dot at once, which keeps a thousand of them smooth. The transform centres
   each dot on its coordinates whatever that size is. */
.stn-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    display: grid; place-items: center;
    border-radius: 50%; color: #fff; font-weight: 700;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 1px 5px rgba(19,33,38,0.35);
    font-family: var(--font-sans);
    width: 14px; height: 14px; font-size: 0;
    transition: width .12s ease, height .12s ease;
}
.stn-marker.silent { opacity: 0.4; }

.stn-z-xs .stn-marker { width: 10px; height: 10px; border-width: 1.5px; font-size: 0; }
.stn-z-sm .stn-marker { width: 14px; height: 14px; border-width: 1.5px; font-size: 0; }
.stn-z-md .stn-marker { width: 20px; height: 20px; font-size: 0; }
.stn-z-lg .stn-marker { width: 28px; height: 28px; font-size: 11px; }
.stn-z-xl .stn-marker { width: 36px; height: 36px; font-size: 12px; }

/* ---------- Tabs ---------- */
.stn-tabs {
    display: flex; gap: 0.3rem; margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-grey-light);
}
.stn-tabs button {
    font-family: inherit; font-size: 0.98rem; font-weight: 600; cursor: pointer;
    border: 0; background: none; color: var(--color-grey-dark);
    padding: 0.7rem 1.1rem; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.stn-tabs button:hover { color: var(--color-charcoal); }
.stn-tabs button.is-active { color: var(--color-charcoal); border-bottom-color: var(--color-green-accent); }
.stn-tabs .tab-count { font-weight: 600; color: var(--color-grey-dark); font-size: 0.85rem; margin-left: 0.35rem; }

.stn-legend {
    display: flex; flex-wrap: wrap; gap: 0.75rem 1.1rem; align-items: center;
    padding: 0.9rem 1.25rem; border-top: 1px solid var(--color-grey-light);
    font-size: 0.82rem; color: var(--color-grey-dark);
}
.stn-legend span.key { display: inline-flex; align-items: center; gap: 0.4rem; }
.stn-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* ---------- Map popup ---------- */
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 0; width: 290px !important; font-family: var(--font-sans); }

.stn-pop-head { padding: 0.9rem 1rem 0.6rem; }
.stn-pop-head h4 { font-size: 1.05rem; margin: 0 0 0.15rem; line-height: 1.25; }
.stn-pop-head .sub { font-size: 0.8rem; color: var(--color-grey-dark); }

.stn-pop-reading {
    margin: 0 0.75rem; padding: 0.8rem 0.9rem; border-radius: 12px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
}
.stn-pop-reading .pm .l { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.stn-pop-reading .pm .v { font-family: var(--font-serif); font-size: 1.8rem; line-height: 1.1; }
.stn-pop-reading .pm .u { font-size: 0.8rem; opacity: 0.85; }
.stn-pop-reading .band { text-align: right; font-weight: 700; font-size: 0.92rem; }
.stn-pop-reading .band small { display: block; font-weight: 600; opacity: 0.85; font-size: 0.78rem; }

.stn-pop-env {
    display: flex; gap: 0.5rem; margin: 0.6rem 0.75rem 0;
    border: 1px solid var(--color-grey-light); border-radius: 10px;
    padding: 0.5rem 0.6rem; font-size: 0.82rem; color: var(--color-grey-dark);
}
.stn-pop-env div { flex: 1; text-align: center; }
.stn-pop-env b { display: block; color: var(--color-charcoal); font-size: 0.95rem; }

.stn-pop-trend { margin: 0.75rem 0.75rem 0; }
.stn-pop-trend .t-head {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 0.78rem; color: var(--color-grey-dark); margin-bottom: 0.3rem;
}
.stn-spark { display: flex; align-items: flex-end; gap: 2px; height: 56px; }
.stn-spark i { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; display: block; }
.stn-spark .muted { color: var(--color-grey-dark); font-size: 0.82rem; align-self: center; }

.stn-pop-cta {
    display: block; margin: 0.8rem 0.75rem 0.85rem; text-align: center;
    background: var(--color-charcoal); color: #fff !important; font-weight: 600;
    padding: 0.6rem 1rem; border-radius: 10px; text-decoration: none;
}
.stn-pop-cta:hover { background: var(--color-green-accent); }

/* ---------- Detail: statistics + chart ---------- */
.stn-detail-grid {
    display: grid; grid-template-columns: 320px 1fr; gap: var(--spacing-md); align-items: start;
}
@media (max-width: 900px) { .stn-detail-grid { grid-template-columns: 1fr; } }

.stn-now {
    border-radius: 16px; padding: 1.25rem 1.35rem; color: #fff; margin-bottom: 1rem;
}
.stn-now .l { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.9; }
.stn-now .v { font-family: var(--font-serif); font-size: 3rem; line-height: 1.05; }
.stn-now .u { font-size: 1rem; opacity: 0.9; }
.stn-now .band { font-weight: 700; margin-top: 0.2rem; }
.stn-now .band small { display: block; font-weight: 600; opacity: 0.9; }
.stn-now .env {
    display: flex; gap: 0.5rem; margin-top: 0.9rem; background: rgba(255,255,255,0.18);
    border-radius: 10px; padding: 0.5rem 0.6rem; font-size: 0.82rem;
}
.stn-now .env div { flex: 1; text-align: center; }
.stn-now .env b { display: block; font-size: 0.98rem; }

.stn-statlist { padding: 0.35rem 1.25rem 1.1rem; }
.stn-statlist .row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 0; border-bottom: 1px solid #eef2f0; font-size: 0.95rem;
}
.stn-statlist .row:last-child { border-bottom: 0; }
.stn-statlist .row b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.stn-chart-head {
    display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
    padding: 1.1rem 1.35rem 0.4rem;
}
.stn-chart-head h3 { margin: 0; font-size: 1.2rem; }
.stn-chart-head p { margin: 0; font-size: 0.88rem; color: var(--color-grey-dark); width: 100%; }
.stn-toggle { margin-left: auto; display: inline-flex; border: 1px solid var(--color-grey-light); border-radius: 999px; overflow: hidden; }
.stn-toggle button {
    font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
    border: 0; background: #fff; color: var(--color-grey-dark); padding: 0.4rem 0.95rem;
}
.stn-toggle button.is-active { background: var(--color-charcoal); color: #fff; }

.stn-chart { display: flex; align-items: flex-end; gap: 3px; height: 240px; padding: 0 1.35rem 0.6rem; }
.stn-chart .bar { flex: 1; min-width: 3px; border-radius: 3px 3px 0 0; position: relative; }
.stn-chart .bar:hover { outline: 2px solid var(--color-charcoal); outline-offset: 1px; }
.stn-axis {
    display: flex; justify-content: space-between; padding: 0 1.35rem 1.1rem;
    font-size: 0.76rem; color: var(--color-grey-dark);
}

.stn-breadcrumb { font-size: 0.88rem; color: var(--color-grey-dark); margin-bottom: 0.5rem; }
.stn-breadcrumb a { font-weight: 600; }
.stn-about { padding: 1.25rem 1.35rem; font-size: 0.95rem; line-height: 1.85; }
.stn-about h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
