/* QHD readability guardrails.
   Loaded last so legacy template-local compact styles cannot shrink core work text. */
@media screen and (min-width: 1680px) {
  .product-ui .commercial-shell {
    max-width: min(2080px, calc(100vw - 112px));
  }

  .product-ui .query-page-head,
  .product-ui .search-studio,
  .product-ui .search-studio + .query-empty-note {
    width: min(100%, 2080px);
    max-width: min(2080px, calc(100vw - 112px));
  }

  .product-ui :is(.page-head:not(.source-page-head), .page-header:not(.source-page-head), .query-page-head) h1 {
    font-size: clamp(28px, .86vw + 12px, 36px);
  }

  .product-ui :is(.page-head:not(.source-page-head), .page-header:not(.source-page-head), .query-page-head) p,
  .product-ui :is(.panel-head, .operation-card-head, .query-zone-head) p,
  .product-ui .query-empty-note,
  .product-ui .query-scope-note,
  .product-ui .unmatched-vendor-panel,
  .product-ui .db-coverage-hint,
  .product-ui .period-hint {
    font-size: clamp(14px, .22vw + 10px, 16px) !important;
    line-height: 1.6;
  }

  .product-ui :is(.search-studio, .municipal-query, .admin-shell, .system-shell,
    .collection-shell, .vendor-group-shell, .permission-shell) :is(label, input, select, textarea, button, summary) {
    font-size: clamp(15px, .2vw + 11px, 17px);
  }

  .product-ui :is(.button, .primary, .ghost) {
    min-height: 40px;
    font-size: 14px;
  }

  /* Audit and operations screens previously used 8-12px desktop text. */
  .product-ui :is(.audit-summary-grid span, .audit-summary-grid small,
    .audit-filter-form label, .audit-mini-list, .audit-mini-list small,
    .audit-log-table th, .audit-log-table td, .audit-action,
    .audit-detail summary, .audit-detail p, .audit-detail pre,
    .audit-pagination, .audit-delete-bar,
    .ops-health span, .ops-metric span, .ops-metric small,
    .ops-grid p, .ops-batch dt, .ops-batch dd,
    .municipal-filter-grid label, .query-note, .municipal-table-head span,
    .municipal-legend div) {
    font-size: 14px !important;
    line-height: 1.55;
  }

  .product-ui :is(.audit-log-table th, .audit-log-table td,
    .ops-grid th, .ops-grid td, .municipal-table-head + .responsive-table th,
    .municipal-table-head + .responsive-table td) {
    font-size: 15px !important;
  }

  /* Dense regional cards keep their layout but no longer solve width by tiny type. */
  .product-ui :is(.province-vendor-card h3, .province-vendor-card header p,
    .province-vendor-card th, .province-vendor-card td, .vendor-rank,
    .vendor-region-card h3, .vendor-region-card p, .vendor-region-card th,
    .vendor-region-card td, .contract-rate-labels strong,
    .contract-mix-panel .mix-row b, .contract-mix-panel .mix-row span,
    .ranking-column-group h4) {
    font-size: 14px !important;
    line-height: 1.45;
  }

  .product-ui .province-vendor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* System/admin secondary copy must remain readable at the same distance as cards. */
  .product-ui :is(.system-latest, .system-latest *, .admin-inline-note,
    .admin-advanced-tools > summary small, .admin-advanced-tools > summary i,
    .backup-history p, .restore-form, .restore-form *,
    .backup-all-list, .backup-all-list *, .reservation-more-list, .reservation-more-list *,
    .reservation-status-grid, .reservation-status-grid *,
    .reservation-run-list, .reservation-run-list *,
    .reservation-all-list, .reservation-all-list *, .danger-link,
    .scheduled-backup-list, .scheduled-backup-list *,
    .auto-refresh-import-summary span, .auto-refresh-import-summary small) {
    font-size: 14px !important;
    line-height: 1.55;
  }

  .product-ui :is(.innovation-ranking-table, .innovation-analysis-table,
    .vendor-total-ranking-table) th,
  .product-ui :is(.innovation-ranking-table, .innovation-analysis-table,
    .vendor-total-ranking-table) td {
    font-size: clamp(15px, .18vw + 12px, 17px) !important;
  }
}
