/* Mobile UI final overrides - keep person action buttons in one row */
@media (max-width: 1199.98px) {
  .sidebar-collapse-btn {
    display: none !important;
  }

  .mobile-bottom-nav {
    z-index: 3000 !important;
    pointer-events: auto !important;
  }

  .mobile-bottom-nav button {
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }

  .mobile-fab {
    z-index: 3001 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }

  .btn-close {
    min-width: 40px !important;
    min-height: 40px !important;
    background-size: 14px !important;
    touch-action: manipulation !important;
  }

  #gisRefreshBtn,
  .gis-search-clear {
    min-width: 40px !important;
    min-height: 40px !important;
    touch-action: manipulation !important;
  }

  .household-check,
  .person-check {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    margin: 0 !important;
    touch-action: manipulation !important;
  }

  .gis-search-field input,
  .gis-search-wrap input {
    min-height: 44px !important;
  }

  .screen {
    padding-bottom: 92px !important;
  }

  body.mobile-screen-changing .screen {
    transition: opacity .16s ease, transform .16s ease;
  }

  .mobile-refresh-indicator {
    position: fixed;
    left: 50%;
    top: -44px;
    z-index: 3002;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(11,107,58,.16);
    border-radius: 999px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 12px 28px rgba(15,23,42,.14);
    color: #526071;
    font-size: 13px;
    font-weight: 750;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
  }

  .mobile-refresh-indicator.ready {
    color: var(--brand, #0b6b3a);
  }

  .mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2990;
    border: 0;
    background: rgba(15,23,42,.28);
  }

  .mobile-sheet-backdrop.d-none {
    display: none !important;
  }

  .mobile-bottom-sheet {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    z-index: 2995 !important;
    max-height: min(76vh, 620px) !important;
    overflow: auto !important;
    padding: 16px !important;
    border: 1px solid rgba(223,231,226,.92) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 22px 60px rgba(15,23,42,.24) !important;
    transform: translateY(18px);
    opacity: 0;
    transition: transform .18s ease, opacity .18s ease;
  }

  .mobile-bottom-sheet.is-open {
    transform: translateY(0);
    opacity: 1;
  }

  tr td.text-center.text-muted,
  .report-empty-state {
    border-radius: 14px !important;
    background: #f7faf8 !important;
    color: #667085 !important;
    font-weight: 700 !important;
  }

  #personRows tr.ds-group-row > td {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  #personRows .ds-group-header {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 4px 10px !important;
  }

  #personRows .ds-group-header span {
    min-width: 0 !important;
  }

  #personRows .ds-group-header small {
    display: block !important;
    grid-column: 1 / -1 !important;
    margin-top: 2px !important;
  }

  #personRows tr.ds-person-row {
    grid-template-columns: 1fr !important;
  }

  #personRows tr.ds-person-row > td {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }

  #personRows tr.ds-person-row > td.ds-action-cell,
  #personRows td.ds-action-cell {
    grid-area: auto / 1 / auto / -1 !important;
    grid-column-start: 1 !important;
    grid-column-end: -1 !important;
    width: 100% !important;
    max-width: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    justify-content: stretch !important;
  }

  #personRows tr.ds-person-row > td.ds-action-cell::before,
  #personRows td.ds-action-cell::before {
    display: none !important;
    content: none !important;
  }

  #personRows tr.ds-person-row > td.ds-action-cell .btn,
  #personRows td.ds-action-cell .btn {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
  }
}
