:root {
  --bg: #eef3f7;
  --ink: #1c2b33;
  --muted: #6d7f89;
  --panel: #ffffff;
  --line: #d9e3e8;
  --green: #18a37a;
  --blue: #1784c7;
  --orange: #e48922;
  --shadow: 0 12px 34px rgba(28, 43, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.live-header,
.live-grid,
.charts-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.live-header {
  padding: 24px 0 16px;
}

.brand-row,
.status-row,
.card-head,
.wind-layout,
.two-metrics,
.split {
  display: flex;
}

.brand-row,
.status-row {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.station-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.station-switch button {
  min-height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.station-switch button.is-active {
  background: var(--green);
  color: #fff;
}

.status-row {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 28px;
}

.weather-card {
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.outdoor-card,
.wind-card {
  min-height: 260px;
}

.card-head {
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: #344d58;
}

.card-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #e8f6f2;
  color: var(--green);
  font-weight: 900;
}

.split {
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.metric-label,
.subline,
.trend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hero-value {
  margin-top: 4px;
  font-size: clamp(54px, 9vw, 96px);
  font-weight: 300;
  line-height: 0.95;
  color: var(--green);
}

.big-value {
  margin-top: 6px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 300;
  line-height: 1;
  color: var(--blue);
}

.hero-value small,
.big-value small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 22px;
  font-weight: 700;
}

.trend,
.subline {
  margin-top: 9px;
}

.metric-stack,
.mini-grid,
.rain-grid {
  display: grid;
  gap: 10px;
}

.metric-stack {
  min-width: 190px;
  grid-template-columns: 1fr;
}

.metric-stack div,
.mini-grid div,
.rain-grid div {
  padding: 10px 12px;
  border-radius: 6px;
  background: #f5f9fb;
}

.metric-stack span,
.mini-grid span,
.rain-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-stack strong,
.mini-grid strong,
.rain-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

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

.two-metrics {
  gap: 20px;
}

.two-metrics > div {
  flex: 1 1 0;
}

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

.primary-rain {
  grid-column: span 2;
}

.wind-layout {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.compass {
  position: relative;
  display: grid;
  width: 154px;
  height: 154px;
  flex: 0 0 154px;
  place-items: center;
  border: 2px solid #d8e5ea;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 30%, transparent 31%),
    conic-gradient(from 0deg, #f3f8fa 0 25%, #eaf2f5 0 50%, #f3f8fa 0 75%, #eaf2f5 0 100%);
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.compass-ring {
  position: absolute;
  inset: 22px;
  border: 1px solid #d6e3e8;
  border-radius: 50%;
}

.compass::before,
.compass::after {
  content: "";
  position: absolute;
  background: #cad9df;
}

.compass::before {
  width: 1px;
  height: 100%;
}

.compass::after {
  width: 100%;
  height: 1px;
}

.dir {
  position: absolute;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  z-index: 1;
}

.dir-n { top: 8px; }
.dir-e { right: 10px; }
.dir-s { bottom: 8px; }
.dir-w { left: 10px; }

.needle {
  position: absolute;
  top: 22px;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 58px solid var(--orange);
  transform: translateX(-50%) rotate(0deg);
  transform-origin: 50% 55px;
  z-index: 2;
}

.error-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 420px;
  padding: 14px 16px;
  border: 1px solid #f2b8b5;
  border-radius: 8px;
  background: #fff1f0;
  color: #842029;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.charts-shell {
  padding: 4px 0 34px;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.range-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.range-tabs button,
.date-tools button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbfc;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.range-tabs button {
  padding: 0 13px;
}

.range-tabs button.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.date-tools {
  display: flex;
  gap: 6px;
  align-items: center;
}

.date-tools button {
  width: 38px;
  font-size: 22px;
  line-height: 1;
}

.date-tools input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  font: inherit;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.chart-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.chart-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chart-card canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.chart-tooltip {
  position: fixed;
  z-index: 30;
  min-width: 190px;
  padding: 9px 10px;
  border: 1px solid rgba(28, 43, 51, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 13px;
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 4px;
}

.chart-tooltip span {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.is-muted {
  opacity: 0.48;
}

@media (max-width: 860px) {
  .brand-row,
  .status-row,
  .split,
  .wind-layout,
  .two-metrics {
    display: block;
  }

  .station-switch {
    margin-top: 14px;
  }

  .live-grid {
    grid-template-columns: 1fr;
  }

  .chart-toolbar,
  .chart-head {
    display: block;
  }

  .date-tools {
    margin-top: 10px;
  }

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

  .metric-stack,
  .rain-grid {
    margin-top: 16px;
  }

  .rain-grid {
    grid-template-columns: 1fr 1fr;
  }

  .compass {
    margin: 18px 0;
  }
}
