:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-primary: #00d4ff;
  --accent-secondary: #00ff88;
  --accent-warm: #ff9f43;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --success: #00ff88;
  --warning: #ffaa00;
  --info: #00b4d8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app { width: 100%; height: 100%; position: relative; }

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

.header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
}
.header h1 { font-size: 22px; font-weight: 600; flex: 1; }
.header-meta { font-size: 13px; color: var(--text-secondary); }

.content {
  flex: 1;
  padding: 14px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.content:focus { outline: none; }

.focusable {
  transition: transform 200ms cubic-bezier(0.6, 0, 0.4, 1), box-shadow 200ms ease, background 200ms ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

.nav-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}
.nav-item:focus { background: var(--bg-card); }
.nav-item.primary { background: var(--accent-primary); color: var(--bg-primary); }
.nav-item.primary:focus { background: #33ddff; }
.nav-item.active { background: var(--danger); color: #fff; }
.nav-item.active:focus { background: #ff6680; }
.nav-item[disabled] { opacity: 0.5; cursor: default; }

.hint {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.hint.error { color: var(--danger); }
.hint.success { color: var(--success); }
.hint.pulsing { animation: pulse 1.6s ease-in-out infinite; color: var(--text-secondary); }

@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.location-line {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

.current-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.current-main {
  display: flex;
  align-items: center;
  gap: 16px;
}
.current-emoji {
  font-size: 52px;
  line-height: 1;
  width: 64px;
  text-align: center;
  flex-shrink: 0;
}
.current-temp-block { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.current-temp {
  font-size: 52px;
  font-weight: 700;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.current-unit {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 2px;
}
.current-label {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
}

.current-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--bg-tertiary);
  padding-top: 12px;
}
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.meta-value {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hourly-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section-title {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.hourly-list {
  display: flex;
  flex-direction: column;
}

.hour-row {
  display: grid;
  grid-template-columns: 64px 32px 1fr 56px;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--bg-tertiary);
  font-size: 14px;
}
.hour-row:last-child { border-bottom: none; }
.hour-time {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.hour-emoji { font-size: 20px; text-align: center; }
.hour-label {
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hour-temp {
  color: var(--accent-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.hour-precip {
  color: var(--info);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  white-space: nowrap;
}
.badge.granted { background: rgba(0, 255, 136, 0.15); color: var(--success); }
.badge.denied { background: rgba(255, 68, 102, 0.18); color: var(--danger); }
.badge.pending { background: rgba(255, 170, 0, 0.18); color: var(--warning); }
.badge.unsupported { background: rgba(96, 96, 112, 0.25); color: var(--text-secondary); }
.badge.ready { background: rgba(0, 180, 216, 0.18); color: var(--info); }

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  border: 1px solid var(--accent-primary);
  transition: transform 0.3s ease;
  z-index: 100;
  pointer-events: none;
  max-width: 520px;
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--success); }

.hidden { display: none !important; }
