/* Shared typography. rem preserves the user's root font preference.
   First-party applications load this after their existing stylesheets. */
:root {
  --hcp-font-body-size: .875rem;
  --hcp-font-help-size: .8125rem;
  --hcp-font-section-size: 1rem;
  --hcp-font-page-size: 1.25rem;
  --bs-body-font-size: var(--hcp-font-body-size);
  --bs-btn-font-size: var(--hcp-font-body-size);
}
html { font-size: 100%; }
body { font-size: var(--hcp-font-body-size); }

/* Normal text in shared navigation, lists, forms and action controls. */
:where(
  label, .form-label, .col-form-label, .form-check-label,
  .hcp-field-caption, .hcp-field-label, .hcp-field-value, .hcp-modal-module, dt, dd,
  .form-control, .form-control-plaintext, .form-select,
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select, select option, select optgroup, textarea, output,
  button:not(.hcp-modal-close):not(.btn-close), .btn:not(.hcp-modal-close):not(.btn-close), .button, .small-button, .hcp-settings-button,
  .hcp-shared-action, .hcp-record-toolbar, .hcp-inline-links, .hcp-shared-list-actions,
  .fields a, .hcp-field-value a, .hcp-dashboard-detail,
  .hcp-resource-meta, .hcp-server-card-meta, .hcp-compact-native-summary,
  .hcp-list-pages, .hcp-directory-table, .hcp-directory-table th, .hcp-directory-table td,
  .hcp-record-table, .hcp-record-table th, .hcp-record-table td, .hcp-record-table details,
  .hcp-table, .hcp-table th, .hcp-table td, .table th, .table td,
  .table-wrap table, .table-wrap th, .table-wrap td, .wsm-work-table, .wsm-work-table th, .wsm-work-table td,
  .hcp-admin-nav-link, .hcp-admin-menu a, .hcp-admin-user-menu a,
  .hcp-provider-action-row, .hcp-provider-action-disclosure > summary, .hcp-side-link, .hcp-side-nav-link, .hcp-tab-link,
  .podc-public-nav a, .podc-account-menu a, .hcp-portal-account-menu a, .hcp-portal-account-menu .dropdown-item, .podc-service-link, .podc-product-grid b, .podc-product-grid strong,
  .podc-account-stats span, .podc-account-service-row span,
  .wsm-primary-nav a, .wsm-nav-group a, .wsm-inline-pages, .wsm-service-actions a,
  .wsm-event-tree summary, .wsm-event-tree a, .wsm-key-values, .wsm-stage-list, .wsm-workspace .notice,
  .wsm-advanced summary, .wsm-profile-policies summary,
  .hcp-navigation-trail, .breadcrumbs, .invalid-feedback, .valid-feedback, .field-validation-error, .validation-summary-errors
) { font-size: var(--hcp-font-body-size) !important; }

/* Explanatory text is intentionally secondary, rather than an arbitrary smaller body size. */
:where(
  .form-text, .help, .help-text, .field-hint, .field-help, .small, form small, .fields small,
  .hcp-help-text, .hcp-field-help, .hcp-form-help, .hcp-shared-form-help, .hcp-dashboard-widget-help, [data-hcp-help],
  .hcp-provider-test-note, .hcp-users-note, .hcp-renewal-date-note, .hcp-renewal-unavailable,
  .hcp-feedback-history-meta, .hcp-record-table small, .table small, .wsm-work-table small,
  .tooltip-inner
) { font-size: var(--hcp-font-help-size) !important; }

/* Content section headings. Sidebar category captions, KPI values and icon sizes
   retain their distinct roles; they are not normal body text. */
:where(
  main h2:not(.podc-hero h2):not(.podc-section-heading h2):not(.podc-service-overview h2):not(.podc-support-callout h2):not(.podc-product-grid h2):not(.podc-commerce-offer h2):not(.wsm-nav-group h2),
  main h3:not(.hcp-provider-action-group h3):not(.podc-product-grid h3),
  .hcp-compact-section-heading, .hcp-form-section-title, .hcp-fieldset-title, legend,
  .hcp-field-mapping-heading, .hcp-domain-section-title, .hcp-renewal-history h2,
  .hcp-shared-record-section-heading, .hcp-record-editor > h2, .hcp-record-editor > h3,
  .hcp-record-editor form > h2, .hcp-record-editor form > h3,
  .hcp-panel-main h2:not(.wsm-nav-group h2), .hcp-panel-main h3:not(.hcp-provider-action-group h3),
  .hcp-customer-section > h2, .hcp-hosting-section > h2,
  .hcp-dashboard-section h2, .hcp-dashboard-panel h3, .hcp-dashboard-widget-heading h2,
  .hcp-softwareone-business-data h2, .hcp-hosting-card-heading h2,
  .hcp-users-role-options > legend, .hcp-users-permission-options > legend,
  .hcp-users-section-actions > h2, .hcp-feedback-history h2,
  .devc-enrollment-setup h2, .devc-form-preview h3,
  .podc-account-attention h2, .podc-account-section-heading h2,
  .wsm-workspace h2:not(.wsm-nav-group h2), .wsm-workspace h3,
  .wsm-event-workspace h2, .wsm-event-workspace h3, .wsm-setup-section h2,
  .fields > h2, .sections > section > h2
) { font-size: var(--hcp-font-section-size) !important; }

/* Page/modal title roles win when a native dialog happens to live inside main.
   Public marketing hero/brand typography remains intentional. */
:where(
  main h1:not(.podc-hero h1):not(.podc-marketing-hero h1),
  .hcp-page-title, .hcp-list-title, .hcp-shared-record-heading h1,
  .hcp-form-modal .hcp-modal-heading > h2, .modal-title, .hcp-modal-title, .hcp-dashboard-page-heading h1,
  .wsm-page-heading h1, .wsm-workspace .hero h1
) { font-size: var(--hcp-font-page-size) !important; }
