:root {
  color-scheme:dark;
  --bg:#09141f; --surface:#10212f; --chart:#0b1824; --field:#0a1722; --code:#0c1725;
  --ink:#e7f1f7; --muted:#afbfcd; --dim:#8c9fab; --line:#2b404e; --mint:#74ead1;
  --violet:#c1b6fa; --mono:"IBM Plex Mono","SFMono-Regular",Consolas,monospace;
  font:16px/1.5 "Inter","Segoe UI",Arial,sans-serif; background:var(--bg); color:var(--ink);
}
* {box-sizing:border-box}
body {margin:0;min-width:280px;min-height:100vh;background:radial-gradient(ellipse at 94% 8%,#29243762 0,transparent 40%),radial-gradient(ellipse at 0 38%,#0c393655 0,transparent 43%),var(--bg)}
button,select,input,textarea {font:inherit}
button,select,summary,.file-action {cursor:pointer}
a {color:var(--mint);text-underline-offset:.2em}
a:hover {color:white}
:focus-visible {outline:2px solid var(--mint);outline-offset:3px}
[hidden] {display:none!important}
.shell {width:min(1580px,calc(100% - clamp(24px,6vw,100px)));margin-inline:auto}
.skip,.visually-hidden {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip:focus-visible {z-index:9;top:8px;left:8px;clip-path:none;width:auto;height:auto;background:var(--bg);padding:.5rem 1rem}
.mast {border-bottom:1px solid var(--line);background:#091420d9}
.mast-inner {min-height:64px;display:flex;align-items:center;gap:1.15rem}
.mast-inner a {text-decoration:none}
.wordmark {display:inline-flex;align-items:center;gap:.55rem;color:#f0f5f6}
.wordmark img {border-radius:8px}
.wordmark>span {font-size:1.25rem;font-weight:700;letter-spacing:-.055em}
.wordmark small {font-size:.94rem;font-weight:500;letter-spacing:-.025em;color:var(--muted)}
.nav-divider {height:17px;border-left:1px solid #465663}
.parent-link,.lab-link {color:#c9d5df;font-size:.92rem}
.lab-link {margin-left:auto;border:1px solid #344b5b;border-radius:6px;padding:.32rem .78rem}
.lab-link:hover {border-color:var(--mint)}
.intro {display:flex;justify-content:space-between;align-items:end;gap:1rem;padding:clamp(1.55rem,3.6vw,3.25rem) 0 clamp(1.2rem,2.1vw,2rem)}
h1,h2,h3,p {margin:0}
h1 {font-size:clamp(2.3rem,4.4vw,4.25rem);font-weight:650;line-height:1.03;letter-spacing:-.067em}
h1>span {color:var(--mint)}
.intro p {color:var(--muted);margin-top:.55rem;font-size:clamp(1rem,1.25vw,1.13rem)}
.source-controls {display:flex;flex-wrap:wrap;align-items:center;gap:.8rem}
button,.file-action,select {border-radius:6px}
button,.file-action {font-weight:650;min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:.62rem}
button:disabled,select:disabled {opacity:.55;cursor:default}
button,.file-action {border:1px solid #3c5262;background:#182b39;color:var(--ink);padding:.45rem .84rem;font-size:.9rem}
button:hover,.file-action:hover {background:#223b49;border-color:#708995}
.file-action {position:relative;overflow:hidden}
.file-action:focus-within {outline:2px solid var(--mint);outline-offset:3px}
.file-action input {position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.upload-icon {width:.8rem;height:.78rem;position:relative;border:1.5px solid currentColor;border-top:none;border-radius:0 0 2px 2px}
.upload-icon:before {content:"";position:absolute;left:.26rem;top:-.22rem;width:.23rem;height:.23rem;transform:rotate(45deg);border-top:1.5px solid currentColor;border-left:1.5px solid currentColor}
.upload-icon:after {content:"";position:absolute;left:.355rem;top:-.13rem;height:.53rem;border-left:1.5px solid currentColor}
.quiet {color:#b9cbd6;background:transparent;border-color:transparent;padding-inline:.3rem}
.quiet:hover {border-color:transparent;background:transparent;color:var(--mint);text-decoration:underline}
.desk {display:grid;grid-template-columns:minmax(0,1.8fr) minmax(360px,1fr);align-items:start;gap:clamp(.75rem,1.3vw,1.45rem)}
.panel {border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface);box-shadow:0 10px 26px #02070e25;min-width:0}
.chart-panel {background:var(--chart);border-top-color:#4b6b71}
.editor-panel {border-top-color:#625776}
.plot-head,.editor-head,.section-line,.editor-actions,.foot {display:flex;align-items:center;justify-content:space-between;gap:.8rem}
.plot-head,.editor-head,.inspector,.script-selectors,.editor-actions,.guide {padding-inline:clamp(.9rem,1.5vw,1.45rem)}
.plot-head {padding-block:.95rem .6rem}
.instrument-line {display:flex;align-items:center;gap:.72rem}
.instrument-line h2 {font-size:clamp(1.3rem,1.75vw,1.8rem);line-height:1.1;letter-spacing:-.055em}
.instrument-line h2 span {color:#88a2af;padding-inline:.1em}
.interval {font:600 .8rem/1.45 var(--mono);color:#cae4e4;background:#17343b;border:1px solid #2e5158;border-radius:4px;padding:.02rem .35rem}
#data-name {display:inline-block;max-width:100%;color:var(--muted);font-size:.87rem;margin-top:.2rem;overflow-wrap:anywhere}
.frame-button {background:transparent;font-size:.86rem;color:var(--muted);border-color:#3a505d}
.fit-icon {width:.78rem;height:.78rem;display:inline-block;background:linear-gradient(var(--muted),var(--muted)) top left/4px 1px,linear-gradient(var(--muted),var(--muted)) top left/1px 4px,linear-gradient(var(--muted),var(--muted)) top right/4px 1px,linear-gradient(var(--muted),var(--muted)) top right/1px 4px,linear-gradient(var(--muted),var(--muted)) bottom left/4px 1px,linear-gradient(var(--muted),var(--muted)) bottom left/1px 4px,linear-gradient(var(--muted),var(--muted)) bottom right/4px 1px,linear-gradient(var(--muted),var(--muted)) bottom right/1px 4px;background-repeat:no-repeat}
.chart-description {padding:.65rem clamp(.9rem,1.5vw,1.45rem) .62rem;border-top:1px solid #1d3140;display:flex;align-items:center;gap:.8rem;min-height:42px;flex-wrap:wrap}
.chart-description h3 {font:600 .9rem/1.35 "Inter","Segoe UI",Arial,sans-serif;overflow-wrap:anywhere}
#legend {color:#b0c4cf;display:flex;flex-wrap:wrap;align-items:center;gap:.3rem .82rem;font-size:.8rem}
#legend>span {display:inline-flex;align-items:center;gap:.35rem}
#legend i {display:inline-block;width:14px;height:3px;border-radius:2px}
#chart {width:100%;height:clamp(320px,45vh,600px);position:relative;background:var(--chart)}
.inspector {padding-block:.85rem 1rem;border-top:1px solid var(--line);background:#10202d}
.section-line h3 {font-size:.95rem;font-weight:650}
#bar-time {font: .8rem/1.5 var(--mono);color:#acbfcc}
#bar-values {display:flex;flex-wrap:wrap;gap:.4rem 1.25rem;color:#deebf1;margin-top:.55rem;font: .86rem/1.55 var(--mono);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#bar-values>span,#bar-values>div {display:inline-flex;gap:.35rem;align-items:baseline}
#bar-values small {color:var(--dim);font: .79rem/1.4 "Inter","Segoe UI",Arial,sans-serif}
#bar-values strong {font-weight:500}
.editor-head {padding-block:.9rem;border-bottom:1px solid #334351;background:linear-gradient(100deg,#182934,#212738)}
.editor-head h2 {display:flex;align-items:center;gap:.6rem;font-size:1.22rem;letter-spacing:-.035em}
.code-icon {display:inline-grid;place-items:center;width:1.92rem;height:1.92rem;border:1px solid #5a496b;border-radius:6px;background:#2b2a3d;color:#d0bcff;font:600 .85rem/1 var(--mono);letter-spacing:-.08em}
.run {background:#7ce6cd;border-color:#81edd5;color:#072822;font-size:.89rem;white-space:nowrap}
.run:hover {background:#a6f4df;border-color:#b9ffe9}
.play-icon {width:0;height:0;border-top:4.5px solid transparent;border-bottom:4.5px solid transparent;border-left:7px solid currentColor}
.script-selectors {display:grid;grid-template-columns:1fr 1fr;gap:.72rem;padding-block:.78rem .95rem}
.script-selectors label {display:block;min-width:0;color:#c3d1dc;font-size:.875rem;font-weight:550}
select {display:block;width:100%;min-width:0;max-width:100%;margin-top:.24rem;padding:.32rem 1.65rem .32rem .55rem;min-height:35px;background-color:#10212d;color:var(--ink);border:1px solid #3e5361;font-size:.86rem;appearance:none;background-image:linear-gradient(45deg,transparent 50%,#afc3d2 50%),linear-gradient(135deg,#afc3d2 50%,transparent 50%);background-position:calc(100% - 13px) 50%,calc(100% - 9px) 50%;background-size:4px 4px;background-repeat:no-repeat}
.code-area {border-block:1px solid #2d404e;background:var(--code);position:relative}
#editor {display:block;width:100%;height:clamp(225px,30vh,420px);min-height:150px;padding:.9rem 1rem .9rem 1.15rem;resize:vertical;border:0;border-left:3px solid #7564aa;border-radius:0;tab-size:2;color:#d8cff9;background:var(--code);font:normal .91rem/1.85 var(--mono);caret-color:var(--mint);letter-spacing:-.015em}
#editor:focus-visible {outline:0;border-left-color:#bc9fff;box-shadow:inset 0 0 0 1px #635c83}
#editor::selection {background:#514776;color:white}
.editor-actions {align-items:flex-start;flex-wrap:wrap;justify-content:flex-start;padding-block:.8rem;gap:.45rem .8rem}
.save {font-size:.86rem;min-height:34px;padding:.3rem .7rem}
#status {align-self:center;color:#b8cec9;font-size:.83rem;line-height:1.45;overflow-wrap:anywhere}
.script-error,.notice {border-left:3px solid #f5a3a4;background:#392732;color:#ffd5d5;padding:.62rem .8rem;font-size:.9rem;white-space:pre-wrap;overflow-wrap:anywhere}
.script-error {margin:0 .95rem .85rem}
.guide {border-top:1px solid var(--line);font-size:.91rem}
summary {padding:.72rem 0;font-weight:600;color:#cbd2e5}
summary:hover {color:white}
summary::marker {color:#b4a8da}
.guide-body {color:var(--muted);padding:0 0 .95rem;line-height:1.55}
.guide-body p+p,.guide-body p+pre,.guide-body pre+p {margin-top:.65rem}
.guide-body pre {border-radius:6px;border:1px solid #384355;background:var(--code);padding:.6rem .65rem;overflow-x:auto;margin:0;color:#cec0fd;font-size:.8rem;line-height:1.7}
code {font-family:var(--mono)}
.functions strong {margin-right:.36rem;color:#d0dce3}
.foot {padding:1rem 0 1.55rem;color:#a5b7c4;font-size:.85rem;align-items:baseline}
.foot details {max-width:690px}
.foot summary {color:#bccbd5;padding:.2rem 0}
.foot p {padding:.45rem 0 .6rem}
.foot a {color:#bccbd5}
@media(min-width:1600px) {.desk {grid-template-columns:minmax(0,2fr) minmax(450px,1fr)}}
@media(max-width:1020px) {
 .desk {grid-template-columns:minmax(0,1.5fr) minmax(315px,1fr)}
 .source-controls {gap:.35rem}
 .chart-description {display:block}
 #legend:not(:empty) {margin-top:.28rem}
 #bar-values {gap:.3rem .85rem}
}
@media(max-width:780px) {
 .desk {grid-template-columns:minmax(0,1fr)}
 .intro {align-items:flex-start;flex-direction:column;gap:.85rem}
 .source-controls {gap:.65rem}
 .script-selectors {max-width:580px}
 .mast-inner {gap:.7rem;min-height:55px}
 .wordmark small {display:none}
 #chart {height:clamp(285px,48vh,420px)}
 #editor {height:245px}
 .chart-description {display:flex}
 #legend:not(:empty) {margin-top:0}
 .foot {align-items:flex-start}
}
@media(max-width:440px) {
 .shell {width:calc(100% - 22px)}
 .mast-inner {gap:.48rem}
 .parent-link,.lab-link {font-size:.8rem}
 .wordmark>span {font-size:1rem}
 .wordmark img {width:28px;height:28px}
 .lab-link {padding:.3rem .49rem}
 .wordmark {gap:.35rem}
 .nav-divider {height:14px}
 .plot-head,.editor-head,.inspector,.script-selectors,.editor-actions,.guide {padding-inline:.78rem}
 .section-line {flex-wrap:wrap;gap:.15rem .6rem}
 .foot {flex-wrap:wrap;gap:.65rem}
}
@media(prefers-reduced-motion:reduce) {*,*:before,*:after {scroll-behavior:auto!important}}
.chart-hint {padding:0 clamp(.9rem,1.5vw,1.45rem) .42rem;color:#a9b9c5;font: .8rem/1.4 "Inter","Segoe UI",Arial,sans-serif}
.script-file-actions {display:flex;gap:.55rem;flex-wrap:wrap;padding:0 0 .85rem}
#chart-title,#legend,#bar-values {min-width:0;max-width:100%;overflow-wrap:anywhere}
#legend>*,#bar-values>* {max-width:100%;overflow-wrap:anywhere}
#legend i {flex-shrink:0}
.wordmark b {font-weight:600;color:var(--mint)}
.footer-links {display:flex;gap:.6rem 1.2rem;flex-wrap:wrap;border-top:1px solid #263644;padding:.8rem 0 1.3rem;font-size:.85rem}
.footer-links a {color:#b8c8d1}
.tv-plans{display:flex;align-items:baseline;gap:.5rem .9rem;flex-wrap:wrap;margin:1rem 0;color:#a1b4c7}.tv-plans a{font-weight:650;color:#7dead3}.tv-plans small{font-size:.81rem}.footer-links{flex-wrap:wrap}

@media(max-width:520px){.mast-inner{flex-wrap:wrap;padding-block:.5rem}.wordmark{white-space:nowrap}.parent-link,.lab-link{white-space:nowrap}}
