.weather-page { min-height: 100vh; background: linear-gradient(160deg, var(--page-bg), var(--page-bg-2)); }
.weather-shell { width: min(100% - 40px, 1040px); margin: 0 auto; padding: 16px 0 18px; }
.weather-shell > .page-header { margin-bottom: 14px; }
.city-search { display: flex; gap: 8px; margin-bottom: 8px; }
.city-search input { min-width: 0; flex: 1; height: 40px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--field-bg); color: var(--ink); font-size: 15px; }
.weather-button, .weather-retry { min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.weather-button:hover, .weather-retry:hover { background: var(--accent-hover); }
.city-results { display: grid; gap: 6px; margin: 8px 0 14px; }
.city-result { min-height: 46px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.city-result:hover { background: var(--page-bg-2); }
.weather-message { min-height: 22px; margin: 10px 0; color: var(--muted); font-size: 14px; }
.weather-message.error { color: var(--danger); }
.weather-message:empty { display: none; }
.weather-retry { margin: 4px 0 16px; }
.current-panel { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; align-items: center; gap: 5px; padding: 15px 18px; border: 1px solid var(--accent-soft-line); border-radius: var(--radius-lg); background: var(--accent-soft); }
.current-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.eyebrow { margin: 0 0 3px; color: var(--accent-soft-muted); font-size: 12px; }
.current-top h2 { margin: 0; font-size: clamp(17px, 2vw, 21px); letter-spacing: -.025em; }
.refresh-button { width: 36px; height: 36px; flex: none; border: 1px solid var(--accent-soft-divider); border-radius: var(--radius-sm); background: var(--accent-soft-chip); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.refresh-button:hover { background: var(--surface-hover); }
.current-main { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.weather-symbol { width: 52px; flex: none; font-size: 48px; line-height: 1; text-align: center; }
.temperature-line { display: flex; align-items: baseline; gap: 10px; }
.temperature { font-size: clamp(84px, 10vw, 104px); line-height: .9; font-weight: 700; letter-spacing: -.075em; font-variant-numeric: tabular-nums; }
.degree { font-size: .66em; vertical-align: top; letter-spacing: -.04em; }
.feels-inline { display: inline-flex; align-items: baseline; gap: 7px; color: var(--accent-soft-muted); white-space: nowrap; }
.feels-slash { color: var(--muted); font-size: 44px; line-height: .9; font-weight: 400; }
.feels-inline strong { color: var(--ink); font-size: 44px; line-height: .9; font-weight: 600; font-variant-numeric: tabular-nums; }
.details-grid { grid-column: 1; grid-row: auto; min-width: 0; margin: 0; }
.detail-card { min-width: 0; padding: 7px 11px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--accent-soft-line); border-radius: var(--radius-sm); background: var(--accent-soft-chip); }
.wind-metric { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 7px; row-gap: 1px; }
.humidity-metric { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.detail-label { color: var(--muted); font-size: 11px; }
.detail-card strong { font-size: clamp(15px, 1.8vw, 19px); font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.detail-note { color: var(--muted); font-size: 10px; }
.wind-direction { font-size: 12px; font-weight: 500; white-space: nowrap; }
.forecast-section { margin-top: 14px; }
.forecast-section h2 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.02em; }
.forecast-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.forecast-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.carousel-controls { display: flex; gap: 7px; flex: none; }
.carousel-controls button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 21px; line-height: 1; cursor: pointer; }
.carousel-controls button:hover { background: var(--page-bg-2); }
.hourly-list, .daily-list { display: block; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding: 1px 1px 6px; }
.hourly-track, .daily-track { position: relative; display: flex; min-width: max-content; }
.hourly-track { height: 140px; }
.daily-track { height: 216px; }
.hour-card { position: relative; min-width: 0; flex: 0 0 54px; height: 140px; padding: 10px 2px; display: flex; flex-direction: column; align-items: center; border: 0; background: transparent; text-align: center; scroll-snap-align: start; }
.hour-card::before, .daily-card::before { content: ""; position: absolute; z-index: 0; inset: 3px 2px; border-radius: 15px; background: var(--page-bg-2); opacity: .72; }
.hour-card > *, .daily-card > * { position: relative; z-index: 4; }
.hour-card:nth-child(even)::before, .daily-card:nth-child(even)::before { background: var(--control-bg); }
.hour-time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hour-symbol { display: block; margin: 9px 0 3px; font-size: 21px; }
.hour-temp { display: block; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.temperature-curve { position: absolute; z-index: 2; top: 0; left: 0; height: 100%; overflow: visible; pointer-events: none; }
.temperature-line { fill: none; stroke: #528cdd; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.temperature-point { fill: #528cdd; stroke: var(--page-bg); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.daily-temperature-curve { height: 216px; }
.daily-temperature-curve .temperature-line-night { stroke: #727f89; }
.daily-temperature-curve .temperature-point-night { fill: #727f89; }
.daily-card { position: relative; min-width: 0; flex: 0 0 76px; height: 216px; padding: 9px 3px; display: flex; flex-direction: column; align-items: center; border: 0; background: transparent; text-align: center; scroll-snap-align: start; }
.daily-card-top { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.daily-name { font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.daily-symbol { font-size: 21px; line-height: 1; }
.daily-high { position: absolute !important; top: 76px; z-index: 4; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.daily-low { position: absolute !important; top: 180px; z-index: 4; color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline-legend { display: flex; align-items: center; gap: 9px; margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.timeline-legend span { display: inline-flex; align-items: center; gap: 4px; }
.timeline-legend span::before { content: ""; width: 12px; border-top: 2px solid #528cdd; }
.timeline-legend .legend-night::before { border-color: #727f89; }
.temperature-curve.hourly-temperature-curve .temperature-line { stroke: #528cdd; }
.uv-section { margin-top: 12px; padding: 9px 12px 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--control-bg); }
.uv-chart { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.uv-chart svg { display: block; max-width: none; height: 86px; overflow: visible; margin-inline: auto; }
.uv-bar-bg { fill: var(--line); opacity: .55; }
.uv-bar-bg-current { fill: #d99a19; opacity: .22; }
.uv-bar-value { fill: var(--muted); font: 10px system-ui, sans-serif; }
.uv-bar-value-current { fill: #8a5907; font-size: 12px; font-weight: 700; }
.uv-bar-time { fill: var(--muted); font: 10px system-ui, sans-serif; }
.uv-bar-time-current { fill: var(--ink); font-weight: 700; }
.uv-bar-column { fill: #d99a19; }
.uv-bar-current { fill: #ae7410; }
.weather-footer { display: flex; justify-content: flex-start; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.weather-footer a { color: inherit; text-underline-offset: 3px; }
.weather-page [hidden] { display: none !important; }

html[data-theme="dark"] .detail-card { background: #344438; border-color: #4b5b4c; }

@media (max-width: 700px) {
  .weather-shell { width: min(100% - 24px, 540px); padding: max(12px, env(safe-area-inset-top)) 0 max(14px, env(safe-area-inset-bottom)); }
  .weather-shell > .page-header { gap: 10px; margin-bottom: 10px; }
  .page-meta { font-size: 12px; }
  .city-search { gap: 6px; }
  .city-search input { height: 38px; padding: 0 10px; }
  .weather-button { min-height: 38px; padding: 0 10px; font-size: 13px; }
  .current-panel { gap: 4px; padding: 9px 12px; border-radius: 14px; }
  .current-top { grid-column: 1; }
  .current-main { grid-column: 1; margin: 1px 0 3px; gap: 8px; }
  .weather-symbol { width: 42px; font-size: 38px; }
  .temperature { font-size: 76px; }
  .temperature-line { gap: 8px; }
  .feels-inline { gap: 5px; }
  .feels-slash, .feels-inline strong { font-size: 32px; }
  .details-grid { width: 100%; }
  .detail-card { width: 100%; min-height: 0; padding: 6px 9px; border-radius: 10px; gap: 7px; }
  .wind-metric { column-gap: 6px; }
  .detail-card strong { font-size: 15px; }
  .detail-label { font-size: 10px; }
  .detail-note { font-size: 9px; }
  .forecast-section { margin-top: 4px; }
  .hourly-list, .daily-list { padding-bottom: 3px; }
  .forecast-heading { gap: 8px; margin-bottom: 3px; }
  .forecast-heading h2 { font-size: 15px; }
  .carousel-controls { gap: 5px; }
  .carousel-controls button { width: 34px; height: 34px; }
  .hourly-track, .hour-card { height: 76px; }
  .hour-card { flex-basis: 54px; padding: 4px 2px; }
  .hour-time { font-size: 11px; }
  .hour-symbol { margin: 3px 0 1px; font-size: 16px; line-height: 1; }
  .hour-temp { font-size: 14px; }
  .daily-track, .daily-card, .daily-temperature-curve { height: 100px; }
  .daily-card { flex-basis: 76px; padding: 6px 3px; }
  .daily-card-top { gap: 3px; }
  .daily-name { font-size: 11px; }
  .daily-symbol { font-size: 18px; }
  .daily-high { top: 43px; font-size: 14px; }
  .daily-low { top: 77px; font-size: 12px; }
  .uv-section { margin-top: 4px; padding: 4px 7px 2px; }
  .uv-section .forecast-heading { margin-bottom: 2px; }
  .uv-section .forecast-heading h2 { font-size: 14px; }
  .uv-chart svg { height: 44px; }
  .uv-bar-value { font-size: 9px; }
  .uv-bar-value-current { font-size: 10px; }
  .uv-bar-time { font-size: 8px; }
  .weather-footer { flex-direction: column; gap: 3px; }
}

@media (max-width: 360px) {
  .weather-shell { width: min(100% - 18px, 540px); }
  .page-meta { max-width: 92px; }
  .weather-button { padding: 0 8px; }
  .daily-card { flex-basis: 76px; padding: 9px 3px; }
}

@media (prefers-reduced-motion: no-preference) {
  .weather-button, .refresh-button, .weather-retry, .city-result, .carousel-controls button { transition: background .15s ease; }
}
