:root {
  color-scheme: dark;
  --bg: #07111a;
  --panel: rgba(8, 30, 44, 0.86);
  --line: rgba(125, 211, 252, 0.28);
  --line-strong: rgba(125, 211, 252, 0.58);
  --text: #f8fbff;
  --muted: #9fb4c4;
  --accent: #45d6a6;
  --warn: #f8c44f;
  --danger: #ff4c5d;
  --blue: #38bdf8;
  --font: "Rajdhani", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body.portal {
  display: grid;
  place-items: center;
  padding: 38px;
  background:
    linear-gradient(180deg, rgba(10, 26, 40, 0.94), rgba(3, 8, 13, 0.98)),
    repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.05) 0 1px, transparent 1px 5px);
}

a {
  color: inherit;
  text-decoration: none;
}

.portal-shell {
  width: min(1180px, 100%);
}

.portal-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.eyebrow,
.display-kicker,
.metric-label,
.panel-title,
.stream-label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0;
}

.portal-header h1 {
  margin: 4px 0 0;
  font-size: 42px;
  line-height: 1;
}

.status-pill {
  min-width: 130px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.status-pill.ok {
  color: #032d22;
  border-color: var(--accent);
  background: var(--accent);
}

.status-pill.bad {
  color: white;
  border-color: var(--danger);
  background: rgba(255, 76, 93, 0.24);
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.route-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.route-card:hover {
  border-color: var(--line-strong);
}

.route-card span,
.route-card small {
  color: var(--muted);
  font-weight: 700;
}

.route-card strong {
  font-size: 28px;
  line-height: 1;
}

.display-body {
  width: 100vw;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, #061724 0%, #02070d 100%),
    repeating-linear-gradient(0deg, rgba(56, 189, 248, 0.05) 0 1px, transparent 1px 5px);
}

.display-shell {
  width: min(1920px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-rows: 92px 178px 1fr 188px 54px;
  gap: 14px;
}

.display-header,
.top-grid,
.middle-grid,
.bottom-panel,
.ticker {
  border: 1px solid var(--line);
  background: rgba(3, 12, 20, 0.76);
}

.display-header {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
}

.brand {
  font-size: 26px;
  font-weight: 900;
}

.headline {
  text-align: center;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.clock {
  text-align: right;
  font-size: 26px;
  font-weight: 800;
  color: var(--muted);
}

.top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 16px;
  align-items: center;
}

.metric-icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  font-size: 44px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
}

.metric-value {
  font-size: 46px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.metric-note {
  color: var(--muted);
  font-size: 22px;
  font-weight: 700;
}

.middle-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(440px, 1.7fr) minmax(260px, 0.82fr);
  min-height: 0;
}

.panel {
  position: relative;
  min-width: 0;
  padding: 22px;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.panel:last-child {
  border-right: 0;
}

.panel-title {
  font-size: 18px;
}

.weather-now {
  display: grid;
  gap: 14px;
  align-content: center;
  min-height: 100%;
}

.weather-icon {
  font-size: 74px;
  line-height: 1;
}

.weather-text {
  font-size: 34px;
  line-height: 1.05;
  font-weight: 900;
}

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

.stat-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.stat-tile span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.stat-tile strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1;
}

.map-panel {
  padding: 0;
  min-height: 430px;
}

.map-canvas {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(69, 214, 166, 0.12), transparent 20%),
    linear-gradient(145deg, #153322, #082034 48%, #09131f);
}

.range-ring,
.range-spoke,
.range-cross {
  position: absolute;
  pointer-events: none;
}

.range-ring {
  border: 3px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.range-ring.r1 {
  width: 22%;
  height: 22%;
  border-color: rgba(255, 255, 255, 0.9);
}

.range-ring.r2 {
  width: 43%;
  height: 43%;
  border-color: rgba(255, 237, 110, 0.82);
}

.range-ring.r3 {
  width: 82%;
  height: 82%;
  border-color: rgba(255, 255, 255, 0.7);
}

.range-cross {
  width: 18px;
  height: 18px;
  left: calc(50% - 9px);
  top: calc(50% - 9px);
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 24px var(--warn);
}

.range-spoke {
  width: 3px;
  height: 82%;
  left: calc(50% - 1.5px);
  top: 9%;
  background: rgba(255, 255, 255, 0.76);
  transform-origin: 50% 50%;
}

.map-label {
  position: absolute;
  left: 24px;
  bottom: 22px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 28px;
  font-weight: 900;
  text-transform: uppercase;
}

.map-warning {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  text-align: center;
  background: rgba(255, 40, 65, 0.16);
  color: white;
  font-size: 48px;
  font-weight: 900;
  text-transform: uppercase;
}

.lightning-active .map-warning {
  display: grid;
}

.forecast-card {
  display: grid;
  gap: 14px;
  height: 100%;
  align-content: center;
}

.forecast-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.forecast-head .weather-icon {
  font-size: 64px;
}

.forecast-title {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.forecast-copy {
  color: var(--text);
  font-size: 22px;
  line-height: 1.18;
  font-weight: 700;
}

.bottom-panel {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.pollen-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pollen-title .weather-icon {
  font-size: 56px;
}

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

.pollen-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}

.pollen-item strong,
.pollen-item span {
  display: block;
  overflow-wrap: anywhere;
}

.pollen-item strong {
  font-size: 19px;
  text-transform: uppercase;
}

.pollen-item span {
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
}

.ticker {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 24px;
  font-weight: 800;
}

.stream-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 38px;
}

.stream-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  margin: 14px 0;
}

.stream-card pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 15px Consolas, monospace;
}

@media (max-width: 980px) {
  body.portal {
    padding: 20px;
  }

  .route-grid,
  .top-grid,
  .middle-grid,
  .bottom-panel,
  .pollen-grid,
  .display-header {
    grid-template-columns: 1fr;
  }

  .display-shell {
    height: auto;
    overflow: auto;
    grid-template-rows: auto;
  }

  .clock,
  .headline {
    text-align: left;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-panel {
    min-height: 360px;
  }
}

