/* Woolly UI typography authority. Load after theme, component and page styles.
   Change semantic tokens here, not numeric text sizes in individual modules.
   Colour palettes, layout geometry, icon glyphs, code and document/PDF styles
   remain owned by their existing stylesheets. Display-sized login art is an
   intentional exception to the business-screen heading scale. */
:root {
  --woolly-font-family: "Montserrat", "Segoe UI", "Nirmala UI", Arial, sans-serif;
  --woolly-font-body: .875rem;
  --woolly-font-control: .875rem;
  --woolly-font-label: .8125rem;
  --woolly-font-grid: .875rem;
  --woolly-font-menu: .875rem;
  --woolly-font-help: .8125rem;
  --woolly-font-badge: .75rem;
  --woolly-font-section: 1rem;
  --woolly-font-subheading: 1.25rem;
  --woolly-font-page: 1.5rem;
  --woolly-weight-regular: 400;
  --woolly-weight-medium: 500;
  --woolly-weight-semibold: 600;
  --woolly-weight-bold: 700;
  --woolly-weight-notice: 500;
  --woolly-weight-help: 400;
  --woolly-weight-advisory: 500;
  --woolly-weight-validation: 600;
  --woolly-line-body: 1.5;
  --woolly-line-control: 1.5;
  --woolly-line-label: 1.4;
  --woolly-line-heading: 1.25;
  --crm-font-xs: var(--woolly-font-help);
  --crm-font-sm: var(--woolly-font-label);
  --crm-font-body: var(--woolly-font-body);
  --crm-font-md: var(--woolly-font-section);
  --crm-font-lg: var(--woolly-font-subheading);
  --crm-font-xl: var(--woolly-font-page);
  --crm-menu-font-size: var(--woolly-font-menu);
  --wds-font-grid: var(--woolly-font-grid);
  --wds-font-label: var(--woolly-font-label);
  --bs-body-font-family: var(--woolly-font-family);
  --bs-body-font-size: var(--woolly-font-body);
}

html { font-size: 16px; }
html:lang(hi) { --woolly-font-family: "Noto Sans Devanagari", "Montserrat", "Nirmala UI", sans-serif; }
html:lang(bn) { --woolly-font-family: "Noto Sans Bengali", "Montserrat", "Nirmala UI", sans-serif; }

body.crm-body,
body.auth-body,
body.error-page {
  font-family: var(--woolly-font-family) !important;
  font-size: var(--woolly-font-body) !important;
  font-weight: var(--woolly-weight-regular);
  line-height: var(--woolly-line-body);
}

/* Important is restricted to text roles with pre-existing legacy important
   declarations. It does not change their colours, spacing, borders or sizing. */
body.crm-body :is(.form-control, .form-select, .login-control, .reference-search-input):not(.website-capture-code):not(.font-monospace),
body.crm-body .crm-content-container :is(.form-control, .form-select):not(.website-capture-code):not(.font-monospace),
body.auth-body :is(.form-control, .form-select, .login-control):not(.font-monospace),
body.crm-body :is(.crm-searchable-select-trigger, .crm-searchable-select-option, .crm-searchable-select-search) {
  font-family: var(--woolly-font-family) !important;
  font-size: var(--woolly-font-control) !important;
  font-weight: var(--woolly-weight-regular) !important;
  line-height: var(--woolly-line-control) !important;
}

body.crm-body :is(.form-label, .form-check-label, .col-form-label),
body.crm-body .crm-content-container :is(.form-label, .form-check-label, .col-form-label),
body.crm-body .crm-content-container label:not(.btn),
body.auth-body :is(.form-label, .form-check-label, .col-form-label),
body.auth-body label:not(.btn) {
  font-family: var(--woolly-font-family) !important;
  font-size: var(--woolly-font-label) !important;
  font-weight: var(--woolly-weight-semibold) !important;
  line-height: var(--woolly-line-label) !important;
}

body.crm-body .btn,
body.crm-body .crm-content-container .btn,
body.auth-body .btn,
body.error-page .btn {
  font-family: var(--woolly-font-family) !important;
  font-size: var(--woolly-font-label) !important;
  font-weight: var(--woolly-weight-semibold) !important;
}

body.crm-body :is(.table, .dashboard-table) :is(th, td),
body.crm-body .crm-content-container :is(.table, .dashboard-table) :is(th, td) {
  font-size: var(--woolly-font-grid) !important;
  line-height: var(--woolly-line-body) !important;
}
body.crm-body :is(.table, .dashboard-table) th {
  font-weight: var(--woolly-weight-semibold) !important;
}
body.crm-body :is(.table, .dashboard-table) :is(.dashboard-table-link, .lead-list-primary, .customer-email__address, .customer-city),
body.crm-body .crm-content-container :is(.table, .dashboard-table) :is(.dashboard-table-link, .lead-list-primary, .customer-email__address, .customer-city) {
  font-size: var(--woolly-font-grid) !important;
}
body.crm-body :is(.table, .dashboard-table) .dashboard-table-link {
  font-weight: var(--woolly-weight-semibold) !important;
}

body.crm-body :is(.form-text, .small, small, .dashboard-section-meta, .lead-list-secondary, .lead-list-tertiary, .customer-secondary, .website-capture-hint, .website-capture-muted, .lead-form-action-note, .crm-pagination-summary, .breadcrumb, .dashboard-page-breadcrumb),
body.crm-body .crm-content-container :is(.form-text, .small, small, .lead-list-secondary, .lead-list-tertiary),
body.auth-body :is(.form-text, .small, small, .login-help-text, .auth-subtitle) {
  font-size: var(--woolly-font-help) !important;
  line-height: var(--woolly-line-body) !important;
}

body.crm-body :is(.status-badge, .badge),
body.crm-body .crm-content-container :is(.status-badge, .badge),
body.crm-body .crm-nav-count {
  font-size: var(--woolly-font-badge) !important;
  font-weight: var(--woolly-weight-semibold) !important;
}
body.crm-body .crm-nav-count {
  font-family: var(--woolly-font-family) !important;
}

body.crm-body :is(.dashboard-page-title, .woolly-platform-welcome h1),
body.auth-body .auth-title,
body.error-page #error-title {
  font-size: var(--woolly-font-page) !important;
  font-weight: var(--woolly-weight-bold) !important;
  line-height: var(--woolly-line-heading);
}
body.crm-body :is(.dashboard-section-title, .lead-section-title, .website-capture-step-heading h2, .woolly-platform-section-heading h2, .woolly-platform-master-category-heading h2, .woolly-platform-application h2) {
  font-size: var(--woolly-font-section) !important;
  font-weight: var(--woolly-weight-semibold) !important;
  line-height: var(--woolly-line-label);
}

body.crm-body :is(.crm-nav-link, .crm-nav-group-toggle, .woolly-platform-apps-link, .woolly-platform-management-nav a, .woolly-platform-management-link strong, .wds-tab-label, .wds-tab-title, .crm-user-copy, .crm-user-copy strong, .woolly-platform-account-copy strong) {
  font-size: var(--woolly-font-menu) !important;
  font-weight: var(--woolly-weight-semibold) !important;
}
body.crm-body :is(.woolly-platform-management-link small, .woolly-platform-welcome p, .woolly-platform-master-category-heading p, .woolly-platform-application-description, .woolly-platform-access-note) {
  font-size: var(--woolly-font-help) !important;
  line-height: var(--woolly-line-body) !important;
}

/* Keep browser-filled credentials on the same scale as manually typed text.
   No autofill background/text colours are overridden. */
body :is(.form-control, .login-control):autofill {
  font-family: var(--woolly-font-family) !important;
  font-size: var(--woolly-font-control) !important;
}
body :is(.form-control, .login-control):-webkit-autofill::first-line {
  font-family: var(--woolly-font-family) !important;
  font-size: var(--woolly-font-control) !important;
}

body.error-page .error-message {
  font-size: var(--woolly-font-body);
}
body.error-page :is(.error-eyebrow, .error-session-note, .error-reference small, .error-reference > span) {
  font-size: var(--woolly-font-help);
}

/* Embedded customer papers keep the previous compact scale. Aliases are
   redeclared here because inherited custom-property aliases are already
   resolved at their ancestor; resetting only the semantic tokens is not enough. */
:where(.quotation-preview-document, .itinerary-preview-document, .package-preview-sheet, .payment-receipt-paper) {
  --woolly-font-grid: .8125rem;
  --woolly-font-menu: .8125rem;
  --woolly-font-help: .75rem;
  --woolly-font-badge: .6875rem;
  --woolly-weight-notice: 700;
  --crm-font-xs: var(--woolly-font-help);
  --crm-menu-font-size: var(--woolly-font-menu);
  --wds-font-grid: var(--woolly-font-grid);
}
@media print {
  html:root {
    --woolly-font-grid: .8125rem;
    --woolly-font-menu: .8125rem;
    --woolly-font-help: .75rem;
    --woolly-font-badge: .6875rem;
    --woolly-weight-notice: 700;
    --crm-font-xs: var(--woolly-font-help);
    --crm-menu-font-size: var(--woolly-font-menu);
    --wds-font-grid: var(--woolly-font-grid);
  }
}

/* Business sections have one heading/description scale. These screen-only
   additions do not restyle customer papers, login display art or icon glyphs. */
@media screen {
  body.crm-body :is(
    .lead-form-section-header h2, .customer-form-section-heading h2,
    .quotation-builder-form-section-header h3, .lead-detail-section-heading h3,
    .supplier-finance-source-header h2, .organization-config-subheading > span,
    .reports-section-heading h2, .operational-offering-builder .flight-route-editor-header strong
  ):not(:where(
    .quotation-preview-document, .quotation-preview-document *,
    .itinerary-preview-document, .itinerary-preview-document *,
    .package-preview-sheet, .package-preview-sheet *,
    .payment-receipt-paper, .payment-receipt-paper *
  )) {
    font-size: var(--woolly-font-section) !important;
    font-weight: var(--woolly-weight-semibold) !important;
    line-height: var(--woolly-line-label);
  }
  body.crm-body :is(
    .lead-form-section-header p, .customer-form-section-heading p,
    .quotation-builder-form-section-header p, .itinerary-builder-section-heading p,
    .supplier-finance-source-header p, .reports-section-heading p,
    .reports-section-note, .reports-filter-help, .reports-filter-footer > p,
    .reports-kpi p, .reports-metric-grid dt, .reports-result-count,
    .wds-tab-label > small
  ):not(:where(
    .quotation-preview-document, .quotation-preview-document *,
    .itinerary-preview-document, .itinerary-preview-document *,
    .package-preview-sheet, .package-preview-sheet *,
    .payment-receipt-paper, .payment-receipt-paper *
  )) {
    font-size: var(--woolly-font-help) !important;
    font-weight: var(--woolly-weight-help) !important;
    line-height: var(--woolly-line-body) !important;
  }
  body.crm-body .wds-tab-count:not(:where(
    .quotation-preview-document, .quotation-preview-document *,
    .itinerary-preview-document, .itinerary-preview-document *,
    .package-preview-sheet, .package-preview-sheet *,
    .payment-receipt-paper, .payment-receipt-paper *
  )) {
    font-size: var(--woolly-font-badge) !important;
    font-weight: var(--woolly-weight-semibold) !important;
  }

  /* Routine instructions should support the field rather than compete with
     its label, section heading or validation. Explicit strong/b is untouched. */
  body:is(.crm-body, .auth-body, .error-page) :is(
    .form-text, .lead-form-help, .lead-form-action-note, .login-help-text,
    .customer-import-note, .customer-import-hint,
    .organization-config-note, .organization-integration-note,
    .organization-company-profile-help, .organization-list-scope-note,
    .settings-branding-note, .settings-branding-upload-help,
    .email-config-note, .email-config-state-note, .website-capture-hint,
    .website-capture-result-note, .website-capture-navigation-note,
    .financial-list-summary-note, .reports-filter-help, .reports-section-note,
    .geography-master-section-help, .lead-classification-section-help,
    .lead-classification-order-note, .lead-status-section-help,
    .lead-status-preview-note, .invoice-due-date-help, .supplier-bill-auto-note,
    .supplier-bill-field-hint, .lead-service-change-notice
  ):not(:where(
    .quotation-preview-document, .quotation-preview-document *,
    .itinerary-preview-document, .itinerary-preview-document *,
    .package-preview-sheet, .package-preview-sheet *,
    .payment-receipt-paper, .payment-receipt-paper *
  )) {
    font-weight: var(--woolly-weight-help) !important;
  }

  /* Advisory information is medium-weight; semantic colours and explicit
     emphasis remain owned by the existing components. */
  body:is(.crm-body, .auth-body, .error-page) :is(
    :where(.alert):not(.alert-danger), .crm-info-banner, .crm-info-banner__content,
    .organization-config-access-note, .email-config-default-note,
    .email-config-storage-note, .email-config-inline-warning, .email-config-provider-tip,
    .website-capture-disabled-note, .lead-budget-note, .reports-definition-help,
    .lead-detail-alert, .lead-assignment-access-alert, .lead-assignment-lock-note,
    .lead-frozen-notice, .lead-quotation-handoff-note, .booking-workspace-lock-note,
    .calendar-sidebar-note, .itinerary-builder-lock-notice, .itinerary-create-alert,
    .itinerary-side-note, .itinerary-rules-help, .quotation-workflow-revision-notice,
    .quotation-create-action-note, .quotation-customer-help, .geography-master-notice,
    .geography-master-readonly-note, .lead-classification-shared-note,
    .lead-status-notice, .superadmin-notice, .woolly-platform-access-note,
    .insurance-delete-notice, .rental-delete-notice, .whatsapp-window-notice
  ):not(:where(
    .quotation-preview-document, .quotation-preview-document *,
    .itinerary-preview-document, .itinerary-preview-document *,
    .package-preview-sheet, .package-preview-sheet *,
    .payment-receipt-paper, .payment-receipt-paper *
  )) {
    font-weight: var(--woolly-weight-advisory) !important;
  }

  /* Failures retain clear emphasis without turning every surrounding hint
     bold. This does not change any validation condition or message text. */
  body:is(.crm-body, .auth-body, .error-page) :is(
    .alert-danger, .validation-summary-errors, .field-validation-error, .login-field-error,
    .lead-form-validation, .lead-form-validation-summary, .lead-page-title-validation,
    .customer-form-validation, .department-form-validation, .superadmin-validation,
    .geography-master-validation, .lead-status-validation, .reports-validation,
    .email-config-validation, .email-config-state--error,
    .supplier-bill-validation-summary, .supplier-bill-items-validation,
    .quotation-payment-schedule__validation, .cruise-day-validation,
    .customer-import-error, .customer-import-issue, .customer-import-row-message,
    .guide-work-area-error, .lead-service-traveller-error, .lead-document-modal--error,
    .booking-calendar-error, .dashboard-ajax-error, .dashboard-task-error,
    .notification-center-error, .crm-session-warning__error, .screen-help-error,
    .capture-error, .error-message, .error-session-note
  ):not(:where(
    .quotation-preview-document, .quotation-preview-document *,
    .itinerary-preview-document, .itinerary-preview-document *,
    .package-preview-sheet, .package-preview-sheet *,
    .payment-receipt-paper, .payment-receipt-paper *
  )) {
    font-weight: var(--woolly-weight-validation) !important;
  }
  body:is(.crm-body, .auth-body, .error-page) :is(
    .alert, .crm-info-banner__content, .validation-summary-errors,
    .lead-form-validation, .lead-form-validation-summary, .customer-form-validation,
    .department-form-validation, .superadmin-validation, .geography-master-validation,
    .lead-status-validation, .reports-validation, .email-config-validation,
    .supplier-bill-validation-summary, .supplier-bill-items-validation,
    .customer-import-error, .customer-import-issue, .reports-definition-help,
    .itinerary-rules-help, .lead-detail-alert, .lead-frozen-notice,
    .booking-workspace-lock-note, .itinerary-builder-lock-notice,
    .quotation-workflow-revision-notice, .geography-master-notice, .superadmin-notice
  ) :where(p, ul, ol, li, dt, dd):not(:where(
    .quotation-preview-document, .quotation-preview-document *,
    .itinerary-preview-document, .itinerary-preview-document *,
    .package-preview-sheet, .package-preview-sheet *,
    .payment-receipt-paper, .payment-receipt-paper *
  )) {
    font-weight: inherit !important;
  }
}
