:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --line: #334155;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #1e3a5f, var(--bg) 70%);
  color: var(--text);
}

.card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.search { display: flex; gap: 0.5rem; }

.search input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

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

.search button {
  padding: 0 1.1rem;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #0c4a6e;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.results li + li { border-top: 1px solid var(--line); }

.results button {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.results button:hover { background: var(--bg); }

.weather header h1 { margin: 1rem 0 0.1rem; font-size: 1.5rem; font-weight: 600; }

.now { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; }

.icon { font-size: 4rem; line-height: 1; }

.temp { margin: 0; font-size: 3.5rem; font-weight: 300; line-height: 1; }

.desc { margin: 0.3rem 0 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.stats div {
  background: var(--bg);
  border-radius: 12px;
  padding: 0.75rem;
}

.stats dt { font-size: 0.8rem; color: var(--muted); }
.stats dd { margin: 0.2rem 0 0; font-size: 1.05rem; font-weight: 500; }

.forecast {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  text-align: center;
}

.forecast li {
  background: var(--bg);
  border-radius: 12px;
  padding: 0.6rem 0.2rem;
  font-size: 0.85rem;
}

.forecast .fi { font-size: 1.4rem; display: block; margin: 0.2rem 0; }

.muted { color: var(--muted); margin: 0; font-size: 0.9rem; }

.status { margin-top: 1rem; text-align: center; }

[hidden] { display: none !important; }

@media (max-width: 420px) {
  .forecast { grid-template-columns: repeat(3, 1fr); }
  .temp { font-size: 2.8rem; }
}
