/* Preserve the type hierarchy and browser zoom while reducing interface density. */
:root[data-font-size],:root[data-font-size]:has(#shell.unified-shell) {font-size:92%!important;--type-control:max(14px,.875rem);--type-meta:max(12px,.8125rem);--type-composer:max(16px,1rem);--type-answer:max(16px,1rem);--type-title:1.5rem;--type-heading:1.25rem}
:root[data-font-size=balanced],:root[data-font-size=balanced]:has(#shell.unified-shell){font-size:100%!important}
:root[data-font-size=large],:root[data-font-size=large]:has(#shell.unified-shell){font-size:112%!important}
:root[data-font-family=humanist]{--font-ui:Calibri,Candara,"Segoe UI",sans-serif}
:root[data-font-family=classic]{--font-ui:Arial,Helvetica,sans-serif}
:root[data-font-family] body,:root[data-font-family] :is(button,select,input,textarea,h1,h2,h3,h4){font-family:var(--font-ui,"Segoe UI",system-ui,sans-serif)}
:root[data-font-size] #shell.unified-shell :is(.nav,.topbar select,.launch-signin,.task-window-tabs button,.execution-controls button){font-size:var(--type-control)!important}
:root[data-font-size] #task-activity-window :is(.execution-status,.execution-controls select,.task-window-heading strong){font-size:max(13px,.9375rem)!important}
:root[data-font-size] #task-activity-window #prompt{font-size:var(--type-composer)!important}
:root[data-font-size] #shell.unified-shell :is(.visual-header-card h2,.code-studio h2,.workspace-tool-screen h1){font-size:var(--type-title)!important}
:root[data-font-size] #shell.unified-shell :is(.settings-section h3,.recent-work h2){font-size:var(--type-heading)!important}
.font-preview{padding:12px;border-radius:10px;background:var(--raised);display:grid;gap:5px;margin:8px 0}
.font-preview strong{font-size:var(--type-heading)}.font-preview span{font-size:var(--type-answer)}.font-preview small{font-size:var(--type-meta)}
@media(max-width:650px){
 :root,:root:has(#shell.unified-shell){font-size:84%!important;--type-control:12px;--type-meta:11px;--type-composer:13px;--type-answer:13px;--type-title:1.15rem;--type-heading:1rem}
 :root[data-mobile-font-size=compact],:root[data-mobile-font-size=compact]:has(#shell.unified-shell){font-size:80%!important}
 :root[data-mobile-font-size=large],:root[data-mobile-font-size=large]:has(#shell.unified-shell){font-size:92%!important}
 :root #shell.unified-shell h1,:root #shell.unified-shell .launch-home h1{font-size:1.25rem!important;line-height:1.2!important}
 :root #shell.unified-shell h2{font-size:1.05rem!important;line-height:1.25!important}
 :root #shell.unified-shell h3{font-size:.9rem!important;line-height:1.3!important}
 :root #shell.unified-shell h4{font-size:.82rem!important;line-height:1.35!important}
 :root #shell.unified-shell p{font-size:.82rem!important;line-height:1.45!important}
 :root[data-font-size] .settings-row{gap:10px}
}


/* Compact interface scale shared by every project type; answer text remains configurable. */
:root[data-density=compact]{--type-control:12px;--type-meta:11px;--type-title:1.25rem;--type-heading:1.05rem}
:root[data-density=compact][data-font-size] #shell.unified-shell :is(.nav,.topbar select,.launch-signin,.task-window-tabs button,.execution-controls button){font-size:12px!important}
:root[data-density=compact][data-font-size] #task-activity-window :is(.execution-status,.execution-controls select,.task-window-heading strong){font-size:12px!important}
:root[data-density=compact] #shell :is(.pw-tabs,.pw-summary,.pw-status,.pw-field,.execution-active-work,.execution-relationship,.task-context-card){font-size:12px;line-height:1.45}
:root[data-density=compact] #shell :is(.pw-tabs button,.pw-header select,.workspace-tool-screen>header button){font-size:11px;min-height:30px;padding:5px 8px}
:root[data-density=compact] #shell :is(.pw-header,.pw-content){padding:12px}
:root[data-density=compact] #shell .pw-subtitle{font-size:12px;line-height:1.5}
@media(pointer:coarse){:root[data-density=compact] #shell :is(.pw-tabs button,.pw-header select,.workspace-tool-screen>header button){min-height:36px}}

:root[data-density=compact] #shell :is(.professional-workspace,.code-studio,.workspace-tool-screen) :is(button,select,label){font-size:12px!important;line-height:1.4}
:root[data-density=compact] #shell :is(.professional-workspace,.code-studio,.workspace-tool-screen) :is(small,.hint,.status){font-size:11px!important;line-height:1.45}

/* Compact is the agreed 12px reading/composer baseline. Larger user choices remain available. */
@media(min-width:651px){
:root[data-theme][data-font-size=compact]:has(#shell.unified-shell){--type-control:12px;--type-composer:12px;--type-answer:12px}
:root[data-theme][data-font-size=compact] body #shell#shell#shell#shell#shell#shell #prompt{font-size:12px!important}
:root[data-theme][data-font-size=compact] body #shell#shell#shell#shell#shell#shell .message-body{font-size:12px!important}
}
