* { box-sizing: border-box; }

:root {
  --bg: #EFF3F6;
  --surface: #FFFFFF;
  --ink: #1C2530;
  --ink-soft: #5B6B7A;
  --line: #DDE4EA;
  --accent: #2F6FED;
  --warm: #E2574C;
  --cool: #3E8FD0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181D;
    --surface: #1D2329;
    --ink: #EDF1F5;
    --ink-soft: #93A2AF;
    --line: #2A323A;
    --accent: #6C9BFF;
    --warm: #F0776D;
    --cool: #6BB1E6;
  }
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "SF Pro Text", "Roboto", "Segoe UI", system-ui, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 20px 40px;
}

.loc {
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.today {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 20px 28px;
  text-align: center;
  box-shadow: 0 12px 28px -18px rgba(28, 37, 48, 0.25);
  overflow: hidden;
}

.today::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 70%;
  border-radius: 50%;
  opacity: 0.16;
  pointer-events: none;
  filter: blur(2px);
}

.today.cond-sun::before   { background: radial-gradient(circle, var(--warm), transparent 70%); }
.today.cond-cloud::before { background: radial-gradient(circle, var(--ink-soft), transparent 70%); }
.today.cond-rain::before  { background: radial-gradient(circle, var(--cool), transparent 70%); }
.today.cond-snow::before  { background: radial-gradient(circle, var(--cool), transparent 70%); }

.today-icon {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.wicon {
  display: inline-flex;
  line-height: 0;
}

.today-icon-svg {
  width: 56px;
  height: 56px;
}

.wicon-sun   { color: var(--warm); }
.wicon-cloud { color: var(--ink-soft); }
.wicon-rain  { color: var(--cool); }
.wicon-snow  { color: var(--cool); }

.today-temp {
  position: relative;
  font-size: 60px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.today-desc {
  position: relative;
  margin-top: 6px;
  font-size: 16px;
  color: var(--ink-soft);
}

.today-range {
  position: relative;
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.today-range .sep {
  margin: 0 4px;
  opacity: 0.5;
}

.toggle {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.toggle:active {
  opacity: 0.85;
}

.week {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 320ms ease, opacity 260ms ease;
}

.week.open {
  max-height: 640px;
  opacity: 1;
}

.week-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.week-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.week-list li:last-child {
  border-bottom: none;
}

.day-icon-svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.day-name {
  flex: 0 0 40px;
  color: var(--ink-soft);
}

.day-desc {
  flex: 1;
  color: var(--ink-soft);
  font-size: 13px;
}

.day-rain {
  flex: 0 0 40px;
  text-align: right;
  color: var(--cool);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.day-temps {
  flex: 0 0 88px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.day-high { color: var(--warm); }
.day-low { color: var(--cool); margin-left: 6px; }

.error {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--warm);
}
