:root {
  color-scheme: light;
  --bg: #eff4fb;
  --surface: #ffffff;
  --surface-strong: #f6f9fd;
  --text: #112033;
  --muted: #5f7289;
  --line: #d8e2ef;
  --accent: #0f7ed6;
  --accent-soft: #dcecff;
  --shadow: 0 20px 45px rgba(17, 32, 51, 0.08);

  --mio-4: #2f9d57;
  --mio-3: #f5a623;
  --mio-2: #f5732a;
  --mio-1: #e53e3e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f4f8fd 0%, #eaf1f8 100%);
  color: var(--text);
}

body {
  padding: 28px;
}

.dashboard {
  max-width: 1600px;
  margin: 0 auto;
}

/* === Hero === */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 420px);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.1;
}

.subtitle {
  margin: 14px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.weather-text {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 760px;
}

.meta-card,
.anchor-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 226, 239, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.meta-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  align-content: start;
}

.meta-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.meta-link {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

/* === Controls === */
.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.status-pill {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
}

.refresh-link {
  min-height: 40px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.refresh-link:hover {
  background: #c8dfff;
}

/* === Grid === */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* === Anchor Card === */
.anchor-card {
  overflow: hidden;
}

.anchor-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px 12px;
}

.anchor-name {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.anchor-publish-time {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.overall-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.overall-badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* === Forecast Table === */
.forecast-table-wrap {
  margin: 0 12px 14px;
  overflow-x: auto;
}

.forecast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.35;
}

.forecast-table th {
  position: sticky;
  top: 0;
  background: var(--surface-strong);
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.forecast-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(216, 226, 239, 0.5);
  white-space: nowrap;
}

.forecast-table tbody tr:hover {
  background: rgba(15, 126, 214, 0.04);
}

/* Current time-slot highlight */
.forecast-table tbody tr.current-slot {
  background: rgba(15, 126, 214, 0.08);
  font-weight: 600;
}

.forecast-table tbody tr.current-slot td:first-child {
  position: relative;
}

.forecast-table tbody tr.current-slot td:first-child::before {
  content: "▸";
  position: absolute;
  left: 1px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 11px;
}

/* Day separator */
.forecast-table tbody tr.day-sep td {
  border-top: 2px solid var(--line);
}

/* MIO dots */
.mio-cell {
  display: flex;
  gap: 4px;
  align-items: center;
}

.mio-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.mio-dot[title]::after {
  content: "";
}

.mio-4 { background-color: var(--mio-4); }
.mio-3 { background-color: var(--mio-3); }
.mio-2 { background-color: var(--mio-2); }
.mio-1 { background-color: var(--mio-1); }

/* MIO legend */
.mio-legend {
  display: flex;
  gap: 14px;
  padding: 8px 18px 14px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}

.mio-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mio-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* === Footer === */
.footer {
  margin-top: 28px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

/* === Responsive === */
@media (max-width: 1080px) {
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding: 14px;
  }

  .controls {
    flex-wrap: wrap;
  }

  .anchor-name {
    font-size: 18px;
  }

  .forecast-table {
    font-size: 11.5px;
  }

  .forecast-table th,
  .forecast-table td {
    padding: 5px 6px;
  }
}
