:root {
  --wx-bg:        #0f172a;
  --wx-card:      #1e293b;
  --wx-card-2:    #243245;
  --wx-text:      #e2e8f0;
  --wx-muted:     #94a3b8;
  --wx-accent:    #38bdf8;
  --wx-warn:      #f97316;
  --wx-good:      #34d399;
  --wx-radius:    12px;
  --wx-pad:       1rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --wx-bg:    #f8fafc;
    --wx-card:  #ffffff;
    --wx-card-2:#f1f5f9;
    --wx-text:  #0f172a;
    --wx-muted: #64748b;
  }
}

.wx-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
  color: var(--wx-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wx-empty {
  text-align: center;
  padding: 4rem 1rem;
}
.wx-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.4rem;
  background: var(--wx-accent);
  color: #002033;
  border-radius: var(--wx-radius);
  text-decoration: none;
  font-weight: 600;
}

/* -------------------------------------------------------------------- */
/* Header                                                               */
/* -------------------------------------------------------------------- */
.wx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.wx-station { font-size: 1.6rem; margin: 0; }
.wx-asof { color: var(--wx-muted); font-size: 0.875rem; display: flex; gap: 0.75rem; align-items: center; }

.wx-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wx-status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.wx-status[data-status="live"]       { color: var(--wx-good); background: rgba(52,211,153,.12); }
.wx-status[data-status="connecting"] { color: var(--wx-warn); background: rgba(249,115,22,.12); }
.wx-status[data-status="offline"]    { color: #ef4444;        background: rgba(239,68,68,.12); }

.wx-units {
  display: inline-flex;
  border: 1px solid var(--wx-card-2);
  border-radius: var(--wx-radius);
  overflow: hidden;
}
.wx-units-btn {
  background: transparent;
  color: var(--wx-muted);
  border: none;
  padding: 0.5rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
.wx-units-btn[aria-pressed="true"] {
  background: var(--wx-card-2);
  color: var(--wx-text);
}

/* -------------------------------------------------------------------- */
/* Cards / grid                                                         */
/* -------------------------------------------------------------------- */
.wx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.wx-card {
  background: var(--wx-card);
  border-radius: var(--wx-radius);
  padding: var(--wx-pad);
}
.wx-card h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wx-muted);
  margin: 0 0 0.75rem;
}
.wx-card-hero {
  grid-column: span 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--wx-card), var(--wx-card-2));
}
@media (max-width: 600px) {
  .wx-card-hero { grid-column: span 1; }
}

.wx-icon  { font-size: 2.5rem; opacity: .85; margin-bottom: .25rem; }
.wx-temp  { font-size: 4.5rem; font-weight: 200; line-height: 1; }
.wx-temp-unit { font-size: 1.5rem; vertical-align: top; color: var(--wx-muted); margin-left: 0.25rem; }
.wx-feels { color: var(--wx-muted); margin-top: 0.25rem; }
.wx-cond  { margin-top: 0.5rem; font-size: 1.1rem; }

.wx-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--wx-card-2);
}
.wx-stat:last-child { border-bottom: none; }
.wx-label { color: var(--wx-muted); }

/* -------------------------------------------------------------------- */
/* Compass                                                              */
/* -------------------------------------------------------------------- */
.wx-compass {
  width: 80px;
  height: 80px;
  border: 2px solid var(--wx-card-2);
  border-radius: 50%;
  position: relative;
  margin: 0 auto 1rem;
}
.wx-compass::before {
  content: "N";
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  background: var(--wx-card);
  padding: 0 4px;
  font-size: 0.7rem;
  color: var(--wx-muted);
}
.wx-compass-needle {
  position: absolute;
  top: 50%; left: 50%;
  width: 2px;
  height: 36px;
  background: var(--wx-accent);
  transform-origin: center top;
  transform: translate(-50%, 0) rotate(0deg);
  transition: transform 0.5s ease-out;
}

/* -------------------------------------------------------------------- */
/* Hourly + daily strips                                                */
/* -------------------------------------------------------------------- */
.wx-section { margin-top: 2rem; }
.wx-section h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wx-muted);
  margin-bottom: 0.75rem;
}
.wx-hourly, .wx-daily {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.wx-hour, .wx-day {
  flex: 0 0 auto;
  background: var(--wx-card);
  border-radius: var(--wx-radius);
  padding: 0.75rem;
  text-align: center;
  min-width: 72px;
}
.wx-hour-time, .wx-day-name { font-size: 0.75rem; color: var(--wx-muted); }
.wx-hour-icon, .wx-day-icon { font-size: 1.5rem; margin: 0.25rem 0; }
.wx-hour-temp { font-weight: 600; }
.wx-day-temps .wx-hi { font-weight: 600; }
.wx-day-temps .wx-lo { color: var(--wx-muted); margin-left: 0.4rem; }
.wx-hour-pop, .wx-day-pop {
  font-size: 0.75rem;
  color: var(--wx-accent);
  margin-top: 0.25rem;
}

/* -------------------------------------------------------------------- */
/* Toast                                                                */
/* -------------------------------------------------------------------- */
.wx-toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--wx-warn);
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: var(--wx-radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  z-index: 1000;
  animation: wx-slide-in 0.3s ease-out;
}
@keyframes wx-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
