.learning-tools { display:grid; gap:22px; }
.learning-tools-heading { display:flex; justify-content:space-between; align-items:center; gap:24px; }
.learning-tools-heading h3 { font-size:26px; margin:8px 0; }
.learning-tools-heading p,.learning-tool-card p,.learning-tools-note,.learning-tools-context { color:var(--studio-muted); font-size:13px; line-height:1.8; }
.learning-tools-heading label { display:grid; gap:8px; min-width:180px; font-size:13px; }
.learning-tools-heading select { max-width:100%; padding:12px; border:1px solid var(--line); border-radius:12px; background:white; color:var(--ink); }
.learning-tools-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.learning-tool-card { display:flex; flex-direction:column; align-items:flex-start; gap:16px; min-width:0; padding:28px; border:1px solid var(--line); border-radius:20px; background:white; }
.learning-tool-card h3 { font-size:20px; }
.learning-tool-card p { flex:1; overflow-wrap:anywhere; }
.learning-tool-icon { display:grid; place-items:center; width:44px; height:44px; border-radius:14px; background:var(--studio-soft); color:var(--studio-deep); font-size:24px; }
.learning-tools-context { overflow-wrap:anywhere; }
@media(max-width:600px){.learning-tools-heading{align-items:stretch;flex-direction:column;gap:16px}.learning-tools-heading h3{font-size:23px}.learning-tools-grid{grid-template-columns:1fr;gap:14px}.learning-tool-card{padding:22px}.learning-tools-heading label{min-width:0}}
.hw-dialog{width:min(1000px,calc(100vw - 32px));max-height:90dvh;margin:auto;padding:0;border:1px solid var(--studio-border);border-radius:24px;background:var(--studio-bg);color:var(--studio-ink);overflow:auto}
.hw-dialog::backdrop{background:#18352d66;backdrop-filter:blur(3px)}
.hw-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:18px 26px;background:white;border-bottom:1px solid var(--studio-border);position:sticky;top:0;z-index:2}
.hw-dialog-head h2{margin:2px 0;font-size:22px}.hw-body{padding:24px}.hw-status{position:sticky;bottom:0;margin:0;padding:12px 24px;background:var(--studio-soft);white-space:pre-wrap}.hw-status:empty{display:none}
.hw-toolbar,.hw-tabs,.hw-actions,.hw-question-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.hw-toolbar{justify-content:space-between;margin-bottom:22px}.hw-toolbar label{min-width:120px}.hw-dialog label{display:grid;gap:6px;font-size:13px;font-weight:600}.hw-dialog input:not([type=checkbox]),.hw-dialog select,.hw-dialog textarea{width:100%;min-width:0;padding:10px 12px;border:1px solid var(--studio-border);border-radius:10px;background:white;color:var(--studio-ink);font:inherit;box-sizing:border-box}.hw-dialog textarea{resize:vertical}
.hw-settings,.hw-originals,.hw-editor{padding:14px 16px;border:1px solid var(--studio-border);border-radius:14px;margin:14px 0;background:white}.hw-dialog summary{cursor:pointer;font-weight:600}.hw-settings p,.hw-context,.hw-hint{font-size:13px;color:var(--studio-muted)}.hw-settings .hw-toggle{display:flex;align-items:center;margin:12px 0}.hw-heading{margin:20px 0}.hw-heading h3{font-size:26px;line-height:1.4;margin:8px 0}.hw-heading p{color:var(--studio-muted);margin:6px 0}
.hw-list{display:grid;gap:12px}.hw-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;background:white;padding:18px;border:1px solid var(--studio-border);border-radius:16px}.hw-list-item>div{min-width:0}.hw-list-item strong{white-space:pre-wrap;overflow-wrap:anywhere}.hw-list-item p{font-size:12px;color:var(--studio-muted);margin:8px 0 0}.hw-list-item button{flex-shrink:0}.hw-empty{text-align:center;padding:40px 20px;background:var(--studio-soft);border-radius:20px}.hw-empty p{color:var(--studio-muted)}
.hw-form,.hw-editor form{display:grid;gap:16px}.hw-form{background:white;padding:24px;border-radius:20px;border:1px solid var(--studio-border)}.hw-file{position:relative;overflow:hidden}.hw-file input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer}.hw-pages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.hw-pages figure{margin:0}.hw-pages img{width:100%;height:180px;object-fit:contain;background:var(--studio-bg);border:1px solid var(--studio-border);border-radius:12px}.hw-pages figcaption{display:flex;justify-content:space-between;font-size:12px}.hw-pages button{background:none;color:var(--studio-deep);padding:6px}
.hw-summary{display:grid;grid-template-columns:repeat(4,1fr);background:white;border:1px solid var(--studio-border);border-radius:18px;padding:20px;gap:12px}.hw-summary>div{display:grid;gap:3px;text-align:center}.hw-summary strong{font-size:26px}.hw-summary span{font-size:13px;color:var(--studio-muted)}.hw-warning{padding:16px;border-radius:12px;background:#fff3db;white-space:pre-wrap}.hw-originals img{max-width:100%;height:auto}.hw-originals figure{margin:16px 0}.hw-questions{display:grid;gap:20px;margin-top:20px}.hw-question{padding:24px;border:1px solid var(--studio-border);border-radius:20px;background:white;scroll-margin-top:100px}.hw-question-head{justify-content:space-between}.hw-question h3{font-size:18px;margin:0}.hw-question small{color:var(--studio-muted);font-size:12px;font-weight:normal}.hw-verdict{padding:5px 12px;border-radius:20px;font-size:12px;background:var(--studio-soft)}.hw-verdict.wrong{background:#ffe8df;color:#a6472c}.hw-verdict.needs_review,.hw-verdict.unanswered{background:#fff3db;color:#86601f}.hw-question>details{margin-top:14px}.hw-question canvas{max-width:100%;height:auto;display:block;margin-top:12px;background:var(--studio-bg)}.hw-stem,.hw-explanation,.hw-correction p{white-space:pre-wrap;overflow-wrap:anywhere}.hw-stem{font-size:16px;line-height:1.8}.hw-answer-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.hw-answer-grid>div{background:var(--studio-bg);border-radius:12px;padding:14px;min-width:0}.hw-answer-grid span{font-size:12px;color:var(--studio-muted)}.hw-answer-grid p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.hw-explanation{line-height:1.8}.hw-corrections{border-top:1px solid var(--studio-border);margin-top:18px}.hw-correction{padding:14px;background:var(--studio-soft);border-radius:12px;margin:10px 0}.hw-correction form{margin-top:12px}.hw-filter{display:grid;grid-template-columns:1fr 2fr auto;gap:12px;align-items:end;margin:18px 0}
@media(max-width:600px){.hw-dialog{width:100vw;max-width:100vw;max-height:100dvh;height:100dvh;margin:0;border-radius:0}.hw-dialog-head{padding:12px 16px}.hw-body{padding:16px}.hw-dialog-head h2{font-size:19px}.hw-heading h3{font-size:23px}.hw-form,.hw-question{padding:16px}.hw-tabs{gap:6px}.hw-tabs .studio-button{padding:8px 10px;font-size:12px}.hw-toolbar{align-items:stretch}.hw-toolbar>label{width:100%}.hw-pages{grid-template-columns:repeat(2,minmax(0,1fr))}.hw-pages img{height:150px}.hw-list-item{align-items:flex-start;flex-direction:column}.hw-answer-grid{grid-template-columns:1fr}.hw-filter{grid-template-columns:1fr 1fr}.hw-filter button{grid-column:1/-1}.hw-summary{padding:14px 8px;gap:5px}.hw-summary strong{font-size:23px}}

/* The shell owns the rounded edge; only the inset content scrolls. */
.hw-dialog { overflow:hidden; height:min(900px,90dvh); box-sizing:border-box; }
.hw-dialog[open] { display:flex; flex-direction:column; }
.hw-dialog-head { flex-shrink:0; position:relative; }
.hw-dialog .hw-body { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; margin:8px 6px 12px; padding:16px 18px; scroll-padding-block:8px; }
.hw-dialog .hw-body :is(button,input,textarea,select,summary,a) { scroll-margin-block:8px; }
.hw-dialog .hw-status { flex-shrink:0; position:relative; overflow-wrap:anywhere; }
@media(max-width:600px) { .hw-dialog { height:100dvh; } .hw-dialog .hw-body { margin:8px 6px; padding:8px 10px; } }
