/* Only Statistics capabilities/layout exceptions. The shell, route cards, editors,
   inspector, palette and output primitives use the actual ML base + shared CSS. */
body[data-playground="statistics"] {--accent:var(--pg-accent);--wash:var(--pg-wash)}
body[data-playground="statistics"] .control-strip{display:block;min-height:54px;padding:9px 16px}
body[data-playground="statistics"] .controls{display:grid;grid-template-columns:minmax(290px,430px) minmax(230px,310px) 200px auto;justify-content:start;gap:14px;align-items:end}
body[data-playground="statistics"] .control{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:9px}
body[data-playground="statistics"] .control select{height:34px;width:100%;min-width:0}
body[data-playground="statistics"] .control-strip .toolbar-button{height:34px;white-space:nowrap}
.study-panel{padding:12px 16px;border-bottom:2px solid var(--border);background:var(--panel)}
.study-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}
.study-panel-head strong{font:700 .65rem var(--display);color:var(--accent)}
.study-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 14px}
.study-field{min-width:0}.study-field label,.study-note-label{display:block;margin-bottom:5px}.study-note-label{font:700 .61rem var(--mono);color:var(--muted)}
.study-field select,.study-field input,#questionNote{width:100%;min-width:0;min-height:34px;border:1px solid var(--border);border-radius:4px;padding:6px 8px;background:var(--panel);color:var(--ink);font:inherit}
.study-field select{height:34px}
.study-field .check-label{display:flex;align-items:center;gap:7px;min-height:34px;margin-top:15px}
.study-field input[type=checkbox]{width:16px;min-height:16px;flex:0 0 16px}.study-field p{font-size:.7rem;color:var(--muted);margin:5px 0}.study-note-label{margin-top:12px}
#questionNote{max-width:820px}.study-panel>.result-note{margin:5px 0;font-size:.7rem}
.inspector-note{font-size:.69rem;color:var(--muted);line-height:1.45;margin:6px 0}.method-name{font-size:.78rem;color:var(--accent);font-weight:800;margin:0}
body[data-playground="statistics"] .feature-row{gap:8px}.feature-row b{flex:1}.feature-row span{max-width:60%;text-align:right;white-space:normal;overflow-wrap:anywhere}
body[data-playground="statistics"] .route-card:disabled{opacity:.46;cursor:not-allowed;transform:none}
body[data-playground="statistics"] .route-card[data-state=stale]{border-color:var(--gold)}
body[data-playground="statistics"] .cell[data-status=stale]{border-color:var(--gold)}
.notebook-progress{font:600 .57rem var(--mono);color:var(--muted)}
/* Placement and scroll regions come from the shared desktop/mobile contract. */
.statistics-evidence{display:flex;flex-wrap:wrap;gap:9px;margin:10px 0}.statistics-evidence .metric{flex:1 1 160px;margin:0}.statistics-evidence .metric b{font-size:1rem;overflow-wrap:anywhere}.statistics-evidence .metric span{font-size:.7rem}
.output-cue,.output-caveat{font-size:.78rem;line-height:1.5;color:var(--muted);margin:9px 0}.output-cue strong{color:var(--accent)}.output-caveat{padding:8px 10px;border-left:2px solid var(--gold);background:var(--wash)}
.chart-wrap{margin:10px 0;border:1px solid var(--border);background:var(--paper);color:var(--paper-ink)}.chart-wrap img{display:block;max-width:100%;width:auto;max-height:460px;height:auto;margin:auto}.chart-wrap figcaption{padding:8px 12px;font-size:.75rem;line-height:1.4}
.advanced-calculation{padding:8px 10px;background:#25272d;color:#d9deea;border-top:1px solid #444853}.advanced-calculation summary{font:600 .67rem var(--mono);cursor:pointer;color:#f5c518}.advanced-calculation p{font-size:.73rem;line-height:1.5}.advanced-calculation .code-input{width:calc(100% - 40px);min-width:600px}
.global-error{flex:0 0 auto;max-height:200px;margin:10px 0}.statistics-guide{width:min(850px,94vw);max-height:85dvh;overflow:auto;background:var(--panel);color:var(--ink);border:2px solid var(--border);border-radius:7px;padding:18px}.statistics-guide::backdrop{background:#080d1dbb}.statistics-guide h2{font:700 .9rem var(--display)}.statistics-guide article{padding:12px 0;border-top:1px solid var(--border)}.statistics-guide h3{font-size:.95rem;margin:0 0 6px}.statistics-guide p{font-size:.85rem;margin:5px 0}
.skip-link{position:fixed;top:-100px;left:10px;z-index:99;background:var(--panel);padding:10px}.skip-link:focus{top:10px}
@media(max-width:1120px){body[data-playground="statistics"] .controls{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}.study-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){body[data-playground="statistics"] .control-strip{padding:9px 10px}body[data-playground="statistics"] .controls{grid-template-columns:1fr 1fr;gap:8px}body[data-playground="statistics"] .control.question{grid-column:1/-1}body[data-playground="statistics"] .control{grid-template-columns:1fr;gap:3px}body[data-playground="statistics"] .control.dataset{grid-column:1/-1}body[data-playground="statistics"] #studyButton{grid-column:auto}.study-fields{grid-template-columns:1fr}.study-panel{padding:12px 10px}.chart-wrap img{max-height:none}.statistics-evidence .metric{flex-basis:130px}}
/* Keep question and dataset compact; reserve an unshrinkable confidence control. */
@media(min-width:821px){body[data-playground="statistics"] .control-strip{min-height:56.25px}}

body[data-playground="statistics"] .control.dataset{grid-template-columns:auto 34px minmax(0,1fr)}
