:root {
    color-scheme: light;
    --paper: 248, 246, 239;
    --ink: #26382e;
    --muted: #536256;
    --line: #b4bdb1;
    --accent: #426350;
    --warning: #77421b;
    font-family: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --paper: 21, 31, 27;
    --ink: #f2f2e9;
    --muted: #c2cbbc;
    --line: #5c6b5f;
    --accent: #bdd8b5;
    --warning: #ffd4a4;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: rgb(var(--paper)); font-size: 14px; line-height: 1.6; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line); background: rgba(var(--paper), .96); padding: .6rem .85rem; border-radius: 6px; min-height: 44px; }
button:hover { background: rgb(var(--paper)); border-color: var(--ink); }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
::selection { color: rgb(var(--paper)); background: var(--ink); }
:root { scrollbar-color: var(--muted) rgb(var(--paper)); }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 3.7vw, 3.3rem); line-height: 1.12; font-weight: 500; letter-spacing: -.035em; overflow-wrap: anywhere; text-wrap: balance; }
h2 { font-size: 1rem; line-height: 1.5; font-weight: 600; }
main, .site-header { width: min(100% - 2rem, 960px); margin-inline: auto; }
.weather-artwork { margin: 1.5rem 0 2rem; }
.weather-artwork img { display: block; width: 100%; height: auto; object-fit: contain; border-radius: 8px; }
.weather-artwork figcaption { margin-top: .6rem; color: var(--muted); font-size: .75rem; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; }
.wordmark { display: flex; align-items: center; gap: .8rem; text-decoration: none; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.wordmark svg { width: 32px; height: 32px; flex-shrink: 0; }
.byline { display: block; color: var(--muted); font-size: .75rem; font-weight: 400; margin-top: .2rem; }
.controls { display: flex; gap: .4rem; }
.controls button { display: flex; align-items: center; justify-content: center; gap: .5rem; background: transparent; border-color: transparent; font-size: .75rem; }
.controls button:hover { border-color: var(--line); }
.controls svg { display: block; flex: 0 0 18px; width: 18px; height: 18px; }
.weather-stage { padding: 1.5rem 0 2rem; border-top: 3px solid var(--weather-color, var(--line)); }
.reading-panel { padding: 0; }
.place-line { display: flex; flex-direction: column; gap: .6rem; }
#local-date { color: var(--muted); font-size: .75rem; }
.update-line { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .75rem; margin-top: .5rem; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
:root[data-stale="true"] .status-dot { background: var(--warning); }
.conditions { margin-top: 1.6rem; padding: 1.1rem 0; border-block: 1px solid var(--line); }
.condition-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: .8rem; }
#temperature { font-size: 1.8rem; font-weight: 500; line-height: 1.25; font-variant-numeric: tabular-nums; }
#condition-description { font-size: .85rem; }
#condition-details { color: var(--muted); font-size: .75rem; margin-top: .4rem; }
.small-note { font-size: .75rem; color: var(--muted); line-height: 1.65; }
#observation-time { margin-top: .3rem; }
#weather-report { margin-top: 1.6rem; font-size: .92rem; line-height: 1.85; overflow-wrap: anywhere; }
#weather-report h2 { font-size: 1.18rem; line-height: 1.45; margin-bottom: .8rem; font-weight: 500; text-wrap: balance; }
#weather-report p + p { margin-top: .9rem; }
.report-details { border-top: 1px solid var(--line); margin-top: 1.4rem; padding-top: 1.1rem; display: grid; gap: 1rem; }
.report-details h2 { font-size: .75rem; color: var(--muted); font-weight: 400; margin-bottom: .25rem; }
.report-details p { font-size: .8rem; line-height: 1.75; }
#timestamp { margin-top: 1.3rem; }
.notice { font-size: .75rem; color: var(--warning); margin-top: 1rem; padding-block: .7rem; border-block: 1px solid var(--line); }
.loading { color: var(--muted); }
#retry-button { margin-top: 1rem; }
.forecast-dock { padding: 1.5rem 0 1.2rem; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.section-heading span { color: var(--muted); font-size: .75rem; }
.forecast-list { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; }
.forecast-period { display: flex; flex-direction: column; gap: .3rem; padding: .25rem 1.1rem .4rem; border-left: 1px solid var(--line); font-size: .75rem; }
.forecast-period:first-child { border-left: 0; padding-left: 0; }
.forecast-period time { font-size: .75rem; }
.forecast-period .forecast-day { font-size: .75rem; color: var(--muted); }
.forecast-period .forecast-temp { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.forecast-period .forecast-description { color: var(--muted); min-height: 2.8em; }
.forecast-period .forecast-rain { color: var(--muted); font-size: .75rem; }
.forecast-empty { grid-column: 1 / -1; padding-block: 1rem; color: var(--muted); font-size: .8rem; }
.history-section { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1rem; }
summary { cursor: pointer; width: fit-content; padding-block: .25rem; min-height: 36px; font-size: .8rem; }
summary:hover { text-decoration: underline; text-underline-offset: .25em; }
#history-count { color: var(--muted); font-size: .75rem; }
#history-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.3rem 2.5rem; padding: 0; list-style: none; margin: 1.2rem 0 .5rem; }
#history-list li { font-size: .75rem; overflow-wrap: anywhere; }
#history-list time { display: block; color: var(--muted); font-size: .75rem; margin-bottom: .3rem; }
#history-list .history-temp { display: block; margin-top: .4rem; font-size: .75rem; color: var(--muted); }
footer { display: flex; gap: .5rem 2rem; justify-content: space-between; flex-wrap: wrap; margin-top: 1.2rem; color: var(--muted); font-size: .75rem; }
.keyboard-hint { margin-left: 1.25rem; }
.skip-link { position: fixed; left: 1rem; top: -10rem; padding: .7rem 1rem; background: rgb(var(--paper)); z-index: 20; }
.skip-link:focus { top: 1rem; }
.noscript { margin: 1rem; padding: 1rem; background: rgb(var(--paper)); }
@media (max-width: 1100px) { .forecast-period { padding-inline: .7rem; } .forecast-list { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 1.3rem; } .forecast-period:nth-child(4n+1) { border-left: 0; padding-left: 0; } }
@media (max-width: 700px) {
    .site-header { padding-block: .8rem; }
    .wordmark { font-size: .88rem; gap: .6rem; }
    .wordmark svg { width: 26px; height: 26px; }
    .control-label { display: none; }
    .controls { gap: 0; }
    .controls button { padding: .55rem; min-width: 44px; }
    .weather-stage { padding: 1.25rem 0 1.5rem; }
    .weather-artwork { margin-block: 1.25rem 1.5rem; }
    h1 { font-size: 2.2rem; }
    #weather-report { font-size: .88rem; }
    .forecast-dock { padding-block: 1.5rem; }
    .forecast-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .forecast-period { padding-inline: .6rem; }
    .forecast-period .forecast-temp { font-size: 1.05rem; }
    .forecast-period .forecast-description { font-size: .75rem; }
    #history-list { grid-template-columns: 1fr; gap: 1rem; }
    .keyboard-hint { display: none; }
    footer { margin-top: 1.5rem; }
}
@media (max-width: 370px) {
    main, .site-header { width: calc(100% - 1.3rem); }
    .forecast-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .forecast-period:nth-child(2n+1) { padding-left: 0; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

@media print { .controls { display: none; } body { background: white; color: black; } main { width: 100%; } .weather-artwork img { max-height: 40vh; } }
