/* Compact History. Weather is always a column, including on narrow phones. */
#observations .history-brief{max-width:760px;margin:12px auto 0;min-width:0}
.history-title{display:flex;align-items:center;justify-content:space-between;gap:4px 12px;flex-wrap:wrap}
#observations .history-title h2{margin:0}
#observations #official{display:inline-flex;min-height:44px;align-items:center;gap:4px;font-size:13px}
#observations #obsSource,#observations #historyZone,#observations #historyWindow,#observations #historyStatus{font-size:13px;line-height:1.35;margin:0 0 4px}
.history-controls{display:flex;gap:5px 8px;flex-wrap:wrap;align-items:center;margin:7px 0}
#observations .history-controls :is(button,select){min-height:44px;font-size:13px;padding:4px 8px;white-space:nowrap}
#observations .history-controls .controls{margin:0;gap:3px}
#observations #tablewrap,#observations #plot{min-width:0;max-width:100%}
#observations #historyHint{font-size:13px;margin:5px 0 6px}
#observations #records{width:100%;min-width:0;table-layout:fixed;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:15px;line-height:1.2}
#observations #records :is(th,td){padding:6px 4px;text-align:left;white-space:normal;overflow-wrap:anywhere}
#observations #records thead th{font-size:13px;color:var(--accent);background:var(--tint);border-top:1px solid var(--line)}
#observations #records .history-date th{color:var(--accent);font-size:13px;font-weight:700;padding-block:8px;border-bottom:1px solid var(--line)}
#observations #records .hist-col-time{width:26%}
#observations #records :is(.hist-col-temperature,.hist-col-dew){width:18%}
#observations #records .hist-col-weather{width:38%}
.history-report{cursor:pointer}
.history-report:hover{background:var(--tint)}
#observations #records .history-report th{padding:0}
#observations #records .history-report button{
 display:block;min-height:46px;width:100%;text-align:left;padding:3px 4px;background:none;border:0;border-radius:0;font-size:16px;line-height:1.15
}
#observations #records .history-report button small{display:block;color:var(--muted);font-size:11px;font-weight:400;margin-top:2px}
#observations #records .history-report button:focus-visible{outline-offset:-2px}
#observations #records .history-weather{position:relative;padding-right:15px;font-size:14px}
.history-caret{position:absolute;top:50%;right:5px;transform:translateY(-70%) rotate(45deg);height:6px;width:6px;border:solid var(--accent);border-width:0 1.5px 1.5px 0}
.history-report:has(button[aria-expanded=true]) .history-caret{transform:translateY(-20%) rotate(225deg)}
#observations #records .history-detail td{padding:8px 9px 9px;background:var(--tint)}
.history-detail dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 9px;margin:0}
.history-detail dt,.history-raw-label{font-size:12px;color:var(--muted)}
.history-detail dd{margin:0;font-size:14px;font-weight:700}
.history-detail .history-raw-label{margin:8px 0 3px}
.history-detail pre{font:12px/1.42 ui-monospace,monospace;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
#observations .history-airport{margin-top:10px;font-size:13px;color:var(--accent)}
.history-sr{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
@media(min-width:580px){
 #observations #records :is(th,td){padding-inline:10px}
 #observations #records .history-report button{padding-inline:10px}
 #observations #records .history-weather{padding-right:22px}
 .history-caret{right:10px}
 .history-detail dl{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* Give History its own source line and keep the compact table unpaged. */
main:has(> #observations:not([hidden])) > :is(.desk-mast,.desk-status){display:none}
@media(max-width:500px){
 #observations .history-brief{margin-top:5px}
 :root[data-material] main #observations .history-title h2{font-size:clamp(26px,7vw,33px)}
 #observations .history-controls{gap:3px 5px;margin:5px 0}
 #observations .history-controls :is(button,select){padding-inline:5px}
 #observations #historyHint{margin:3px 0}
 #observations #records :is(th,td){padding-block:4px}
 #observations #records .history-report th{padding-block:0}
}

/* Desktop: the full selected range and the full observation record, unpaged. */
#observations .history-wide{display:none}
@media(min-width:1024px){
 main:has(> #observations:not([hidden])){width:min(100%,1540px);padding-inline:clamp(19px,3vw,42px)}
 main #observations,main #observations .history-brief{max-width:none}
 #observations :is(#records,#historyHint){display:none}
 #observations .history-wide{display:block;max-width:100%}
 #observations #recordsWide{width:100%;min-width:0;table-layout:fixed;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums;line-height:1.3}
 #observations #recordsWide :is(th,td){padding:7px 5px;text-align:left;vertical-align:top;white-space:normal;overflow-wrap:anywhere}
 #observations #recordsWide thead th{border-top:1px solid var(--line);color:var(--muted)}
 #observations #recordsWide.history-wide-hourly thead th:nth-child(1){width:8%}
 #observations #recordsWide.history-wide-hourly thead th:nth-child(4){width:10%}
 #observations #recordsWide.history-wide-hourly thead th:nth-child(11){width:8%}
 #observations #recordsWide.history-wide-hourly thead th:nth-child(14){width:23%}
 #observations #recordsWide small{display:block;font-size:11px}
 #observations #recordsWide code{font:11px/1.35 ui-monospace,monospace}
}
