:root {
  color-scheme: light dark;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1c2530;
  --text-muted: #5b6570;
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1c222b;
    --text: #f2f4f7;
    --text-muted: #9aa4b1;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app-header {
  padding: 24px 16px 10px;
  text-align: center;
}

.app-header h1 {
  margin: 0 0 16px;
  font-size: 1.4rem;
}

.profile-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  border: none;
  background: var(--surface);
  color: var(--text);
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tab.active {
  background: var(--text);
  color: var(--bg);
  transform: scale(1.05);
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px 48px;
}

.loading,
.error {
  text-align: center;
  color: var(--text-muted);
  padding: 70px 20px;
}

.primary-card {
  border-radius: var(--radius);
  padding: 30px 24px;
  background: linear-gradient(135deg, #ffe1a8, #ff9a56);
  color: #3a2400;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  text-align: center;
}

#app.category-clear .primary-card { background: linear-gradient(135deg, #ffe1a8, #ff9a56); color: #3a2400; }
#app.category-clouds .primary-card { background: linear-gradient(135deg, #d7dee3, #94a2ad); color: #1c2530; }
#app.category-fog .primary-card { background: linear-gradient(135deg, #dcd7cd, #a9a397); color: #25211a; }
#app.category-rain .primary-card { background: linear-gradient(135deg, #5b7fc7, #25335c); color: #ffffff; }
#app.category-snow .primary-card { background: linear-gradient(135deg, #eef5fc, #bcd4ea); color: #1c2530; }
#app.category-storm .primary-card { background: linear-gradient(135deg, #54606c, #242b33); color: #ffffff; }

.date {
  margin: 0 0 2px;
  font-size: 0.9rem;
  opacity: 0.85;
}

.place {
  margin: 0 0 20px;
  font-size: 1.5rem;
}

.headline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

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

.headline-temps {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.t-max {
  font-size: 2.6rem;
  font-weight: 600;
}

.t-min {
  font-size: 1.4rem;
  opacity: 0.75;
}

.condition-label {
  margin: 6px 0 24px;
  font-size: 1.05rem;
}

.periods {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 14px 8px;
}

.period {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.period-label {
  font-size: 0.66rem;
  opacity: 0.85;
  text-align: center;
  line-height: 1.15;
}

.period-icon {
  font-size: 1.4rem;
}

.period-temp {
  font-size: 0.85rem;
  font-weight: 600;
}

.others {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: 14px;
  padding: 13px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.mini-icon {
  font-size: 1.6rem;
}

.mini-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9rem;
}

.mini-info strong {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

@media (max-width: 380px) {
  .period-label { font-size: 0.58rem; }
  .headline-icon { font-size: 2.3rem; }
  .t-max { font-size: 2.1rem; }
}
