/* SAS Core data components. Colors inherit the theme's text color; only the map
   ramp and the bar fill are fixed. Works in light and dark themes. */
:root { --sas-line: rgba(127,127,127,.28); --sas-muted: rgba(127,127,127,.95); --sas-empty: #e6e5e1; --sas-bar: #2a78d6; --sas-stroke: #fff; }
@media (prefers-color-scheme: dark) { :root { --sas-empty: #3a3a37; --sas-bar: #5598e7; --sas-stroke: #1f1f1d; } }

.sas-table-wrap { margin: 1.5em 0; }
.sas-controls { display: flex; flex-wrap: wrap; gap: .75em 1.25em; align-items: end; margin-bottom: .75em; font-size: .95em; }
.sas-controls label { display: flex; flex-direction: column; gap: .25em; }
.sas-controls label span { font-size: .85em; color: var(--sas-muted); }
.sas-controls input, .sas-controls select { min-height: 40px; padding: .35em .6em; border: 1px solid var(--sas-line); border-radius: 6px; font: inherit; background: transparent; color: inherit; }
.sas-count { margin-left: auto; color: var(--sas-muted); font-size: .85em; }
.sas-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sas-table { width: 100%; border-collapse: collapse; font-size: .95em; }
.sas-table caption { text-align: left; font-weight: 600; padding-bottom: .5em; }
.sas-table th, .sas-table td { padding: .55em .7em; border-bottom: 1px solid var(--sas-line); text-align: left; vertical-align: top; }
.sas-table tbody th { font-weight: 500; }
.sas-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sas-table thead th { white-space: nowrap; }
.sas-table thead button { all: unset; cursor: pointer; font-weight: 600; }
.sas-table thead button:focus-visible { outline: 2px solid var(--sas-bar); outline-offset: 2px; }
.sas-table th[aria-sort="ascending"] button::after { content: " ▲"; font-size: .7em; }
.sas-table th[aria-sort="descending"] button::after { content: " ▼"; font-size: .7em; }

.sas-figure { margin: 1.5em 0; }
.sas-figure figcaption { font-weight: 600; margin-bottom: .5em; }
.sas-map { width: 100%; height: auto; aspect-ratio: var(--sas-ar, 4 / 3); display: block; }
.sas-map path { stroke: var(--sas-stroke); stroke-width: .6; }
.sas-map path:hover, .sas-map path:focus { stroke: currentColor; stroke-width: 1.5; outline: none; }
.sas-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4em 1em; padding: 0; margin: .6em 0 0; font-size: .85em; }
.sas-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35em; vertical-align: -1px; }
.sas-chart { width: 100%; height: auto; display: block; font-size: 13px; }
.sas-chart rect { fill: var(--sas-bar); }
.sas-chart .bar:hover rect, .sas-chart .bar:focus rect { opacity: .8; }
.sas-chart text { fill: currentColor; }
.sas-chart .lbl { opacity: .85; }
.sas-dates { font-size: .85em; color: var(--sas-muted); }

.sas-table tr[id] { scroll-margin-top: 80px; }
.sas-table tr.sas-hit > * { background: rgba(42,120,214,.14); }
.sas-line polyline { fill: none; stroke: var(--sas-bar); stroke-width: 2; stroke-linejoin: round; }
.sas-line circle { fill: var(--sas-bar); stroke: var(--sas-stroke); stroke-width: 2; }
.sas-line circle.hit { fill: transparent; stroke: none; }
.sas-line .pt:hover circle:not(.hit), .sas-line .pt:focus circle:not(.hit) { r: 6; }
.sas-line line.grid { stroke: var(--sas-line); stroke-width: 1; }
