/* Typography roles: maps every product surface to the shared tokens in typography-tokens.css (generated from design/typography.tokens.json). Loaded LAST so it is the single place where
   sizes are decided. It sets size and line-height only (colour, family and the existing weights/capitalisation rules stay as approved); tool names keep the dot-matrix face from typography.css.
   Sizes are rem-based tokens, so they follow the user's text-size / accessibility setting. Long text wraps (overflow-wrap) instead of clipping. */
:root { --sv-fs: var(--sv-type-body-secondary-size); }
html body { font-size: var(--sv-type-body-secondary-size); line-height: var(--sv-type-body-secondary-lh); overflow-wrap: break-word; }

/* headings */
html body h1 { font-size: var(--sv-type-display-size); line-height: var(--sv-type-display-lh); font-weight: var(--sv-type-display-weight) !important; }
html body h2 { font-size: var(--sv-type-heading-xl-size); line-height: var(--sv-type-heading-xl-lh); font-weight: var(--sv-type-heading-xl-weight) !important; }
html body .sv-page-head h1, html body .sv-page-head h2, html body .chat-header-title, html body .ops-banner-main, html body .modal h3, html body .modal h2 { font-size: var(--sv-type-heading-lg-size); line-height: var(--sv-type-heading-lg-lh); font-weight: var(--sv-type-heading-lg-weight) !important; }
html body .chat-empty-brand { font-size: var(--sv-type-display-size); line-height: var(--sv-type-display-lh); }

/* conversation: user messages, AI responses, artifacts' prose */
html body .chat-message .chat-message-body, html body .chat-message.role-assistant .chat-message-body, html body .chat-message.role-user .chat-message-body, html body .sv-prose, html body .assistant-text { font-size: var(--sv-type-body-size); line-height: var(--sv-type-body-lh); }
html body .chat-message .chat-message-body h1, html body .chat-message .chat-message-body h2, html body .chat-message .chat-message-body h3 { line-height: var(--sv-type-heading-lg-lh); }
html body .chat-message { font-size: var(--sv-type-body-size); line-height: var(--sv-type-body-lh); }
html body .chat-message .chat-message-meta, html body .notif-time, html body .chat-message .chat-message-note, html body .chat-message .chat-context-note, html body .chat-message .chat-routing-note, html body .chat-message .chat-model-note, html body .branch-count { font-size: var(--sv-type-metadata-size); line-height: var(--sv-type-metadata-lh); }
html body .chat-empty-hint, html body .glass-option-detail { font-size: var(--sv-type-tool-description-size); line-height: var(--sv-type-tool-description-lh); }

/* composer and inputs */
html body .composer-input, html body .composer textarea, html body .sh-input, html body input[type="text"], html body input[type="email"], html body input[type="password"], html body input[type="search"], html body textarea, html body select { font-size: var(--sv-type-composer-size); line-height: var(--sv-type-composer-lh); }
html body .composer .state, html body .composer-voice-strip .voice-status { font-size: var(--sv-type-subtitle-size); line-height: var(--sv-type-subtitle-lh); }

/* tool execution cards, agent activity, build and preview activity */
html body .tool-activity-summary-text, html body .tool-activity-row-label { font-size: var(--sv-type-tool-label-size); line-height: var(--sv-type-tool-label-lh); font-weight: var(--sv-type-tool-label-weight) !important; }
html body .tool-activity-row-target, html body .tool-activity-row-meta, html body .tool-activity-details, html body .tool-activity-details dd, html body .tool-activity-details dt, html body .tool-activity-links { font-size: var(--sv-type-tool-description-size); line-height: var(--sv-type-tool-description-lh); }
html body .armour-stages li, html body .cl-task-sub, html body .mcp-chip { font-size: var(--sv-type-tool-description-size); line-height: var(--sv-type-tool-description-lh); }

/* navigation */
html body .sidebar-item, html body .sidebar-section-label, html body .nav-back, html body .savannah-tab-btn, html body .sh-back { font-size: var(--sv-type-navigation-size); line-height: var(--sv-type-navigation-lh); font-weight: var(--sv-type-navigation-weight) !important; }
html body .sh-nav-title { font-size: var(--sv-type-body-secondary-size); line-height: var(--sv-type-body-secondary-lh); }

/* settings, billing, usage and other row screens */
html body .sv-row-title, html body .sv-section-label, html body .sh-label { font-size: var(--sv-type-body-size); line-height: var(--sv-type-body-lh); }
html body .sv-row-desc, html body .sv-page-sub, html body .sh-sub, html body .sh-hint, html body .sv-empty, html body .sv-loading, html body .sv-error, html body .sv-success, html body .sv-plan p, html body .sv-device-meta { font-size: var(--sv-type-subtitle-size); line-height: var(--sv-type-subtitle-lh); }

/* buttons, dialogs, menus, notifications */
html body .btn, html body .btn-glass, html body button.btn, html body .composer-pill, html body .chat-menu-item, html body .glass-option, html body .modal button { font-size: var(--sv-type-button-size); line-height: var(--sv-type-button-lh); font-weight: var(--sv-type-button-weight) !important; }
html body .modal p, html body .modal label, html body .modal li { font-size: var(--sv-type-body-secondary-size); line-height: var(--sv-type-body-secondary-lh); }
html body .notif-body, html body .notif-item { font-size: var(--sv-type-subtitle-size); line-height: var(--sv-type-subtitle-lh); }

/* admin and monitoring dashboards */
html body .ops-banner-sub, html body .ops-notice, html body .ops-table { font-size: var(--sv-type-subtitle-size); line-height: var(--sv-type-subtitle-lh); }
html body .ops-reason, html body .ops-fact, html body .ops-meas, html body .ops-uptime, html body .ops-timeline { font-size: var(--sv-type-tool-description-size); line-height: var(--sv-type-tool-description-lh); }
html body .ops-chip, html body .ops-status, html body .ops-sev { font-size: var(--sv-type-tool-label-size); line-height: var(--sv-type-tool-label-lh); }

/* nothing may clip or overlap at large text sizes */
html body .chat-message-body, html body .sv-row-title, html body .sv-row-desc, html body .tool-activity-row-label, html body .tool-activity-row-target, html body .notif-body, html body .ops-reason { overflow-wrap: anywhere; min-width: 0; }
