:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  color: #222;
  background: #fff;
  font-size: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 1080px; margin: 0 auto; padding: 10px 14px 24px; }
a { color: #075caa; }
a:hover { text-decoration: none; }
header { display: flex; flex-wrap: wrap; align-items: center; }
header h1, header .status-line { flex-basis: 100%; }
.status-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; color: #555; font-size: 13px; }
.site-name { display: inline-block; color: #333; font-size: 20px; font-weight: bold; text-decoration: none; margin: 0 16px 0 0; }
h1 { font-size: 20px; margin: 10px 0 3px; line-height: 1.25; }
h2 { font-size: 16px; margin: 3px 0 5px; }
.lede { margin: 0; line-height: 1.4; }
.status { color: #555; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; margin: 3px 0; }
.status.error { color: #9b1919; background: #fff0ef; border: 1px solid #d99; padding: 10px; white-space: normal; }
.drop-zone { width: fit-content; max-width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 12px; background: #f5f5f5; border: 1px solid #bbb; padding: 8px 10px; margin: 8px 0 6px; }
.drop-zone strong { display: inline; font-size: 14px; margin-right: 8px; }
.drop-zone span { display: inline; color: #555; line-height: 1.5; }
.drop-zone.dragging { border-color: #417e37; background: #edf5e9; }
.dataset-actions, .export-actions { display: flex; flex-wrap: wrap; gap: 5px; }
button, select, input { font: inherit; }
button { color: #222; background: #eee; border: 1px solid #aaa; border-radius: 2px; padding: 4px 8px; cursor: pointer; line-height: 1.3; }
button:hover:not(:disabled) { background: #e0e0e0; border-color: #777; }
#toggle, #chooseDataset { background: #e3efdc; border-color: #92ad7e; color: #234219; font-weight: bold; }
#toggle:hover:not(:disabled), #chooseDataset:hover:not(:disabled) { background: #d4e7c9; }
button:disabled, select:disabled, input:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid #075caa; outline-offset: 3px; }
select { padding: 3px; border: 1px solid #aaa; background: white; color: #222; max-width: 100%; }
.test-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.test-presets > div { margin-right: 5px; }
.test-button { padding: 3px 7px; font-size: 13px; }
.test-button.active { background: #e3efdc; border-color: #64834f; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; padding: 8px 10px; border: 1px solid #ccc; background: #fafafa; }
.controls h2 { flex-basis: 100%; margin: 0; font-size: 16px; }
label { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; line-height: 1.3; }
input[type="range"] { width: 90px; accent-color: #568443; }
input[type="color"] { width: 32px; height: 26px; padding: 1px; background: #fff; border: 1px solid #aaa; cursor: pointer; }
output { min-width: 38px; font-variant-numeric: tabular-nums; }
.metrics { display: flex; flex-wrap: wrap; gap: 5px 16px; padding: 6px 0; border-bottom: 1px solid #ddd; font-size: 13px; color: #555; }
.metrics strong { color: #222; font-variant-numeric: tabular-nums; }
.views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
figure { margin: 0; min-width: 0; border: 1px solid #ccc; background: #f5f5f5; padding: 5px; }
canvas { display: block; width: 100%; aspect-ratio: 1; background: #191e29; }
figcaption { padding: 4px 2px 1px; font-size: 13px; overflow-wrap: anywhere; }
.export-actions { margin-top: 6px; }
details { margin-top: 12px; border-top: 1px solid #ddd; padding-top: 8px; line-height: 1.5; }
summary { cursor: pointer; font-weight: bold; }
details p { max-width: 850px; }
textarea { width: 100%; margin: 3px 0; padding: 10px; background: #fff; color: #222; border: 1px solid #aaa; border-radius: 0; font: 13px/1.5 monospace; }
@media (max-width: 600px) {
  main { padding: 8px 10px 20px; }
  .views { grid-template-columns: 1fr; }
  .drop-zone { padding: 8px; }
  .controls { gap: 7px 10px; }
  h1 { font-size: 19px; }
}
