@media (max-width: 760px) {
  * {
    box-sizing: border-box;
  }

  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .wpz-shell,
  body > .card,
  main {
    width: 100%;
    max-width: none;
  }

  .wpz-shell {
    padding: 14px 10px 32px;
  }

  body:not(:has(.wpz-shell)) {
    padding: 12px;
  }

  body > h1,
  body > p,
  body > .card {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  h1,
  .wpz-title {
    font-size: 20px;
    line-height: 1.2;
  }

  h2 {
    font-size: 18px;
    line-height: 1.25;
  }

  .wpz-card,
  section,
  .card {
    width: 100%;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 14px;
    border-radius: 8px;
  }

  .wpz-stack,
  .wpz-shell,
  main,
  form {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  input,
  select,
  textarea,
  button,
  .button,
  .home-link,
  .wpz-common-link {
    min-height: 44px;
    font-size: 16px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    min-height: 0;
  }

  input,
  select,
  textarea {
    max-width: 100%;
  }

  button,
  .button {
    white-space: normal;
    text-align: center;
  }

  .row,
  .toolbar,
  .summary,
  .section-head,
  .toolbar-actions {
    gap: 8px;
  }

  .row > *,
  .toolbar > *,
  .toolbar label,
  .toolbar input,
  .toolbar select,
  .toolbar button,
  .section-head .button,
  .section-head button {
    min-width: 0;
  }

  .row > label,
  .toolbar > label,
  .actions > label,
  .ctrls > label,
  .row > input,
  .row > select,
  .row > button,
  .row > .button,
  .toolbar > input,
  .toolbar > select,
  .toolbar > button,
  .toolbar > .button {
    flex: 1 1 180px;
  }

  .home-links,
  .wpz-grid,
  .checks,
  .permBoard,
  .detail-grid,
  .photo-grid,
  .balls-cards,
  .settlement-summary {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .balls-card,
  .settlement-total-card,
  .settlement-location-block {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .table-wrap,
  .tableWrap,
  [style*="overflow:auto"],
  [style*="overflow: auto"] {
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  table {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .compact-table table,
  table.compact-table {
    min-width: 520px;
  }

  td,
  th {
    padding: 10px 8px;
  }

  .wpz-common-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .wpz-common-nav-inner {
    flex-wrap: nowrap;
    align-items: center;
    padding: 8px 10px;
    width: max-content;
    min-width: 100%;
  }

  .wpz-common-brand,
  .wpz-common-link {
    flex: 0 0 auto;
  }

  .wpz-common-location {
    flex: 0 0 auto;
    width: auto;
  }

  .wpz-common-location select {
    max-width: 170px;
  }

  .calendar {
    grid-template-columns: 1fr !important;
  }

  .dow {
    display: none;
  }

  .day {
    min-height: 72px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  .modal-inner {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 20px);
    overflow: auto;
    border-radius: 12px;
  }
}

@media (max-width: 420px) {
  .settlement-total-grid,
  .balls-card-grid {
    grid-template-columns: 1fr !important;
  }

  table {
    min-width: 100%;
  }

  .summary,
  .row,
  .toolbar,
  .actions,
  .ctrls {
    align-items: stretch !important;
  }

  .summary > *,
  .row > *,
  .toolbar > *,
  .actions > *,
  .ctrls > * {
    width: 100%;
  }
}
