/* Workspace chrome only: generated documents, canvases and print sheets keep their own styles. */
:root{--ws-bg:#f5f7f8;--ws-surface:#fff;--ws-soft:#f0f3f4;--ws-text:#283438;--ws-secondary:#596a72;--ws-border:#dce3e7;--ws-accent:#326b54;--ws-on-accent:#fff;--ws-ring:#769f89}
:root[data-ui-theme=dark]{--ws-bg:#191d20;--ws-surface:#242a2e;--ws-soft:#2d353a;--ws-text:#e5ebee;--ws-secondary:#b2c0c8;--ws-border:#465159;--ws-accent:#b7d8a3;--ws-on-accent:#213120;--ws-ring:#9dbb88}
@media screen{
body.tool-shell-page,body[data-education]{background:var(--ws-bg)!important;color:var(--ws-text);font-family:var(--ui-font)!important;line-height:1.6}
body.tool-shell-page>:is(.app,.tool-app,.md-app,.page),.edu-main{width:min(1400px,calc(100% - 48px));max-width:1400px;margin-inline:auto;padding:28px 0 48px}
body.tool-shell-page>:is(.app,.tool-app,.md-app,.page)>:is(.hero,.md-header),.edu-intro{padding:0 0 24px;margin:0;gap:20px;align-items:center}
body.tool-shell-page>:is(.app,.tool-app,.md-app,.page)>:is(.hero,.md-header) h1,.edu-intro h1{font:650 28px/1.4 var(--ui-font)!important;color:var(--ws-text);letter-spacing:0;margin:0 0 8px;text-shadow:none}
body.tool-shell-page>:is(.app,.tool-app,.md-app,.page)>:is(.hero,.md-header) :is(.lead,.lede,.hero-lede),.edu-intro p{font-size:14px;line-height:1.8;color:var(--ws-secondary)!important;margin:8px 0 0;max-width:78ch}
body.tool-shell-page>:is(.app,.tool-app,.md-app,.page)>:is(.hero,.md-header) .eyebrow{font-size:11px;font-weight:600;color:var(--ws-accent);margin-bottom:6px}
body.tool-shell-page :is(.workspace,.layout){gap:20px}
body.tool-shell-page :is(.workspace,.layout)>:is(.panel,.pane,.preview-panel,.sidebar),.edu-settings{background:var(--ws-surface)!important;border:1px solid var(--ws-border)!important;border-radius:8px!important;box-shadow:none!important;color:var(--ws-text)}
body.tool-shell-page :is(.panel,.pane,.preview-panel)>:is(.panel-head,.pane-head,.preview-head){background:var(--ws-surface)!important;border-bottom:1px solid var(--ws-border);padding:16px 20px;color:var(--ws-text)!important}
body.tool-shell-page :is(.panel-head,.pane-head,.preview-head) h2,.edu-settings h2{font:600 16px/1.5 var(--ui-font);margin:0;color:var(--ws-text)}
body.tool-shell-page :is(.app,.tool-app,.md-app,.page)>.toolbar,body.tool-shell-page .panel>.toolbar{background:var(--ws-surface)!important;border-color:var(--ws-border)!important;border-radius:8px;box-shadow:none;padding:12px;gap:8px}
/* Exclude authored/exported content even when it contains matching element names. */
body.tool-shell-page :is(.btn,.tool-btn,.chip,.choice,.filter):not(:where(.mi-document *,.card-preview *,.preview-card *,.article-preview *)){font-family:var(--ui-font);font-size:13px;font-weight:550;letter-spacing:0;border-radius:6px;box-shadow:none!important;text-shadow:none;min-height:36px;background:var(--ws-surface);color:var(--ws-text);border-color:var(--ws-border)}
body.tool-shell-page .btn.primary,body.tool-shell-page .btn.accent,.edu-actions .primary{background:var(--ws-accent)!important;border-color:var(--ws-accent)!important;color:var(--ws-on-accent)!important}
body.tool-shell-page :is(.chip,.choice,.filter):is(.active,[aria-pressed=true]){background:var(--ws-accent);border-color:var(--ws-accent);color:var(--ws-on-accent)}
body.tool-shell-page .btn.danger{background:var(--ws-surface);border-color:#c76b6b;color:#b63838}
:root[data-ui-theme=dark] body.tool-shell-page .btn.danger{color:#ffaaaa;border-color:#aa6464}
body.tool-shell-page :is(.panel-body,.field,.control-group,.settings,.settings-panel,.sidebar,.toolbar,.controls) :is(input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),select,textarea),.edu-settings :is(input:not([type=checkbox]):not([type=radio]):not([type=color]),select,textarea){background:var(--ws-surface)!important;color:var(--ws-text)!important;border:1px solid var(--ws-border)!important;border-radius:6px;font-size:14px;line-height:1.6;padding:9px 11px;box-shadow:none;min-width:0}
body.tool-shell-page :is(.field,.control-group,.settings-panel) label,.edu-settings label{color:var(--ws-secondary)!important;font-size:12px;font-weight:550}
body.tool-shell-page :is(.field,.control-group,.settings-panel,.panel-body) input::placeholder,.edu-settings :is(input,textarea)::placeholder{color:var(--ws-secondary);opacity:.8}
body.tool-shell-page :is(button,input,select,textarea,a):focus-visible,body[data-education] :is(button,input,select,textarea,a):focus-visible{outline:2px solid var(--ws-ring);outline-offset:3px}
body.tool-shell-page :is(input[type=checkbox],input[type=radio],input[type=range]),.edu-settings input{accent-color:var(--ws-accent)}
body.tool-shell-page button:disabled{opacity:.5;cursor:not-allowed}
.edu-layout{grid-template-columns:300px minmax(0,1fr);gap:24px}.edu-settings{padding:20px;gap:18px}.edu-settings h2{padding-bottom:12px;border-bottom:1px solid var(--ws-border)}.edu-toolbar{min-height:44px;margin-bottom:12px;padding:0}.edu-toolbar span,.edu-hint,.edu-status,.edu-badge{color:var(--ws-secondary)!important;font-size:12px}.edu-preview{background:var(--ws-soft)!important;border:1px solid var(--ws-border);padding:24px;border-radius:8px}.edu-actions :is(button,select){background:var(--ws-surface);color:var(--ws-text);border:1px solid var(--ws-border);border-radius:6px;min-height:38px;font-size:13px}.edu-related{border-color:var(--ws-border)}.edu-links a{color:var(--ws-accent);padding:5px 0}.edu-paper{color-scheme:light}
/* Resource directories use repeated cards rather than editor panels. */
.tool-shell-page .page>:is(.controls,.stats,.source-card),.tool-shell-page .page .hero>.source-card,.tool-shell-page .page #provider-grid>article{background:var(--ws-surface);border-color:var(--ws-border);box-shadow:none;border-radius:8px;color:var(--ws-text)}
.tool-shell-page .page .source-card p,.tool-shell-page .page .result-line{color:var(--ws-secondary)}
/* Legacy Polaroid chrome; photo frames and rendered text are deliberately untouched. */
body.tool-shell-polaroid-camera .main-container{background:transparent;box-shadow:none;border:0;padding-top:28px}body.tool-shell-polaroid-camera .main-container>.title{font:650 28px/1.4 var(--ui-font);color:var(--ws-text);text-shadow:none;letter-spacing:0}body.tool-shell-polaroid-camera .main-container>.rainbow-strip{display:none}
body.tool-shell-polaroid-camera :is(.editor-panel,.controls-area){background:var(--ws-surface);color:var(--ws-text);border-color:var(--ws-border)}body.tool-shell-polaroid-camera .panel-header{background:var(--ws-soft)}body.tool-shell-polaroid-camera :is(.panel-title,.control-title){font-family:var(--ui-font);color:var(--ws-text);text-shadow:none}body.tool-shell-polaroid-camera .panel-subtitle{color:var(--ws-secondary)}body.tool-shell-polaroid-camera .cute-button{font:550 14px/1.5 var(--ui-font);background:var(--ws-accent);color:var(--ws-on-accent);border:1px solid var(--ws-accent);border-radius:6px;box-shadow:none;text-shadow:none}
:root body.tool-shell-page :is(.app,.tool-app,.formatter)>.settings-panel{background:var(--ws-surface)!important;color:var(--ws-text);border-color:var(--ws-border);box-shadow:none}
:root[data-ui-theme] body.tool-shell-page .btn.primary{background:var(--ws-accent)!important;border-color:var(--ws-accent)!important;color:var(--ws-on-accent)!important}
/* PC builder retains all configuration and sharing behavior, with neutral UI chrome. */
body.tool-shell-pc-builder{--cp77-yellow:var(--ws-accent);--cp77-yellow-dim:var(--ws-secondary);--cp77-blue:#3684ae;--cp77-blue-dim:#326d8c;--cp77-dark:var(--ws-surface);--cp77-darker:var(--ws-soft);--cp77-gray:var(--ws-secondary);--cp77-light:var(--ws-text);letter-spacing:0;margin:0}
body.tool-shell-pc-builder::before,body.tool-shell-pc-builder .cyber-bg{display:none}
body.tool-shell-pc-builder>.container{width:min(1400px,calc(100% - 48px));margin:28px auto}
body.tool-shell-pc-builder :is(.cyber-title,.main-title){font:650 28px/1.4 var(--ui-font);color:var(--ws-text);text-shadow:none;letter-spacing:0}
body.tool-shell-pc-builder :is(.cyber-container,.part-card,.collapsible-panel){background:var(--ws-surface);border:1px solid var(--ws-border);border-radius:8px;box-shadow:none;clip-path:none}
body.tool-shell-pc-builder :is(.cyber-container,.cyber-container-decorated,.cyber-button,.cyber-button-alt,.cyber-title)::before,body.tool-shell-pc-builder :is(.cyber-container-decorated,.cyber-title)::after{display:none}
body.tool-shell-pc-builder :is(.cyber-button,.cyber-button-alt){font:550 13px/1.5 var(--ui-font);border:1px solid var(--ws-border);border-radius:6px;clip-path:none;box-shadow:none;text-shadow:none;min-height:36px;background:var(--ws-surface);color:var(--ws-text);letter-spacing:0}
body.tool-shell-pc-builder .cyber-button{background:var(--ws-accent);color:var(--ws-on-accent)}body.tool-shell-pc-builder input.cyber-input{background:var(--ws-surface);color:var(--ws-text);border:1px solid var(--ws-border);border-radius:6px;min-width:0;max-width:100%}
body.tool-shell-pc-builder :is(.cyber-font,.cyber-subtitle,.cyber-text){font-family:var(--ui-font);letter-spacing:0;text-shadow:none}
body.tool-shell-pc-builder .version-tag{position:static;display:inline-block;transform:none;margin:8px 0;color:var(--ws-secondary)}
/* All PC builder surfaces must follow the current UI theme, including legacy dark fills. */
body.tool-shell-pc-builder{--cp77-blue:#216b90;--cp77-blue-dim:#216b90}
:root[data-ui-theme=dark] body.tool-shell-pc-builder{--cp77-blue:#8dc9ed;--cp77-blue-dim:#8dc9ed}
body.tool-shell-pc-builder :is(.bg-highlight,.tip-section,.recommended-part,.recommended-part-image,.preview-content,.cyber-step,.selected-part){background:var(--ws-soft);color:var(--ws-text);border-color:var(--ws-border);clip-path:none}
body.tool-shell-pc-builder .bg-highlight{border-left:3px solid var(--ws-accent);border-radius:6px}
body.tool-shell-pc-builder :is(.part-item,.modal-content){background:var(--ws-surface);color:var(--ws-text);border-color:var(--ws-border);border-radius:8px;clip-path:none}
body.tool-shell-pc-builder .cyber-step{color:var(--ws-secondary);border:1px solid var(--ws-border);border-bottom-width:2px}
body.tool-shell-pc-builder .cyber-step.active{background:var(--ws-accent);color:var(--ws-on-accent);border-color:var(--ws-accent)}
body.tool-shell-pc-builder .cyber-step:not(.active):hover{background:var(--ws-surface);color:var(--ws-text)}
body.tool-shell-pc-builder :is(.collapsible-panel-header,.recommended-part,.part-table tr):hover{background:var(--ws-soft)}
body.tool-shell-pc-builder .collapsible-panel-body>.bg-black,body.tool-shell-pc-builder code.bg-black{background:var(--ws-soft);color:var(--ws-text)}
body.tool-shell-pc-builder :is(.text-gray-400,.text-gray-500){color:var(--ws-secondary)}
body.tool-shell-pc-builder :is(.text-blue-300,.text-blue-400){color:var(--cp77-blue)}
body.tool-shell-pc-builder :is(.text-red-300,.text-red-400){color:#b63838}
:root[data-ui-theme=dark] body.tool-shell-pc-builder :is(.text-red-300,.text-red-400){color:#ffaaaa}
body.tool-shell-pc-builder :is(.cart-item,.part-card-header,.part-table td){border-color:var(--ws-border)}
body.tool-shell-pc-builder input.cyber-input::placeholder{color:var(--ws-secondary);opacity:1}
body.tool-shell-pc-builder .cyber-checkbox{background:var(--ws-surface);border-color:var(--ws-secondary)}
body.tool-shell-pc-builder .cyber-checkbox:checked{background:var(--ws-accent);border-color:var(--ws-accent)}
body.tool-shell-pc-builder .cyber-checkbox:checked::after{color:var(--ws-on-accent)}
@media(max-width:850px){body.tool-shell-page>:is(.app,.tool-app,.md-app,.page),.edu-main{width:calc(100% - 28px);padding-top:20px}.edu-layout{grid-template-columns:1fr}.edu-settings{position:static;grid-template-columns:repeat(2,minmax(0,1fr))}.edu-settings h2,.edu-settings .wide,.edu-settings .edu-actions,.edu-settings .edu-error{grid-column:1/-1}.edu-preview{padding:12px}.edu-intro{padding-bottom:20px}.edu-toolbar{align-items:flex-start}.edu-actions{gap:6px}}
@media(max-width:600px){body.tool-shell-page>:is(.app,.tool-app,.md-app,.page)>:is(.hero,.md-header) h1,.edu-intro h1{font-size:24px!important}.edu-settings{padding:16px}.edu-actions button{padding:8px 10px;font-size:12px}}
}
