:root{color-scheme:light;--ink:#182c35;--muted:#5b6d76;--teal:#0c6969;--line:#dce5e6;--paper:#f5f8f8;--tint:#eef6f4;--danger:#9d3030;font-family:Segoe UI,Arial,sans-serif;font-size:15px;scroll-behavior:smooth;scroll-padding-top:22px}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);line-height:1.6}button,input,select,textarea{font:inherit}button,.file-button{min-height:42px;padding:8px 16px;border:1px solid #c7d5d6;border-radius:7px;background:white;color:var(--ink);cursor:pointer;font-weight:600;transition:background .15s}button:hover,.file-button:hover{background:#eff5f5}button:disabled{opacity:.5;cursor:default}button.primary{background:var(--teal);color:white;border-color:var(--teal)}button.primary:hover{background:#095757}button:focus-visible,a:focus-visible,summary:focus-visible,.file-button:focus-within{outline:3px solid #deaa50;outline-offset:3px}a{color:var(--teal)}.topbar{display:flex;gap:20px;align-items:center;flex-wrap:wrap;padding:20px max(24px,calc((100% - 1180px)/2));background:white;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:13px;text-decoration:none;color:var(--ink);font-size:22px;line-height:1.2}.brand-icon{display:grid;place-items:center;background:var(--teal);color:white;border-radius:10px;width:43px;height:43px;font-size:28px;font-family:Georgia,serif}.brand small{display:block;font-size:9px;letter-spacing:1.7px;color:var(--muted);margin-top:5px}.isolated{font-size:12px;color:var(--muted);margin-left:auto;padding:5px 10px;border:1px solid var(--line);border-radius:5px}.connection{font-size:12px;font-weight:600;color:var(--teal);min-width:120px}.connection[data-state=stale]{color:#655b48}.connection[data-state=error]{color:var(--danger)}main{max-width:1180px;margin:auto;padding:10.5px 24px 20px}.eyebrow{font-size:10px;font-weight:700;letter-spacing:1.5px;color:var(--teal);margin:0 0 10px}h1{font-family:Georgia,serif;font-size:clamp(32px,5vw,57px);font-weight:500;line-height:1.15;letter-spacing:-1.8px;margin:0 0 20px}h1 span{color:var(--teal)}h1 sub{font-size:.6em}.steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--line);background:white;border-radius:9px;margin:7px 0 28px;overflow:hidden}.steps a{display:flex;align-items:center;gap:10px;padding:14px 16px;text-decoration:none;color:var(--ink);font-size:12px;font-weight:600;border-right:1px solid var(--line)}.steps a:last-child{border:0}.steps a:hover{background:var(--tint)}.steps span{font-size:10px;color:var(--teal);padding:4px;border-radius:4px;background:var(--tint)}.study-tools,.actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.study-tools{justify-content:space-between;margin-bottom:12px}.study-tools>div:first-child{display:flex;gap:10px;align-items:center;flex-wrap:wrap;min-width:0}.study-tools strong{font-size:13px}.actions button,.file-button{font-size:11px;min-height:36px;padding:6px 11px}.file-button{display:inline-flex;align-items:center}.file-button input{position:absolute;width:1px;height:1px;opacity:0}.pill{background:#ebe7dd;color:#6b5830;font-size:10px;border-radius:5px;padding:3px 8px}.error{white-space:pre-wrap;overflow-wrap:anywhere;background:#fff2f0;border:1px solid #e9c1bb;color:var(--danger);padding:14px;border-radius:7px}.card{min-width:0;padding:26px 28px;margin-bottom:22px;border:1px solid var(--line);border-radius:11px;background:white;box-shadow:0 3px 12px #17343f03;scroll-margin-top:20px}.stage-header{display:flex;align-items:center;gap:15px;flex-wrap:wrap;margin-bottom:14px}.stage-number{font-size:18px;font-family:Georgia,serif;color:var(--teal);width:42px;height:42px;display:grid;place-items:center;border:1px solid #c6ddda;border-radius:8px;background:#f4f9f8}.stage-header .eyebrow{margin-bottom:3px}.stage-header h2{margin:0;font-size:23px;font-family:Georgia,serif;font-weight:500;line-height:1.3}h3{font-size:14px;font-weight:600;margin:24px 0 14px}.card>p{font-size:13px;color:var(--muted);margin:0 0 22px}.result-badge{margin-left:auto;font-size:10px;background:#f0f3f3;color:var(--muted);padding:5px 9px;border-radius:5px}.result-badge[data-role=success]{background:var(--tint);color:var(--teal)}.result-badge[data-role=danger]{background:#fff1ed;color:var(--danger)}.config-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:20px 0}.detail-grid{gap:15px}.wide{grid-column:span 2}.full{grid-column:1/-1}label{display:block;color:#31464f;font-size:12px;font-weight:600;min-width:0}label>span{color:var(--muted);font-size:10px;font-weight:400;margin-left:3px}input,select,textarea{width:100%;min-height:42px;padding:9px 10px;margin-top:7px;border:1px solid #cad7da;border-radius:6px;background:#fbfdfd;color:var(--ink);font-size:13px}input:focus,select:focus,textarea:focus{outline:2px solid #b2d4cc;outline-offset:1px;border-color:var(--teal)}textarea{resize:vertical;min-height:75px;font-weight:400}input[type=checkbox]{width:17px;min-height:17px;height:17px;accent-color:var(--teal);margin:0}.checkbox{display:flex;align-items:center;gap:9px;padding-bottom:12px}.selected-flow{display:flex;align-items:end;gap:14px;flex-wrap:wrap;padding-top:15px;margin:10px 0 20px;border-top:1px solid var(--line)}.selected-flow label{min-width:140px;flex:1}.selected-flow button{font-size:12px;margin-bottom:0}.baseline-inputs{display:grid;grid-template-columns:1fr 1fr 1fr;align-items:end;gap:16px;margin-bottom:25px}.academic-grid{display:grid;grid-template-columns:1.05fr 1fr;gap:20px;margin-top:20px}.two-columns{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:20px 0}.equation-panel{border:1px solid #dfe9e5;border-radius:8px;background:#f8fbfa;padding:17px 18px;min-width:0}.substitution-panel{border:1px solid var(--line);border-radius:8px;padding:17px 18px;min-width:0}.panel-label{display:block;font-size:9px;letter-spacing:1.3px;font-weight:700;color:var(--teal);margin-bottom:13px}.equation{max-width:100%;overflow-x:auto;overflow-y:hidden;padding:9px 4px;margin:3px 0;color:#19363b;font-size:17px}.equation math{min-width:max-content;margin:0 auto}.rp-panel .equation{font-size:22px}.compact{margin:18px 0}.help{display:block;font-size:11px;font-weight:400;color:var(--muted);line-height:1.65;overflow-wrap:anywhere}.equation-panel p.help{margin:12px 0 0}.substitution{font-size:13px;min-height:58px;overflow-wrap:anywhere;color:var(--muted)}.substitution .equation{font-size:16px}.metrics{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:23px 0 4px}.metrics>div{min-width:0}.metrics span{display:block;font-size:11px;color:var(--muted);margin-bottom:5px}.metrics strong{display:block;color:var(--teal);font-size:24px;font-family:Georgia,serif;font-weight:500;overflow-wrap:anywhere}.metrics strong small{font-size:12px;font-family:Segoe UI,Arial,sans-serif}.metrics.four{grid-template-columns:repeat(4,minmax(0,1fr));padding:20px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.metrics.four strong{font-size:19px}details{margin:15px 0;padding:12px 0;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}summary{cursor:pointer;font-size:12px;color:#3f5963;font-weight:600;padding:3px 0;min-height:28px;line-height:1.6}.input-details{margin:18px 0}.hero-result{margin:20px 0 5px;padding-top:17px;border-top:1px solid var(--line)}.hero-result>span{font-size:11px;color:var(--muted)}.hero-result>strong{display:block;font-family:Georgia,serif;color:var(--teal);font-weight:500;font-size:40px;line-height:1.4}.hero-result strong small{font-family:Segoe UI,sans-serif;font-size:16px}.hero-result>small{color:var(--muted);font-size:11px}.section-line,.chart-title{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}.section-line h3{margin:28px 0 15px}.section-line button{font-size:11px;min-height:34px}.table-scroll{max-width:100%;overflow:auto;border:1px solid var(--line);border-radius:7px;overscroll-behavior-x:contain;margin:15px 0}table{border-collapse:collapse;width:100%;font-size:12px;text-align:left}caption{font-size:12px;font-weight:600;text-align:left;padding:12px 14px}th{color:#425e68;font-weight:600;background:#f3f7f7;font-size:11px;padding:12px 14px;line-height:1.4;white-space:nowrap}th small{display:block;font-size:9px;color:var(--muted);font-weight:400}td{padding:11px 14px;border-top:1px solid #e6eded;font-variant-numeric:tabular-nums;white-space:nowrap}td input{margin:0;min-height:36px;font-size:11px;min-width:103px;padding:6px 7px}.runs td{padding:8px}.runs td:nth-child(2) input,.runs td:nth-child(3) input{min-width:130px}.runs td:nth-child(4) input,.runs td:nth-child(5) input{min-width:80px}.runs td input[type=checkbox]{min-width:17px}.runs td button{min-height:30px;padding:4px 8px;font-size:10px}.chart-wrap{margin-top:24px;background:#fcfdfd;border:1px solid var(--line);border-radius:8px;padding:15px 16px 8px;min-width:0}.chart-title h3{margin:0}.legend{display:inline-flex;align-items:center;flex-wrap:wrap;font-size:10px;color:var(--muted);gap:7px}.legend i{background:var(--teal);width:7px;height:7px;border-radius:50%}.legend b{width:16px;border-top:1px dashed #b77a39;margin-left:8px}svg{display:block;width:100%;height:auto;min-height:160px;margin-top:10px;overflow:visible}svg text{font-family:Segoe UI,Arial,sans-serif;fill:#546c76;font-size:12px}.next-run{padding:15px;border-radius:7px;margin-top:16px;background:#eff6f5;font-size:12px;color:#365b5b;overflow-wrap:anywhere}.next-run strong{color:var(--teal)}#diagnostics-body p{padding:8px 0;overflow-wrap:anywhere}.evaluation{padding:17px 20px;border:1px solid var(--line);border-radius:8px;align-self:start}.evaluation strong{display:block;font-size:30px;font-family:Georgia,serif;color:var(--teal);margin:15px 0}.evaluation p{font-size:12px;color:var(--muted);margin:0}.export-bar{display:flex;align-items:center;flex-wrap:wrap;gap:12px;border-top:1px solid var(--line);padding-top:20px;margin-top:20px}.export-bar>div{flex:1;min-width:200px}.export-bar strong{font-size:12px}.export-bar p{font-size:11px;color:var(--muted);margin:3px 0}.export-bar button{font-size:11px}.references h2{font-size:18px;font-family:Georgia,serif;font-weight:500}.references ul{padding-left:20px}.references li{margin:12px 0;overflow-wrap:anywhere}.references p{font-size:12px}footer{display:flex;justify-content:space-between;gap:15px;flex-wrap:wrap;color:var(--muted);font-size:10px;padding:6px 0 15px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}
@media(max-width:950px){.steps a{padding:12px 10px;font-size:11px}.config-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.academic-grid{grid-template-columns:1fr}.metrics.four{grid-template-columns:repeat(2,minmax(0,1fr))}.rp-panel .equation{font-size:20px}.study-tools{gap:15px}.two-columns{grid-template-columns:1fr}}
@media(max-width:600px){main{padding:6.5px 14px 15px}.topbar{padding:16px;gap:14px}.brand{font-size:20px}.isolated{display:none}.connection{margin-left:auto;font-size:10px;min-width:85px}.steps{grid-template-columns:1fr 1fr}.steps a:nth-child(2){border-right:0}.steps a:nth-child(-n+2){border-bottom:1px solid var(--line)}.card{padding:20px 16px;border-radius:9px}.stage-header{gap:10px}.stage-header h2{font-size:20px}.stage-number{width:35px;height:35px;font-size:16px}.stage-header .eyebrow{font-size:8px;letter-spacing:1px}.stage-header>div{flex:1;min-width:180px}.result-badge{margin-left:45px}.config-grid{gap:14px 11px}.baseline-inputs{grid-template-columns:1fr 1fr}.baseline-inputs .checkbox{grid-column:1/-1;padding-top:6px}.selected-flow{gap:10px}.selected-flow label{min-width:110px}.selected-flow button{width:100%}.equation-panel,.substitution-panel{padding:14px 12px}.equation{font-size:16px}.rp-panel .equation{font-size:18px}.two-columns{gap:15px}.hero-result>strong{font-size:36px}.metrics{gap:15px}.metrics strong{font-size:23px}.metrics.four{gap:17px}.metrics.four strong{font-size:18px}.chart-wrap{padding:12px 8px 5px}.chart-title{padding:0 5px}.chart-title h3{font-size:12px}.legend{font-size:9px}svg{min-height:140px}.eyebrow{font-size:9px}footer{font-size:9px}.export-bar button{flex:1}}
@media(max-width:360px){.config-grid{grid-template-columns:1fr}.wide{grid-column:span 1}.baseline-inputs{grid-template-columns:1fr}.baseline-inputs .checkbox{grid-column:1}.metrics.four{grid-template-columns:1fr 1fr}.connection{margin-left:0}.actions{gap:7px}.actions button,.file-button{font-size:10px}.stage-header>div{min-width:150px}.card{padding:18px 12px}}
@media(prefers-reduced-motion:reduce){:root{scroll-behavior:auto}button,.file-button{transition:none}}
@media print{body{background:white}.topbar,.study-tools,.steps,.actions,.selected-flow button,.section-line button,.export-bar button{display:none}.card{box-shadow:none;break-inside:avoid;padding:18px}.config-grid{grid-template-columns:repeat(4,1fr)}main{padding:0}.equation-panel{background:white}}
.run-condition{margin:0;padding:0;border:0;min-width:126px}.run-condition summary{font-size:10px;white-space:normal}.run-condition[open]{min-width:190px}.run-condition label{margin:10px 0;font-size:11px}.run-condition .checkbox{padding-bottom:0}.runs td:nth-child(4) input,.runs td:nth-child(5) input{min-width:80px}
.stage-header>div{min-width:0;flex:1 1 150px;max-width:100%}.stage-header h2{overflow-wrap:anywhere}.selected-flow label{min-width:0;flex-basis:140px;max-width:100%}.export-bar>div{min-width:0;flex-basis:200px;max-width:100%}.brand{max-width:100%}.brand>span:last-child{min-width:0;overflow-wrap:anywhere}.brand-icon{flex-shrink:0}.steps a{min-width:0;overflow-wrap:anywhere}.study-tools strong{overflow-wrap:anywhere}.actions{min-width:0;max-width:100%}.actions button,.file-button{max-width:100%;white-space:normal}

.equation:focus-visible{outline:2px solid #b2d4cc;outline-offset:2px}.equation-hint{font-size:10px;margin-top:8px;color:var(--muted)}
/* Compact provenance-bound context transfer, wrapping within the Lab viewport. */
.application-sync { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:0 0 18px; font-size:12px; }
.application-sync[hidden], .application-sync [hidden] { display:none; }
.application-sync select { width:auto; max-width:100%; }
.application-sync span { flex:1 1 260px; min-width:0; overflow-wrap:anywhere; color:var(--muted); }
.application-reference { padding:14px; margin:0 0 18px; border:1px solid var(--line); border-radius:8px; }
.application-reference[hidden] { display:none; }
.application-reference p { margin-bottom:0; overflow-wrap:anywhere; font-size:11px; }
.steps span { flex: 0 0 auto; white-space: nowrap; }
.persistence-tools{padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.persistence-tools>div:first-child{align-items:end}.persistence-tools label{max-width:100%;flex:1 1 240px}.persistence-tools select{margin-top:3px}
.equation-priority{padding:10px 14px;background:var(--tint);border-left:3px solid var(--teal);border-radius:4px}
#workspace-status:empty,#cloud-input-status:empty{display:none}
.study-control-card{display:flex;flex-direction:column;gap:16px}
.study-control-card>.study-tools,.study-control-card>.application-sync{margin:0}
.study-control-card>.persistence-tools{padding:16px 0 0;border-top:1px solid var(--line);border-bottom:0}
.study-control-card>p{margin:0}.study-control-card>p.error{color:var(--danger)}
@media(max-width:600px){.study-control-card>.study-tools>div{flex-basis:100%}.study-control-card .actions{justify-content:flex-start}}
/* Independent Lab touch/reflow projection; engineering operands stay in Python. */
@media(any-pointer:coarse),(max-width:600px){
  body{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
  button,.actions button,.runs td button,.section-line button,.file-button,input:not([type=checkbox]):not([type=file]):not([type=hidden]),select,textarea{min-height:44px}
  input[type=file],.file-button input[type=file]{min-height:44px}
  input:not([type=checkbox]):not([type=file]):not([type=hidden]),select,textarea{font-size:16px}
  button,.actions button,.runs td button,.section-line button,.file-button{min-width:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
  .checkbox{min-height:44px;align-items:center;line-height:1.5;overflow-wrap:anywhere}
  .checkbox input[type=checkbox]{flex:0 0 17px;width:17px;height:17px;min-height:17px}
  summary{min-height:44px;display:flex;align-items:center;overflow-wrap:anywhere}
  .steps a{min-height:44px}
}

/* Shared hosted Lab presentation. Engineering values remain Python-owned. */
:root{font-family:Inter,"Segoe UI",Arial,sans-serif;font-size:16px;line-height:1.55;--ink:#183544;--muted:#536d7b;--accent:#006979;--teal:#006979;--border:#ccd9df;--line:#ccd9df;--paper:#fff;--bg:#f3f6f7;--tint:#edf5f8}
body.formal-lab{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,"Segoe UI",Arial,sans-serif;line-height:1.55}
body.formal-lab *{box-sizing:border-box}
header.lab-site-header{background:#173845;color:#fff;padding:1.4em 1.5em;border:0;font:16px/1.55 Inter,"Segoe UI",Arial,sans-serif}
.lab-site-header .lab-header-inner{max-width:1132px;margin:auto;display:flex;justify-content:space-between;align-items:center;gap:1em}
.lab-site-header .lab-heading{min-width:0;flex:1 1 280px}
.lab-site-header .eyebrow{font-family:inherit;font-size:.72em;line-height:1.55;letter-spacing:.16em;font-weight:500;color:#d0e0e5;margin:0 0 11.2px}
.lab-site-header h1{font-family:inherit;font-size:clamp(28.8px,3vw,41.6px);font-weight:700;line-height:1.2;letter-spacing:normal;color:#fff;margin:0 0 7.2px;overflow-wrap:anywhere}
.lab-site-header .lab-subtitle{font-size:1em;line-height:1.55;margin:0;color:#fff;overflow-wrap:anywhere}
.lab-site-header .lab-header-navigation{min-width:0;flex:0 1 58%;max-width:100%}
.lab-site-header :is(nav,[role="navigation"]){display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:.5em;margin:0;padding:0}
.lab-site-header :is(nav,[role="navigation"]) a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;max-width:100%;padding:8.8px 12.8px;border:1px solid #567481;border-radius:6px;background:transparent;color:#fff;text-decoration:none;font-size:.95em;font-weight:400;overflow-wrap:anywhere}
.lab-site-header :is(nav,[role="navigation"]) a[aria-current]{background:#286070}
.lab-site-header .lab-header-status{min-height:1.55em;margin-top:.5em;text-align:right}
body.formal-lab #freshness{color:#d9ecf2;font-size:.85rem;line-height:1.5;min-width:0;overflow-wrap:anywhere}
body.formal-lab #freshness[data-state="error"]{color:#ffd2c9}
body.formal-lab #freshness[data-state="stale"]{color:#fce0a7}
body.formal-lab>main,body.formal-lab>main.wrap{width:100%;max-width:1180px;min-width:0;margin:auto;padding:1.5rem 1.5rem 3rem}
body.formal-lab>main>:first-child{margin-top:0}
body.formal-lab :is(.panel,.card){min-width:0;margin:1.2rem 0;padding:1.4rem;background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 2px 5px #122e3e05}
body.formal-lab :is(h2,h3,h4){font-family:inherit;color:var(--ink);overflow-wrap:anywhere}
body.formal-lab h2,body.formal-lab .stage-header h2{font-size:1.35rem;font-weight:700;line-height:1.35;letter-spacing:normal}
body.formal-lab h3{font-size:1.1rem;font-weight:700;line-height:1.4}
body.formal-lab :is(p,li){line-height:1.55;overflow-wrap:anywhere}
body.formal-lab .card>p{font-size:.94rem;color:var(--muted)}
body.formal-lab main :is(label,.form-label){font-family:inherit;font-size:.9rem;font-weight:600;line-height:1.5;min-width:0}
body.formal-lab main label span{font-size:.8rem}
body.formal-lab main :is(input,select,textarea){font-family:inherit;font-size:.95rem;line-height:1.5;min-width:0;max-width:100%;min-height:44px;padding:.62rem .7rem;border:1px solid #acbec7;border-radius:5px;color:var(--ink);background:#fff}
body.formal-lab main :is(input[type="checkbox"],input[type="radio"]){width:20px;min-height:20px;height:20px;padding:0;flex-shrink:0}
body.formal-lab main input[type="range"]{padding:0;background:transparent;border:0}
body.formal-lab main textarea{font-family:Consolas,monospace;font-size:.88rem}
body.formal-lab main :is(button,.file-button){display:inline-flex;align-items:center;justify-content:center;font-family:inherit;font-size:.875rem;font-weight:600;line-height:1.45;min-height:44px;max-width:100%;padding:.6rem .9rem;border:1px solid #bccdd5;border-radius:6px;background:#fff;color:#244757;white-space:normal;overflow-wrap:anywhere;cursor:pointer;text-align:center}
body.formal-lab main button.primary{background:var(--accent);border-color:var(--accent);color:#fff}
body.formal-lab main :is(button,.file-button):not(:disabled):hover{background:#edf4f6;border-color:#80a8b5}
body.formal-lab main button.primary:not(:disabled):hover{background:#005665;border-color:#005665}
body.formal-lab main button:disabled{opacity:1;background:#eef2f4;border-color:#dae2e6;color:#71838d;cursor:default;box-shadow:none}
body.formal-lab .study-control-card{gap:1rem}
body.formal-lab .study-tools .actions{gap:.6rem}
body.formal-lab .study-tools strong{font-size:.95rem}
body.formal-lab .study-control-card>.persistence-tools{padding:1rem;background:#f7f9fa;border:1px solid #dce5e9;border-radius:8px;gap:.8rem}
body.formal-lab .persistence-tools>.actions{gap:.6rem;justify-content:flex-start}
body.formal-lab .cloud-input-tools{align-items:flex-end}
body.formal-lab .persistence-tools label.file-button{flex:0 1 auto;width:auto;margin:0}
body.formal-lab .file-button:has(input[type="file"]){flex-direction:column}
body.formal-lab .persistence-tools label:not(.file-button){font-size:.85rem;color:var(--muted)}
body.formal-lab .application-sync button{flex:0 1 auto}
body.formal-lab .application-sync span,body.formal-lab .help{font-size:.875rem;line-height:1.55}
body.formal-lab .steps a{font-size:.85rem;line-height:1.45;min-height:48px}
body.formal-lab .pill{font-size:.75rem}
body.formal-lab :is(a,button,input,select,textarea,summary):focus-visible{outline:3px solid #73b8c6;outline-offset:2px}
body.formal-lab .file-button:focus-within{outline:3px solid #73b8c6;outline-offset:2px}
body.formal-lab .notice{border:1px solid #bfd4dc;border-left:1px solid #bfd4dc;background:#edf5f8;color:#244757;padding:.8rem 1rem;border-radius:6px}
body.formal-lab summary{min-height:44px;line-height:1.55;overflow-wrap:anywhere}
body.formal-lab .stage-number{font-family:inherit;font-weight:700}
body.formal-lab :is(.metrics strong,.hero-result>strong,.evaluation strong){font-family:inherit}
body.formal-lab #thermal-history-panel{margin-top:0}
body.formal-lab #thermal-history-panel>summary{min-height:44px;margin-bottom:0;padding-block:.5rem}
body.formal-lab #thermal-history-panel:not([open]){padding-block:.625rem}
body.formal-lab #thermal-history-panel[open]>summary{margin-bottom:1rem}
@media(max-width:800px){.lab-site-header .lab-header-inner{align-items:flex-start;flex-direction:column}.lab-site-header .lab-heading{flex:0 1 auto}.lab-site-header .lab-header-navigation{flex:0 1 auto;width:100%}.lab-site-header :is(nav,[role="navigation"]){justify-content:flex-start}.lab-site-header .lab-header-status{text-align:left}}
@media(max-width:480px){header.lab-site-header{padding:1.2em .8em}body.formal-lab>main,body.formal-lab>main.wrap{padding:1rem .8rem 2rem}body.formal-lab :is(.panel,.card){padding:1rem}body.formal-lab h2,body.formal-lab .stage-header h2{font-size:1.2rem}body.formal-lab main :is(input,select,textarea){font-size:1rem}}
@media(max-width:600px){body.formal-lab .study-tools>.actions,body.formal-lab .persistence-tools>div{width:100%}body.formal-lab .study-control-card .actions>:is(button,.file-button){flex:1 1 100%;width:100%}body.formal-lab .persistence-tools>div:first-child>:is(button,label){flex:1 1 100%;width:100%}body.formal-lab .application-sync button{width:100%}}
@media (max-width: 480px) {
  .lab-site-header .lab-header-navigation .local-lab-links {
    display: grid;
    grid-template-columns: minmax(44px, .65fr) repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .lab-site-header .lab-header-navigation .local-lab-links a {
    min-width: 0;
    padding-inline: 4px;
    text-align: center;
  }
}
@media(prefers-reduced-motion:reduce){body.formal-lab *{scroll-behavior:auto;transition:none}}

/* v2 worksheet; scoped so the shared Cavitation CFD layout is unchanged. */
body.worksheet { margin:0; overflow-wrap:anywhere; }
body.worksheet .card { min-width:0; padding:22px; margin-bottom:20px; }
body.worksheet .study-tools,body.worksheet .actions,body.worksheet .selected-flow,body.worksheet .section-line { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
body.worksheet .stage-header { flex-wrap:wrap; gap:12px; }
body.worksheet .stage-header h2 { margin:4px 0; }
body.worksheet .defense-button { margin-left:auto; }
body.worksheet button,body.worksheet .file-button,body.worksheet select { min-height:44px; }
body.worksheet button { white-space:normal; }
body.worksheet label { display:flex; flex-direction:column; gap:6px; min-width:0; }
body.worksheet input,body.worksheet select,body.worksheet textarea { width:100%; min-width:0; max-width:100%; box-sizing:border-box; font:inherit; }
body.worksheet input:not([type=checkbox]) { min-height:42px; }
body.worksheet input[type=checkbox] { width:20px; height:20px; flex:0 0 auto; }
body.worksheet .checkbox { flex-direction:row; align-items:center; margin:14px 0; }
body.worksheet .config-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:16px; margin:16px 0; }
body.worksheet .config-grid .full { grid-column:1/-1; }
body.worksheet details { margin-top:16px; }
body.worksheet summary { cursor:pointer; padding:10px 0; }
body.worksheet .table-scroll { overflow-x:auto; max-width:100%; }
body.worksheet table { width:100%; border-collapse:collapse; }
body.worksheet th,body.worksheet td { padding:10px; vertical-align:top; }
body.worksheet .row-inputs { display:grid; grid-template-columns:repeat(2,minmax(125px,1fr)); gap:10px; }
body.worksheet #run-rows input { min-width:125px; }
body.worksheet #run-rows details { min-width:160px; margin:0; }
body.worksheet #run-rows th { max-width:130px; }
body.worksheet .chart-wrap { width:100%; min-width:0; overflow-x:auto; }
body.worksheet .chart-wrap svg { display:block; width:100%; height:auto; min-width:420px; }
body.worksheet .chart-wrap text { font-size:12px; fill:#294953; }
body.worksheet .metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
body.worksheet .metrics strong { display:block; padding:6px 0; }
body.worksheet .two-columns { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:20px; }
body.worksheet .source-record,body.worksheet #formula-content pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; }
body.worksheet dialog { width:min(960px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:20px; box-sizing:border-box; border:1px solid #89a9b7; border-radius:10px; overflow:auto; color:#173b4a; }
body.worksheet dialog::backdrop { background:#102e40aa; }
body.worksheet .defense-equation { padding:12px 0 20px; border-bottom:1px solid #c4d7e0; }
body.worksheet .defense-equation h4 { margin:12px 0 6px; }
body.worksheet .math-scroll { max-width:100%; overflow:auto; }
body.worksheet [hidden] { display:none !important; }
body.worksheet :focus-visible { outline:3px solid #126baa; outline-offset:3px; }
@media(max-width:700px) {
 body.worksheet .card { padding:16px; }
 body.worksheet .config-grid { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
 body.worksheet .metrics,body.worksheet .two-columns { grid-template-columns:1fr; }
 body.worksheet .selected-flow>label { flex:1 1 160px; }
 body.worksheet .study-tools>.actions { flex:1 1 100%; }
 body.worksheet .study-tools button,body.worksheet .study-tools .file-button { flex:1 1 140px; }
}
@media(max-width:380px) { body.worksheet .config-grid { grid-template-columns:1fr; } body.worksheet .card { padding:12px; } }

/* Bound the transparent file chooser to its own button, never the viewport. */
body.worksheet .file-button { position:relative; overflow:hidden; }
body.worksheet .file-button input[type=file] { position:absolute; inset:0; width:100%; height:100%; min-height:0; opacity:0; cursor:pointer; }
body.worksheet .math-scroll { overflow-x:auto; overflow-y:hidden; padding:.35rem 0; }

body.worksheet dialog>.study-tools { position:sticky; top:0; z-index:2; background:white; padding:4px 0; }

body.worksheet #observation-results tr[data-role=risk] { background:#fff0ee; color:#8b2020; border-left:3px solid #b8272d; }

#main-adoption-preview{min-width:0;overflow-wrap:anywhere}#main-adoption-preview dl{font-size:12px}#main-adoption-preview dt{font-weight:600}#main-adoption-preview dd{margin:0 0 8px}.source-digest{overflow-wrap:anywhere}
