:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --card-bg: #ffffff;
  --text: #1c1c1e;
  --text-secondary: #6e6e73;
  --border: rgba(60, 60, 67, 0.15);
  --good: #1f9d55;
  --minor: #b8860b;
  --severe: #d0342c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card-bg: #1c1c1e;
    --text: #f2f2f7;
    --text-secondary: #98989d;
    --border: rgba(255, 255, 255, 0.12);
    --good: #34c759;
    --minor: #ffcc00;
    --severe: #ff453a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.page-header {
  padding: 12px 4px 20px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.date {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.day-toggle {
  display: flex;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin: 0 0 16px;
}

.day-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 0;
  border-radius: 9px;
  font-family: inherit;
}

.day-toggle button.active {
  background: var(--good);
  color: #fff;
}

.live-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.loading {
  color: var(--text-secondary);
  margin: 0;
}

.error {
  color: var(--severe);
  margin: 0;
}

/* Weather card */
.weather-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.weather-temp {
  font-size: 2.2rem;
  font-weight: 600;
}

.weather-desc {
  color: var(--text-secondary);
}

.weather-details {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Tube card */
.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.status-good { background: var(--good); }
.status-minor { background: var(--minor); color: #1c1c1e; }
.status-severe { background: var(--severe); }

.status-reason {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.tube-line-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.tube-line-row:last-child {
  border-bottom: none;
}

.tube-line-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tube-line-name {
  font-weight: 500;
}

/* Calendar card */
.meeting-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.meeting-list li {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.meeting-list li:last-child {
  border-bottom: none;
}

.meeting-time {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 46px;
}

.meeting-title {
  font-weight: 500;
}

/* News card */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.news-list li:last-child {
  border-bottom: none;
}

.news-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.news-list a:active {
  opacity: 0.6;
}
