/* Reference: the supplied progress card. Nunito 650/17, 400/15, 400/14.
   Scope the whole client surface, including dynamically mounted dialog/state text.
   Keep the legacy rem root unchanged so spacing and fixed tree geometry survive. */
html[data-theme] body.cp-shell {
  --cp-font: "Nunito", "Nunito Sans", system-ui, sans-serif;
  --nd-font: var(--cp-font);
  --font: var(--cp-font);
  --font-heading: var(--cp-font);
  --font-fact: var(--cp-font);
  --cp-copy: 15px;
  --cp-secondary: 14px;
  --cp-emphasis: 17px;
  font-weight: 400;
  line-height: 1.7;
}
html[data-theme] body.cp-shell,
html[data-theme] .cp-shell * {
  font-family: var(--cp-font) !important;
  font-optical-sizing: auto;
}
/* This covers alerts, validation, empty/recovery states and future mounted text
   through semantic roles, without changing their visibility or behavior. */
html[data-theme] .cp-shell :is(p, li, dt, dd, label, legend, summary, td, th, caption, pre) {
  font-size: var(--cp-copy) !important;
  line-height: 1.7 !important;
  font-weight: 400;
  letter-spacing: -.015em;
}
html[data-theme] .cp-shell :is(h1, h2, h3, h4, h5, h6) {
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.015em;
}
html[data-theme] .cp-shell :is(h3, h4, h5, h6) { font-size: var(--cp-emphasis); }
html[data-theme] .cp-shell :is(strong, b) { font-weight: 650; }
html[data-theme] .cp-shell :is(label, legend, th) { font-weight: 650; }
html[data-theme] .cp-shell button {
  font-size: var(--cp-copy) !important;
  font-weight: 650;
  line-height: 1.5 !important;
  letter-spacing: -.015em;
}
html[data-theme] .cp-shell :is(input, select, textarea) {
  font-size: 16px !important;
  font-weight: 400;
  line-height: 1.5 !important;
  letter-spacing: -.015em;
}
html[data-theme] .cp-shell :is(small, .cp-empty, .ni-help, .ni-small, .ni-answer-state, .ni-source-label,
  .review-local-note, .cp-settings-note, .review-case-context-note, .cp-stage-step-state,
  .cp-stage-hint, .cp-feature-notice, .ft-muted, .ft-subtitle, .ft-status, .ft-count, .ft-explainer,
  .ft-dialog-error, .ft-alerts small, .ft-activity small) {
  font-size: var(--cp-secondary) !important;
  line-height: 1.7 !important;
  letter-spacing: -.015em;
}
html[data-theme] .cp-shell :is(.review-eyebrow, .ni-eyebrow, .cp-document-preview-label,
  .review-case-context-badge, .review-badge, .cp-pill, .review-questionnaire-count,
  .review-questionnaire-count strong, .ni-menu-current, .ni-section-time, .ni-section-count,
  .ni-section-status, .ni-section-status .pe-status, .ni-answer-options summary,
  .cp-message strong, .cp-message small, .review-current-caption) {
  font-size: var(--cp-secondary) !important;
  line-height: 1.6 !important;
}
html[data-theme] .cp-shell :is(.review-eyebrow, .ni-eyebrow, .cp-document-preview-label) { letter-spacing: .04em; }
html[data-theme] .cp-shell .cp-sidebar button { font-size: 16px !important; }
html[data-theme] .cp-shell .cp-sidebar .ft-nav-alert { font-size: 12px !important; }
html[data-theme] .cp-shell :is(.cp-brand > span, .cp-private, .review-disclosure, .review-view-switch button,
  .cp-sidebar-toggle, #cp-refresh) { font-size: var(--cp-secondary) !important; line-height: 1.6 !important; }
html[data-theme] .cp-shell :is(.cp-card > h1, .cp-document-preview h2) { font-size: 30px; }
html[data-theme] .cp-shell :is(.cp-card h2, .ni-card h2) { font-size: 24px; }
html[data-theme] .cp-shell .review-case-context-heading h2 { font-size: var(--cp-emphasis); }
html[data-theme] .cp-shell .review-case-context-values dd { font-weight: 650; }
html[data-theme] .cp-shell :is(.review-stage-link strong, .cp-shared-document h3,
  .cp-settings-group legend, .cp-appearance-option strong, #ni-section-menu-summary,
  .ni-section-name, .ft-directory h2, .ft-beneficiaries h2, .ft-tree-heading h2,
  .ft-selection h2, .ft-alerts h2, .ft-dialog h3) {
  font-size: var(--cp-emphasis) !important;
  font-weight: 650;
  line-height: 1.5 !important;
}
html[data-theme] .cp-shell .review-stage-link strong { font-size: 14px !important; }
html[data-theme] .cp-shell .review-firm-mark { font-weight: 650; letter-spacing: -.015em; }
html[data-theme] .cp-shell :is(.cp-document-preview-page p, .cp-document-preview pre, .cp-message p) {
  font-size: var(--cp-copy) !important;
  line-height: 1.7 !important;
}
html[data-theme] .cp-shell .ni-inline-panel .ni-question > :is(label, legend) { font-size: 16px !important; }
html[data-theme] .cp-shell .ni-answer-options button { font-size: var(--cp-secondary) !important; }
html[data-theme] .cp-shell #ni-progress-label { font-size: 17px; font-weight: 650; line-height: 1.5; }
html[data-theme] .cp-shell #ni-progress-detail { font-size: 15px !important; font-weight: 400; line-height: 1.7 !important; }
html[data-theme] .cp-shell #ni-save-status { font-size: 14px; font-weight: 400; line-height: 1.7; }
html[data-theme] .cp-shell :is(#ni-status, #ni-last-saved, #cp-message-status, #cp-document-status) { font-size: 15px !important; }
html[data-theme] .cp-shell :is(#ni-editor-actions button, #ni-final-submit) { font-size: 16px !important; }

/* Diagram labels use compact roles inside the approved 220x128 fixed cards.
   No generation positions, card geometry or two-line name/detail clamps change. */
html[data-theme] .cp-shell .ft-title { font-size: 28px; }
html[data-theme] .cp-shell .ft-widget .ft-button { font-size: 14px !important; }
html[data-theme] .cp-shell .ft-widget .ft-icon { font-size: 20px !important; }
html[data-theme] .cp-shell .ft-person-details { font-size: 13px; line-height: 15px; }
html[data-theme] .cp-shell .ft-person-details strong { font-size: 13px; line-height: 15px; font-weight: 650; }
html[data-theme] .cp-shell .ft-person-details small { font-size: 12px !important; line-height: 13px !important; }
html[data-theme] .cp-shell .ft-person .ft-card-action { font-size: 12px !important; line-height: 1.3 !important; }
html[data-theme] .cp-shell .ft-person .ft-beneficiary-badge { font-size: 11px; line-height: 12px; }
html[data-theme] .cp-shell :is(.ft-directory-person strong, .ft-beneficiary-person strong) { font-size: 15px; line-height: 1.5; }
html[data-theme] .cp-shell :is(.ft-directory-person small, .ft-beneficiary-person small) { font-size: 14px !important; }
html[data-theme] .cp-shell :is(.ft-generation-label, .ft-zoom-label) { font-size: 14px !important; line-height: 1.5 !important; }
html[data-theme] .cp-shell .ft-avatar { font-size: 12px; }
html[data-theme] .cp-shell .ft-beneficiaries > .ft-muted { font-size: 14px !important; }
@media (max-width: 580px) {
  html[data-theme] .cp-shell .cp-sidebar button { font-size: 14px !important; }
  html[data-theme] .cp-shell :is(.cp-card > h1, .cp-document-preview h2, .ft-title) { font-size: 26px; }
  html[data-theme] .cp-shell :is(.cp-card h2, .ni-card h2) { font-size: 22px; }
}
