.material-study { width:100%; min-width:0; box-sizing:border-box; }
.material-study * { box-sizing:border-box; }
.material-study-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(230px,300px); gap:14px; align-items:start; }
.material-study-figure { margin:0; min-width:0; position:sticky; top:0; }
.material-study-canvas { display:block; width:100%; height:auto; max-height:none; max-width:min(100%,calc((100dvh - 200px)*var(--support-aspect,1.5))); margin-inline:auto; touch-action:none; border-radius:7px; box-shadow:0 8px 28px #0008; }
.material-study-canvas:focus-visible { outline:2px solid #e3bf70; outline-offset:4px; }
.material-study-figure figcaption { margin:8px 3px; font-size:13px; line-height:1.4; color:inherit; opacity:.78; }
.material-study-tools fieldset { min-width:0; padding:0; border:0; margin:0; }
.material-study-instructions { margin:0 0 12px; line-height:1.5; }
.material-study-reference { margin:10px 0 14px; border-bottom:1px solid #cfb57340; padding-bottom:10px; }
.material-study-reference summary { cursor:pointer; color:inherit; font-weight:600; text-decoration:underline; }
.material-study-reference p { line-height:1.45; font-size:14px; }
.material-study-setting { display:grid; gap:5px; margin:11px 0; font-size:14px; }
.material-study-setting input[type=range] { width:100%; accent-color:#d3b275; min-height:28px; }
.material-study-setting select { width:100%; min-height:38px; background:#233039; color:#f1e8d2; border:1px solid #a18e695c; padding:5px; border-radius:5px; }
.material-study-group { display:grid; gap:7px; margin:14px 0; }
.material-study-tools button { display:block; width:100%; min-height:38px; margin:7px 0; text-align:left; line-height:1.3; padding:8px 10px; }
.material-study-status { position:absolute; inset:15px 15px auto; background:#17242bea; color:#f9eedc; border:1px solid #ae9671; padding:12px; border-radius:7px; }
.material-study-status[hidden] { display:none; }
.clair-study .clair-study-grades { display:flex; gap:8px; }
.clair-study .clair-study-grades button { flex:1; text-align:center; min-height:44px; padding:8px 4px; }
.clair-study .clair-study-grades button[aria-pressed=true] { border-color:#f2d38f; background:#80603f; }
.clair-study .material-study-tools button { min-height:44px; }
.clair-study .material-study-canvas { cursor:grab; }
.clair-study .material-study-canvas:active { cursor:grabbing; }
dialog:has(.material-study) { width:min(1500px,96vw); max-width:96vw; max-height:96dvh; padding:14px; }
dialog:has(.material-study) .modal-header { margin-bottom:8px; }
dialog:has(.material-study) #modal-body { max-width:none; }
@media(max-width:850px) {
 .material-study-layout { grid-template-columns:1fr; }
 .material-study-figure { position:relative; }
 .material-study-canvas { max-width:min(100%,calc(66dvh*var(--support-aspect,1.5))); }
 .material-study-tools fieldset { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px; }
 .material-study-instructions,.material-study-reference,.material-study-group { grid-column:1/-1; }
 .material-study-tools button { align-self:start; }
}
@media(max-width:480px) {
 dialog:has(.material-study) { padding:10px; }
 .material-study-tools fieldset { grid-template-columns:1fr; }
 .material-study-canvas { max-width:min(100%,calc(55dvh*var(--support-aspect,1.5))); }
}
