:root {
  color-scheme: light;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  --color-ink: #17283e;
  --color-page: #f3f6fb;
  --color-white: #fff;
  --color-muted: #77869a;
  --color-control-border: #dce5ef;
  --color-focus: #4b83ef;
  --shadow-focus: rgba(75, 131, 239, .13);
  --color-panel: #f7f9fc;
  --color-rule: #edf1f6;
  --color-wind-light: #2e9b69;
  --color-wind-medium: #e89a36;
  --color-wind-strong: #dc4c4c;
  --color-wind-gust: #8f1d2c;
  --color-pressure: #9a72c7;
  --color-temperature: #ee8b50;
  --color-dewpoint: #5884d8;
  --color-rain-light: #78b9e8;
  --color-rain-moderate: #3289c8;
  --color-rain-heavy: #1762a5;
  --color-lightning: #e8a52a;
  color: var(--color-ink);
  background: var(--color-page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html {
  overflow-y: scroll;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 86% 0%, rgba(181, 219, 255, .36), transparent 34rem),
    var(--color-page);
}

.app-shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 46px 0 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.header-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: grid;
  flex: 0 0 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  background: var(--color-ink);
}

.brand-logo {
  width: 100%;
  height: 100%;
  color: var(--color-white);
  fill: currentColor;
}

.eyebrow {
  margin: 0 0 7px;
  color: #72839a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.eyebrow span,
.section-heading h2 span {
  color: #9babbe;
}

.page-header h1,
.section-heading h2 {
  margin: 0;
  color: var(--color-ink);
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-weight: 750;
  letter-spacing: -.035em;
}

.page-header h1 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
}

.filter-panel {
  display: flex;
  flex: 0 1 auto;
  align-items: end;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.field {
  display: grid;
  min-width: 140px;
  gap: 7px;
}

.field span,
.field-title {
  color: #66788f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}

.field select,
.field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--color-control-border);
  border-radius: 9px;
  outline: 0;
  color: #20344e;
  background: var(--color-white);
  font: 600 13px 'DM Sans', 'Segoe UI', sans-serif;
}

.field select:focus,
.field input:focus {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px var(--shadow-focus);
}

.date-field {
  min-width: 236px;
}

.date-control {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 5px;
}

.date-control input {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 0 8px;
}

.date-nav-button {
  display: grid;
  flex: 0 0 34px;
  min-height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--color-control-border);
  border-radius: 9px;
  color: #355274;
  background: var(--color-white);
}

.date-chevron {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.date-nav-button:focus-visible {
  outline: 0;
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px var(--shadow-focus);
}

.date-nav-button:disabled {
  border-color: #e4e9f0;
  color: #b7c1ce;
  background: #f3f5f8;
}

.reports-section,
.visual-section {
  margin-top: 30px;
}

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

.section-heading h2 {
  font-size: 19px;
  line-height: 1.25;
}

.table-scroll,
.weather-card {
  overflow: hidden;
  border: 1px solid #e0e7f0;
  border-radius: 15px;
  background: var(--color-white);
  box-shadow: 0 10px 30px rgba(31, 57, 91, .045);
}

.table-scroll {
  overflow-x: auto;
  padding-bottom: 5px;
  background: var(--color-panel);
}

.metar-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
  text-align: left;
}

.metar-table th {
  padding: 12px 12px;
  color: var(--color-muted);
  background: var(--color-panel);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.metar-table td {
  padding: 1px 12px;
  border-top: 1px solid var(--color-rule);
  color: #52657d;
  font-size: 15px;
  letter-spacing: .05em;
  white-space: nowrap;
}

.metar-table tbody tr:first-child td {
  border-top: 0;
}

.metar-table tbody tr:last-child td {
  padding-bottom: 4px;
}

.metar-table .airport-cell {
  color: #2459c5;
  font-weight: 700;
}

.metar-table .time-cell {
  color: #263d5a;
  font-weight: 600;
}

.metar-table code {
  color: #354c69;
  font: 500 13px/1.45 'SFMono-Regular', Consolas, monospace;
}

.metar-table code .wind-light,
.metar-table code .visibility-good {
  color: #27875e;
}

.metar-table code .wind-medium,
.metar-table code .visibility-moderate {
  color: #a96100;
}

.metar-table code .wind-strong,
.metar-table code .visibility-poor {
  color: #c63737;
}

.metar-table code .wind-gust,
.metar-table code .visibility-low {
  color: var(--color-wind-gust);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 14px;
  color: var(--color-muted);
  font-size: 10px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-arrow {
  color: #2672d8;
  font-size: 18px;
  font-style: normal;
  font-weight: 700;
  line-height: 12px;
}

.legend-cloud {
  width: 13px;
  height: 8px;
  border-radius: 5px;
  background: #476b9b;
}

.legend-visibility {
  width: 14px;
  height: 6px;
  border-radius: 5px;
  background: #32b79b;
}

.legend-temperature,
.legend-dewpoint,
.legend-pressure {
  width: 15px;
  height: 2px;
  border-radius: 2px;
}

.legend-pressure {
  background: var(--color-pressure);
}

.weather-card {
  padding: 8px 0 0;
}

.chart-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  max-width: min(240px, calc(100% - 16px));
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 7px;
  color: var(--color-white);
  background: var(--color-ink);
  box-shadow: 0 5px 16px rgba(20, 38, 62, .2);
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-line;
  pointer-events: none;
}

.chart-tooltip[hidden] {
  display: none;
}

.weather-chart [data-tooltip] {
  cursor: default;
}

.weather-chart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
}

.chart-rule {
  stroke: var(--color-rule);
  stroke-width: 1;
}

.column-rule {
  stroke: #f0f3f7;
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.chart-gridline {
  stroke: var(--color-rule);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.cloud-threshold-line {
  stroke: #9e9e9e;
}

.axis-caption,
.row-label,
.scale-label,
.hour-label,
.metric-caption {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
}

.axis-caption,
.row-label {
  fill: #8190a3;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

.scale-label {
  fill: #a4afbd;
  font-size: 8px;
}

.hour-label {
  fill: #293e59;
  font-size: 12px;
  font-weight: 700;
}

.wind-light,
.wind-medium,
.wind-strong,
.wind-gust {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.wind-light {
  color: var(--color-wind-light);
  stroke: var(--color-wind-light);
}

.wind-medium {
  color: var(--color-wind-medium);
  stroke: var(--color-wind-medium);
  stroke-width: 3;
}

.wind-strong {
  color: var(--color-wind-strong);
  stroke: var(--color-wind-strong);
  stroke-width: 3.5;
}

.wind-gust {
  color: var(--color-wind-gust);
  stroke: var(--color-wind-gust);
  stroke-width: 4;
}

.wind-arrowhead {
  fill: currentColor;
  stroke: none;
}

.calm-indicator {
  fill: #eaf6ef;
  stroke: var(--color-wind-light);
  stroke-width: 2;
}

.metric-value {
  fill: #293f5c;
  font: 700 9px 'DM Sans', sans-serif;
}

.metric-caption {
  fill: #8290a3;
  font-size: 8px;
}

.missing-data-mark {
  fill: #e5e7eb;
  font: 500 11px 'DM Sans', sans-serif;
}

.cloud-symbol {
  fill: #42668f;
}

.convective-cloud {
  fill: var(--color-wind-gust);
  stroke: #681523;
  stroke-width: .8;
  stroke-linejoin: round;
}

.rain-symbol {
  fill: currentColor;
}

.rain-light {
  color: var(--color-rain-light);
}

.rain-moderate {
  color: var(--color-rain-moderate);
}

.rain-heavy {
  color: var(--color-rain-heavy);
}

.rain-symbol.precipitation-freezing {
  color: var(--color-wind-gust);
}

.snowflake {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.4;
}

.hailstone {
  fill: var(--color-wind-gust);
  stroke: #681523;
  stroke-width: .8;
}

.wet-surface-symbol {
  fill: none;
  stroke: #4a9cc4;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.lightning-symbol {
  fill: var(--color-lightning);
  stroke: #fff;
  stroke-linejoin: round;
  stroke-width: .8;
}

.clear-sky {
  fill: #fff3c8;
  stroke: #efc75c;
  stroke-width: 2;
}

.visibility-track {
  fill: #e8f3f1;
}

.visibility-good {
  fill: #39a978;
}

.visibility-moderate {
  fill: var(--color-wind-medium);
}

.visibility-poor {
  fill: var(--color-wind-strong);
}

.visibility-low {
  fill: var(--color-wind-gust);
}

.temperature-line,
.dewpoint-line,
.pressure-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  pointer-events: none;
}

.temperature-line {
  stroke: var(--color-temperature);
}

.dewpoint-line {
  stroke: var(--color-dewpoint);
}

.pressure-line {
  stroke: var(--color-pressure);
}

.temperature-point {
  fill: var(--color-temperature);
  stroke: var(--color-white);
  stroke-width: 1.5;
}

.dewpoint-point {
  fill: var(--color-dewpoint);
  stroke: var(--color-white);
  stroke-width: 1.5;
}

.pressure-point {
  fill: var(--color-pressure);
  stroke: var(--color-white);
  stroke-width: 1.5;
}

.empty-state,
.empty-chart,
.notice {
  border: 1px dashed #d4dfeb;
  border-radius: 14px;
  color: #75869b;
  background: rgba(255, 255, 255, .78);
  font-size: 13px;
  text-align: center;
}

.empty-state {
  padding: 28px 16px;
}

.empty-chart {
  padding: 38px 16px;
}

.notice {
  display: grid;
  gap: 6px;
  padding: 28px 16px;
}

.notice strong {
  color: #2a405d;
}

.loading-state {
  color: #75869b;
  text-align: center;
}

.error-notice {
  color: #8f1d2c;
}

.retry-button {
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  color: #20344e;
  background: #fff;
  font: 600 12px 'DM Sans', 'Segoe UI', sans-serif;
}

.page-footer {
  margin: 8px auto 10px;
  color: #8996a7;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 900px) {
  .page-header {
    flex-wrap: wrap;
  }

  .filter-panel {
    flex-basis: 100%;
  }
}

@media (max-width: 740px) {
  .app-shell {
    width: min(100% - 28px, 600px);
    padding-top: 28px;
  }

  .page-header {
    display: grid;
    gap: 16px;
  }

  .header-brand {
    gap: 13px;
  }

  .brand-mark {
    flex-basis: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .filter-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0;
  }

  .field {
    min-width: 0;
  }

  .section-heading {
    align-items: start;
  }

  .visual-heading {
    display: grid;
  }

  .legend {
    justify-content: start;
    gap: 8px 14px;
  }

}

@media (max-width: 420px) {
  .filter-panel {
    grid-template-columns: 1fr;
  }

  .section-heading h2 {
    font-size: 17px;
  }
}
