:root {
    color-scheme: light;
    --bg: #f5f5f5; --surface: #fff; --text: #171717; --muted: #626262;
    --accent: #2563eb; --selection: #eaf0ff; --line: #e5e5e5; --sun: #f5b800;
    --cloud: #7594a9; --alert: #9c4c00; --alert-bg: #fff0d8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-synthesis: none; letter-spacing: 0;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #000; --surface: #1c1c1e; --text: #f5f5f5; --muted: #aaa;
    --accent: #8aafff; --selection: #202c46; --line: #38383a;
    --cloud: #a8c7dc; --alert: #ffd08b; --alert-bg: #352817;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; border: 0; -webkit-tap-highlight-color: transparent; }
button, input, a { touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .55; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
main { width: min(100%, 1040px); margin: auto; padding: max(20px, env(safe-area-inset-top)) 32px max(24px, env(safe-area-inset-bottom)); }
.icon { display: inline-block; width: 24px; height: 24px; flex-shrink: 0; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; vertical-align: middle; }
.icon.small { width: 18px; height: 18px; }
.app-header, .header-actions, .location-button, .section-heading, .sheet-heading { display: flex; align-items: center; }
.app-header { justify-content: space-between; gap: 12px; }
.header-actions { gap: 6px; flex-shrink: 0; }
.location-button { min-width: 0; min-height: 48px; gap: 10px; padding: 6px 0; background: none; font-size: 20px; font-weight: 650; text-align: left; }
#location-name { overflow-wrap: anywhere; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); flex-shrink: 0; }
.icon-button:hover { background: var(--selection); }
.status-row { min-height: 28px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); padding-top: 6px; }
.status-row.error { color: var(--alert); }
.text-button { min-height: 44px; padding: 8px 12px; background: none; color: var(--accent); font-weight: 650; }
.current { text-align: center; padding: 16px 0 32px; min-height: 270px; }
.current-date { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.current-main { display: flex; justify-content: center; align-items: center; gap: 28px; }
.current-temperature { font-size: 100px; font-weight: 300; line-height: 1.2; font-variant-numeric: tabular-nums; }
.weather-symbol { width: 88px; height: 88px; color: var(--cloud); }
.weather-symbol.sun, .weather-symbol.moon, .weather-symbol.sunrise, .weather-symbol.sunset { color: var(--sun); }
.weather-symbol.cloud-rain, .weather-symbol.cloud-drizzle, .weather-symbol.cloud-lightning { color: var(--accent); }
.current-condition { font-size: 20px; margin: 8px 0 10px; font-weight: 550; }
.current-detail { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; }
.metric { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.metric .icon { width: 18px; height: 18px; }
.wind-readings { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.gust-value { padding-left: 24px; font-size: 12px; }
.metric.strong-wind { color: #a42621; background: #ffe7e5; border-radius: 6px; font-weight: 750; }
[data-theme="dark"] .metric.strong-wind { color: #ffb4ad; background: #4b2020; }
.wind-readings .strong-wind { padding: 2px 4px; }
.hours-heading { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 2; background: var(--bg); padding: 12px 0; }
.hours-heading .section-date { font-weight: 600; color: var(--text); }
.hours-heading h2 { flex-shrink: 0; }
.hour.day-boundary { box-shadow: inset 1px 0 var(--line); }
.current-extra { margin-top: 14px; }
.alerts:empty { display: none; }
.alert { display: flex; gap: 12px; padding: 16px 20px; border-radius: 20px; background: var(--alert-bg); color: var(--alert); font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.alert p { margin: 0; overflow-wrap: anywhere; }
.forecast-section { margin-bottom: 28px; min-width: 0; }
.section-heading { justify-content: space-between; gap: 14px; margin: 0 4px 14px; }
h2 { margin: 0; font-size: 20px; font-weight: 650; }
.section-date { color: var(--muted); font-size: 13px; text-align: right; }
.hours { display: flex; overflow-x: auto; overscroll-behavior-x: contain; gap: 0; border-radius: 24px; background: var(--surface); padding: 4px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.history-toggle { flex: 0 0 15px; width: 15px; min-height: 44px; align-self: stretch; margin: 0; padding: 0; border-radius: 8px; background: var(--selection); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.history-toggle .icon { width: 12px; height: 12px; transform: rotate(90deg); }
.history-toggle[aria-expanded="true"] .icon { transform: rotate(-90deg); }
.hour { position: relative; flex: 0 0 110px; min-width: 0; padding: 19px 10px 16px; border-radius: 20px; text-align: center; }
.hour.night::before { content: ''; position: absolute; height: 3px; top: 0; left: 12px; right: 12px; background: #000; border-radius: 2px; }
[data-theme="dark"] .hour.night::before { background: #9b9ba2; }
.hour.past { opacity: .5; }
.hour.now { background: var(--selection); }
.hour-time { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.condition-control { position: relative; }
.condition-control summary { cursor: pointer; list-style: none; display: flex; justify-content: center; align-items: center; min-height: 48px; border-radius: 12px; }
.condition-control summary::-webkit-details-marker { display: none; }
.condition-control .weather-symbol { width: 34px; height: 34px; }
.condition-description { font-size: 12px; line-height: 1.4; margin: 4px 0 10px; overflow-wrap: anywhere; }
.hour-temperature { font-size: 26px; font-weight: 600; margin: 10px 0 12px; }
.hour-metrics { display: grid; gap: 10px; justify-items: center; }
.hour-metrics .metric { font-size: 13px; color: var(--muted); gap: 5px; white-space: nowrap; }
.hour-metrics .metric.strong-wind { color: #a42621; }
[data-theme="dark"] .hour-metrics .metric.strong-wind { color: #ffb4ad; }
.hour-metrics .unit { font-size: 10px; }
.hour-metrics .notable-rain { color: #144db3; background: #e2edff; border-radius: 6px; padding: 2px 4px; font-weight: 750; }
[data-theme="dark"] .hour-metrics .notable-rain { color: #b6d3ff; background: #19345a; }
.days { display: flex; gap: 14px; overflow-x: auto; padding: 3px 3px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.day { background: var(--surface); border: 2px solid transparent; border-radius: 24px; flex: 0 0 calc((100% - 28px) / 3); min-width: 0; padding: 20px; text-align: left; scroll-snap-align: start; }
.day.selected { border-color: var(--accent); }
.day-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; }
.day.selected .day-heading { color: var(--accent); }
.day-heading .icon { width: 18px; height: 18px; }
.day-date { color: var(--muted); font-size: 12px; margin-top: 4px; }
.day-weather { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; }
.day-weather .weather-symbol { width: 40px; height: 40px; }
.day-temperature { font-size: 28px; font-weight: 550; }
.day-temperature small { font-size: 22px; color: var(--muted); margin-left: 8px; }
.day-condition { font-size: 13px; margin-bottom: 16px; min-height: 18px; }
.day-metrics { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }
.astro { display: flex; overflow-x: auto; background: var(--surface); border-radius: 24px; padding: 22px 8px; scrollbar-width: thin; }
.astro-item { display: flex; flex: 1 0 130px; flex-direction: column; align-items: center; gap: 9px; text-align: center; font-size: 14px; padding: 0 12px; }
.astro-item .icon { color: var(--sun); width: 28px; height: 28px; }
.astro-item small { font-size: 12px; color: var(--muted); }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 11px; padding: 0 4px 12px; }
.sheet { border: 0; border-radius: 28px; padding: 24px; background: var(--surface); color: var(--text); width: min(520px, calc(100% - 32px)); max-height: 85dvh; overscroll-behavior: contain; }
.sheet::backdrop { background: #0006; }
.sheet-heading { justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.back-icon { transform: rotate(90deg); }
#saved-places { list-style: none; margin: 0 0 20px; padding: 4px; max-height: 48dvh; overflow-y: auto; }
.saved-place { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.saved-place-select { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 64px; padding: 12px; border-radius: 12px; background: transparent; text-align: left; }
.saved-place-select[aria-pressed="true"] { color: var(--accent); background: var(--selection); }
.saved-place-description { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.saved-place-description strong, .saved-place-description small { display: block; }
.saved-place-description small { color: var(--muted); margin-top: 4px; }
.current > .action-button { width: auto; margin: 0 auto; padding-inline: 28px; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--bg); border-radius: 16px; }
.search-field input { width: 100%; min-width: 0; background: none; border: 0; color: var(--text); min-height: 52px; font-size: 16px; }
#suggestions { list-style: none; margin: 12px 0 0; padding: 0; max-height: 48dvh; overflow-y: auto; }
#suggestions li { padding: 13px 14px; min-height: 52px; border-radius: 12px; cursor: pointer; }
#suggestions li[aria-selected="true"], #suggestions li:hover { background: var(--selection); }
#suggestions li strong { display: block; overflow-wrap: anywhere; }
#suggestions li small { display: block; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
#search-status { margin-top: 10px; }
fieldset { border: 0; padding: 0; margin: 0 0 24px; }
legend { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-options label { display: flex; flex-direction: column; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 18px; padding: 14px 4px; font-size: 14px; cursor: pointer; position: relative; }
.theme-options label:has(:checked) { border-color: var(--accent); background: var(--selection); color: var(--accent); }
.theme-options input { accent-color: var(--accent); }
.view-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.view-options label { text-align: center; }
.complete-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0 4px 20px; color: var(--muted); font-size: 12px; }
.complete-legend .icon { width: 16px; height: 16px; }
.complete-day { width: 100%; table-layout: fixed; border-spacing: 0; margin-bottom: 28px; background: var(--surface); border-radius: 24px; }
.complete-day caption { text-align: left; padding: 4px 4px 14px; font-size: 17px; font-weight: 650; }
.complete-day td { width: 16.666667%; padding: 6px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.complete-day tr:last-child td { border-bottom: 0; }
.complete-day .compact-hour { width: 100%; min-width: 0; padding: 12px 4px; border-radius: 12px; box-shadow: none; }
.compact-hour .hour-time { font-size: 13px; margin: 2px 0 0; }
.compact-hour .hour-temperature { font-size: 22px; margin: 5px 0 10px; }
.compact-hour .hour-metrics { gap: 9px; }
.compact-hour .hour-metrics .metric { font-size: 13px; gap: 2px; }
.compact-hour .hour-metrics .unit { display: none; }
.compact-hour .hour-metrics > .metric:not(.hour-rain) .icon,
.compact-hour .wind-readings .icon { display: none; }
.compact-hour .hour-rain .icon { width: 12px; height: 12px; }
.compact-hour .hour-rain { flex-wrap: wrap; justify-content: center; max-width: 100%; }
.compact-hour .gust-value { padding-left: 0; }
.compact-hour .wind-readings { gap: 6px; }
.compact-hour .condition-description { font-size: 11px; padding: 0 2px; }
.missing-hour { display: grid; place-items: center; min-height: 160px; color: var(--muted); }
@media (max-width: 640px) {
    .complete-day .compact-hour { padding: 12px 2px; }
    .compact-hour .hour-temperature { font-size: 15px; font-weight: 650; }
    .compact-hour .hour-time { font-size: 12px; }
    .compact-hour .condition-control .weather-symbol { width: 25px; height: 25px; }
    .compact-hour .hour-metrics .metric { font-size: 11px; }
    .compact-hour .wind-readings .strong-wind, .compact-hour .notable-rain { padding: 2px; }
    .complete-legend { gap: 8px; font-size: 11px; }
}
.action-button { display: flex; justify-content: center; align-items: center; width: 100%; gap: 10px; background: var(--accent); color: var(--surface); border-radius: 24px; padding: 14px; min-height: 48px; }
.update-banner { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(480px, calc(100% - 32px)); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 8px 28px #0002; z-index: 5; font-size: 14px; }
.empty { padding: 30px 20px; font-size: 14px; color: var(--muted); }
.loading-placeholder { display: block; background: var(--line); border-radius: 18px; width: 190px; height: 100px; margin: 32px auto; }
@media (max-width: 640px) {
    main { padding-left: 20px; padding-right: 20px; }
    .location-button { font-size: 18px; gap: 7px; }
    .header-actions { gap: 2px; }
    .current { padding: 16px 0 28px; min-height: 260px; }
    .current-main { gap: 22px; }
    .current-temperature { font-size: 88px; }
    .current-main .weather-symbol { width: 76px; height: 76px; }
    h2 { font-size: 19px; }
    .day { flex-basis: 80%; }
    .sheet { margin: auto 0 0; width: 100%; max-width: none; border-radius: 28px 28px 0 0; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
    .hour { flex-basis: 100px; padding-left: 6px; padding-right: 6px; }
    .astro-item { flex-basis: 104px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (max-width: 360px) {
    main { padding-left: 16px; padding-right: 16px; }
    .current-main { gap: 12px; }
    .current-temperature { font-size: 72px; }
    .current-main .weather-symbol { width: 64px; height: 64px; }
}
