/* Shared text roles for every 2D page and dialog. Keep scene artwork outside this scale.
   The scoped size reset retires older component and narrow-window font overrides. */
:root{
 --type-title:19px;
 --type-heading:14px;
 --type-body:13px;
 --type-caption:12px;
 --type-heading-weight:600;
}

:where(.ui-workspace,dialog,.prototype-toast,#runtime-error){font-size:var(--type-body);line-height:1.8}
:where(.ui-workspace,dialog) :where(*){font-size:inherit!important}

/* Main titles and dialog titles share the same size and weight. */
:where(.ui-workspace,dialog) :is(h1,h2){font-size:var(--type-title)!important;font-weight:var(--type-heading-weight)!important;line-height:1.45!important;letter-spacing:normal!important}

/* Section headings, directory names and card names. */
:where(.ui-workspace,dialog) :is(h3,h4,h5,h6,.member-info strong,.memory-row-title,.library-resource-name,.resource strong,.matched-resource-heading strong,.summary-block>header,.empty>strong),
.ui-workspace .settings h2,
.ui-workspace .memory-list-empty h2,
.ui-workspace .library-manager h2,
.ui-workspace .directory-heading h2{
 font-size:var(--type-heading)!important;font-weight:var(--type-heading-weight)!important;line-height:1.6!important;
}

/* Reading text, including code, keeps one size; code retains its monospace family. */
:where(.ui-workspace,dialog) :is(.intro,.meaning-text,.record-content,.memory-text,.memory-row-preview,.wp-plan-text,.preference-copy,.log-text,.skill-instructions,.skill-step-content,.skill-step-context,.archive-paper,.rule-attachment-text,.tr-summary,.tr-result-text,.read-only,pre,code){
 font-size:var(--type-body)!important;line-height:1.8!important;
}
:where(.ui-workspace,dialog) p{line-height:1.8}

/* Secondary facts and explanations stay readable on narrow windows too. */
:where(.ui-workspace,dialog) :is(small,time,.small,.helper,.description,.scope,.badge,.meta,.count,.tab-count,.section-label,.list-labels,.doc-top,.doc-meta,.nav-label,.breadcrumb,.panel-footer,.settings-note,.settings-about,.member-project,.member-participation,.resource-use-status,.preference-scope,.preference-demo-note,.match-scope,.memory-scope-note,.memory-entry-meta,.memory-tab-count,.memory-reference,.material-status,.material-file-summary,.material-file-preview,.work-byline,.meaning-meta,.meaning-note,.meaning-citations,.tr-context,.tr-source-file,.tr-reading-status,.record-context,.record-note,.record-outcomes,.log-history,.log-footnote,.log-version,.usage-correction-note,.correction-context,.correction-help,.archive-path,.archive-caption,.archive-usage,.archive-toolbar-description,.archive-window-heading p,.archive-toolbar p,.library-selection-count,.library-manager-head p,.skill-info-content,.skill-editor-note,.skill-step-edit-scope,.skill-step-number,.skill-step-intro>span,.discovery-note,.memory-row-bottom p,.member-heading p,.profile-hero p,.member-summary p,.setting-row p,.item .meta),
.ui-workspace .heading-line .inline-description,
#footer-context,#discovery-status{
 font-size:var(--type-caption)!important;line-height:1.6!important;
}

/* Navigation, form labels and actions use the body size, even inside captions. */
:where(.ui-workspace,dialog) :is(button,input,select,textarea,label,summary,.label,.detail-label,.archive-folder,.archive-file,.archive-root,.rule-file-row>a,.work-acquisition a){
 font-size:var(--type-body)!important;line-height:1.5;
}
:where(.ui-workspace,dialog) :is(textarea,.skill-step-code-input){line-height:1.8!important}
:where(.ui-workspace,dialog) :is(.memory-row-title,.wp-import-row h3 button){font-size:var(--type-heading)!important;line-height:1.6!important}
:where(.ui-workspace,dialog) :is(.badge,.count,.tab-count,.skill-step-number){font-size:var(--type-caption)!important}
:is(.prototype-toast,#runtime-error),
:where(.ui-workspace,dialog) :is(.form-error,.correction-error,#memory-error,#memory-entry-error){font-size:var(--type-body)!important}

/* These are glyph icons or avatar marks, rather than text hierarchy. */
dialog :is(header,.discovery-header,.archive-window-heading) button[aria-label^="关闭"],
:where(.ui-workspace,dialog) :is(.memory-close,.panel-back){font-size:20px!important;line-height:1!important}
:where(.ui-workspace,dialog) .attribute-tag button{font-size:16px!important;line-height:1!important}
:where(.ui-workspace,dialog) :is(.monogram,.avatar){font-size:18px!important}
:where(.ui-workspace,dialog) :is(.profile-hero .monogram,.member-detail-pane .profile-hero .monogram){font-size:22px!important}
:where(.ui-workspace,dialog) .avatar-toggle{font-size:28px!important}
:where(.ui-workspace,dialog) :is(.archive-file-type,.file-symbol){font-size:var(--type-caption)!important;min-width:30px}

/* Wider labels reflow instead of introducing a smaller responsive type scale. */
:where(.ui-workspace,dialog) :is(h1,h2,h3,h4,.memory-row-title){overflow-wrap:anywhere}
:where(.ui-workspace,dialog) .heading-actions{flex-wrap:wrap}
:where(.ui-workspace,dialog) .memory-row-bottom{flex-wrap:wrap}

/* First-use window has a deliberate product and task hierarchy. */
#folder-dialog.folder-setup-dialog .guide-wordmark h2{font-size:19px!important;line-height:1.2!important;letter-spacing:.015em!important}
#folder-dialog.folder-setup-dialog .guide-wordmark span{font-size:12px!important;line-height:1.4!important}
#folder-dialog.folder-setup-dialog .guide-brand-kicker{font-size:12px!important;line-height:1.5!important}
#folder-dialog.folder-setup-dialog .guide-brand-promise{font-size:32px!important;font-weight:680!important;line-height:1.32!important;letter-spacing:-.025em!important}
#folder-dialog.folder-setup-dialog .guide-brand-subtitle{font-size:14px!important;line-height:1.7!important}
#folder-dialog.folder-setup-dialog .guide-step-title{font-size:22px!important;font-weight:680!important;line-height:1.3!important;letter-spacing:-.025em!important}
#folder-dialog.folder-setup-dialog .guide-lead{font-size:15px!important;line-height:1.75!important}
#folder-dialog.folder-setup-dialog .guide-state-card>strong{font-size:17px!important;line-height:1.45!important}
#folder-dialog.folder-setup-dialog :is(.guide-test-note,.guide-availability p,.guide-state-card>p){font-size:12px!important;line-height:1.6!important}
#folder-dialog.folder-setup-dialog .guide-progress li{font-size:12px!important;line-height:1.5!important}
@media(max-width:900px){
 #folder-dialog.folder-setup-dialog .guide-brand-promise{font-size:25px!important}
}
@media(max-width:760px){
 #folder-dialog.folder-setup-dialog .guide-brand-promise{font-size:20px!important;line-height:1.3!important}
 #folder-dialog.folder-setup-dialog .guide-step-title{font-size:20px!important}
 #folder-dialog.folder-setup-dialog .guide-lead{font-size:14px!important}
}
