:root {
  --bg: #f3efe5;
  --bg-deep: #12343b;
  --surface: rgba(255, 252, 246, 0.82);
  --surface-strong: #fffdf7;
  --surface-dark: #15282d;
  --line: rgba(18, 52, 59, 0.14);
  --line-strong: rgba(18, 52, 59, 0.24);
  --ink: #173038;
  --ink-soft: #43616b;
  --air: #1c7c69;
  --noise: #cf6a32;
  --sun: #e0a83c;
  --sky: #4f8da5;
  --alert: #bf4f3e;
  --shadow: 0 22px 60px rgba(18, 52, 59, 0.14);
  --shadow-soft: 0 14px 34px rgba(18, 52, 59, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/Inter.woff2') format('woff2');
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(224, 168, 60, 0.22), transparent 28%),
    radial-gradient(circle at 85% 8%, rgba(79, 141, 165, 0.2), transparent 24%),
    linear-gradient(180deg, #f7f3ea 0%, #efe8da 44%, #f7f2e8 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

body::before,
body::after {
  content: "";
  position: absolute;
  inset: auto;
  z-index: -1;
  pointer-events: none;
}

body::before {
  top: -9rem;
  right: -7rem;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(28, 124, 105, 0.12), transparent 68%);
}

body::after {
  bottom: 12rem;
  left: -10rem;
  width: 30rem;
  height: 20rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(207, 106, 50, 0.1), transparent 70%);
}

a {
  color: inherit;
}

.skip-link,
.sr-only {
  position: absolute;
}

.skip-link {
  top: -48px;
  left: 16px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 12px;
  background: #173038;
  color: #fff8ee;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 16px;
}

.sr-only {
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: 16px;
}

.header-inner,
main,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  padding: 14px 18px;
  background: rgba(255, 252, 246, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.35));
  box-shadow: inset 0 0 0 1px rgba(18, 52, 59, 0.08);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small,
.top-nav,
.section-copy p,
.site-footer,
.metric span,
.card-top,
.hero-copy p,
.eyebrow,
.hero-kpis span,
.hero-panel p,
.hero-panel li,
.explain-grid p,
.subtle {
  color: var(--ink-soft);
}

.top-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.95rem;
}

.top-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.top-nav a:hover,
.top-nav a:focus-visible,
.brand:focus-visible,
.range-btn:focus-visible {
  background: rgba(18, 52, 59, 0.07);
  color: var(--ink);
  transform: translateY(-1px);
}

.brand:focus-visible,
.top-nav a:focus-visible,
.range-btn:focus-visible {
  outline: 2px solid rgba(23, 48, 56, 0.36);
  outline-offset: 2px;
}

main {
  padding: 24px 0 48px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 22px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: calc(var(--radius-xl) + 8px);
  background:
    linear-gradient(135deg, rgba(255, 252, 246, 0.9), rgba(243, 239, 229, 0.72)),
    linear-gradient(180deg, rgba(79, 141, 165, 0.1), transparent 54%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-shell::before {
  content: "";
  position: absolute;
  inset: auto -3rem -5rem auto;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(28, 124, 105, 0.16), transparent 68%);
}

.hero-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.18), transparent 35%),
    repeating-linear-gradient(90deg, rgba(18, 52, 59, 0.02) 0, rgba(18, 52, 59, 0.02) 1px, transparent 1px, transparent 18px);
  pointer-events: none;
}

.hero-copy,
.hero-aside {
  position: relative;
  z-index: 1;
}

.hero-copy h1,
.section-copy h2,
.chart-heading h3,
.legal-page h1,
.legal-page h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.hero-copy h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(3rem, 7.5vw, 5.9rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.hero-copy p {
  max-width: 42rem;
  margin: 18px 0 0;
  font-size: clamp(1rem, 1.7vw, 1.18rem);
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.hero-kpis article {
  padding: 16px 18px;
  border: 1px solid rgba(18, 52, 59, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 246, 0.84);
}

.hero-kpis strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1;
}

.hero-aside {
  display: grid;
  gap: 16px;
}

.hero-panel {
  padding: 22px;
  border: 1px solid rgba(18, 52, 59, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 246, 0.88);
  box-shadow: var(--shadow-soft);
}

.hero-panel h2,
.hero-panel h3,
.section-copy h2,
.chart-heading h3,
.legal-page h1,
.legal-page h2,
.sensor-card h3,
.explain-grid h3 {
  margin: 0;
}

.hero-panel ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.hero-panel li + li {
  margin-top: 10px;
}

.status-stack {
  display: grid;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(18, 52, 59, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.94rem;
  line-height: 1.3;
}

.status-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 0 5px rgba(79, 141, 165, 0.12);
  flex: none;
}

.status-pill.good::before {
  background: var(--air);
  box-shadow: 0 0 0 5px rgba(28, 124, 105, 0.14);
}

.status-pill.ok::before {
  background: var(--sky);
}

.status-pill.watch::before {
  background: var(--sun);
  box-shadow: 0 0 0 5px rgba(224, 168, 60, 0.16);
}

.status-pill.bad::before {
  background: var(--alert);
  box-shadow: 0 0 0 5px rgba(191, 79, 62, 0.16);
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 0;
}

.insight-strip article {
  position: relative;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(21, 40, 45, 0.93);
  color: #eff5f3;
  box-shadow: 0 18px 30px rgba(18, 52, 59, 0.18);
  overflow: hidden;
}

.insight-strip article::before {
  content: "";
  position: absolute;
  inset: auto auto -2.6rem -1.2rem;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.insight-strip h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.insight-strip p {
  position: relative;
  margin: 0;
  color: rgba(239, 245, 243, 0.78);
}

.section {
  margin-top: 22px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: calc(var(--radius-xl) + 2px);
  background: rgba(255, 252, 246, 0.9);
  box-shadow: var(--shadow-soft);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 26px;
}

.section-copy p {
  margin: 10px 0 0;
  max-width: 40rem;
}

.section-copy h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.section-status {
  max-width: 18rem;
  margin: 0;
  text-align: right;
}

.section-status.good {
  color: var(--air);
}

.section-status.ok {
  color: var(--sky);
}

.section-status.watch {
  color: #9a6a15;
}

.section-status.bad {
  color: var(--alert);
}

.range-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.range-btn {
  padding: 10px 16px;
  border: 1px solid rgba(18, 52, 59, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.range-btn:hover,
.range-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(18, 52, 59, 0.2);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.range-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff8ee;
}

.sensor-grid,
.chart-grid,
.explain-grid {
  display: grid;
  gap: 18px;
}

.sensor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sensor-card,
.empty-state {
  border: 1px solid rgba(18, 52, 59, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 252, 246, 0.96)),
    linear-gradient(135deg, rgba(79, 141, 165, 0.08), transparent 62%);
  box-shadow: var(--shadow-soft);
}

.sensor-card {
  position: relative;
  padding: 22px;
  overflow: hidden;
  animation: card-rise 0.45s ease both;
}

.sensor-card::after {
  content: "";
  position: absolute;
  inset: auto -2rem -2.5rem auto;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background: rgba(18, 52, 59, 0.04);
}

.sensor-card.air {
  border-top: 5px solid var(--air);
}

.sensor-card.noise {
  border-top: 5px solid var(--noise);
}

.sensor-card.weather {
  border-top: 5px solid var(--sky);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.86rem;
}

.freshness-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(18, 52, 59, 0.08);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  white-space: nowrap;
}

.freshness-badge.good {
  color: var(--air);
}

.freshness-badge.ok {
  color: var(--sky);
}

.freshness-badge.watch {
  color: #9a6a15;
}

.freshness-badge.bad {
  color: var(--alert);
}

.sensor-card h3 {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
  font-size: 1.46rem;
  line-height: 1.1;
}

.primary-metric {
  position: relative;
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid rgba(18, 52, 59, 0.08);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(23, 48, 56, 0.05), rgba(255, 255, 255, 0.94));
}

.primary-metric span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.primary-metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 0.96;
}

.primary-metric small {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.primary-metric p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.assessment {
  display: grid;
  gap: 4px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(18, 52, 59, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
}

.assessment strong {
  font-size: 1rem;
}

.assessment span {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.assessment.good {
  box-shadow: inset 0 0 0 2px rgba(28, 124, 105, 0.08);
}

.assessment.ok {
  box-shadow: inset 0 0 0 2px rgba(79, 141, 165, 0.1);
}

.assessment.watch {
  box-shadow: inset 0 0 0 2px rgba(224, 168, 60, 0.12);
}

.assessment.bad {
  box-shadow: inset 0 0 0 2px rgba(191, 79, 62, 0.12);
}

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

.metric {
  padding: 14px;
  border: 1px solid rgba(18, 52, 59, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.93);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.05;
}

.metric small {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.history-section {
  background:
    linear-gradient(180deg, rgba(79, 141, 165, 0.05), transparent 22%),
    rgba(255, 252, 246, 0.72);
}

.chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius-lg) + 2px);
  background:
    radial-gradient(circle at top left, rgba(79, 141, 165, 0.16), transparent 28%),
    linear-gradient(180deg, #173038 0%, #10252b 100%);
  color: #eff5f3;
  box-shadow: 0 24px 44px rgba(18, 52, 59, 0.22);
}

.chart-panel.wide {
  grid-column: 1 / -1;
}

.chart-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 16px;
}

.chart-summary-meta {
  grid-column: 1 / -1;
  color: rgba(239, 245, 243, 0.72);
  font-size: 0.82rem;
}

.chart-summary-meta.good {
  color: #90d4bd;
}

.chart-summary-meta.ok {
  color: #9fcae0;
}

.chart-summary-meta.watch {
  color: #e7c776;
}

.chart-summary-meta.bad {
  color: #ef9f90;
}

.chart-stat,
.chart-stats-empty {
  border: 1px solid rgba(239, 245, 243, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.chart-stat {
  padding: 12px 14px;
  box-shadow: inset 3px 0 0 var(--stat-accent, rgba(239, 245, 243, 0.24));
}

.chart-stat span {
  display: block;
  color: rgba(239, 245, 243, 0.68);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-stat strong {
  display: block;
  margin-top: 8px;
  color: #fff8ee;
  font-size: 1.35rem;
  line-height: 1;
}

.chart-stat small {
  color: rgba(239, 245, 243, 0.7);
  font-size: 0.78rem;
}

.chart-stat p,
.chart-stats-empty {
  margin: 8px 0 0;
  color: rgba(239, 245, 243, 0.7);
  font-size: 0.86rem;
}

.chart-stats-empty {
  grid-column: 1 / -1;
  padding: 14px;
}

.chart-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(239, 245, 243, 0.08);
}

.chart-heading span,
.chart-heading small {
  color: rgba(239, 245, 243, 0.68);
}

.chart-heading h3 {
  margin-top: 4px;
  font-size: 1.2rem;
}

.chart-panel canvas {
  display: block;
  width: 100%;
  height: 300px;
  cursor: crosshair;
  touch-action: none;
}

.chart-panel.wide canvas {
  height: 340px;
}

.chart-tooltip {
  position: fixed;
  z-index: 30;
  width: min(240px, calc(100vw - 28px));
  padding: 12px;
  color: #eff5f3;
  background: rgba(16, 37, 43, 0.96);
  border: 1px solid rgba(239, 245, 243, 0.14);
  border-radius: 14px;
  box-shadow: 0 18px 30px rgba(16, 37, 43, 0.28);
  font-size: 0.84rem;
  opacity: 0;
  pointer-events: none;
}

.chart-tooltip b {
  display: block;
  margin-bottom: 8px;
}

.chart-tooltip div {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.chart-tooltip i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.tooltip-assessment {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(239, 245, 243, 0.12);
  color: rgba(239, 245, 243, 0.82);
  line-height: 1.45;
}

.tooltip-assessment strong {
  display: block;
  margin-bottom: 4px;
  color: #fff8ee;
}

.tooltip-assessment.good strong {
  color: #90d4bd;
}

.tooltip-assessment.ok strong {
  color: #9fcae0;
}

.tooltip-assessment.watch strong {
  color: #e7c776;
}

.tooltip-assessment.bad strong {
  color: #ef9f90;
}

.explain-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.explain-grid article {
  padding: 22px;
  border: 1px solid rgba(18, 52, 59, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 246, 0.9);
}

.explain-grid h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.explain-grid p {
  margin-bottom: 0;
}

.empty-state,
.empty-note {
  color: var(--ink-soft);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
}

code {
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(18, 52, 59, 0.08);
  color: var(--ink);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 26px 0 44px;
  font-size: 0.92rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a,
.back-link {
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
}

.legal-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 80px;
  overflow-wrap: anywhere;
}

.legal-page h1 {
  margin: 18px 0;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.legal-page h2 {
  margin-bottom: 10px;
  font-size: 1.45rem;
}

.legal-page section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.legal-page p {
  color: var(--ink-soft);
}

.api-doc-grid,
.api-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.api-doc-card,
.api-field-card {
  padding: 18px 20px;
  border: 1px solid rgba(18, 52, 59, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 246, 0.9);
}

.api-doc-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.api-doc-card h3,
.api-field-card h3 {
  margin: 0 0 8px;
}

.api-doc-card p,
.api-field-card p {
  margin: 0;
}

.api-field-card p + p {
  margin-top: 8px;
}

.api-docs-page pre {
  overflow-x: auto;
  padding: 16px 18px;
  border: 1px solid rgba(18, 52, 59, 0.08);
  border-radius: var(--radius-md);
  background: #173038;
  color: #eff5f3;
  box-shadow: var(--shadow-soft);
}

.api-docs-page pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.legal-page a,
.back-link {
  color: var(--sky);
}

.back-link {
  display: inline-block;
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .sensor-card,
  .top-nav a:hover,
  .top-nav a:focus-visible,
  .brand:focus-visible,
  .range-btn:hover,
  .range-btn:focus-visible {
    transform: none;
  }
}

@media (max-width: 980px) {
  .hero-shell,
  .chart-grid,
  .explain-grid,
  .sensor-grid {
    grid-template-columns: 1fr;
  }

  .chart-stats {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .chart-panel.wide {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  .site-header {
    padding-top: 10px;
  }

  .section-heading,
  .site-footer {
    display: block;
  }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-radius: 28px;
    min-height: auto;
    padding: 12px 14px;
  }

  .top-nav {
    margin-top: 0;
    justify-content: flex-end;
    gap: 6px;
  }

  main {
    padding-top: 14px;
  }

  .hero-shell,
  .section {
    padding: 20px;
  }

  .hero-kpis,
  .insight-strip {
    grid-template-columns: 1fr;
  }

  .hero-copy p,
  .section-copy p {
    max-width: none;
  }

  .hero-aside {
    gap: 12px;
  }

  .hero-panel,
  .sensor-card,
  .explain-grid article {
    padding: 18px;
  }

  .section-heading {
    margin-bottom: 20px;
  }

  .section-copy h2 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .section-status {
    max-width: none;
    margin-top: 12px;
    text-align: left;
  }

  .card-top {
    align-items: start;
    flex-direction: column;
  }

  .freshness-badge {
    white-space: normal;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric,
  .assessment,
  .primary-metric {
    padding: 12px 14px;
  }

  .primary-metric strong {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .metric strong {
    font-size: 1.5rem;
  }

  .chart-heading {
    display: block;
    padding: 16px 16px 10px;
  }

  .chart-heading small {
    display: block;
    margin-top: 6px;
  }

  .chart-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 16px 14px;
  }

  .chart-stat {
    padding: 10px 12px;
  }

  .chart-panel canvas,
  .chart-panel.wide canvas {
    height: 250px;
  }

  .api-doc-grid,
  .api-field-grid {
    grid-template-columns: 1fr;
  }

  .site-footer span {
    display: block;
    margin-bottom: 6px;
  }

  .site-footer nav {
    margin-top: 10px;
  }
}

@media (max-width: 560px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(224, 168, 60, 0.18), transparent 24%),
      linear-gradient(180deg, #f7f3ea 0%, #efe8da 54%, #f7f2e8 100%);
  }

  .header-inner,
  main,
  .site-footer,
  .legal-page {
    width: min(100% - 20px, 1180px);
  }

  .brand {
    gap: 10px;
  }

  .header-inner {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .brand strong {
    font-size: 0.95rem;
  }

  .brand small {
    font-size: 0.78rem;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .top-nav a {
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .hero-copy h1 {
    font-size: clamp(2.45rem, 14vw, 3.4rem);
  }

  .hero-copy p {
    font-size: 0.98rem;
  }

  .hero-kpis article {
    padding: 14px 16px;
  }

  .insight-strip article {
    padding: 16px;
  }

  .range-picker {
    gap: 6px;
  }

  .range-btn {
    padding: 9px 12px;
    font-size: 0.84rem;
  }

  .metrics,
  .chart-stats,
  .explain-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel canvas,
  .chart-panel.wide canvas {
    height: 230px;
  }

  .site-footer {
    padding-top: 18px;
    font-size: 0.86rem;
  }
}
