:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* Top bar */
.topbar {
  flex: 0 0 auto;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 22px 26px 18px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
}
.topbar-title { font-size: 30px; font-weight: 700; letter-spacing: 0.3px; }
.topbar-sub { font-size: 18px; color: var(--text-secondary); max-width: 320px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Content */
.content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 26px 28px;
  display: flex; flex-direction: column;
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }

/* Home */
.home-content { align-items: center; }
.aqi-dial {
  width: 230px; height: 230px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-secondary);
  border: 8px solid var(--cat-color, var(--text-muted));
  box-shadow: 0 0 36px -6px var(--cat-color, transparent);
  margin-top: 6px;
}
.aqi-value { font-size: 96px; font-weight: 800; line-height: 1; color: var(--cat-color, var(--text-primary)); }
.aqi-label { font-size: 17px; color: var(--text-secondary); letter-spacing: 1.5px; margin-top: 4px; text-transform: uppercase; }
.aqi-cat {
  margin-top: 18px; font-size: 26px; font-weight: 700; text-align: center;
  color: var(--cat-color, var(--text-primary));
}
.aqi-dominant { margin-top: 6px; font-size: 18px; color: var(--text-secondary); }
.aqi-updated { margin-top: 4px; font-size: 14px; color: var(--text-muted); }

.home-actions { width: 100%; margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }

/* Buttons */
.btn {
  min-height: 64px;
  width: 100%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 20px; font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.btn-ghost { background: var(--bg-secondary); color: var(--text-secondary); font-weight: 500; }
.back-btn { margin-top: 18px; min-height: 56px; }

/* City list */
.list { gap: 12px; }
.city-item {
  min-height: 80px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.city-name { font-size: 21px; font-weight: 600; }
.city-country { font-size: 15px; color: var(--text-secondary); margin-top: 2px; }
.city-badge {
  flex: 0 0 auto;
  min-width: 64px; height: 56px;
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 24px;
  color: #0a0a0f;
}
.city-badge small { font-size: 11px; font-weight: 700; opacity: 0.8; letter-spacing: 0.5px; }

/* Pollutant breakdown */
.poll-list { display: flex; flex-direction: column; gap: 16px; }
.poll-row {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}
.poll-head { display: flex; align-items: baseline; justify-content: space-between; }
.poll-name { font-size: 20px; font-weight: 700; }
.poll-val { font-size: 18px; font-weight: 600; }
.poll-unit { font-size: 13px; color: var(--text-secondary); margin-left: 4px; }
.poll-bar-track { margin-top: 10px; height: 10px; border-radius: 5px; background: var(--bg-tertiary); overflow: hidden; }
.poll-bar-fill { height: 100%; border-radius: 5px; transition: width 0.3s ease; }
.poll-dominant { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: 0.5px; margin-left: 8px; }

/* Health */
.health-band {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  background: var(--bg-secondary);
  border-left: 6px solid var(--cat-color, var(--text-muted));
}
.health-band-cat { font-size: 22px; font-weight: 700; color: var(--cat-color, var(--text-primary)); }
.health-band-aqi { font-size: 15px; color: var(--text-secondary); margin-top: 2px; }
.health-lead { margin-top: 16px; font-size: 18px; line-height: 1.45; color: var(--text-primary); }
.health-tips { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.health-tip {
  font-size: 16px; line-height: 1.4; color: var(--text-secondary);
  background: var(--bg-primary); border-radius: 10px; padding: 12px 14px;
  display: flex; gap: 10px;
}
.health-tip .dot { color: var(--cat-color, var(--accent)); font-weight: 800; }

/* Toast */
.toast {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--accent);
  color: var(--text-primary);
  font-size: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  max-width: 520px; text-align: center;
  box-shadow: 0 0 24px -8px var(--accent);
  z-index: 10;
}
