:root { color-scheme: light; font: 13px Arial, Helvetica, sans-serif; color: #26313d; background: #fff; }
* { box-sizing: border-box; }
body { margin: 16px; }
a { color: #245d97; text-underline-offset: 2px; }
a:hover { color: #153d66; }
button, input, select { font: inherit; color: inherit; }
button, select, input[type=search], input[type=number], .filter-menu > summary { border: 1px solid #bac4ce; border-radius: 4px; background: #fff; }
button, select, .filter-menu > summary { min-height: 32px; padding: 6px 9px; }
button, summary { cursor: pointer; }
button:hover, .filter-menu > summary:hover { background: #edf2f7; }
input[type=search], input[type=number] { min-height: 32px; padding: 6px 8px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; width: calc(100vw - 32px); padding-bottom: 12px; border-bottom: 1px solid #d9e0e6; }
.toolbar > label { color: #596676; }
#dataset { max-width: 240px; }
#search { width: 185px; }
#reset { background: #f3f5f7; }
.filter-menu { position: relative; }
.filter-menu > summary { list-style: none; white-space: nowrap; }
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-menu > summary::after { content: ' ▾'; color: #6c7987; }
.filter-menu[open] > summary { background: #e9f0f8; border-color: #819ab5; }
.panel { position: absolute; top: calc(100% + 5px); left: 0; z-index: 10; width: 325px; max-width: calc(100vw - 32px); padding: 12px; background: #fff; border: 1px solid #bac4ce; border-radius: 5px; box-shadow: 0 3px 12px #27394a20; }
.panel > input[type=search] { width: 100%; }
.choice-actions { display: flex; gap: 8px; margin: 9px 0; }
.choice-actions button { min-height: 27px; font-size: 12px; padding: 4px 7px; }
.choices { max-height: min(380px, 55vh); overflow: auto; }
.choice { flex-direction: row; align-items: start; gap: 7px; padding: 5px 2px; font-size: 13px; line-height: 1.35; }
.choice input { flex: none; margin: 2px 0 0; accent-color: #376b9d; }
.choice small { display: block; color: #6c7987; font-size: 11px; }
.choice-group { display: block; font-size: 11px; color: #596676; border-bottom: 1px solid #e4e8ec; padding: 10px 0 4px; }
.ranges { width: 365px; max-height: min(570px, 75vh); overflow: auto; }
fieldset { border: 0; padding: 10px 0; margin: 8px 0 0; border-top: 1px solid #e1e6eb; min-width: 0; }
legend { font-weight: bold; font-size: 12px; padding: 0 5px 0 0; }
fieldset > small { display: block; color: #697786; font-size: 11px; line-height: 1.5; margin-bottom: 6px; }
.bounds { display: flex; gap: 10px; }
.bounds label { flex: 1; min-width: 0; }
.bounds input { width: 100%; }
.range-error { color: #a32d25; font-size: 12px; margin: 6px 0 0; }
[aria-invalid=true] { border-color: #a32d25 !important; }
.table-meta { display: flex; align-items: center; gap: 20px; font-size: 12px; }
.table-meta p { margin: 10px 0; color: #596676; }
.table-meta { flex-wrap: wrap; }
#chart { width: calc(100vw - 32px); padding: 12px; margin: 0 0 16px; border: 1px solid #cbd5df; border-radius: 4px; background: #fff; }
.chart-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.chart-controls select { max-width: 310px; }
.chart-check { flex-direction: row; align-items: center; min-height: 32px; }
.chart-check input { accent-color: #376b9d; }
#chart p { margin: 8px 0; font-size: 12px; line-height: 1.5; }
#chart-status, .chart-key { color: #697786; }
#chart-scale-note { color: #8a5a16; }
.chart-scroll { overflow-x: auto; }
#chart-svg { display: block; width: 100%; min-width: 650px; height: clamp(560px, 65vh, 760px); }
.chart-grid { stroke: #e5eaf0; stroke-width: 1; }
.chart-axis { stroke: #9baaba; stroke-width: 1; }
.chart-tick { fill: #697786; font-size: 12px; }
.chart-axis-title { fill: #3b5068; font-size: 13px; }
.chart-empty { fill: #697786; font-size: 14px; }
.chart-point { cursor: pointer; }
.chart-point:hover, .chart-point:focus { opacity: 1; stroke: #111; stroke-width: 3; outline: none; }
#chart-detail { white-space: pre-wrap; min-height: 66px; max-height: 200px; overflow: auto; padding: 8px 10px; background: #f3f6f9; border-left: 3px solid #8098b1; font-size: 12px; line-height: 1.5; }
#chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; max-height: 180px; overflow: auto; padding: 10px 0; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.chart-legend-item svg { flex: none; }
.selection-note { color: #8a5a16; font-size: 12px; width: calc(100vw - 32px); }
table { border-collapse: separate; border-spacing: 0; font-size: 12px; font-variant-numeric: tabular-nums; min-width: 100%; }
th, td { border-bottom: 1px solid #e1e6eb; border-right: 1px solid #e9edf0; padding: 6px 8px; text-align: right; white-space: nowrap; }
th { background: #e9eef3; position: sticky; top: 0; z-index: 2; border-top: 1px solid #cbd5df; border-bottom-color: #cbd5df; }
th button { border: 0; background: none; padding: 0; min-height: 0; color: #3b5068; cursor: pointer; white-space: normal; min-width: 70px; font-weight: bold; font-size: 11px; line-height: 1.4; }
th:first-child, td:first-child, td.text { text-align: left; }
th:first-child, td:first-child { position: sticky; left: 0; min-width: 200px; max-width: 350px; white-space: normal; background: #fff; border-left: 1px solid #e1e6eb; z-index: 1; }
th:first-child { background: #e9eef3; z-index: 3; }
tbody tr:nth-child(even), tbody tr:nth-child(even) td:first-child { background: #f7f9fb; }
tbody tr:hover, tbody tr:hover td:first-child { background: #edf3fa; }
td details { text-align: left; max-width: 450px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { text-align: left; padding: 18px; }
aside, footer { margin-top: 18px; width: calc(100vw - 32px); max-width: 1100px; font-size: 12px; color: #697786; line-height: 1.55; }
aside p, footer p { margin: 6px 0; }
footer { border-top: 1px solid #d9e0e6; padding-top: 8px; }
footer > a { margin-left: 12px; }
.warning { color: #a32d25; font-weight: bold; }
:focus-visible { outline: 2px solid #376b9d; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 750px) {
  body { margin: 10px; }
  .toolbar, aside, footer, .selection-note { width: calc(100vw - 20px); }
  #chart { width: calc(100vw - 20px); padding: 8px; }
  .chart-controls > label:not(.chart-check) { width: 100%; }
  .chart-controls select { width: 100%; max-width: none; }
  .filter-menu { position: static; }
  .panel { position: fixed; left: 10px; top: 160px; width: calc(100vw - 20px); max-width: none; max-height: calc(100dvh - 180px); overflow: auto; }
  .toolbar > label { flex: 1; min-width: 140px; }
  #dataset, #search { width: 100%; max-width: none; }
  th:first-child, td:first-child { min-width: 180px; max-width: 230px; }
}

.chart-label text { font-size: 10px; font-weight: 600; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }

.chart-hit, .touch-hint { display: none; }
@media (max-width: 1100px) {
  #chart-svg { height: clamp(440px, 52svh, 620px); }
  .table-scroll { width: calc(100vw - 32px); overflow-x: auto; }
  .touch-hint { display: block; color: #697786; }
}
@media (pointer: coarse) {
  button, select, input[type=search], input[type=number], .filter-menu > summary { min-height: 44px; font-size: 16px; }
  .choice, .chart-check { min-height: 44px; align-items: center; }
  .choice-actions button { min-height: 44px; }
  .choice input, .chart-check input { width: 20px; height: 20px; }
  .chart-hit { display: block; }
}
@media (max-width: 750px) {
  #chart-svg { height: 420px; }
  .table-scroll { width: calc(100vw - 20px); }
  .chart-controls > label:not(.chart-check) { width: calc(50% - 5px); }
  .chart-controls > label:nth-child(-n+2) { width: 100%; }
}
@media (max-height: 500px) and (max-width: 1100px) {
  #chart-svg { height: 360px; }
  .filter-menu { position: static; }
  .panel { position: fixed; left: 10px; width: calc(100vw - 20px); max-width: none; overflow: auto; }
}
