/* Keep navigation names visible in the compact desktop/tablet sidebar. */
@media (min-width: 651px) and (max-width: 1000px) {
  .portal nav button { flex-direction: column; gap: 4px; padding: 8px 2px; }
  .portal nav button span { display: inline; font-size: 11px; line-height: 1.3; white-space: nowrap; }
}

/* Mobile order cards use the same labels as their desktop columns. */
@media (max-width: 650px) {
  .ui-agent #orders td[data-label]::before { content: attr(data-label); }
  .ui-agent #traffic-orders td[colspan]::before { content: none; }
}

/* Keep account exit reachable while the phone navigation scrolls independently. */
@media (max-width: 650px) {
  .ui-agent .portal > aside { overflow: hidden; gap: 6px; }
  .ui-agent .portal > aside > .brand { flex: 0 0 auto; margin-right: 0; }
  .ui-agent .portal > aside > nav { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
  .ui-agent .portal > aside > .logout {
    display: flex; flex: 0 0 auto; align-items: center; justify-content: center;
    margin: 0; min-height: 44px; padding: 8px 10px; white-space: nowrap;
  }
  .ui-agent .customer-table .traffic-transfer-control {
    grid-template-columns: minmax(0, 1fr) 52px;
    width: 132px; max-width: 100%; flex: 0 1 132px;
  }
  .ui-agent .customer-table .traffic-transfer-control input {
    width: 100%; min-width: 0; height: 44px; padding: 0 6px; font-size: 16px;
  }
  .ui-agent .customer-table .traffic-transfer-control button {
    height: 44px; min-height: 44px; padding: 0 8px; font-size: 14px;
  }
}

/* Search stays readable before two equally sized filter controls. */
@media (max-width: 480px) {
  .ui-agent .customer-list-head .customer-directory-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  }
  .ui-agent .customer-list-head .customer-directory-toolbar > input[type="search"] {
    grid-column: 1 / -1; width: 100%; min-width: 0; height: 44px;
    padding: 0 12px; font-size: 16px;
  }
  .ui-agent .customer-list-head .customer-directory-toolbar > select:not(.warm-select-native),
  .ui-agent .customer-list-head .customer-directory-toolbar .warm-select-trigger {
    min-height: 44px; height: 44px; padding: 0 10px; font-size: 14px;
  }
}

/* A touch user can discover price editing before the first tap. */
@media (hover: none) {
  .ui-agent .invitation-row .invitation-price > button[data-price-key]::after,
  .ui-agent .invitation-row .invitation-flow-main > button[data-price-key]::after { opacity: .7; }
}
