/* Public shell only. Existing editor, API, storage and content are unchanged. */
:root{color-scheme:light;--bg:#e8e5dc;--surface:#f3f1e9;--card:#fffef9;--ink:#171918;--muted:#62655e;--line:rgba(23,25,24,.15);--line-strong:rgba(23,25,24,.3);--signal:#ff5c36;--signal-soft:#ffddd3;--acid:#d8ff63;--shadow:0 6px 24px rgba(42,38,27,.04)}
:root[data-theme=dark]{color-scheme:dark;--bg:#0e100f;--surface:#171a18;--card:#1e211f;--ink:#f4f1e9;--muted:#a7aaa3;--line:rgba(244,241,233,.14);--line-strong:rgba(244,241,233,.3);--signal-soft:#4a281f;--shadow:0 6px 24px rgba(0,0,0,.15)}
body.workspace-shell{background:var(--bg);color:var(--ink);font:15px/1.6 'Segoe UI',Arial,sans-serif;min-width:320px;background-image:linear-gradient(var(--line) 1px,transparent 1px),linear-gradient(90deg,var(--line) 1px,transparent 1px);background-size:36px 36px}
.workspace-shell :where(input,select,button){background:var(--card);border-color:var(--line-strong);color:var(--ink)}
.workspace-shell :where(a,summary){color:var(--ink)}
.workspace-shell :where(a,button,input,select,summary):focus-visible{outline:3px solid var(--signal);outline-offset:3px}
.workspace-shell :where(.note,.source,.topic,#count,footer){color:var(--muted)}
.workspace-shell :where(.card,.empty,.catalog-overview,#training-results){background:var(--card);border-color:var(--line);color:var(--ink)}
.workspace-shell :where(details,.source){border-color:var(--line)}
.workspace-shell :where(.assessment,.cart-preview-body,.saved-test-detail){background:var(--surface);color:var(--ink)}
.workspace-shell button:disabled{opacity:.55;cursor:default}
.workspace-shell .site-header{position:sticky;top:0;z-index:30;display:flex;flex-wrap:nowrap;min-height:74px;padding:0 28px;gap:24px;background:var(--card);border-color:var(--line)}
.workspace-shell .brand{display:flex;gap:3px;flex:none;color:var(--ink);font-size:22px;font-weight:900;letter-spacing:-1px;line-height:1}
.workspace-shell .brand span{font-size:16px;letter-spacing:.06em}.workspace-shell .brand i{color:var(--signal);font-size:32px;font-weight:500;font-style:normal}
.workspace-shell .workspace-nav{display:flex;flex:1;align-self:stretch;align-items:stretch;justify-content:center;flex-wrap:nowrap;gap:4px;margin:0;padding:0;border:0}
.workspace-shell .workspace-nav>a,.workspace-shell #more-nav-toggle{display:flex;align-items:center;justify-content:center;position:relative;min-width:0;min-height:50px;margin:0;padding:0 14px;border:0;border-radius:0;background:transparent;color:var(--muted);text-decoration:none;font-size:13px;white-space:nowrap}
.workspace-shell .workspace-nav>a[aria-current=page],.workspace-shell #more-nav-toggle.is-active{color:var(--ink);background:transparent;font-weight:700}
.workspace-shell .workspace-nav>a[aria-current=page]::after,.workspace-shell #more-nav-toggle.is-active::after{content:'';position:absolute;left:14px;right:14px;bottom:0;height:4px;background:var(--signal)}
.workspace-shell #nav-cart-count{color:var(--ink);background:var(--signal-soft);min-width:22px;font-size:11px}
.workspace-shell #theme-toggle{width:auto;flex:none;margin:0;padding:9px 14px;min-height:40px;border-radius:24px;background:transparent;font-size:12px}
.workspace-shell #more-nav-toggle{display:none;width:auto}
.workspace-shell #more-nav-menu{position:fixed;right:20px;top:70px;z-index:40;display:grid;width:240px;padding:7px;border:1px solid var(--line-strong);border-radius:13px;background:var(--card);box-shadow:0 12px 36px #0003}
.workspace-shell #more-nav-menu a{display:block;min-height:46px;margin:0;padding:11px 13px;border:0;border-radius:7px;background:transparent;color:var(--ink);font-size:14px;text-decoration:none}
.workspace-shell #more-nav-menu a:hover,.workspace-shell #more-nav-menu a[aria-current=page]{background:var(--surface)}
.workspace-shell main{max-width:1920px;padding:30px 32px 48px}
.workspace-shell #workspace-title{font-size:40px;letter-spacing:-1.5px;margin:0 0 12px;line-height:1.15}
.workspace-shell .workspace-kicker{margin:0 0 6px;color:var(--muted);font-size:10px;letter-spacing:.12em;text-transform:uppercase}
.workspace-shell:not([data-workspace-view=catalog]) .workspace-kicker{display:none}
.workspace-shell #catalog-view .layout{grid-template-columns:246px minmax(0,1fr);gap:26px;margin-top:24px}
.workspace-shell #catalog-view aside{position:sticky;top:96px;padding:18px;background:var(--surface);border:1px solid var(--line);border-radius:13px;max-height:calc(100dvh - 116px);overflow:auto}
.workspace-shell #catalog-view aside h2{font-size:18px;margin-bottom:14px}
.workspace-shell #catalog-view aside details{padding:14px 0;margin:0;border-color:var(--line)}
.workspace-shell #catalog-view aside summary{font-size:13px;font-weight:700}
.workspace-shell #catalog-view aside label{color:var(--muted)}
.workspace-shell #catalog-view .filter-section>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.workspace-shell #catalog-view aside select{margin:10px 0 0;border-radius:8px;font-size:14px;min-height:42px;width:100%}
.workspace-shell #catalog-view .source-picker{padding:10px 0 0;margin:0;border:0;display:grid;gap:7px}
.workspace-shell .source-picker legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.workspace-shell #catalog-view .source-chip{margin:0;min-height:42px;text-align:left;border-radius:8px;font-size:13px;color:var(--muted);background:var(--card);border:1px solid var(--line)}
.workspace-shell #catalog-view .source-chip.is-active{background:var(--ink);color:var(--card);border-color:var(--ink)}
.workspace-shell #number-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-top:12px}
.workspace-shell #catalog-view #number-grid button{padding:0;min-height:36px;margin:0;border:1px solid var(--line);border-radius:7px;font-size:12px}
.workspace-shell #catalog-view #number-grid button[aria-pressed=true]{background:var(--ink);color:var(--card);border-color:var(--ink)}
.workspace-shell #reset{background:transparent;border-color:var(--line-strong);border-radius:8px}
.workspace-shell #prototype-options{display:grid;gap:4px;margin-top:10px}
.workspace-shell #prototype-options label{display:grid;grid-template-columns:18px minmax(0,1fr);gap:9px;align-items:center;min-height:44px;margin:0;padding:6px 4px;font-size:13px;font-weight:400;color:var(--ink);border-radius:6px;cursor:pointer;overflow-wrap:anywhere}
.workspace-shell #prototype-options label:hover{background:var(--card)}
.workspace-shell #prototype-options input{width:18px;height:18px;min-height:18px;margin:0;padding:0;accent-color:var(--ink)}
.workspace-shell #prototype-options .prototype-all{width:100%;min-height:40px;margin:0;border-radius:7px;font-size:13px;background:transparent;text-align:left}
.workspace-shell #prototype-options .prototype-all[aria-pressed=true]{background:var(--ink);color:var(--card)}
.workspace-shell .prototype-count{font-size:12px;color:var(--muted)}
.workspace-shell .prototype-count:empty{display:none}
.workspace-shell #active-catalog-filters{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:12px}
.workspace-shell #active-catalog-filters button{display:inline-flex;align-items:center;gap:10px;width:auto;max-width:100%;min-height:36px;margin:0;padding:6px 10px;border:1px solid var(--line);border-radius:20px;background:var(--card);color:var(--ink);font-size:12px;text-align:left;overflow-wrap:anywhere}
.workspace-shell #active-catalog-filters button span:first-child{min-width:0}
.workspace-shell #active-catalog-filters button span:last-child{flex:none;font-size:18px;color:var(--muted)}
.workspace-shell #catalog-results{min-width:0;scroll-margin-top:94px}
.workspace-shell #count{padding:10px 14px;margin:0 0 14px;border:1px solid var(--line);background:var(--surface);border-radius:9px;font-size:13px}
.workspace-shell #catalog-view .card{display:grid;grid-template-columns:minmax(0,1fr) auto;position:relative;padding:0 22px;margin-bottom:14px;border:1px solid var(--line);border-radius:13px;box-shadow:var(--shadow);background:var(--card);line-height:1.6}
.workspace-shell #catalog-view .card .meta{grid-column:1/-1;padding:12px 0;border-bottom:1px solid var(--line);gap:8px;font-size:12px}
.workspace-shell #catalog-view .card .badge{padding:3px 8px;background:var(--ink);color:var(--card);border-radius:5px;font-size:11px}
.workspace-shell #catalog-view .card .author{color:var(--muted)}
.workspace-shell #catalog-view .card .topic{margin:0;color:var(--muted);font-size:12px}
.workspace-shell #catalog-view .task-body{grid-column:1/-1;gap:20px;padding:18px 0;margin:0;align-items:center}
.workspace-shell #catalog-view .task-text{flex:1;min-width:0}
.workspace-shell .formula{color:var(--ink)}
:root[data-theme=dark] .workspace-shell .diagram-link:not(:has(img.generated-drawing)){background:#fff;border-radius:8px;padding:8px}
:root[data-theme=dark] .workspace-shell .diagram-link:not(:has(img.generated-drawing)) .diagram-caption{color:#243c38}
.workspace-shell #catalog-view .card .statement{font-family:Georgia,'Times New Roman',serif;font-size:18px;line-height:1.65;margin:0;overflow-wrap:break-word}
.workspace-shell #catalog-view .task-figures{flex:0 1 30%;width:30%;max-width:30%}
.workspace-shell #catalog-view .task-figures .diagram{max-height:240px;width:auto;height:auto;max-width:100%;margin:6px auto}
.workspace-shell #catalog-view .task-body-scan .task-figures{max-width:100%;width:100%;flex-basis:100%}
.workspace-shell #catalog-view .task-body-scan .diagram{max-height:none}
.workspace-shell #catalog-view .task-add{grid-row:3;grid-column:2;align-self:start;width:auto;min-height:40px;margin:10px 0;z-index:1;padding:8px 14px;background:var(--signal);color:#171918;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:700}
.workspace-shell #catalog-view .task-add:disabled{background:var(--surface);color:var(--muted);border-color:var(--line);opacity:1}
.workspace-shell #catalog-view .task-solution{grid-row:3;grid-column:1/-1;border-top:1px solid var(--line);margin:0;padding:16px 0;min-width:0}
.workspace-shell #catalog-view .task-solution>summary{display:list-item;max-width:calc(100% - 140px);min-height:30px;font-size:13px;font-weight:600;color:var(--ink)}
.workspace-shell #catalog-view .task-solution[open]>summary{margin-bottom:20px}
.workspace-shell .catalog-pagination{display:flex;align-items:center;justify-content:center;gap:16px}.workspace-shell .catalog-pagination button{width:auto;min-height:42px;margin:0;border-radius:8px}
.workspace-shell .empty,.workspace-shell #design-pending-view{background:var(--card);padding:28px;border:1px solid var(--line);border-radius:13px}
.workspace-shell .skip-link{position:fixed;left:16px;top:-100px;z-index:100;background:var(--card);padding:12px;border:2px solid var(--signal)}.workspace-shell .skip-link:focus{top:12px}

@media(max-width:1280px){.workspace-shell .workspace-nav .nav-secondary{display:none}.workspace-shell #more-nav-toggle{display:flex}.workspace-shell .site-header{gap:16px;padding:0 20px}.workspace-shell .workspace-nav>a,.workspace-shell #more-nav-toggle{padding:0 10px;font-size:12px}}
@media(max-width:1050px){.workspace-shell .site-header{min-height:66px;justify-content:space-between}.workspace-shell .workspace-nav{position:fixed;left:0;right:0;bottom:0;z-index:35;min-height:62px;padding-bottom:env(safe-area-inset-bottom);background:var(--card);border-top:1px solid var(--line)}.workspace-shell .workspace-nav>a,.workspace-shell #more-nav-toggle{flex:1;padding:0 6px;min-height:62px;font-size:12px}.workspace-shell .workspace-nav>a[aria-current=page]::after,.workspace-shell #more-nav-toggle.is-active::after{top:0;bottom:auto}.workspace-shell #more-nav-menu{top:auto;bottom:calc(72px + env(safe-area-inset-bottom));right:10px}.workspace-shell main{padding:26px 20px 90px}.workspace-shell footer{padding-bottom:100px}.workspace-shell #catalog-view .layout{grid-template-columns:210px minmax(0,1fr);gap:18px}.workspace-shell #catalog-view aside{top:84px;max-height:calc(100dvh - 170px)}}
@media(max-width:760px){.workspace-shell #catalog-view .layout{grid-template-columns:minmax(0,1fr)}.workspace-shell #catalog-view aside{position:static;max-height:none;padding:12px 16px}.workspace-shell #workspace-title{font-size:32px}.workspace-shell #catalog-view aside .mobile-filter-toggle{display:flex;min-height:44px;background:transparent;margin:0}.workspace-shell #catalog-view .task-body{display:flex;align-items:center}.workspace-shell #catalog-view .task-figures{max-width:30%;width:30%}.workspace-shell #catalog-view .card{padding:0 16px}.workspace-shell #catalog-view .statement{font-size:17px}}
@media(max-width:480px){.workspace-shell main{padding:20px 12px 90px}.workspace-shell .site-header{padding:0 16px}.workspace-shell #theme-toggle{font-size:11px;padding:8px 10px}.workspace-shell .workspace-nav>a,.workspace-shell #more-nav-toggle{font-size:10px;padding:0 4px}.workspace-shell #nav-cart-count{min-width:17px;font-size:10px;margin-left:3px}.workspace-shell #catalog-view .task-body{display:block}.workspace-shell #catalog-view .task-figures{width:100%;max-width:100%;margin:12px auto}.workspace-shell #catalog-view .task-figures .diagram{max-height:220px}.workspace-shell #catalog-view .task-solution>summary{font-size:12px;max-width:calc(100% - 110px)}.workspace-shell #catalog-view .task-add{padding:8px 10px;font-size:12px}}
@media(prefers-reduced-motion:reduce){.workspace-shell *{scroll-behavior:auto!important}}
@media(max-width:480px){.workspace-shell .workspace-nav>a{white-space:normal;line-height:1.3;text-align:center}}
@media print{.workspace-shell .site-header,.workspace-shell .workspace-nav,.workspace-shell #more-nav-menu{display:none!important}.workspace-shell main{padding:0}.workspace-shell{--ink:#000;--card:#fff;--bg:#fff;--surface:#fff}}

@media(max-width:760px){body.workspace-shell{background-image:none}}
@media print{body.workspace-shell{background-image:none}}
