#bandPercentiles th,#bandPercentiles td{padding:8px 12px;text-align:right;border-bottom:1px solid #38404d}#bandPercentiles th:first-child,#bandPercentiles td:first-child{text-align:left}[hidden]{display:none!important}h2{padding:12px 20px}
#bandPercentiles{overflow-x:auto}


#reportPanel{min-width:0}#reportPanel .controls{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
#reportPanel details>summary{padding:12px 20px;color:#b9c4d2;cursor:pointer}
#reportStages{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;padding:12px 20px}
#reportStages p{grid-column:1/-1;margin:4px 0}#reportStages div{padding:8px 10px;background:#151b22;border-radius:4px}
#reportTitle,#reportComment{margin:0}#reportComment:empty{display:none}


.emv-chart-panel{margin:12px 20px;border:1px solid #384453;border-radius:10px;overflow:hidden;min-width:0;background:#101419}
.emv-panel-header{display:flex;align-items:center;gap:8px;padding:8px 14px;background:#151d27;border-bottom:1px solid #303e4f}
.emv-panel-header strong{margin-right:auto}.emv-panel-header button{padding:5px 10px;min-height:34px}.emv-drag{cursor:grab}
.emv-chart-panel.drop-before{border-top:4px solid #258ccd}.emv-chart-panel.moving{opacity:.5}
.emv-order-help{padding:12px 20px;color:#b9c4d2}.emv-order-help button{margin-left:12px}
.sensor-availability{font-size:12px;line-height:1.5;color:#b9c4d2;max-width:420px}
.sensor-availability:empty{display:none}

#chartStack #plot{height:max(800px,calc(45vh - 119px));min-height:0}
.emv-display-controls{display:flex;flex-wrap:wrap;align-items:center;gap:18px;padding:12px 16px;color:#dce3ef}
.emv-display-controls select{background:#202a36;color:#dce3ef;border:1px solid #52657d;border-radius:5px;padding:6px}
.emv-display-controls label{display:flex;align-items:center;gap:8px}
@media(max-width:600px){.emv-chart-panel{margin:8px 5px}.emv-panel-header{padding:8px}.emv-panel-header strong{font-size:13px}.emv-drag{display:none}}


.emv-chart-panel>.group{border:0;border-radius:0;padding:12px 20px}
.emv-chart-panel>details{padding:12px 20px}
.emv-chart-panel>.explain{margin:0}
.emv-chart-panel>p{padding:10px 20px}


.emv-panel-header{flex-wrap:wrap}
.emv-png-choice{display:flex;align-items:center;gap:6px;font-size:12px;cursor:pointer;white-space:nowrap;padding:5px 8px;border:1px solid #384453;border-radius:6px;color:#b9c4d2}
.emv-png-choice input{accent-color:#258ccd;cursor:pointer}
.emv-png-selected .emv-png-choice{border-color:#258ccd;color:#dce3ef;background:#112b3a}
#pngStatus{display:block;max-width:420px;color:#b9c4d2;font-size:13px;line-height:1.5}


#reportStages{display:block;overflow-x:auto;padding:5px 22px}
#bandPercentiles{padding:5px 22px}
#reportStages table,#bandPercentiles table{border-collapse:collapse;width:100%;font-size:12px;font-weight:400}
#reportStages th,#reportStages td,#bandPercentiles th,#bandPercentiles td{border:1px solid #313b49;padding:5px 8px;text-align:right;white-space:nowrap}
#reportStages th:first-child,#bandPercentiles th:first-child{text-align:left}
#reportStages thead,#bandPercentiles thead{color:#bf9bff}
#recordedEventControls .event-note{flex-basis:100%;margin:0}


.emv-chart-panel.emv-collapsed>:not(.emv-panel-header){display:none!important}
.emv-chart-panel.emv-collapsed>.emv-panel-header{border-bottom:0}
.emv-panel-header button.emv-collapse{min-width:34px;padding:5px 8px}


#chartStack{position:relative}
#emvOnsetLines{position:absolute;left:0;top:0;pointer-events:none;overflow:visible}
#chartStack.emv-one-picture{margin:12px 20px;background:#101419}
#chartStack.emv-one-picture>section:not(.emv-png-selected),#chartStack.emv-one-picture>section[data-panel=calibration]{display:none!important}
#chartStack.emv-one-picture>section{margin:0;border:0;border-radius:0}
#chartStack.emv-one-picture .emv-panel-header,#chartStack.emv-one-picture .emv-display-controls{display:none}
#chartStack.emv-one-picture>section.emv-collapsed>:not(.emv-panel-header){display:revert!important}
#chartStack.emv-one-picture>section>p,#chartStack.emv-one-picture>section>.summary{padding:6px 24px;margin:0}
.emv-one-switch{display:flex;align-items:center;gap:6px}


.recorded-window{margin:6px 0;font-weight:600;color:#dce3ef}


body[data-graph-size=panes] #chartStack #plot{height:auto;min-height:0}


#dropZone{display:grid;grid-template-columns:minmax(0,1fr);column-gap:32px;align-content:start}
#dropZone>*{grid-column:1}
#dropZone:has(>#sleepControls:not([hidden])){grid-column:span 3;grid-template-columns:minmax(0,1fr) minmax(0,2fr)}
#dropZone>#sleepControls{grid-column:2;grid-row:1/span 40;align-self:start;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:32px;row-gap:4px;padding:0;font-size:12px}
#sleepControls>b{display:flex;align-items:center;grid-column:1/-1;margin-bottom:2px}
#sleepControls>:nth-child(2){grid-area:2/1}#sleepControls>:nth-child(3){grid-area:2/2}
#sleepControls>:nth-child(4){grid-area:3/1}#sleepControls>:nth-child(5){grid-area:4/1}
#sleepControls>:nth-child(6){grid-area:5/1}#sleepControls>:nth-child(7){grid-area:6/1}
#sleepControls>:nth-child(8){grid-area:3/2}#sleepControls>:nth-child(9){grid-area:4/2}
#sleepControls>:nth-child(10){grid-area:5/2}#sleepControls>:nth-child(11){grid-area:6/2}
#sleepControls label{margin:2px 0;display:flex;align-items:center;gap:8px;min-width:0}

#sleepControls>:nth-child(n+8){display:grid;grid-template-columns:9.5em minmax(40px,220px) 3.8em auto;justify-content:start}
#sleepControls input[type=range]{width:100%;min-width:0}
#sleepControls input[type=number]{width:3.8em}
#sleepControls select{min-width:0}
#sleepControls .summary{padding:0;margin:0;font-size:12px;align-self:center}
#sleepControls>span{font-size:11px;line-height:1.35;color:#9aa6b6}
.info-tip-down span{bottom:auto;top:calc(100% + 9px);white-space:pre-line;width:min(560px,82vw)}

@media(max-width:2200px){#dropZone:has(>#sleepControls:not([hidden])){grid-column:span 2;grid-template-columns:minmax(0,auto) minmax(0,1fr)}#sleepControls>:nth-child(n+8){grid-template-columns:auto minmax(40px,1fr) 3.8em auto}}

@media(max-width:1500px){#dropZone:has(>#sleepControls:not([hidden])){grid-column:span 2;grid-template-columns:1fr}#dropZone>#sleepControls{grid-column:1;grid-row:auto;margin-top:8px}}
@media(max-width:700px){#sleepControls{grid-template-columns:1fr}#sleepControls>*{grid-area:auto!important}}


.emv-chart-panel:has(.info-tip:hover),.emv-chart-panel:has(.info-tip:focus){overflow:visible;position:relative;z-index:30}
.emv-chart-panel .info-tip span{left:0;transform:none}


body.light{background:#f4f6f9;color:#1f2933;color-scheme:light}
body.light .sub,body.light .drop-hint,body.light .emv-order-help,body.light .explain,body.light #pngStatus,body.light .sensor-availability{color:#4b5563}
body.light .controls{background:#ffffff;border-color:#d9dee5}
body.light .group{border-color:#d0d6de}
body.light .group b{color:#111827}
body.light .group label{color:#374151}
body.light input,body.light select,body.light button{background:#ffffff;color:#1f2933;border-color:#b8c1cc}
body.light .emv-chart-panel{background:#ffffff;border-color:#d0d6de}
body.light .emv-panel-header{background:#eef1f5;border-bottom-color:#d9dee5}
body.light .emv-display-controls{color:#1f2933}
body.light .emv-display-controls select{background:#ffffff;color:#1f2933;border-color:#b8c1cc}
body.light .emv-png-choice{border-color:#c5ccd6;color:#374151}
body.light .emv-png-selected .emv-png-choice{background:#e6f2fb;color:#1f2933;border-color:#258ccd}
body.light .percentiles th,body.light .percentiles td,body.light #reportStages th,body.light #reportStages td{border-color:#d9dee5}
body.light .percentiles thead,body.light #reportStages thead{color:#6d3fc0}
body.light .selectable-table tbody tr:hover{background:#eef1f5}
body.light .selectable-table tbody tr.selected-row{background:#e4dafa;color:#1f2933}
body.light #reportStages div{background:#f4f6f9}
body.light #sleepControls>span{color:#4b5563}
body.light .recorded-window{color:#1f2933}
body.light #chartStack.emv-one-picture{background:#ffffff}
body.light .drop-zone.dragging{background:#f3edff}
