/* UI_TYPOGRAPHY_READABILITY_ROLLOUT: crm-ui-typography-readability-1 · crm-ui-typography-readability-beta */

html.crm-ui-typography-readability-beta {
  --ui-text-xs: 12px;
  --ui-text-sm: 13px;
  --ui-text-md: 14px;
  --ui-text-lg: 15px;
}

html.crm-ui-typography-readability-beta body {
  font-size: 14px;
}

html.crm-ui-typography-readability-beta :is(.button, input, select, textarea) {
  font-size: 14px;
}

html.crm-ui-typography-readability-beta :is(
  .orders-list__row > span,
  .contacts-cell,
  .finance-cell,
  .company-staff-table__row,
  .settings-table > div
) {
  font-size: 13px;
}

html.crm-ui-typography-readability-beta :is(
  .orders-list__row--head > span,
  .orders-list__row--head > .table-sort,
  .contacts-row--head .contacts-cell,
  .contacts-row--head .table-sort
) {
  font-size: 12px;
}

html.crm-ui-typography-readability-beta :is(
  .manager-dashboard__eyebrow,
  .manager-kpi span,
  .manager-kpi em,
  .manager-dashboard__row em,
  .manager-dashboard__section-head span,
  .home-attention-strip__head p,
  .contacts-summary,
  .finance-kpi span,
  .finance-kpi em
) {
  font-size: 13px;
}

html.crm-ui-typography-readability-beta .manager-dashboard-period__range-card {
  font-size: 13px;
}

html.crm-ui-typography-readability-beta .manager-dashboard-period__range-card input {
  font-size: inherit;
}

/* NS Warehouse shell and catalog: keep density, raise the optical floor. */
html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(.nsw-mainbar__item, .nsw-nav__item) {
  font-size: 13px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot .nsw-mainbar__brand-copy strong {
  font-size: 15px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(.nsw-mainbar__brand-copy small, .nsw-mainbar__meta) {
  font-size: 11px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(
  .nsw-catalog-actions .button,
  .nsw-bulk-toolbar .button,
  .nsw-editor-head .button,
  .nsw-modal .button,
  .nsw-catalog-search input,
  .nsw-filter-panel select,
  .nsw-bulk-toolbar select,
  .nsw-category-root,
  .nsw-category-name
) {
  font-size: 13px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(.nsw-filter-panel label, .nsw-category-empty) {
  font-size: 12px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot .nsw-catalog-table {
  font-size: 12px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot .nsw-catalog-table :is(th, .nsw-type-badge) {
  font-size: 11px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot .nsw-catalog-table :is(th, td) {
  height: 38px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(.nsw-category-count, .nsw-catalog-pagination) {
  font-size: 11px;
}

/* NS Warehouse receipts: do not touch label designer or physical print sizes. */
html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(
  .nsw-document-toolbar h1,
  .nsw-document-editor-header h1,
  .nsw-receipt-list-title h1
) {
  font-size: 24px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(
  .nsw-document-toolbar p,
  .nsw-document-editor-header p,
  .nsw-receipt-lines p,
  .nsw-back-link,
  .nsw-pagination
) {
  font-size: 12px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot .nsw-receipt-kpis span {
  font-size: 11px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot .nsw-receipt-kpis strong {
  font-size: 18px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot .nsw-receipt-kpis small {
  font-size: var(--ui-text-2xs, 10px);
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(
  .nsw-receipt-tabs button,
  .nsw-receipt-search input,
  .nsw-receipt-table,
  .nsw-back-link,
  .nsw-receipt-product-search > input,
  .nsw-receipt-product-results strong,
  .nsw-receipt-product-tools > .button
) {
  font-size: 13px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(
  .nsw-receipt-tabs b,
  .nsw-receipt-table th,
  .nsw-document-status,
  .nsw-receipt-link + small,
  .nsw-receipt-product-results small
) {
  font-size: 11px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot .nsw-receipt-link {
  font-size: 13px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(
  .nsw-receipt-document-fields label > span,
  .nsw-receipt-item-main label > span,
  .nsw-receipt-item-extra label > span,
  .nsw-receipt-bottom > label > span
) {
  font-size: 12px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(
  .nsw-receipt-document-fields input,
  .nsw-receipt-document-fields select,
  .nsw-receipt-item input,
  .nsw-receipt-item select,
  .nsw-receipt-bottom textarea
) {
  min-height: 36px;
  font-size: 13px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot .nsw-receipt-lines h2 {
  font-size: 16px;
}

html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(
  .nsw-receipt-commandbar__meta small,
  .nsw-receipt-comment small,
  .nsw-receipt-totals small
) {
  font-size: 11px;
}

@media (max-width: 760px) {
  html.crm-ui-typography-readability-beta :is(
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea,
    .manager-dashboard-period__range-card input
  ) {
    font-size: 16px;
  }

  html.crm-ui-typography-readability-beta .mobile-bottom-nav span {
    font-size: 11px;
  }

  html.crm-ui-typography-readability-beta .app-topbar__tenant select {
    font-size: 16px;
  }

  html.crm-ui-typography-readability-beta #nsWarehouseRoot :is(
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea
  ) {
    font-size: 16px;
  }

  html.crm-ui-typography-readability-beta .contacts-row--modern:not(.contacts-row--head) > .contacts-cell:nth-child(7),
  html.crm-ui-typography-readability-beta .orders-list__phone-line em,
  html.crm-ui-typography-readability-beta .orders-list__person > strong,
  html.crm-ui-typography-readability-beta .orders-list__mobile-accepted,
  html.crm-ui-typography-readability-beta .orders-list__due > strong {
    font-size: 12px;
  }

  html.crm-ui-typography-readability-beta .contacts-row--modern:not(.contacts-row--head) > .contacts-cell:nth-child(4)::before,
  html.crm-ui-typography-readability-beta .contacts-row--modern:not(.contacts-row--head) > .contacts-cell:nth-child(5)::before,
  html.crm-ui-typography-readability-beta .contacts-row--modern:not(.contacts-row--head) > .contacts-cell:nth-child(6)::before,
  html.crm-ui-typography-readability-beta .orders-list__price small,
  html.crm-ui-typography-readability-beta .orders-list__due small,
  html.crm-ui-typography-readability-beta .orders-list__person > small,
  html.crm-ui-typography-readability-beta .orders-list__urgent {
    font-size: 11px;
  }
}

/* Screen readability must never alter document or label print geometry. */
@media print {
  html.crm-ui-typography-readability-beta {
    --ui-text-xs: 11px;
    --ui-text-sm: 12px;
    --ui-text-md: 13px;
    --ui-text-lg: 14px;
  }

  html.crm-ui-typography-readability-beta body {
    font-size: 13px;
  }
}
