/* Important declarations in this first layer take precedence over historical
   component !important fonts without changing chart or icon geometry. */
@layer prima-typography {
  @media screen {
    html:root,
    body.prima-ui,
    body.prima-ui :where(*):not(.print-sheet,.print-sheet *,#archiveReportPreview,#archiveReportPreview *,#printContent,#printContent *,.print-only,.print-only *,.wordmark,.wordmark *,.brand-name,.brand-name *) {
      font-family: var(--prima-font, Arial, Helvetica, sans-serif) !important;
    }
    body.prima-ui :is(h1,.prima-page-title,.page-title):not(.print-sheet *,#archiveReportPreview *,#printContent *,.print-only *) {
      font-size: var(--prima-page-title-size,32px) !important;
      line-height: 1.2 !important;
      max-width: 100%; min-width: 0; overflow-wrap: anywhere;
    }
    body.prima-ui :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select,textarea,.prima-picker-trigger,.prima-picker-option):not(.prima-picker-native,.print-sheet *,#archiveReportPreview *,#printContent *,.print-only *) {
      /* A dedicated token prevents dense cards from shrinking editable text.
         The mobile scale layer compensates this token for its 80% view. */
      font-size: var(--prima-control-size,16px) !important;
      line-height: 1.4 !important;
      min-height: 2.5em !important;
      box-sizing: border-box;
    }
    body.prima-ui :is(.prima-picker-caption,.prima-picker-option-copy) {
      font-size: inherit !important;
      line-height: inherit !important;
      min-width: 0;
    }
    body.prima-ui .prima-picker-heading {
      font-size: var(--prima-control-size,16px) !important;
      line-height: 1.4 !important;
      min-width: 0;
    }
  }
}
/* Kept for existing image/PDF exports; screen text uses the shared sans stack. */
@font-face {
  font-family: "Montserrat";
  src: url("/fonts/Montserrat-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
/* Shared screen typography for every PRIMA ONE document and embedded tool.
   Loaded last so older page-specific sizes cannot fragment the hierarchy.
   Print styles, exported documents, logos and chart geometry keep their layout. */
@media screen {
  :root {
    --prima-font: Arial, Helvetica, sans-serif;
    --prima-page-title-size: 32px;
    --prima-title: 32px;
    --prima-section: 22px;
    --prima-subtitle: 18px;
    --prima-body: 14px;
    --prima-caption: 12px;
    --prima-input: 16px;
    --prima-stat: 32px;
  }
  body.prima-ui { font-family: var(--prima-font); font-size: var(--prima-body) !important; line-height: 1.5; }
  body.prima-ui :is(button,input,select,textarea):not(.print-sheet *,#archiveReportPreview *) { font-family: var(--prima-font); }
  body.prima-ui button:not(.print-sheet *,#archiveReportPreview *,[aria-label],.prima-picker-trigger) { font-size: var(--prima-body) !important; line-height: 1.4; }
  body.prima-ui :is(h1,.prima-page-title):not(.print-sheet *,#archiveReportPreview *) {
    font-family: var(--prima-font); font-size: var(--prima-title) !important;
    line-height: 1.2 !important; font-weight: 650; letter-spacing: -.035em;
  }
  body.prima-ui :is(h2,.card-title,.panel-title):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-section) !important; line-height: 1.3 !important; font-weight: 650;
  }
  body.prima-ui :is(h3,h4,h5,h6,legend,.service-toolbar h2,.vr-widget-heading h3,.home-widget-head h2):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-subtitle) !important; line-height: 1.35 !important; font-weight: 650;
  }
  /* Card headers use one section-title level, independent of their HTML tag. */
  body.prima-ui :is(.vr-widget-heading h2,.vr-widget-heading h3,.dd-panel-heading h2,.dd-breakdown-heading h2,.home-widget-head h2):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-section) !important; line-height: 1.3 !important;
  }
  body.prima-ui :is(p,label,legend,dt,dd,summary,li):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-body) !important; line-height: 1.5;
  }
  body.prima-ui :is(label,.field-label,.rc-field,.rc-members-title,.gr-forecast h4,.vr-goal-heading h4,.evening-staff-title):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-body) !important; line-height: 1.4 !important;
  }
  body.prima-ui :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select,textarea):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-input) !important; line-height: 1.4 !important;
  }
  body.prima-ui :is(.btn,.button,.dd-button,.nav-item,.row-button,.formError,#formError,.card-status,.status,.notice,.empty,.todo-description,.todo-empty,.report-description,.report-warning,.progress-source-note,.progress-chart-caption,.gr-rules p,.gr-review,.gr-rule,.gr-breakdown-row,.vr-goal-target,.vr-goal-footer,.sr-phone,.sr-stats span,.evening-muted,.home-reminder-message,.registry-empty,.work-selection,.scope,.footnote):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-body) !important; line-height: 1.5 !important;
  }
  body.prima-ui :is(.registry-tabs button,.progress-view-switch button,.report-filter-actions button,.dd-pdv-selection-heading button,.filters button,.actions button,.review-actions button,.login .submit,.booking-card button,.list-switch button,.filter-chip,.weekly-panel button):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-body) !important; line-height: 1.4 !important;
  }
  body.prima-ui :is(header>div>p,.dd-heading p,.registry-heading p,.reports-heading p,.panel-subtitle,.dd-panel-heading p,.dd-section-heading p,.dd-breakdown-heading p,.review-head p,.section-head p,.page-heading p:not(.eyebrow)):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-body) !important; line-height: 1.5 !important;
  }
  body.prima-ui :is(table,th,td,.report-table,.dd-table,.dd-breakdown-table,.company-text>button,.customer-name,.registry-item-subtitle,.registry-store-address,.registry-store-tag,.employee-store-choice strong,.rc-person strong,.rc-cluster strong,.contract-title,.customer strong):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-body) !important; line-height: 1.5 !important;
  }
  body.prima-ui :is(small,.hint,.help,.error,.field-help,.profile-note,.registry-field-note,.registry-share-note,.rc-note,.pda-help,.pda-file,.archive-caption,.results-meta,.customer-tax,.customer-phone,.customer-owner,.customer-address,.tax,.todo-meta,.todo-state,.todo-new,.evening-staff-heading>span,.evening-person-header span,.evening-history-count,.home-sales-scope-note,.home-sales-composition-note,.home-sales-donut-center>span,.home-sales-extras span,.home-reminder-meta,.home-reminder-days,.home-reminder-client span,.report-message,.report-result-period,.report-chart-note,.report-chart-legend,.report-chart-heading>span,.report-outcome,.report-day-total,.dd-breakdown-note,.dd-legend,.dd-footnote,.dd-count,.dd-source,.dd-mnp-note,.dd-mnp-race-foot,.dd-mnp-race-outlook,.vr-notes,.vr-goal-status,.sr-badge,.sr-stats small,.gr-step-status,.gr-breakdown-head,.gr-type,.vr-pos,.badge,.private-label,.registry-role,.registry-status,.registry-list-count,.registry-subordinates-label,.registry-overview span,.technology-tag,.schedule-detail,.schedule-tag,.territory-tags,.territory-rule>p,.stat-top,.quota span,.list-heading p,.table-footer,.page-footer,.distance,.priority-tag,.status-pill,.count-badge,.small-badge,.lead-meta,.history-line,.demo-note,.configuration-summary span,.config-address,.source-link,.script-step small,.script-objection summary,.store-overview p,.store-overview a,.pdf-routing p,.pdf-routing span):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-caption) !important; line-height: 1.5 !important;
  }
  body.prima-ui .app-nav-group::before { font-size: var(--prima-caption) !important; line-height: 1.4 !important; letter-spacing: .08em; }
  body.prima-ui :is(.prima-page-eyebrow,.eyebrow,.kicker,.dd-eyebrow,.breadcrumb,.mobile-sheet-group>h3):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-caption) !important; line-height: 1.4 !important; letter-spacing: .08em;
  }
  body.prima-ui :is(.dd-kpi>strong,.dd-breakdown-total strong,.dd-mix-total strong,.dd-mnp-stat strong,.vr-goal-numbers strong,.vr-projection>strong,.sr-stats strong,.gr-forecast strong,.report-kpis strong,.report-comparison strong,.progress-kpi strong,.home-sales-donut-center #homeSalesTotal,.home-sales-total strong,.stat strong,.quota strong,.summary strong,.registry-overview strong):not(.print-sheet *,#archiveReportPreview *) {
    font-size: var(--prima-stat) !important; line-height: 1.15 !important; font-variant-numeric: tabular-nums;
  }
  body.prima-ui :is(#homeSalesExtras strong,.evening-totals-grid strong):not(.print-sheet *,#archiveReportPreview *) { font-size: var(--prima-section) !important; line-height: 1.2 !important; }
  body.prima-ui :is(.dd-breakdown-quantity b,.home-sales-legend-row strong,.gr-step>strong,.progress-month-bar strong):not(.print-sheet *,#archiveReportPreview *) { font-size: var(--prima-input) !important; line-height: 1.35 !important; }
  body.prima-ui :is(.dd-breakdown-metric,.dd-pdv-option,.home-sales-legend-row,.dd-focus-row,.gr-breakdown summary,.gr-rules summary):not(.print-sheet *,#archiveReportPreview *) { font-size: var(--prima-body) !important; line-height: 1.4 !important; }
  body.prima-ui :is(.app-nav-btn,.mobile-sheet-item-copy strong):not(.print-sheet *,#archiveReportPreview *) { font-size: var(--prima-body) !important; line-height: 1.35 !important; }
  body.prima-ui :is(h1,h2,h3,h4,h5,h6,.prima-page-title,.card-title,.panel-title):not(.print-sheet *,#archiveReportPreview *) {
    max-width: 100%; min-width: 0; overflow-wrap: anywhere;
  }
  body.prima-ui :is(h1,h2,h3,h4,h5,h6,.prima-page-title,.card-title,.panel-title) > :is(span,a):not(.badge,.count-badge,.small-badge,.race-target-badge,.print-sheet *,#archiveReportPreview *) {
    font-size: inherit !important; line-height: inherit;
  }
  /* Allow the standardized text to wrap inside narrow cards and action groups. */
  body.prima-ui :is(.vr-widget-heading h2,.vr-widget-heading h3,.dd-breakdown-track h3,.registry-item-title h3,.panel-title):not(.print-sheet *,#archiveReportPreview *) { overflow-wrap: anywhere; }
  body.prima-ui :is(.registry-item-title,.review-actions,.card-head,.list-heading):not(.print-sheet *,#archiveReportPreview *) { flex-wrap: wrap; }
  body.prima-ui :is(.registry-store-tag,.registry-item-subtitle,.registry-store-address,.employee-store-choice small):not(.print-sheet *,#archiveReportPreview *) { white-space: normal; overflow-wrap: anywhere; }
}
@media screen and (max-width:760px) {
  :root { --prima-title: 28px; --prima-page-title-size: 28px; --prima-section: 20px; --prima-stat: 28px; }
  /* Inputs stay at 16px, including dense editable tables, for readable mobile entry. */
  body.prima-ui :is(.btn,.button):not(.print-sheet *,#archiveReportPreview *) { white-space: normal; }
}
