: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 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
  min-height: 60px;
  flex-shrink: 0;
}
.topbar .loc {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .loc-sub {
  margin-left: auto;
  font-size: 15px;
  color: var(--text-secondary);
}
.status {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  white-space: nowrap;
}
.status[data-state="live"] { color: #04221a; background: var(--accent-secondary); }
.status[data-state="cached"] { color: var(--text-secondary); background: var(--bg-tertiary); }
.status[data-state="offline"] { color: #fff; background: var(--danger); }
.status[data-state="loading"] { color: #04222b; background: var(--accent); }

.iconbtn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  min-height: 44px;
}

/* ---- Home: current ---- */
.current {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 20px;
}
.cur-icon { font-size: 92px; line-height: 1; }
.cur-temp { font-size: 84px; font-weight: 700; line-height: 1; letter-spacing: -2px; }
.cur-cond { font-size: 24px; color: var(--text-secondary); margin-top: 4px; }
.cur-hilo { font-size: 20px; color: var(--text-muted); margin-top: 2px; }
.cur-hilo span:first-child { color: var(--text-primary); }

/* ---- Home: stats ---- */
.stats {
  display: flex;
  gap: 10px;
  padding: 0 20px 14px;
  flex-shrink: 0;
}
.stat {
  flex: 1;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-val { font-size: 22px; font-weight: 600; }

/* ---- Home: actions ---- */
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px 20px;
  flex-shrink: 0;
}
.btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  min-height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Forecast list ---- */
.fc-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fc-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 110px;
}
.fc-day { width: 110px; flex-shrink: 0; }
.fc-day .fc-name { font-size: 22px; font-weight: 700; }
.fc-day .fc-date { font-size: 15px; color: var(--text-muted); }
.fc-emoji { font-size: 52px; line-height: 1; }
.fc-cond { flex: 1; font-size: 17px; color: var(--text-secondary); }
.fc-temps { text-align: right; flex-shrink: 0; }
.fc-temps .fc-max { font-size: 30px; font-weight: 700; }
.fc-temps .fc-min { font-size: 20px; color: var(--text-muted); }

/* ---- City list ---- */
.city-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.city {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 600;
}
.city .city-cc { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.city.is-active { border-color: var(--accent-secondary); }
.city.is-active .city-cc { color: var(--accent-secondary); }

/* ---- Settings ---- */
.set-list {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.row {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 19px;
  font-weight: 600;
}
.row-val { color: var(--accent); font-size: 20px; }
.set-meta {
  margin-top: auto;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px;
}

/* Scrollbar (thin, subtle) */
.fc-list::-webkit-scrollbar,
.city-list::-webkit-scrollbar { width: 6px; }
.fc-list::-webkit-scrollbar-thumb,
.city-list::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }
