:root{font-family:Inter,system-ui,sans-serif;color:#18313b;background:#f3f6f7;font-size:14px;line-height:1.5;--accent:#174f58}*{box-sizing:border-box}body{margin:0}header{background:var(--accent);color:#fff;padding:16px 24px;display:flex;align-items:center;justify-content:space-between;gap:16px}header strong{font-size:21px}header span{display:block;color:#d2e6e6;font-size:13px}.actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}button,.button{font:inherit;background:white;border:1px solid #b6c9ce;border-radius:6px;padding:8px 12px;color:#194852;cursor:pointer;display:inline-block;font-weight:600;text-align:center}button:hover,.button:hover{background:#e8f3f2}button:disabled{opacity:.5;cursor:wait}button.primary{background:var(--accent);color:white}.statusline{padding:9px 24px;display:flex;gap:20px;flex-wrap:wrap;background:#e4eeee;font-size:12px}#notice{margin:12px 24px;padding:12px 16px;background:#fff3d8;border-left:4px solid #bd7a00;white-space:pre-wrap}main{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:20px;margin:20px 24px;align-items:start}.data-panel,.figure-panel{background:white;padding:20px;border:1px solid #d7e2e5;border-radius:10px;min-width:0}.figure-panel{position:sticky;top:12px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.section-head label{max-width:240px}h1{font-size:21px;margin:0 0 12px}h2{font-size:18px;margin:12px 0}p{margin:8px 0;color:#526972}details{margin:12px 0;border-top:1px solid #dce5e7;padding-top:10px}summary{cursor:pointer;font-weight:650;color:#205966}input,select,textarea{font:inherit;border:1px solid #b8cbd1;border-radius:5px;padding:7px;color:#18313b;background:#fff;max-width:100%}input:focus,select:focus,textarea:focus,button:focus-visible{outline:2px solid #248d9a;outline-offset:1px}label{display:flex;flex-direction:column;font-size:12px;font-weight:600;gap:3px}.paste-label{margin:10px 0}textarea{width:100%;font:12px ui-monospace,monospace;resize:vertical}.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0}.fields input,.fields select{width:100%}input[type=color]{height:35px;padding:2px}.table-help{display:flex;align-items:center;gap:10px;margin:16px 0 8px;flex-wrap:wrap}.table-help span{font-size:12px;color:#526972;flex:1}.table-scroll{max-height:330px;overflow:auto;border:1px solid #dce5e7;border-radius:5px}table{border-collapse:collapse;width:100%;font-size:12px}th,td{border-bottom:1px solid #e1e9eb;padding:5px;text-align:left}th{background:#eaf0f2;position:sticky;top:0;z-index:1;white-space:nowrap}td input{width:80px;padding:5px}td input[data-key=reason]{width:130px}td input[type=checkbox]{width:20px;height:20px}td button{padding:3px 8px}tr.excluded{background:#f1f3f3;color:#788b91}#rowSummary,.hint,#exportState,#resultState{font-size:12px;color:#526972}.analysis-panel{margin-top:20px;padding-top:4px;border-top:1px solid #dce5e7}.result-card{background:#eaf4ef;border:1px solid #c8e0d0;padding:12px;border-radius:6px;margin:12px 0}.result-card strong{font-size:18px}.warning{background:#fff6df;border-left:3px solid #c18a1a;padding:8px 10px;margin:6px 0;color:#634b1e;font-size:12px}.error{color:#96332b;background:#fff0ed;padding:12px;border-left:3px solid #b44134}#figure{min-height:240px;display:flex;align-items:center;justify-content:center;border:1px solid #e1e7e9;background:white;overflow:hidden}#figure svg{width:100%;height:auto}#figure text[data-edit]{cursor:text}.figure-controls{grid-template-columns:repeat(2,minmax(0,1fr))}#record{max-height:250px;overflow:auto;font-size:11px;white-space:pre-wrap}#residualPlot svg{width:100%;height:auto}footer{padding:16px 24px;color:#6b8087;font-size:12px}#versionNotice{padding:12px;background:#fff0d1}#methodHelp{font-size:12px}#results table{margin:10px 0}#sheetBox{margin:10px 0}@media(min-width:1550px){main{max-width:1700px;margin:24px auto}}@media(max-width:980px){main{grid-template-columns:1fr;margin:12px;gap:12px}.figure-panel{position:static}header{padding:12px;align-items:flex-start;flex-wrap:wrap}.statusline{padding:8px 12px;gap:6px 16px}.data-panel,.figure-panel{padding:14px}.section-head{flex-wrap:wrap}.table-scroll{max-height:280px}#notice{margin:12px}}@media(prefers-reduced-motion:no-preference){button{transition:background .12s}}
[hidden]{display:none!important}

/* Keep readiness short; the exact calculation engine stays one disclosure away. */
#engineDetails{margin:0;border:0;padding:0;min-width:0;max-width:100%}#engineDetails summary{font-weight:inherit;color:inherit}#engineDetails[open]{flex-basis:100%}#engineVersion{overflow-wrap:anywhere}

.result-explanation{border-left:3px solid #248d9a;padding:8px 12px;margin:12px 0;background:#f0f7f7}.result-explanation p{font-size:13px}

/* One linked sheet workspace, matching Prism's retained data/results/graph structure. */
main.workspace{display:grid;grid-template-columns:210px minmax(0,1fr);gap:0;max-width:none;margin:0;align-items:stretch;min-height:calc(100vh - 170px)}
.navigator{background:#eaf0f4;border-right:1px solid #b8c6cf;padding:16px 10px;min-width:0}
.navigator h2{margin:0 8px 8px;font-size:14px;color:#3a515e}.navigator #sheetProject{font-weight:650;padding:4px 8px;overflow-wrap:anywhere}
.navigator p{font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;margin:18px 8px 4px;color:#4e6472}
.navigator button{display:block;width:100%;border-radius:3px;text-align:left;background:transparent;border:1px solid transparent;font-weight:500;padding:7px 9px}
.navigator button.selected{background:#d5e6f4;border-color:#9cb8cc;color:#113d5c}.navigator small{display:block;margin:24px 8px;color:#566c78;font-size:11px}
.workspace-content{min-width:0;padding:14px 22px 24px}.sheet-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}.sheet-heading h1{margin:0;font-size:20px}
.workspace .data-panel,.workspace .figure-panel,.workspace .analysis-panel{background:white;border:1px solid #cbd6dc;border-radius:3px;padding:18px;position:static;margin:0;min-width:0}
.workspace .figure-panel{max-width:1100px}.workspace .analysis-panel{max-width:1100px}.workspace .section-head{margin-bottom:12px}
.grid-toolbar{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.grid-toolbar label{min-width:170px}.grid-toolbar button{min-height:37px}
#gridHelp{font-size:12px;max-width:1000px}.wide-grid{max-height:52vh;border-radius:0;margin:12px 0;min-height:170px}.wide-grid table{width:auto;min-width:100%;font-size:13px}.wide-grid th,.wide-grid td{border:1px solid #cbd6dc;padding:0;background:white}.wide-grid th{background:#eaf0f4}.wide-grid thead th input{font-weight:650;text-align:center;background:#eaf0f4;color:#174b70}.wide-grid input{width:100%;min-width:116px;max-width:none;border:0;border-radius:0;padding:8px;outline-offset:-2px}.wide-grid tbody th{position:sticky;left:0;z-index:1;min-width:130px;padding:0 10px;font-weight:500}.wide-grid tbody th:has(input){padding:0}.wide-grid thead tr:nth-child(2) th{top:37px;font-weight:500;font-size:12px;padding:4px 8px}.wide-grid thead th:first-child{min-width:150px;padding:4px 10px}.wide-grid .excluded-cell input{color:#175fa8;font-style:italic;background:#edf4fc}
#observationDetails{margin-top:18px}.workspace #figure{max-width:900px;margin:0 auto}.workspace .figure-controls{grid-template-columns:repeat(4,minmax(0,1fr))}.workspace .analysis-panel>.fields{max-width:600px}
@media(max-width:760px){main.workspace{grid-template-columns:1fr}.navigator{position:sticky;top:0;z-index:4;display:flex;gap:4px;padding:6px;border-right:0;border-bottom:1px solid #b8c6cf}.navigator h2,.navigator #sheetProject,.navigator p,.navigator small{display:none}.navigator button{font-size:12px;text-align:center;padding:9px 5px;min-height:40px}.workspace-content{padding:12px}.sheet-heading{align-items:start;flex-wrap:wrap;gap:8px}.sheet-heading h1{font-size:18px}.sheet-heading button{font-size:12px;padding:6px 8px}.workspace .data-panel,.workspace .figure-panel,.workspace .analysis-panel{padding:12px}.workspace .figure-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-toolbar{gap:6px}.grid-toolbar label{min-width:100px;flex:1}.grid-toolbar button{font-size:12px;padding:8px}.wide-grid{max-height:50vh}.wide-grid input{min-width:95px}.wide-grid tbody th{min-width:110px}.wide-grid thead th:first-child{min-width:110px}}

.wide-grid .grid-edit-error{display:block;max-width:150px;padding:6px 8px;white-space:normal;font-size:12px;font-weight:500;line-height:1.35;color:#634b1e;background:#fff3d8;border-left:3px solid #bd7a00;text-align:left}

/* Current and saved result tables share a readable, phone-sized surface. */
.result-table{max-width:100%;overflow-x:auto;margin:10px 0}
.result-table table{table-layout:fixed;margin:0!important}
.result-table th,.result-table td{white-space:normal;overflow-wrap:anywhere;vertical-align:top}
#historyRecords article{min-width:0;border-bottom:1px solid #dce5e7;padding:0 0 12px}
#historyRecords p,#historyRecords h3,.result-card{overflow-wrap:anywhere}
#historyRecords pre,#record{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;max-height:250px;overflow:auto}

/* Analysis choice follows Prism: analyses on the left, input data sets on the right. */
#analysisDialog{width:min(900px,calc(100% - 24px));max-height:calc(100dvh - 24px);overflow:auto;border:1px solid #9cb0ba;border-radius:5px;padding:20px;color:#18313b;box-shadow:0 12px 60px #18313b40}
#analysisDialog::backdrop{background:#18313b66}.analysis-choice{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:20px}.analysis-choice section{min-width:0}.analysis-choice h3{font-size:14px;margin:12px 0 8px}.analysis-choice .fields{display:block;margin:0}#method{width:100%;min-height:190px}#method option{padding:6px;white-space:normal}.dataset-choices{max-height:220px;overflow:auto;border:1px solid #b8cbd1;border-radius:3px;padding:4px}.dataset-choices label{display:flex;flex-direction:row;align-items:center;gap:10px;min-height:38px;padding:5px 8px;overflow-wrap:anywhere;font-size:14px}.dataset-choices input{width:18px;height:18px;flex:none}#selectionHelp{font-size:12px}#selectionHelp.error{padding:8px;margin-top:8px}.dialog-actions{justify-content:flex-end;margin-top:18px;padding-top:12px;border-top:1px solid #dce5e7}.analysis-inputs{overflow-wrap:anywhere}#analysisSettings{overflow-wrap:anywhere}
@media(max-width:600px){#analysisDialog{padding:14px}.analysis-choice{grid-template-columns:1fr;gap:4px}#method{min-height:175px}.dataset-choices{max-height:145px}.dialog-actions{position:sticky;bottom:-14px;background:white;padding-bottom:10px}}

#gridNotice{padding:8px 10px;background:#fff3d8;border-left:3px solid #bd7a00;color:#634b1e;font-size:12px}

#anovaOptions{border:1px solid #b8cbd1;border-radius:5px;margin:12px 0;padding:10px 12px}#anovaOptions legend{font-weight:650}#anovaOptions>label{display:flex;flex-direction:row;align-items:center;gap:8px;margin:6px 0;font-size:13px}#anovaOptions input[type=radio]{flex:none;width:18px;height:18px}#anovaOptions>.control-choice{flex-direction:column;align-items:stretch;margin-left:26px}#analysisDialog{max-height:90dvh;overflow:auto}#analysisDialog .dialog-actions{position:sticky;bottom:-20px;background:white;padding:10px 0}

.graph-controls{grid-template-columns:minmax(0,1fr);max-width:540px}
#pairingRows{max-height:180px;overflow:auto;overflow-wrap:anywhere}

.column-selection{min-width:0;border:0;padding:0;margin:10px 0}.column-selection legend{font-size:12px;font-weight:600}.column-selection .actions{margin:4px 0}.column-selection .dataset-choices{max-height:190px}.column-selection label:has(input:disabled){color:#66777c;background:#edf1f2}.column-selection label{white-space:pre-wrap}#columnImportHelp{font-size:12px;overflow-wrap:anywhere}#columnPreview{margin:8px 0}

/* Format beside the live graph; no modal or staged Apply state. */
.figure-workspace{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
.figure-workspace:has(#formatGraphPanel:not([hidden])){grid-template-columns:minmax(0,1fr) 290px}
.figure-view{min-width:0}#formatGraphPanel{padding:12px;background:#f1f5f8;border:1px solid #b8c6cf;border-radius:3px;min-width:0;position:sticky;top:12px}
#formatGraphPanel h3{font-size:15px;margin:0}#formatGraphPanel .section-head{margin:0 0 10px}#formatGraphPanel .fields{grid-template-columns:repeat(2,minmax(0,1fr))}
#formatGraphPanel label:first-child,#uncertaintyHelp{grid-column:1/-1}#uncertaintyHelp{margin:0}#formatGraphPanel button{padding:5px 9px}#formatGraphPanel #formatSeriesHelp{margin-bottom:0}
.workspace .figure-panel{max-width:1300px}#formatGraph{margin-left:auto}#exportState{flex-basis:100%;text-align:right}
@media(max-width:1050px){.figure-workspace:has(#formatGraphPanel:not([hidden])){grid-template-columns:minmax(0,1fr)}#formatGraphPanel{position:static}.workspace #formatGraphPanel .fields{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Named table families on desktop; two compact navigation rows on a phone. */
.table-picker{display:flex;gap:6px;align-items:end;margin:10px 0}.table-picker label{min-width:0;flex:1}.table-picker select{width:100%;min-width:0}.navigator .table-picker button{width:auto;flex:none;background:white;border-color:#b6c9ce;padding:7px 9px}.navigator #sheetTree button{overflow-wrap:anywhere}.sheet-tabs{display:none}
@media(max-width:760px){.navigator{display:block;padding:4px 6px}.table-picker{margin:0 0 4px}.table-picker label{font-size:11px;flex-direction:row;align-items:center;gap:6px}.table-picker select{flex:1;min-height:34px;padding:4px}.navigator .table-picker button{min-height:34px}.sheet-tabs{display:flex;gap:4px}.sheet-tabs button{min-height:34px;padding:6px}#sheetTree{display:none}.data-panel .section-head label{max-width:100%;width:100%}.data-panel .section-head input{width:100%}}

#notice.information{background:#eef5f7;color:#294650;border-color:#c5d8dd} .observation-paging{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin:.5rem 0}
