:root {
  --bg: #020a14;
  --panel: #06111f;
  --panel-2: #0a1d33;
  --panel-soft: #07182b;

  --line: #244865;
  --line-soft: #15324c;
  --line-blue: #1d5d8f;

  --blue: #2f9bff;
  --blue-2: #5fd7ff;
  --blue-hot: #b7efff;
  --blue-soft: rgba(95, 215, 255, 0.16);
  --blue-grid: rgba(95, 215, 255, 0.13);

  --cyan: #5fd7ff;
  --text: #ffffff;
  --muted: #9bb6ca;

  --green: #63f7a6;
  --yellow: #ffe978;
  --red: #ff6f7d;

  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  scrollbar-color: #4b728c #06111f;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

*::-webkit-scrollbar-track {
  background: #06111f;
}

*::-webkit-scrollbar-thumb {
  background: #4b728c;
  border: 2px solid #06111f;
}

*::-webkit-scrollbar-thumb:hover {
  background: #6f9db8;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(95, 215, 255, 0.10), transparent 28%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 24%),
    repeating-linear-gradient(90deg, rgba(95, 215, 255, 0.028) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 24px),
    var(--bg);
  color: var(--text);
  font-family: "Cascadia Mono", "Consolas", "Roboto Mono", monospace;
  overflow-x: hidden;
}

.station-header {
  position: fixed;
  inset: 0 0 auto 0;
  min-height: 88px;
  z-index: 10;
  background: #020a14;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
}

.station-title {
  min-width: 0;
}

.eyebrow {
  color: var(--blue-2);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
}

h1 {
  margin: 6px 0 0;
  color: #ffffff;
  font-family: "Bahnschrift", "Orbitron", "Rajdhani", "Segoe UI", sans-serif;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.online {
  color: var(--green);
}

.offline {
  color: var(--red);
}

.shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 108px 0 32px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--panel);
}

.metric-card {
  min-height: 132px;
  padding: 18px;
  background: #06111f;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.metric-card:hover {
  outline: 1px solid var(--blue-2);
  outline-offset: -1px;
  background: #0a1d33;
}

.metric-card.primary {
  background:
    linear-gradient(135deg, rgba(95, 215, 255, 0.18), rgba(2, 10, 20, 0.25)),
    #06111f;
}

.metric-label,
.metric-card span {
  color: var(--blue-2);
  font-size: 12px;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 12px 0 6px;
  color: #ffffff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-card .packet-reading {
  margin-top: 6px;
  color: var(--cyan);
  line-height: 1.25;
  text-transform: uppercase;
}

.iaq-card strong {
  color: var(--blue-hot);
}

.iaq-card.iaq-green strong {
  color: var(--green);
}

.iaq-card.iaq-yellow strong {
  color: var(--yellow);
}

.iaq-card.iaq-red strong {
  color: var(--red);
}

.iaq-bar {
  height: 8px;
  margin: 10px 0 8px;
  background: #0b2238;
  border: 1px solid var(--line);
}

.iaq-bar i {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--green);
  transition: width 0.25s ease, background 0.25s ease;
}

.instrument-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.instrument-card {
  background:
    radial-gradient(circle at top right, rgba(95, 215, 255, 0.10), transparent 34%),
    linear-gradient(180deg, #07182b 0%, #04101f 100%);
  border: 1px solid var(--line-blue);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow: hidden;
}

.instrument-card h2,
.panel h2 {
  margin: 0 0 12px 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
}

.compass-card {
  min-height: 374px;
}

.compass-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 8px;
}

.compass-stack {
  width: 100%;
  max-width: 300px;
}

#compass {
  display: block;
  width: 280px;
  height: 280px;
  margin: 0 auto;
}

#compass text {
  fill: #dff8ff;
  font-size: 14px;
  font-weight: 600;
}

.compass-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.compass-meta strong {
  color: #ffffff;
  font-weight: 800;
}

.wind-chart-card {
  min-height: 374px;
}

.wind-chart-card canvas {
  width: 100%;
  height: 300px;
  display: block;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0));
  border-radius: 14px;
}

.panel {
  margin-top: 18px;
  background:
    radial-gradient(circle at top right, rgba(95, 215, 255, 0.08), transparent 32%),
    linear-gradient(180deg, #07182b 0%, #04101f 100%);
  border: 1px solid var(--line-blue);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#weatherChart {
  width: 100%;
  height: 340px !important;
  display: block;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0));
  border-radius: 14px;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .compass-card {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .station-header {
    position: static;
    display: block;
    padding: 18px;
  }

  .status-strip {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .shell {
    padding-top: 18px;
  }

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

  h1 {
    font-size: 24px;
  }

  .instrument-card,
  .panel {
    padding: 14px;
  }

  #compass {
    width: 260px;
    height: 260px;
  }

  .wind-chart-card canvas {
    height: 260px;
  }
}
