.electroWorkbook { width:min(1180px,96vw); max-width:96vw; height:92dvh; max-height:92dvh; padding:0; border:1px solid #bdd8cf; border-radius:22px; color:#173f37; background:#f7fbf9; box-shadow:0 24px 80px #071f3160; }
.electroWorkbook::backdrop { background:#102f36b8; }
.electroWorkbook * { box-sizing:border-box; }
.ew-header { position:sticky; top:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:22px 26px 14px; background:#e4f2eb; border-bottom:1px solid #c6dfd3; }
.ew-header h2 { margin:0 0 5px; font-size:1.45rem; }
.ew-header p { margin:0; color:#476b60; font-size:.9rem; }
.electroWorkbook button { cursor:pointer; min-height:40px; border-radius:9px; border:1px solid #aacfc0; padding:8px 12px; color:#174c3d; background:#fff; font:inherit; font-size:.88rem; line-height:1.4; }
.electroWorkbook button:hover { background:#e2f2e9; }
.electroWorkbook button:disabled { cursor:default; opacity:.55; }
.electroWorkbook :focus-visible { outline:3px solid #1a8b69; outline-offset:3px; }
.electroWorkbook .ew-primary { background:#187858; border-color:#187858; color:#fff; }
.electroWorkbook .ew-primary:hover { background:#105d43; color:#fff; }
.ew-save { margin:0; padding:10px 26px; min-height:42px; font-size:.83rem; color:#48695f; border-bottom:1px solid #d9e7e1; }
.ew-error { color:#a62818; background:#fff2ec; }
.ew-layout { display:grid; grid-template-columns:270px minmax(0,1fr); }
.ew-sidebar { padding:20px; border-right:1px solid #d5e7dd; background:#edf5f1; }
#ewProblemList { display:grid; gap:8px; margin:18px 0; }
#ewProblemList button { text-align:left; padding:10px 12px; }
#ewProblemList button[aria-current="true"] { border-color:#157554; background:#d3ebde; font-weight:700; }
#ewBody { padding:26px; min-width:0; }
#ewBody h2 { margin:6px 0 20px; font-size:1.6rem; line-height:1.3; }
#ewBody h3 { margin:0 0 14px; font-size:1.15rem; }
#ewBody h4 { margin:18px 0 8px; font-size:1rem; }
#ewBody p,#ewBody li { line-height:1.65; overflow-wrap:anywhere; }
.ew-eyebrow { font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; color:#527b6b; margin:0; }
.ew-statement,.ew-work,.ew-results { padding:22px; background:#fff; border:1px solid #d2e4da; border-radius:14px; margin:18px 0; }
.ew-field { display:grid; gap:8px; font-weight:600; margin-bottom:18px; }
.ew-field textarea,.ew-field select,.ew-answer input { min-width:0; width:100%; border:1px solid #aecfc0; border-radius:9px; padding:10px 12px; background:#fff; color:#173f37; font:inherit; font-weight:400; font-size:1rem; }
.ew-field textarea { resize:vertical; line-height:1.55; }
#ew-latex { font-family:Consolas,monospace; font-size:.9rem; }
.ew-toolbar,.ew-actions { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.ew-actions[hidden] { display:none; }
.ew-preview { min-height:100px; padding:20px 12px; background:#f1f7f4; border:1px dashed #96bea8; border-radius:9px; }
.ew-formula { overflow-x:auto; overflow-y:hidden; max-width:100%; padding:7px 2px; font-size:1.1rem; }
.ew-formula .katex { white-space:normal; }
.ew-formula math { font-size:1.12em; }
.ew-formula .mathFallback { white-space:pre-wrap; overflow-wrap:anywhere; font-family:Consolas,monospace; }
.ew-muted { color:#5a7168; font-size:.86rem; }
.ew-guide,.ew-solution,.ew-sources { padding:15px; border:1px solid #c4dcd0; border-radius:10px; margin:14px 0; background:#f3f9f5; }
.electroWorkbook summary { cursor:pointer; font-weight:650; line-height:1.5; }
.ew-formulaCard { border-bottom:1px solid #d6e7dd; padding-bottom:12px; }
.ew-givens { display:grid; grid-template-columns:minmax(60px,auto) 1fr; align-items:center; gap:4px 16px; padding:10px 16px; background:#f4f8f6; border-radius:9px; }
.ew-givens dd { margin:0; }
.ew-answer { display:grid; grid-template-columns:80px minmax(100px,1fr) minmax(50px,auto); align-items:center; gap:12px; margin:12px 0; }
.ew-success { color:#14683f; }
.ew-advanced { margin-top:24px; padding:16px; border:1px solid #c4dcd0; border-radius:10px; background:#f7faf8; }
.ew-advanced > summary { margin-bottom:12px; }
.ew-recipe { margin:16px 0; padding:12px 16px; border-left:3px solid #187858; background:#f0f7f3; }
.ew-hints { padding-left:22px; }
@media(max-width:720px) {
 .electroWorkbook { width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; border:0; border-radius:0; }
 .ew-header { padding:16px; align-items:flex-start; }
 .ew-header h2 { font-size:1.18rem; }
 .ew-save { padding:10px 16px; }
 .ew-layout { display:block; }
 .ew-sidebar { padding:16px; border-right:0; border-bottom:1px solid #c4dcd0; }
 .ew-sidebar .ew-field { margin:0; }
 #ewProblemList { max-height:150px; overflow-y:auto; margin:12px 0; }
 .ew-sidebar > .ew-muted { margin-bottom:0; }
 #ewBody { padding:18px 14px; }
 #ewBody h2 { font-size:1.35rem; }
 .ew-statement,.ew-work,.ew-results { padding:15px; }
 .ew-answer { grid-template-columns:52px minmax(60px,1fr) minmax(40px,auto); gap:8px; }
}
