.demo { margin: 0 0 20px; border: 1px solid #b7cebf; border-radius: 10px; background: #edf4ec; }
.demo > summary { padding: 11px 14px; font-size: 16px; font-weight: 700; color: #17594a; }
.demo-panel { border-top: 1px solid #c9dcd0; padding: 14px; font-size: 15px; line-height: 1.6; }
.demo-panel p { margin: 0 0 8px; }
.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; }
.demo-controls label { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.demo-controls input[type=range] { width: 120px; flex-shrink: 0; accent-color: #14695b; }
.demo-controls input[type=checkbox] { accent-color: #14695b; }
.demo-controls select { max-width: 100%; padding: 5px 7px; border: 1px solid #a7bfb1; border-radius: 6px; background: white; color: #24312e; }
.demo-controls button, .demo-cell:is(button) { padding: 4px 9px; }
.demo-controls [aria-pressed=true], .demo-cell.picked { color: #133f36; background: #c4e3d3; border-color: #387764; }
.demo-result { min-width: 0; }
.demo-readout { line-height: 1.65; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.demo-panel .demo-table { display: table; width: 100%; margin: 8px 0; font-size: 14px; }
.demo-panel .demo-table td, .demo-panel .demo-table th { padding: 4px 6px; text-align: left; }
.demo-table tbody tr.on { background: #d2e9dc; }
.demo-table tbody tr.faint { color: #59665f; }
.demo-table tbody tr.split-after > * { border-bottom: 3px solid #3a7d68; }
.demo-table td.number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.demo-matrices { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 14px; margin: 10px 0; }
.demo-matrix-wrap > span { display: block; color: #4e6255; font-size: 13px; margin-bottom: 3px; }
.demo-matrix { display: grid; grid-template-columns: repeat(var(--cols), minmax(30px, auto)); gap: 3px; width: fit-content; }
.demo-cell { display: grid; place-content: center; min-width: 30px; min-height: 30px; padding: 4px; background: #fff; border: 1px solid #c9d8ca; border-radius: 4px; font-weight: 650; font-variant-numeric: tabular-nums; }
.demo-cell.on { background: #cce7d7; border-color: #408471; color: #194a3e; }
.demo-cell.axis { border-color: transparent; min-height: 26px; background: transparent; color: #4e6255; font-weight: 400; }
.demo-plot { position: relative; height: 126px; margin: 12px 18px 29px 27px; border-left: 1px solid #5f7669; border-bottom: 1px solid #5f7669; background: linear-gradient(to top, transparent 49%, #c3d4c8 49% 50%, transparent 50%), linear-gradient(to right, transparent 49%, #c3d4c8 49% 50%, transparent 50%); }
.demo-plot .plot-point, .demo-plot .plot-tick { position: absolute; font-size: 12px; }
.demo-plot .plot-point { transform: translate(-50%, 50%); border: 2px solid #17594a; border-radius: 50%; width: 10px; height: 10px; background: #fff; z-index: 1; }
.demo-plot .plot-point.on { width: 15px; height: 15px; background: #14695b; outline: 2px solid white; z-index: 2; }
.demo-plot .plot-segment { position: absolute; background: #5a8879; }
.demo-plot .plot-segment.vertical { width: 2px; }
.demo-plot .plot-segment.horizontal { height: 2px; }
.demo-plot .plot-tick.x { bottom: -20px; transform: translateX(-50%); }
.demo-plot .plot-tick.y { left: -23px; transform: translateY(45%); }
.demo-plot .plot-label { position: absolute; font-size: 12px; color: #4a6256; }
.demo-plot .plot-label.x { right: 10%; bottom: -24px; }
.demo-plot .plot-label.y { left: 6px; top: 4px; }
.demo-sequence { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.demo-sequence span { border: 1px solid #bdd0c1; border-radius: 5px; padding: 3px 7px; background: #f9fcf7; }
.demo-sequence .on { background: #cee8d9; border-color: #57917a; }
.demo-bar { display: inline-block; height: 8px; width: min(var(--size), 100%); min-width: 0; vertical-align: middle; background: #21846c; border-radius: 6px; }
.demo-bar.alt { background: #966235; }
.demo-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 4px 18px; padding: 0; list-style: none; }
.demo-links a { display: block; padding: 6px 0; }
.demo-links small { display: block; color: #56675d; }
.demo-related { padding-top: 6px; }
@media (max-width: 550px) {
  .demo-panel { padding: 10px; }
  .demo-panel .demo-table { display: block; overflow-x: auto; }
}
@media print { .demo { display: none; } }
