:root {
  --bg: #0a0a0c;
  --surface: #141417;
  --surface-2: #1e1e23;
  --border: #2e2e36;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --accent-2: #22d3ee;
  --rain: #60a5fa;
  --dry: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #18181c 0%, var(--bg) 60%);
  color: var(--text);
  line-height: 1.5;
}

.app-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
}

.tab-btn.active {
  background: var(--accent);
  color: #071321;
  border-color: var(--accent);
}

.search-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 280px;
}

.search-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
}

.search-input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.geo-btn {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.geo-btn:hover {
  background: rgba(56, 189, 248, 0.22);
}

.suggestions {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.suggestion-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(42, 59, 95, 0.5);
  color: var(--text);
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.suggestion-item:hover {
  background: rgba(56, 189, 248, 0.14);
}

.status-banner {
  margin-top: 0.65rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--warn);
  font-size: 0.9rem;
}

.hero-card {
  background: linear-gradient(145deg, #1a1a1f 0%, #111114 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.hero-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hero-location {
  font-size: 1.25rem;
  font-weight: 700;
}

.hero-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
}

.metric-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 0.95rem;
}

.metric-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0.15rem 0;
}

.metric-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.rain-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.rain-dry { background: rgba(52, 211, 153, 0.15); color: var(--dry); }
.rain-possible { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.rain-likely, .rain-raining { background: rgba(96, 165, 250, 0.2); color: var(--rain); }

.hourly-strip {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  margin-top: 1rem;
  padding-bottom: 0.35rem;
}

.chart-card {
  margin-top: 1rem;
  background: rgba(10, 10, 12, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 0.9rem 0.6rem;
}

.chart-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.chart-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 4px;
  border-radius: 2px;
}

.swatch-feels { background: #22d3ee; }
.swatch-temp { background: #fbbf24; }
.swatch-rain { background: rgba(96, 165, 250, 0.65); height: 8px; }

.forecast-svg {
  width: 100%;
  height: auto;
  display: block;
  touch-action: pan-y;
  cursor: crosshair;
}

.chart-tooltip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.4rem 0.7rem;
  margin-bottom: 0.45rem;
  border-radius: 8px;
  background: rgba(30, 30, 35, 0.75);
  border: 1px solid rgba(156, 163, 175, 0.25);
  font-size: 0.85rem;
}

.chart-tooltip-active {
  background: rgba(30, 30, 35, 0.96);
  border-color: rgba(156, 163, 175, 0.5);
}

.chart-tooltip-placeholder {
  color: var(--muted);
}

.chart-grid {
  stroke: rgba(158, 176, 207, 0.14);
  stroke-dasharray: 3 3;
}

.chart-axis {
  stroke: rgba(158, 176, 207, 0.35);
}

.chart-tick {
  fill: var(--muted);
  font-size: 11px;
}

.chart-tick-rain {
  fill: rgba(96, 165, 250, 0.85);
}

.hourly-pill {
  flex: 0 0 auto;
  min-width: 82px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem;
  text-align: center;
  font-size: 0.82rem;
}

.sources-section h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.source-accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.source-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.source-accordion summary::-webkit-details-marker {
  display: none;
}

.source-summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.source-body {
  border-top: 1px solid var(--border);
  padding: 0.85rem 1rem;
  background: rgba(10, 10, 12, 0.55);
  font-size: 0.9rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}
