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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem;
}

#app {
  width: 100%;
  max-width: 640px;
}

header h1 {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 2.5rem;
}

/* Location form */
#location-form p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 0.75rem;
}

#search-form {
  display: flex;
  gap: 0.5rem;
}

#city-input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
}

#city-input:focus { border-color: #999; }

button {
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover { background: #333; }

/* Location label row */
#location-label {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

#location-name {
  font-size: 1.4rem;
  font-weight: 600;
}

#change-location {
  font-size: 0.8rem;
  background: none;
  color: #888;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

#change-location:hover { color: #333; background: none; }

/* Cards */
#cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem 0.75rem;
  text-align: center;
  border: 1px solid #eee;
}

.card .day {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin-bottom: 0.6rem;
}

.card .icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.card .desc {
  font-size: 0.72rem;
  color: #666;
  min-height: 2.2em;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.card .temps {
  font-size: 0.9rem;
  font-weight: 500;
}

.card .temps .low {
  color: #888;
  font-weight: 400;
  margin-left: 0.3rem;
}

/* Quip */
#quip {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: #888;
  font-style: italic;
}

/* Loading */
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top-color: #555;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.error {
  color: #c0392b;
  font-size: 0.875rem;
  margin-top: 0.6rem;
}

/* Utility */
.hidden { display: none !important; }

@media (max-width: 480px) {
  #cards { grid-template-columns: repeat(3, 1fr); }
  #cards .card:nth-child(n+4) { display: none; }
}
