/* ==============================================================================
   Shared phone / tablet layout rules for every signed-in panel.
   Tables keep their columns on computers; on phones and tablets each row becomes
   a card whose cells are labelled from the table header (see responsive.js).
   ============================================================================== */

html { -webkit-text-size-adjust: 100%; }
img, svg, video { max-width: 100%; }
input, select, textarea { font-size: max(16px, 1em); } /* stops iPhone zooming into fields */
.break-anywhere { overflow-wrap: anywhere; }

@media (max-width: 1023px) {
  table.rt-cards { min-width: 0 !important; width: 100% !important; }
  table.rt-cards thead { display: none; }
  table.rt-cards, table.rt-cards tbody, table.rt-cards tr, table.rt-cards td { display: block; width: 100%; }
  table.rt-cards tbody { border: 0 !important; }
  table.rt-cards tr {
    border: 1px solid #e5e7eb; border-radius: 14px; background: #fff;
    padding: 6px 14px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  }
  /* Label sits in the left 36% of the card; the cell's own content flows normally
     in the rest, so cells holding several pieces (name + phone + badge) never squash. */
  table.rt-cards td {
    position: relative !important; padding: 8px 0 8px 38% !important; min-height: 34px;
    border: 0 !important; text-align: left !important; white-space: normal !important;
    background: transparent !important; overflow-wrap: anywhere; min-width: 0; left: auto !important;
  }
  table.rt-cards td + td { border-top: 1px dashed #eef2f7 !important; }
  table.rt-cards td::before {
    content: attr(data-label); position: absolute; left: 0; top: 9px; width: 34%;
    font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #6b7280;
    line-height: 1.35; overflow-wrap: normal; word-break: keep-all; letter-spacing: .02em;
  }
  table.rt-cards td[data-label=""], table.rt-cards td[colspan] { padding-left: 0 !important; min-height: 0; }
  table.rt-cards td[data-label=""]::before, table.rt-cards td[colspan]::before { content: none; }
  table.rt-cards td[colspan] { text-align: center !important; }
  table.rt-cards td .flex > * { min-width: 0; }
  table.rt-cards td .truncate { white-space: normal; overflow: visible; text-overflow: clip; }
  table.rt-cards td > * { max-width: 100%; }
  table.rt-cards td .text-right, table.rt-cards td .justify-end { text-align: left; justify-content: flex-start; }

  /* Tablets: wider cards, so the label column gets a fixed width */
  @media (min-width: 640px) { table.rt-cards td { padding-left: 170px !important; } table.rt-cards td::before { width: 155px; } }
}
