/* One mobile control row; desktop, permissions, data and table zoom stay intact. */
.sales-mobile-quickbar { display: none; }

@media (max-width: 767px), (max-width: 1023px) and (max-height: 500px) {
  .sales-statistics-page { padding: 2px 6px 6px; }
  .sales-statistics-page > div { gap: 2px; }
  .sales-theme-clean-business .sales-business-header {
    display: block; padding: 0; border: 0; border-radius: 0;
    background: transparent; box-shadow: none;
  }
  .sales-business-header .sales-header-identity,
  .sales-statistics-page .sales-sheet-tabs { display: none; }

  .sales-business-header .sales-mobile-quickbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 44px;
    align-items: center; gap: 4px; padding: 0;
    border: 0; border-radius: 0; background: transparent;
  }
  .sales-mobile-quickbar [data-slot='native-select-wrapper'] { min-width: 0; width: 100%; }
  .sales-statistics-page .sales-mobile-quickbar :where(select, button) {
    width: 100%; min-width: 0; height: 32px; margin: 0; padding: 0 6px;
    border: 0; border-radius: 4px; background: transparent; box-shadow: none;
    color: var(--sales-clean-text, #24416d);
    /* Dense reading toolbar: scale labels, retain 32px targets and generous expanded tools. */
    font-size: clamp(11px, calc(14px * var(--sales-table-zoom, 1)), 16px) !important;
    line-height: 1.3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    touch-action: manipulation; cursor: pointer;
  }
  .sales-statistics-page .sales-mobile-quickbar select { padding-right: 20px; }
  .sales-mobile-quickbar [data-slot='native-select-icon'] { right: 4px; width: 12px; }
  .sales-mobile-quickbar .sales-mobile-tools-toggle { color: #1d4ed8; font-weight: 600; padding: 0 3px; background: #eaf1ff; }
  .sales-mobile-quickbar :where(select, button):focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
  .sales-mobile-quickbar :where(select, button):active { background: #e4eeff; }

  .sales-business-header .sales-header-tools {
    zoom: var(--sales-table-zoom, 1);
    width: 100%; min-width: 0; margin-top: 8px; padding: 8px;
    gap: max(8px, calc(8px / var(--sales-table-zoom, 1)));
    border: 1px solid var(--sales-clean-border); border-radius: 8px; background: #f6f9ff;
  }
  .sales-business-header:not([data-mobile-tools-open='true']) .sales-header-tools { display: none; }
  .sales-business-header .sales-header-tools > div {
    max-width: 100%; flex-wrap: wrap;
    gap: max(8px, calc(8px / var(--sales-table-zoom, 1)));
  }
  .sales-business-header .sales-header-tools :where(button, a[data-slot='button'], select) {
    min-height: calc(44px / var(--sales-table-zoom, 1));
    min-width: calc(44px / var(--sales-table-zoom, 1));
    height: auto; touch-action: manipulation;
  }
  .sales-business-header .sales-header-tools select {
    min-width: 0; font-size: 16px !important; padding-left: 8px; padding-right: 28px;
  }
  .sales-business-header .sales-header-tools .sales-header-date {
    display: grid;
    grid-template-columns: max(88px, calc(48px / var(--sales-table-zoom, 1))) minmax(0, 1fr);
    width: 100%; padding: 0; border: 0; background: transparent; box-shadow: none;
  }
  .sales-header-date > svg { display: none; }
  .sales-header-date [data-slot='native-select-wrapper'] {
    min-width: 0; width: 100%; border: 1px solid var(--sales-clean-border-soft); border-radius: 8px; background: #fff;
  }
  .sales-header-date[data-period-mode='all'] { grid-template-columns: minmax(0, 1fr) !important; }
  .sales-header-date[data-period-mode='custom'] { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important; }
  .sales-header-date[data-period-mode='custom'] > [data-slot='native-select-wrapper']:first-of-type { grid-column: 1 / -1; }
  .sales-statistics-page .sales-workbook-panel { padding: 0; border: 0; border-radius: 8px; box-shadow: none; }
  .sales-statistics-page .sales-workbook-panel::before { display: none; }
}
@media (max-width: 479px) {
  .sales-statistics-page[data-mobile-zoom-large='true'] .sales-header-date { grid-template-columns: minmax(0, 1fr) !important; }
  .sales-statistics-page[data-mobile-zoom-large='true'] .sales-header-date > span { text-align: center; }
}
