:root{color-scheme:light;--ink:#292725;--muted:#797570;--red:#ad3826;--line:#dfdcd7;--paper:#fff;--shadow:0 10px 32px #48413a10;font-family:system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);font-size:14px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,select{touch-action:manipulation}button{cursor:pointer;background:#fff;color:inherit;border:1px solid var(--line);border-radius:7px;padding:9px 13px;transition:background .15s,box-shadow .15s}button:hover:not(:disabled){background:#f3eee8}button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--red);outline-offset:4px}button:disabled{cursor:not-allowed;opacity:.46}button[hidden],[hidden]{display:none!important}button img{width:20px;height:20px}.primary{background:var(--red);border-color:var(--red);color:#fff;box-shadow:0 5px 13px #ad382621}.primary:hover:not(:disabled){background:#94301f}.primary img{filter:brightness(0) invert(1)}#fullscreen-stage{position:relative;width:100%;height:100dvh;min-height:560px;overflow:hidden;background:radial-gradient(ellipse at 7% 35%,#eadbd64d,transparent 50%),radial-gradient(ellipse at 92% 23%,#dce7ed73,transparent 50%),#f4f4f2}#three-stage{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}.topbar{position:absolute;z-index:10;top:0;left:0;right:0;height:72px;padding:0 32px;display:flex;align-items:center;gap:16px;border-bottom:1px solid var(--line);background:#ffffffdc}.brand{display:flex;align-items:center}.brand img{width:105px;height:28px;object-fit:contain}.brand-divider{height:22px;width:1px;background:var(--line)}.topbar strong{font-size:16px}.utilities{margin-left:auto;display:flex;align-items:center;gap:12px}.icon{width:36px;height:36px;border:0;background:transparent;padding:8px;display:inline-flex;align-items:center;justify-content:center}.icon img{width:20px;height:20px}.popover{position:absolute;right:24px;top:64px;z-index:50;box-shadow:var(--shadow);background:#fff;border:1px solid var(--line);border-radius:12px;padding:8px;min-width:210px}.popover button,.popover a{display:block;width:100%;text-align:left;border:0;padding:12px;color:inherit;text-decoration:none}.drawer-handle{position:absolute;z-index:15;top:72px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:13px;padding:14px 20px;border-top:0;border-radius:0 0 22px 22px;box-shadow:var(--shadow);font-size:12px;white-space:nowrap}.drawer-handle img{width:14px}.drawer-handle[aria-expanded=true] img{transform:rotate(180deg)}.mission{position:absolute;top:140px;left:42px;max-width:320px;pointer-events:none}.mission button{pointer-events:auto}.mission>p:first-child{color:var(--red);font-weight:650;letter-spacing:1px;font-size:12px;margin:0 0 24px}.mission h1{font-size:15px;line-height:1.8;font-weight:500;margin:0}.mission p{font-size:14px;color:var(--muted);line-height:1.8;margin:0}.mission #task-person{margin-top:12px;color:var(--red)}.metrics{position:absolute;top:112px;right:32px;display:flex;gap:30px;padding:23px 28px;background:#fffffff2;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);min-width:305px;pointer-events:none}.metrics div{min-width:64px}.metrics small{display:block;color:#5a5550;font-size:11px;letter-spacing:1px;margin-bottom:8px}.metrics strong{font-size:29px;font-weight:650;color:var(--red);font-variant-numeric:tabular-nums}.metrics em{font-style:normal;font-size:10px;margin-left:4px;color:var(--muted)}.start-experiment{position:absolute;top:31%;left:49%;transform:translateX(-20%);display:flex;align-items:center;gap:20px;text-align:left;padding:0;background:none;border:0;border-radius:0}.start-experiment:hover:not(:disabled){background:none}.start-experiment strong{font-size:25px;display:block;letter-spacing:-.5px}.start-experiment small{display:block;margin-top:7px;color:var(--muted);font-size:12px}.play-circle{width:78px;height:78px;background:var(--red);border-radius:50%;outline:1px solid #bb4c3338;outline-offset:7px;display:grid;place-items:center;box-shadow:0 0 0 14px #b9462310}.play-circle img{width:33px;height:33px;filter:brightness(0) invert(1);margin-left:4px}.control-dock{position:absolute;right:32px;bottom:28px;max-width:calc(100% - 64px);z-index:12}.control-row{display:flex;align-items:stretch;gap:14px;justify-content:flex-end}.factors{display:flex;align-items:stretch;gap:0;background:#fffefef5;border:1px solid var(--line);border-radius:14px;padding:14px 16px;box-shadow:var(--shadow)}.factor{margin:0;padding:0 16px;border:0;border-right:1px solid var(--line)}.factor:first-child{padding-left:0}.factor:last-child{border:0;padding-right:0}.factor legend{padding:0;margin:0 0 10px;float:left;width:100%}.factor-title{border:0;background:none;padding:0;font-size:12px;font-weight:650;border-radius:2px}.factor-title:hover:not(:disabled){background:none;color:var(--red)}.segments{display:flex;gap:5px;clear:both}.segments label{position:relative;display:flex;cursor:pointer}.segments input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}.segments span{display:grid;place-items:center;min-width:44px;height:36px;padding:0 10px;border:1px solid var(--line);border-radius:6px;font-size:12px;white-space:nowrap}.segments input:checked+span{background:var(--red);border-color:var(--red);color:white;box-shadow:0 3px 9px #ad38261a}.segments input:focus-visible+span{outline:2px solid #ab3b27;outline-offset:3px}.factor.active .factor-title{color:var(--red)}.factor:disabled{opacity:.5}.launch{min-width:144px;min-height:86px;padding:12px 18px;border-radius:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}.launch>span{display:flex;align-items:center;gap:8px}.launch strong{font-size:16px;font-weight:600;white-space:nowrap}.launch img{width:20px;height:20px}kbd{font-family:inherit;font-size:9px;letter-spacing:1.5px;border:1px solid #ffffff66;padding:3px 6px;border-radius:4px}.control-dock output{display:block;margin:0 0 15px;text-align:right;color:#77716a;font-size:12px;min-height:18px;max-width:720px}.scene-footnote{position:absolute;bottom:5px;left:30px;font-size:9px;letter-spacing:1px;color:#928d87;pointer-events:none}.completed{position:absolute;top:30%;left:45%;text-align:left}.completed>strong{font-size:24px}.completed p{color:var(--muted)}.completed button{margin-right:8px}.data-panel{position:absolute;z-index:20;top:132px;left:5%;width:90%;max-height:calc(100dvh - 290px);background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 18px 50px #49413917;padding:24px;overflow:auto}.data-panel>header{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);padding-bottom:18px}.data-panel h2{font-size:17px;margin:0 0 5px}.data-panel small{color:var(--muted);font-size:11px}.data-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.data-actions button,.data-actions select{font-size:11px;padding:7px 8px;background:#fff;border:1px solid var(--line);border-radius:5px}.data-actions details{position:relative;font-size:12px;cursor:pointer}.data-actions summary{padding:8px}.data-actions details button{position:absolute;top:32px;right:0;white-space:nowrap;background:#fff;color:var(--red);z-index:3;box-shadow:var(--shadow)}.data-body{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(240px,1fr);gap:24px;padding-top:16px}.chart-column{border-left:1px solid var(--line);padding-left:22px}.chart-column h3{font-size:14px;margin:0 0 8px}#scatter{width:100%;height:220px}.chart-column p,.chart-column small{font-size:11px;color:var(--muted);line-height:1.7}#analysis-summary{font-size:12px;line-height:1.8}#record-table{min-width:0;display:flex;flex-direction:column}.sv2-records__table{overflow-x:auto;max-height:none;order:2}.sv2-records__head{display:none}.sv2-records__actions{display:none}table{border-collapse:collapse;width:100%;font-size:12px;white-space:nowrap}th,td{padding:13px 10px;border-bottom:1px solid #efede9;text-align:left}th{font-size:11px;font-weight:550;color:var(--muted)}td button{border:0;background:none;font-size:11px;padding:4px;color:#9e493a}.sv2-records__empty{padding:50px 20px;color:var(--muted);font-size:13px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.sv2-toast-region,#toast{position:fixed;z-index:100;top:84px;right:24px;background:#fff;border-radius:10px;box-shadow:var(--shadow);padding:14px;border:1px solid var(--line);font-size:12px}.sv2-toast{display:flex;align-items:center;gap:12px}dialog{width:min(780px,calc(100% - 36px));border:1px solid var(--line);border-radius:18px;padding:28px;color:var(--ink);box-shadow:0 25px 100px #27201920;max-height:calc(100dvh - 45px);overflow:auto}dialog::backdrop{background:#302e2852;backdrop-filter:blur(3px)}dialog header{display:flex;align-items:center;justify-content:space-between}dialog h2{font-size:21px;margin:0}dialog footer{display:flex;align-items:center;gap:14px;border-top:1px solid var(--line);margin-top:30px;padding-top:22px}dialog footer small{flex:1;color:var(--muted);font-size:11px}dialog footer button:last-child{margin-left:auto}dialog input,dialog textarea{border:1px solid var(--line);border-radius:7px;padding:12px;width:100%;background:#fff;margin:8px 0;color:var(--ink)}dialog textarea{min-height:82px;resize:vertical}dialog label{font-size:13px}.setup-steps{display:flex;justify-content:space-between;list-style:none;padding:0;margin:30px 0;color:#969089;font-size:13px}.setup-steps .active{color:var(--red);font-weight:600}.participation{display:grid;grid-template-columns:185px 1fr;gap:32px;min-height:230px}.participation nav{display:flex;flex-direction:column;gap:12px;border-right:1px solid var(--line);padding-right:24px}.participation nav button{padding:16px;text-align:left}.selected{border-color:var(--red)!important;background:#fcf3ef!important;color:var(--red)}.muted{color:var(--muted);font-size:12px;line-height:1.8}.group-card{border-bottom:1px solid var(--line);padding:0 0 15px;margin-bottom:15px}.group-card button{font-size:11px;padding:4px 8px}.mode-choice{display:flex;flex-direction:column;gap:12px}.mode-choice button{text-align:left;padding:18px}.mode-choice strong{display:block;font-size:15px;margin-bottom:8px}.mode-choice small{color:var(--muted);line-height:1.8}.confirm-list{line-height:2.4;font-size:14px}#setup-error{color:var(--red);font-size:12px;min-height:16px}.help-content{line-height:1.9;font-size:14px}.help-content h3{font-size:15px;margin-top:24px}#confirm-dialog{max-width:480px}#scene-error{position:absolute;left:20%;top:45%;background:#fff;padding:25px;border:1px solid var(--line);border-radius:12px}
@media(max-width:1100px){.topbar{padding:0 24px}.metrics{min-width:270px;gap:20px;padding:19px;right:24px}.mission{left:30px;max-width:265px}.start-experiment{left:44%;gap:16px}.start-experiment strong{font-size:22px}.play-circle{width:66px;height:66px}.control-dock{right:24px;bottom:26px;max-width:calc(100% - 48px)}.factor{padding:0 12px}.data-actions{max-width:500px}.data-panel{padding:20px}.data-body{gap:15px}.data-panel>header{align-items:flex-start}}
@media(max-width:760px){.topbar{height:60px;padding:0 16px;gap:10px}.brand img{width:84px}.topbar strong{font-size:14px}.utilities{gap:1px}.utilities .icon{width:30px;padding:6px}#sound-button{display:none}.drawer-handle{top:60px;font-size:10px;padding:12px 15px}.mission{top:119px;left:22px;max-width:45%}.mission h1,.mission p{font-size:12px}.mission>p:first-child{margin-bottom:12px}.metrics{top:114px;right:18px;gap:14px;padding:15px;min-width:0}.metrics div{min-width:35px}.metrics strong{font-size:20px}.metrics small{font-size:9px}.metrics em{font-size:8px}.start-experiment{top:34%;left:49%;gap:14px}.start-experiment strong{font-size:19px}.start-experiment small{font-size:10px;max-width:150px}.play-circle{width:54px;height:54px}.control-dock{right:16px;bottom:24px;max-width:calc(100% - 32px)}.control-row{gap:8px;flex-wrap:wrap}.factors{padding:12px}.factor{padding:0 9px}.segments span{min-width:35px;padding:0 7px;height:38px;font-size:11px}.launch{min-height:54px;min-width:130px;flex-direction:row;gap:12px;padding:10px 14px}.launch strong{font-size:14px}.control-dock output{font-size:10px;max-width:360px;margin-left:auto}.scene-footnote{font-size:8px;left:15px}.data-panel{top:106px;max-height:calc(100dvh - 290px);left:3%;width:94%;padding:16px}.data-panel>header{display:block}.data-actions{margin-top:12px}.data-body{display:block}.chart-column{border:0;padding:15px 0}.participation{grid-template-columns:1fr;gap:18px}.participation nav{flex-direction:row;border:0;padding:0}.participation nav p{display:none}.setup-steps{font-size:11px}dialog{padding:22px}dialog footer{flex-wrap:wrap}dialog footer small{display:none}.completed{left:35%;top:32%}.completed>strong{font-size:20px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
#record-table th:last-child .sr-only{position:static;width:auto;height:auto;clip:auto;font-size:0}#record-table td:last-child input{accent-color:var(--red);width:15px;height:15px}#delete-selected{color:var(--red)}
.sv2-toast-region:empty{display:none}
@media(max-width:480px){.factors{max-width:100%;flex-wrap:wrap;gap:10px 14px;justify-content:flex-end;padding:12px}.factor{padding:0!important;border:0;min-width:0}.factor legend{margin-bottom:7px}.segments span{min-width:38px;height:40px;padding:0 8px}.factor-title{font-size:11px}.control-dock{max-width:calc(100% - 32px)}.control-dock output{max-width:330px}.metrics{top:200px;right:16px;padding:12px;gap:16px}.mission{max-width:calc(100% - 40px);top:122px}.mission>p:first-child{margin-bottom:8px}.start-experiment{top:38%;left:35%;transform:none}.start-experiment strong{font-size:17px}.start-experiment small{max-width:115px}.play-circle{width:46px;height:46px}.utilities{gap:0}.topbar{padding:0 12px;gap:8px}.topbar strong{font-size:12px}.brand img{width:78px}.utilities .icon{width:27px}#back-view{position:absolute;right:16px;top:106px;font-size:11px;padding:7px 9px;background:#fff}.data-panel{max-height:calc(100dvh - 345px)}.completed{left:20px;top:36%;max-width:90%}.scene-footnote{display:none}}
@media(max-width:480px){.mission{width:calc(100% - 44px);max-width:none}.metrics{top:228px}}
/* Selected measurement-floor composition. The dock remains intrinsically sized. */
#fullscreen-stage{background:#f6f5f2}.start-experiment{top:22%;left:45%}.scene-footnote{color:#8d877f}
@media(min-width:1400px){.topbar{height:88px;padding:0 28px;gap:20px}.brand img{width:128px;height:34px}.topbar strong{font-size:19px}.drawer-handle{top:88px;font-size:14px;padding:18px 25px}.mission{top:150px;left:50px;max-width:350px}.mission>p:first-child{font-size:15px;margin-bottom:23px}.mission h1{font-size:18px}.mission p{font-size:16px}.metrics{top:145px;min-width:400px;padding:25px 30px;gap:48px}.metrics small{font-size:13px}.metrics strong{font-size:33px}.metrics em{font-size:11px}.play-circle{width:90px;height:90px}.play-circle img{width:36px;height:36px}.start-experiment strong{font-size:29px}.start-experiment small{font-size:14px}.control-dock{bottom:30px}.factors{padding:18px;border-radius:18px}.factor{padding:0 20px}.factor-title{font-size:14px}.factor legend{margin-bottom:14px}.segments span{min-width:56px;height:44px;font-size:14px}.launch{min-width:180px;min-height:112px;border-radius:18px}.launch strong{font-size:18px}.launch img{width:24px;height:24px}.control-dock output{margin-bottom:12px}.data-panel{top:158px}}
@media(max-width:760px){.start-experiment{top:28%;left:45%}}
@media(max-width:480px){.start-experiment{top:38%;left:35%}}
@media(min-width:1400px){.start-experiment{top:21.2%}.play-circle{width:102px;height:102px}}
/* One persistent container morphs from the data trigger into the data surface. */
.data-shell{position:absolute;z-index:20;top:72px;left:50%;transform:translateX(-50%);width:240px;height:37px;background:#fff;border:1px solid var(--line);border-top:0;border-radius:0 0 12px 12px;box-shadow:0 3px 9px #49413908,0 1px 2px #49413905;overflow:hidden;isolation:isolate}
.data-shell .drawer-handle{position:absolute;z-index:2;top:0;left:50%;transform:translateX(-50%);width:max-content;max-width:none;margin:0;border:0;border-radius:0;background:transparent;box-shadow:none;white-space:nowrap}
.data-shell .drawer-handle:hover{background:transparent;color:var(--red)}
.data-shell .data-panel{position:absolute;top:48px;left:50%;transform:translateX(-50%);width:92vw;max-height:none;margin:0;border:0;border-radius:0;box-shadow:none;background:transparent;padding:16px 24px 24px;overflow:auto;opacity:0;visibility:hidden}
.data-shell .data-panel>header{padding-bottom:18px}.data-shell[data-open=false] .data-panel{pointer-events:none}
@media(min-width:1400px){.data-shell{top:88px}}
@media(max-width:760px){.data-shell{top:60px}.data-shell .data-panel{padding:12px 16px 16px}}

/* Compact data tab: quiet count, clear title, restrained edge depth. */
.data-shell .drawer-handle{height:36px;padding:0 16px;gap:10px;font-size:12px;line-height:1;color:var(--ink)}
.data-shell .drawer-handle b{order:0;font-weight:600;letter-spacing:.02em}
.data-shell #record-count{order:1;color:#89837c;font-size:11px;font-weight:400;font-variant-numeric:tabular-nums;border-left:1px solid #e8e4df;padding-left:10px}
.data-shell .drawer-handle img{order:2;width:12px;height:12px;opacity:.55;transition:transform .25s,opacity .2s}
.data-shell .drawer-handle:hover img{opacity:1}
.data-shell[data-open=true]{box-shadow:0 12px 28px #49413912}
@media(max-width:760px){.data-shell .drawer-handle{height:40px;padding:0 14px}}

.data-shell{transform-origin:50% 0;scale:1;transition:scale .22s ease}
@media(hover:hover) and (prefers-reduced-motion:no-preference){
  .data-shell[data-open=false][data-hover=true]{animation:data-tab-jelly .48s both}
  @keyframes data-tab-jelly{0%{scale:1}40%{scale:1.035 1.07}70%{scale:1.018 1.025}100%{scale:1.025 1.04}}
}
.data-actions #close-data{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;margin-left:5px;border-color:transparent;background:transparent;color:var(--muted)}
.data-actions #close-data:hover{background:#f3eee8;color:var(--ink)}
@media(prefers-reduced-motion:reduce){.data-shell{transition:none}}
@media(max-width:760px){
  .data-shell .data-panel>header{position:relative}
  .data-shell .data-panel>header>div:first-child{padding-right:36px}
  .data-actions #close-data{position:absolute;right:0;top:0;margin:0}
}
#run-target{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-bottom:10px;font-size:12px;color:var(--ink)}
#run-target button{padding:6px 9px;font-size:11px}
.factor.needs-match .segments{outline:1px solid #ad382655;outline-offset:4px;border-radius:5px}
.target-hint{font-size:10px;color:var(--red);margin-left:8px;font-weight:400}
#analysis-summary{margin-top:20px;border-top:1px solid var(--line);padding-top:16px}
#analysis-summary:empty{display:none}
#analysis-summary h3{font-size:13px;margin:18px 0 10px}
#analysis-summary h3:first-child{margin-top:0}
.effect-row{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid #eeebe7;padding:8px 0;font-size:11px}
.effect-row strong{white-space:nowrap}
.interaction-chart{display:block;width:100%;height:auto;margin-top:10px}
.interaction-chart text{font:10px system-ui;fill:#797570}
.treatment-label{display:block;font-size:12px;margin:16px 0 8px}
#treatment-focus{width:100%;font-size:11px;padding:8px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink)}
.race-result{padding:12px 0;border-bottom:1px solid var(--line)}
.race-result>strong{font-size:12px}.race-result dl{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:10px 0 0}.race-result dt{font-size:10px;color:var(--muted)}.race-result dd{font-size:12px;margin:3px 0 0}
@media(max-width:760px){#run-target{font-size:11px;gap:8px;flex-wrap:wrap}.target-hint{display:block;margin:4px 0 0}}
/* The setup progress uses a connected track with distinct current/completed states. */
#setup-dialog{padding:30px 32px;border-radius:20px;box-shadow:0 24px 80px #30282026}
#setup-dialog>header h2{font-size:22px;letter-spacing:.02em}
#setup-dialog .setup-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin:26px 0 28px;padding:20px 18px;background:#f8f7f5;border:1px solid #eeebe7;border-radius:12px}
.setup-steps li{position:relative;display:flex;align-items:center;gap:10px;min-width:0;color:#98918a}
.setup-steps li:not(:last-child)::after{content:"";position:absolute;left:calc(100% + 2px);top:17px;width:20px;height:1px;background:#ddd8d2}
.step-marker{display:grid;place-items:center;flex:none;width:34px;height:34px;border:1px solid #dcd7d0;border-radius:50%;background:#fff;font-size:13px;font-weight:600;transition:background .2s,border-color .2s,color .2s}
.step-marker svg{display:none;width:17px;height:17px}
.step-caption{display:flex;flex-direction:column;gap:4px;min-width:0}
.step-caption strong{font-size:13px;font-weight:550;white-space:nowrap}
.step-caption small{font-size:10px;white-space:nowrap;line-height:1.4;color:#aaa39b}
.setup-steps .active .step-marker{background:var(--red);border-color:var(--red);color:#fff;box-shadow:0 0 0 4px #ad382610}
.setup-steps .active .step-caption strong{font-weight:650;color:var(--ink)}
.setup-steps .active .step-caption small{color:#847870}
.setup-steps .complete .step-marker{border-color:#dcc6bd;background:#f5ebe6;color:var(--red)}
.setup-steps .complete .step-marker>span{display:none}.setup-steps .complete .step-marker svg{display:block}
.setup-steps .complete .step-caption strong{color:#76685f}.setup-steps .complete::after{background:#cba696!important}
#setup-dialog .mode-choice button{padding:20px;border-radius:10px}#setup-dialog .mode-choice strong{font-size:15px}
#setup-dialog footer{margin-top:24px;padding-top:20px}
@media(max-width:600px){
 #setup-dialog{padding:22px 18px;border-radius:16px}
 #setup-dialog .setup-steps{padding:16px 8px;gap:16px;margin:20px 0}
 .setup-steps li{flex-direction:column;gap:9px;text-align:center}
 .setup-steps li:not(:last-child)::after{left:calc(50% + 25px);width:calc(100% - 34px);top:16px}
 .step-caption strong{font-size:12px}.step-caption small{font-size:9px}
 #setup-dialog .mode-choice button{padding:16px}
}

/* Add groups and individual member chips within the existing participant step. */
#setup-dialog{--doe-line:#e6e0db;--doe-body:12px;--doe-note:11px;--doe-accent-soft:#faf0ea;--light-primary:var(--red)}
#setup-dialog .participant-group-card { overflow: hidden; border: 1px solid #ddd7d2; border-radius: 12px; background: #fff; }
#setup-dialog .participant-group-card.is-active { border-color: rgba(161, 52, 32, .55); box-shadow: 0 0 0 1px rgba(161, 52, 32, .06); }
#setup-dialog .participant-group-card.is-execution-locked { opacity: .52; background: #f5f3f1; }
#setup-dialog .participant-group-card.is-execution-locked .participant-member { cursor: not-allowed; }
#setup-dialog .participant-group-header { display: grid; grid-template-columns: auto minmax(0, 1fr) 34px; align-items: center; gap: 12px; min-height: 48px; padding: 7px 10px 7px 12px; border-bottom: 1px solid var(--doe-line); background: #faf9f8; }
#setup-dialog .participant-group-card.is-active .participant-group-header { background: var(--doe-accent-soft); }
#setup-dialog .participant-group-header > span { color: var(--light-primary); font-size: var(--doe-body); font-weight: 780; white-space: nowrap; }
#setup-dialog .participant-group-header label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; }
#setup-dialog .participant-group-header small,
#setup-dialog .participant-member-section > small { color: #6f6864; font-size: var(--doe-note); font-weight: 650; white-space: nowrap; }
#setup-dialog .participant-group-header input { min-width: 0; width: 100%; height: 34px; padding: 0 10px; color: #302b28; border: 1px solid #d8d2ce; border-radius: 8px; background: #fff; font-size: var(--doe-body); font-weight: 650; }
#setup-dialog .participant-group-delete { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: #b33a2a; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
#setup-dialog .participant-group-delete svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#setup-dialog .participant-group-delete:hover:not(:disabled) { background: rgba(179, 58, 42, .09); }
#setup-dialog .participant-group-delete:focus-visible { outline: 3px solid rgba(179, 58, 42, .16); outline-offset: 1px; }
#setup-dialog .participant-group-delete:disabled { color: #c8c1bd; cursor: not-allowed; }
#setup-dialog .participant-group-body { padding: 11px 12px 12px; }
#setup-dialog .participant-member-section { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: start; gap: 9px; min-height: 32px; }
#setup-dialog .participant-member-section > small { padding-top: 8px; }
#setup-dialog .participant-member-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
#setup-dialog .participant-member { max-width: 180px; height: 32px; padding: 0 11px; overflow: hidden; color: #413a36; border: 1px solid #d8d2ce; border-radius: 999px; background: #fff; font-size: var(--doe-body); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
#setup-dialog .participant-member--static { display: inline-flex; align-items: center; cursor: default; }
#setup-dialog .participant-member.is-active { color: #fff; border-color: var(--light-primary); background: var(--light-primary); }
#setup-dialog .participant-member-empty { display: inline-flex; align-items: center; min-height: 32px; color: #928a85; font-size: var(--doe-note); }
#setup-dialog [data-participant-member-form] { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; min-width: 0; margin-top: 9px; padding-top: 9px; border-top: 1px solid #eeeae7; }
#setup-dialog [data-participant-member-form] input { min-width: 0; width: 100%; height: 38px; padding: 0 11px; color: #302b28; border: 1px solid #d8d2ce; border-radius: 8px; background: #fff; font-size: var(--doe-body); }
#setup-dialog [data-participant-member-form] button,
#setup-dialog [data-add-participant-group] { color: var(--light-primary); border: 1px solid rgba(161, 52, 32, .28); background: #fff7f4; font-size: var(--doe-body); font-weight: 760; cursor: pointer; }
#setup-dialog [data-participant-member-form] button { width: 96px; min-width: 96px; height: 38px; padding: 0 10px; border-radius: 8px; white-space: nowrap; }
#setup-dialog [data-add-participant-group] { width: 100%; height: 40px; margin-top: 9px; border-style: dashed; border-radius: 9px; }


.participants-content{min-width:0}.doe-group-setup{display:grid;gap:12px;margin-top:16px}
.group-recommendation{padding:12px 14px;border:1px solid #e8ded5;background:#faf7f3;border-radius:9px}.group-recommendation strong{font-size:13px}.group-recommendation p{font-size:12px;line-height:1.7;margin:6px 0}.group-recommendation small,.group-live-plan{font-size:11px;color:var(--muted)}
#setup-dialog .participant-group-header input,#setup-dialog [data-participant-member-form] input{margin:0}
#setup-dialog .participant-group-header{gap:8px}#setup-dialog .participant-group-header label{font-size:11px}
@media(max-width:600px){#setup-dialog .participant-group-header{grid-template-columns:1fr 30px}#setup-dialog .participant-group-header>span{grid-column:1/-1}#setup-dialog .participant-member-section{display:block}}
/* Keep the wizard frame stable; only the growing group list scrolls. */
#setup-dialog.participants-step[open]{height:min(740px,calc(100dvh - 40px));max-height:calc(100dvh - 40px);display:flex;flex-direction:column;overflow:hidden}
#setup-dialog.participants-step>header,#setup-dialog.participants-step>.setup-steps{flex-shrink:0}
#setup-dialog.participants-step #setup-form{display:flex;flex-direction:column;flex:1;min-height:0}
#setup-dialog.participants-step #setup-body{flex:1;min-height:0}
#setup-dialog.participants-step .participation{height:100%;min-height:0}
#setup-dialog.participants-step .participants-content{height:100%;min-height:0;display:flex;flex-direction:column}
#setup-dialog.participants-step .group-recommendation,#setup-dialog.participants-step .group-live-plan{flex-shrink:0}
#setup-dialog.participants-step .doe-group-setup{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;margin-top:12px}
.participant-group-list{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;display:flex;flex-direction:column;gap:12px;padding:2px 4px 4px 2px}
.participant-group-list .participant-group-card{flex-shrink:0}
#setup-dialog [data-add-participant-group]{flex-shrink:0;margin:0}
#setup-dialog.participants-step footer{flex-shrink:0;margin-top:12px;padding-top:12px}
#setup-dialog.participants-step #setup-error{flex-shrink:0;margin:8px 0 0;font-size:12px}
#setup-dialog.participants-step #setup-error:empty{display:none}
.group-live-plan{margin:8px 0 0}
@media(max-width:760px){
 #setup-dialog.participants-step .participation{display:flex;flex-direction:column;gap:12px}
 #setup-dialog.participants-step .participation>nav{flex-shrink:0}
 #setup-dialog.participants-step .participation>nav button{padding:9px 14px}
 #setup-dialog.participants-step .participants-content{flex:1}
 #setup-dialog.participants-step .setup-steps{padding:12px 8px;margin:14px 0}
 #setup-dialog.participants-step .group-recommendation{padding:9px 12px}
 #setup-dialog.participants-step .group-recommendation p{margin:4px 0;font-size:11px}
 #setup-dialog.participants-step .group-recommendation small{display:none}
}
#run-target.observation-standard{position:absolute;z-index:5;top:133px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 48px);display:flex;flex-direction:column;gap:9px;margin:0;text-align:center;padding:14px 22px;background:#f8f7f2e8;border:1px solid #e8e3da;border-radius:12px}
.observation-standard>small{font-size:12px;color:var(--red);letter-spacing:.04em}.observation-standard>strong{font-size:19px;font-weight:600}.observation-standard>p{margin:0;font-size:12px;color:var(--muted)}
#results-dialog{width:min(1180px,calc(100% - 40px));height:min(820px,calc(100dvh - 40px));max-height:calc(100dvh - 40px);padding:24px;border-radius:18px;overflow:hidden}
#results-dialog[open]{display:flex;flex-direction:column}
#results-dialog>header,#results-dialog>footer{flex-shrink:0}#results-dialog>header p{font-size:12px;color:var(--muted);margin:8px 0 0}
#results-content{flex:1;min-height:0;overflow:auto;margin-top:18px}
#results-content .data-panel{position:static!important;width:100%!important;max-height:none!important;transform:none!important;opacity:1!important;visibility:visible!important;border:0;box-shadow:none;padding:0;background:transparent;overflow:visible}
#results-content .data-panel>header{padding-bottom:14px}#results-dialog footer{margin-top:16px;padding-top:16px;justify-content:flex-end}
@media(min-width:1400px){#run-target.observation-standard{top:150px}}
@media(min-width:761px) and (max-width:1100px){#run-target.observation-standard{top:240px}}
@media(max-width:760px){#run-target.observation-standard{top:302px;max-width:calc(100% - 32px);width:calc(100% - 32px);padding:10px 12px;gap:5px}.observation-standard>strong{font-size:14px}.observation-standard>p{font-size:10px}.observation-standard>small{font-size:10px}#results-dialog{padding:18px;width:calc(100% - 24px)}#results-dialog .data-panel>header{position:relative}#results-dialog .data-panel>header>div:first-child{padding-right:34px}#results-dialog .data-actions #close-data{position:absolute;right:0;top:0}}

#results-footer{position:sticky;bottom:-24px;display:flex;align-items:center;justify-content:flex-end;gap:12px;margin:18px -24px -24px;padding:14px 24px;border-top:1px solid var(--line);background:#fff;z-index:4}
@media(max-width:760px){#results-footer{bottom:-16px;margin:16px -16px -16px;padding:12px 16px}}
#completed-actions{position:absolute;z-index:6;top:clamp(185px,26vh,300px);left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:26px;width:max-content;max-width:calc(100% - 32px)}
#completed-return{font-size:13px;padding:10px 15px;background:#ffffffc9}
#completed-actions .start-experiment{position:static;transform:none;gap:14px}
#completed-actions .play-circle{width:60px;height:60px}
#completed-actions .play-circle img{width:25px;height:25px}
#completed-actions .start-experiment strong{font-size:23px}
#completed-actions .start-experiment small{font-size:11px;margin-top:5px}
@media(min-width:1400px){#completed-actions{top:clamp(220px,26vh,340px)}}
@media(min-width:761px) and (max-width:1100px){#completed-actions{top:240px}}
@media(max-width:760px){#completed-actions{top:307px;gap:20px}#completed-actions .play-circle{width:48px;height:48px}#completed-actions .start-experiment strong{font-size:19px}#completed-actions .start-experiment small{font-size:10px;max-width:130px}#completed-return{font-size:12px;padding:9px 12px}}

/* Quiet shared teaching-aid backdrop, beneath the measured 3D flight surface. */
#fullscreen-stage{background:radial-gradient(ellipse at 50% 22%,#f3f3f2,transparent 68%),#f7f7f7}
.plane-backdrop{position:absolute;inset:0;pointer-events:none;user-select:none}
.plane-backdrop::before,.plane-backdrop::after{content:"";position:absolute;top:33%;background-repeat:no-repeat;background-size:contain;opacity:.7}
.plane-backdrop::before{left:0;width:12.56%;aspect-ratio:210/280;background-image:url('./perfect-factory-blocks-left.svg')}
.plane-backdrop::after{right:0;width:21.53%;aspect-ratio:360/280;background-image:url('./perfect-factory-blocks-right.svg')}
.plane-watermark{position:absolute;left:3.5%;bottom:5%;font-family:Arial,Helvetica,sans-serif;font-size:clamp(32px,5.5vw,88px);font-weight:700;line-height:1;letter-spacing:-.045em;white-space:nowrap;opacity:.12;pointer-events:none;user-select:none}
.plane-watermark span:first-child{color:#b44029}.plane-watermark span:last-child{color:#373b40}
@media(max-width:760px){.plane-backdrop::before,.plane-backdrop::after{top:43%}.plane-watermark{left:5%;bottom:34%;font-size:32px;opacity:.1}}
@media(max-height:560px){.plane-watermark{bottom:100px;font-size:30px;opacity:.1}}

/* Compact confirmation, distinct from experiment setup. */
#return-trial-dialog{width:min(420px,calc(100% - 40px));padding:24px;border-radius:14px}
#return-trial-dialog h2{font-size:18px;line-height:1.4;margin:0}
#return-trial-dialog>p{font-size:13px;line-height:1.8;color:var(--muted);margin:12px 0 0}
#return-trial-dialog footer{display:flex;justify-content:flex-end;gap:10px;border:0;padding:0;margin:24px 0 0}
#return-trial-dialog footer button{margin:0;padding:9px 15px;font-size:13px}

.mission #restored-progress{display:inline-flex;align-items:center;gap:7px;margin-top:10px;padding:5px 9px;border-radius:5px;background:#edf1ecb3;color:#697669;font-size:11px;line-height:1.5;letter-spacing:0}
.mission #restored-progress::before{content:"";width:5px;height:5px;flex-shrink:0;border-radius:50%;background:#829680}

/* Read the distribution and analysis before the full record list. */
.data-shell .data-body{display:flex;flex-direction:column;gap:24px;padding-top:20px}
.data-shell .chart-column{min-width:0;border:0;padding:0}
.data-shell #scatter{height:260px}
.data-shell .interaction-chart{max-width:440px}
.data-shell .records-section{min-width:0;border-top:1px solid var(--line);padding-top:20px}
.data-shell .records-section>h3{font-size:14px;margin:0 0 12px}
.data-shell .sv2-records__table{max-height:none;overflow-x:auto}
.data-shell #treatment-focus{width:auto;min-width:220px;max-width:100%}

.treatment-select{position:relative;display:inline-block;margin-bottom:12px;min-width:260px}
.data-shell #treatment-focus{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:38px;padding:9px 12px;border:1px solid var(--line);border-radius:9px;background:#fff;font-size:12px;text-align:left}
#treatment-focus[aria-expanded=true]{border-color:#c67d70;box-shadow:0 0 0 3px #ad38260c}
#treatment-focus[aria-expanded=true] svg{transform:rotate(180deg)}
#treatment-options{position:absolute;z-index:5;top:calc(100% + 6px);left:0;min-width:100%;width:max-content;max-height:280px;overflow-y:auto;padding:5px;background:#fff;border:1px solid #e8ded8;border-radius:12px;box-shadow:0 10px 30px #49312a18}
#treatment-options [role=option]{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;padding:10px 12px;border:0;border-radius:7px;background:#fff;font-size:12px;text-align:left;white-space:nowrap}
#treatment-options [role=option]:hover,#treatment-options [role=option]:focus-visible{background:#fcf0ec;color:var(--red);outline:none}
#treatment-options [aria-selected=true]{color:var(--red);font-weight:600;background:#fdf6f3}
#treatment-options .option-check{visibility:hidden}#treatment-options [aria-selected=true] .option-check{visibility:visible}

.design-settings{margin-top:20px;padding:18px;border:1px solid var(--line);border-radius:12px}.design-settings fieldset{border:0;padding:10px 0;margin:0;display:flex;gap:18px;flex-wrap:wrap}.design-settings legend{font-size:12px;color:var(--muted);padding:0;margin-bottom:8px}.design-settings input[type=checkbox],.design-settings input[type=radio]{width:auto;margin:0 6px 0 0;accent-color:var(--red)}.design-settings label{display:inline-flex;align-items:center}.design-numbers{display:flex;gap:16px}.design-numbers label{display:block;flex:1}.design-numbers input{padding:8px}#design-preview{font-size:13px;color:var(--red)}#setup-dialog{max-height:calc(100dvh - 48px)}#record-table input[type=checkbox]{accent-color:var(--red)}

.distribution-stats{border-top:1px solid var(--line);margin-top:20px;padding-top:18px}.distribution-stats svg{display:block;width:100%;max-width:650px}.distribution-stats svg text{font:11px system-ui;fill:#797570}.distribution-stats h4{font-size:12px;margin:16px 0 8px}.run-plan{margin-top:20px;border:1px solid var(--line);border-radius:10px;padding:12px}.run-plan summary{cursor:pointer;font-size:13px;font-weight:600}.run-plan summary span{font-size:11px;color:var(--red);margin-left:12px}.plan-table{overflow-x:auto}.run-plan table{font-size:11px}.run-plan th,.run-plan td{padding:9px 8px}

#setup-dialog.custom-step #setup-body{max-height:48vh;overflow-y:auto;padding-right:8px}#setup-dialog.custom-step .mode-choice{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}#setup-dialog.custom-step .mode-choice button{padding:12px}#setup-dialog.custom-step .mode-choice small{display:none}#setup-dialog.custom-step .mode-choice strong{font-size:12px;margin:0}#setup-dialog.custom-step footer{margin-top:16px}

.control-row{align-items:stretch}.launch-column{display:flex;flex-direction:column;gap:7px}.launch-column>.launch{width:100%;flex:1}.launch-column:has(.formal-actions:not([hidden]))>.launch{min-height:0;padding:8px 14px;gap:4px}.formal-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;line-height:14px}.formal-actions button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:0;margin:0;border:0;border-radius:0;background:transparent;box-shadow:none;font-size:11px;line-height:14px;white-space:nowrap}.formal-actions button svg{width:13px;height:13px;flex-shrink:0}#restart-current{color:#96918b}#trial-current{color:var(--red)}.formal-actions button:hover:not(:disabled){background:transparent;text-decoration:underline;text-underline-offset:3px}

#run-target.observation-standard{width:440px;max-width:calc(100% - 48px);padding:16px 20px;gap:13px;background:#fffffff2;border:1px solid #e6ded6;border-radius:14px;box-shadow:0 6px 22px #49332608;text-align:left}
.run-operator{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%}.operator-identity{display:flex;align-items:center;gap:10px;min-width:0;flex-wrap:wrap}.operator-identity>span{padding:4px 7px;border-radius:5px;background:#f7eee9;color:#925044;font-size:11px;line-height:1.4;overflow-wrap:anywhere}.operator-identity>strong{font-size:23px;font-weight:650;color:var(--red);line-height:1.3;overflow-wrap:anywhere}.run-operator>small{font-size:11px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}.run-parameters{display:grid;grid-template-columns:repeat(3,1fr);width:100%;border-top:1px solid #eee9e3;padding-top:12px}.run-parameters>div{display:flex;align-items:center;justify-content:center;gap:8px;border-right:1px solid #eee9e3}.run-parameters>div:first-child{justify-content:flex-start}.run-parameters>div:last-child{border:0;justify-content:flex-end}.run-parameters span{font-size:11px;color:var(--muted)}.run-parameters strong{font-size:14px;font-weight:550;white-space:nowrap}.run-readiness{display:flex;align-items:center;gap:10px;width:100%;font-size:10px;line-height:1.5}.run-readiness>span{display:inline-flex;align-items:center;gap:5px;color:var(--red);white-space:nowrap}.run-readiness>span::before{content:"";width:4px;height:4px;border-radius:50%;background:currentColor}.run-readiness>p{margin:0;color:var(--muted)}

#design-alias{padding:12px 14px;margin-top:12px;background:#fcf0eb;border-left:3px solid var(--red);border-radius:5px;color:#944432;font-size:12px;line-height:1.8}.configuration-summary{border-top:1px solid var(--line);padding-top:18px;margin-top:20px}.summary-table{overflow-x:auto}.summary-table th,.summary-table td{padding:10px 8px;font-size:11px}.summary-table td:nth-child(n+5){color:var(--red);font-variant-numeric:tabular-nums}

/* Completed runs share one footer; the original actions retain their handlers. */
#data-drawer .lss-tool-results-native-actions #results-close{border-color:transparent}
#data-drawer .lss-tool-results-native-actions #next-round{border-color:var(--red);color:var(--red);background:transparent;box-shadow:none}
