:root {
  --ink: #1a2332;
  --muted: #5a6a7a;
  --sky: #0b3d5c;
  --sky-mid: #1a7a9a;
  --mint: #7bc9a6;
  --paper: #f4f8fb;
  --card: #ffffff;
  --line: #d5e2ec;
  --aqi-very-good: #0d7a3f;
  --aqi-good: #15803d;
  --aqi-satisfactory: #ca8a04;
  --aqi-moderate: #c2410c;
  --aqi-bad: #b91c1c;
  --aqi-very-bad: #7f1d1d;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(11, 61, 92, 0.12);
  --font-display: "Outfit", "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 80% at 10% -20%, #cfe8f5 0%, transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 0%, #d9f0e6 0%, transparent 45%),
    linear-gradient(180deg, #eaf4fa 0%, var(--paper) 40%, #eef3f7 100%);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: var(--sky-mid);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--sky);
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(244, 248, 251, 0.88);
  border-bottom: 1px solid rgba(213, 226, 236, 0.8);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.brand-lockup img {
  height: 40px;
  width: auto;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  font-size: 0.95rem;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.nav a:hover {
  color: var(--sky-mid);
}

.hero {
  padding: 2.5rem 0 1.5rem;
}

.hero__brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sky);
  margin: 0 0 0.4rem;
  line-height: 1.05;
}

.hero__tagline {
  margin: 0 0 1.25rem;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--muted);
  max-width: 36rem;
}

.hero__lead {
  margin: 0 0 1.5rem;
  max-width: 40rem;
}

.search-box {
  position: relative;
  z-index: 1200;
  max-width: 420px;
  margin-bottom: 1rem;
}

.search-box input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  background: var(--card);
  box-shadow: var(--shadow);
}

.search-box input:focus {
  outline: 2px solid var(--sky-mid);
  outline-offset: 1px;
}

.search-box__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(11, 61, 92, 0.18);
  max-height: 320px;
  overflow: auto;
  display: none;
  z-index: 1300;
}

.search-box__list.is-open {
  display: block;
}

.search-box__list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  align-items: center;
}

.search-box__list button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.search-box__list button strong {
  font-weight: 700;
}

.search-box__list button span {
  font-size: 0.82rem;
  color: var(--muted);
}

.search-box__list button:hover,
.search-box__list button:focus {
  background: #eef6fa;
}

.search-box__report {
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: #e8f3f8;
  color: var(--sky);
  white-space: nowrap;
}

.search-box__report:hover {
  background: #d7ebf2;
  color: var(--sky);
}

.search-box--map {
  max-width: 480px;
  margin: 0 0 1rem;
}

.map-shell {
  position: relative;
  z-index: 1;
  height: min(62vh, 560px);
  min-height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #dce8f0;
}

#map {
  width: 100%;
  height: 100%;
}

.map-legend {
  position: absolute;
  z-index: 500;
  left: 12px;
  bottom: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-size: 0.78rem;
  display: grid;
  gap: 0.25rem;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.map-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

/* Hide stale build-time numbers until city.js fills live readings (JS only). */
html.js .metrics[data-city-metrics]:not([data-live-ready]) [data-metric] {
  visibility: hidden;
}

html.js .metrics[data-city-metrics]:not([data-live-ready]) .metric {
  position: relative;
  min-height: 4.2rem;
}

html.js .metrics[data-city-metrics]:not([data-live-ready]) .metric::after {
  content: '';
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  height: 1.15rem;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8eef2 0%, #f7fafb 50%, #e8eef2 100%);
  background-size: 200% 100%;
  animation: pz-metric-pulse 1.1s ease-in-out infinite;
}

@keyframes pz-metric-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.metric {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.metric__label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.metric__value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.badge-source {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #eef6fa;
  color: var(--sky);
}

.aqi {
  font-weight: 700;
  text-transform: lowercase;
}

.aqi--very_good { color: var(--aqi-very-good); }
.aqi--good { color: var(--aqi-good); }
.aqi--satisfactory { color: var(--aqi-satisfactory); }
.aqi--moderate { color: var(--aqi-moderate); }
.aqi--bad { color: var(--aqi-bad); }
.aqi--very_bad { color: var(--aqi-very-bad); }

.dot-very_good { background: var(--aqi-very-good); }
.dot-good { background: var(--aqi-good); }
.dot-satisfactory { background: var(--aqi-satisfactory); }
.dot-moderate { background: var(--aqi-moderate); }
.dot-bad { background: var(--aqi-bad); }
.dot-very_bad { background: var(--aqi-very-bad); }
.dot-unknown { background: #94a3b8; }

.section {
  padding: 2rem 0;
}

.section h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0 0 0.75rem;
  color: var(--sky);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.card-link {
  display: block;
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card-link:hover {
  border-color: var(--sky-mid);
  transform: translateY(-1px);
}

.card-link strong {
  display: block;
  font-family: var(--font-display);
}

.card-link span {
  color: var(--muted);
  font-size: 0.88rem;
}

.prose {
  max-width: 46rem;
}

.prose p {
  margin: 0 0 1rem;
}

.prose h2 {
  margin: 1.75rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--sky);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose .lead,
p.lead {
  font-size: 1.08rem;
  color: var(--ink);
  line-height: 1.55;
}

.seo-block {
  margin: 1.5rem 0 2rem;
}

.section-lead {
  color: var(--muted);
  margin: -0.25rem 0 1rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 1rem 0 1.5rem;
}

.news-list {
  display: grid;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.news-card {
  padding: 1.1rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}

.news-card:last-child {
  border-bottom: 0;
}

.news-card time,
.news-meta time {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.news-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.seo-smog-lead {
  margin-top: -0.35rem;
}

.woj-capital {
  margin: 0.75rem 0 1rem;
}

.faq {
  display: grid;
  gap: 0.65rem;
  margin: 0.75rem 0 1.25rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.35rem 0.9rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.55rem 0;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 1.1rem;
  color: var(--sky-mid);
  font-weight: 700;
}

.faq-item[open] summary::before {
  content: "–";
}

.faq-item p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.breadcrumbs {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 1rem 0 0.5rem;
}

.breadcrumbs a {
  color: var(--muted);
}

.site-footer {
  margin-top: 2.5rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
}

.marker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.pz-marker {
  background: transparent !important;
  border: 0 !important;
}

.pz-point {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(11, 61, 92, 0.28);
  line-height: 1;
}

.pz-point__value {
  font-size: 0.72rem;
  letter-spacing: -0.02em;
}

.pz-point--small .pz-point__value {
  font-size: 0.7rem;
}

.pz-point--medium .pz-point__value {
  font-size: 0.68rem;
}

.pz-point--large .pz-point__value {
  font-size: 0.6rem;
}

.pz-cluster-wrap {
  background: transparent !important;
  border: 0 !important;
}

.pz-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(11, 61, 92, 0.28);
  line-height: 1.05;
  gap: 1px;
}

.pz-cluster__value {
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}

.pz-cluster__unit {
  font-size: 0.55rem;
  font-weight: 600;
  opacity: 0.92;
  text-transform: uppercase;
}

.pz-cluster--small .pz-cluster__value {
  font-size: 0.8rem;
}

.pz-cluster--medium .pz-cluster__value {
  font-size: 0.88rem;
}

.pz-cluster--large .pz-cluster__value {
  font-size: 0.78rem;
}

.leaflet-popup-content .popup-note {
  display: inline-block;
  margin: 0.25rem 0 0.15rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #fff4e5;
  color: #9a5b00;
  font-size: 0.8rem;
  font-weight: 600;
}

.page-hero {
  padding: 2.25rem 0 0.5rem;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  color: var(--sky);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page-hero__lead {
  margin: 0;
  max-width: 38rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}

.about-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}

.about-card h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.45rem;
  color: var(--sky);
}

.about-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.about-steps {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.about-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.about-steps__num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--sky);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.about-cta {
  margin: 2rem 0 0.5rem;
  padding: 1.35rem 1.4rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0b3d5c 0%, #1a7a9a 100%);
  color: #e8f6f3;
}

.about-cta h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #fff;
}

.about-cta p {
  margin: 0 0 1rem;
  color: #d7ebf2;
  max-width: 36rem;
}

.about-cta__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn--light {
  background: #fff;
  color: var(--sky);
}

.btn--primary {
  background: var(--sky);
  color: #fff;
}

.btn--primary:hover {
  color: #fff;
  background: #072c42;
}

.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.btn--light:hover {
  color: var(--sky-mid);
}

.btn--ghost:hover {
  color: #fff;
  border-color: #fff;
}

@media (max-width: 720px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding-top: 1.5rem;
  }
}
