/* Historical records stay in a table on every screen size. */
.member-app .xm-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--outline);
  border-radius: 10px;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.member-app .xm-table-wrap:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.member-app .xm-record-table {
  display: table;
  width: 100%;
  min-width: 680px;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: auto;
  color: var(--text);
  font-size: 12px;
  line-height: 1.65;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.member-app .xm-record-table thead { display: table-header-group; }
.member-app .xm-record-table tbody { display: table-row-group; }
.member-app .xm-record-table tr { display: table-row; }
.member-app .xm-record-table :is(th, td) {
  display: table-cell;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--outline);
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;
}
.member-app .xm-record-table th {
  padding-top: 13px;
  padding-bottom: 13px;
  color: var(--secondary);
  background: var(--input);
  font-size: 11px;
  font-weight: 550;
}
.member-app .xm-record-table tbody tr:last-child td { border-bottom: 0; }
.member-app .xm-record-table tbody tr:hover { background: var(--surface-hover); }
.member-app .xm-record-table .xm-table-title {
  min-width: 180px;
  max-width: 320px;
  color: var(--heading);
  font-weight: 550;
  white-space: normal;
  overflow-wrap: anywhere;
}
.member-app .xm-record-table .xm-table-reference {
  max-width: 290px;
  color: var(--secondary);
  white-space: normal;
  overflow-wrap: anywhere;
}
.member-app .xm-record-table .xm-table-amount {
  text-align: right;
  color: var(--heading);
}
.member-app .xm-record-table th.xm-table-amount { color: var(--secondary); }
.member-app .xm-record-table .xm-table-actions { white-space: nowrap; }
.member-app .xm-record-table .xm-table-actions > :is(button, a) { margin-inline-end: 6px; }
.member-app .xm-record-table .xm-table-actions > :is(button, a):last-child { margin-inline-end: 0; }
.member-app .xm-record-table .n-inner-button {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.6;
}
.member-app .xm-record-table .n-status { white-space: nowrap; }
.member-app .xm-record-table .xm-table-empty {
  padding: 40px 20px;
  color: var(--secondary);
  font-weight: 400;
  text-align: center;
  white-space: normal;
}
.member-app .xm-tickets-table { min-width: 850px; }
.member-app .xm-traffic-table { min-width: 560px; }
.member-app .xm-orders-table { min-width: 850px; }
.member-app .xm-commissions-table { min-width: 420px; }
@media (max-width: 680px) {
  .member-app .xm-record-table :is(th, td) { padding: 13px 14px; }
  .member-app .xm-record-table .n-inner-button { min-height: 40px; padding: 8px 11px; }
  .member-app .xm-record-table .xm-table-empty { padding: 32px 14px; }
}
.member-app .n-commission-history { min-width: 0; max-width: 100%; }

/* Narrow records keep real table columns and show every field within the row. */
.member-app .xm-record-table :is(.xm-table-mobile-cell, .xm-table-mobile-content) { display: none; }
@media (max-width: 1023px) {
  .member-app .xm-table-wrap { overflow: visible; }
  .member-app .xm-table-wrap .xm-record-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    table-layout: fixed;
    font-size: 13px;
  }
  .member-app .xm-table-wrap .xm-record-table :is(th, td) {
    min-width: 0;
    max-width: none;
    padding: 12px 10px;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .member-app .xm-table-wrap .xm-record-table th { font-size: 12px; }
  .member-app .xm-record-table .xm-table-desktop-cell { display: none; }
  .member-app .xm-record-table .xm-table-mobile-cell { display: table-cell; }
  .member-app .xm-record-table .xm-table-mobile-content { display: block; }
  .member-app :is(.xm-orders-table, .xm-tickets-table) th.xm-table-mobile-cell { width: 64%; }
  .member-app :is(.xm-orders-table, .xm-tickets-table) th.xm-table-actions { width: 36%; }
  .member-app .xm-traffic-table th:first-child { width: 34%; }
  .member-app .xm-traffic-table th.xm-table-mobile-cell { width: 38%; }
  .member-app .xm-traffic-table th:last-child { width: 28%; }
  .member-app .xm-commissions-table th:first-child { width: 38%; }
  .member-app .xm-record-table .xm-record-meta {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
  }
  .member-app .xm-record-table .xm-record-meta > div { display: grid; gap: 2px; min-width: 0; }
  .member-app .xm-record-table .xm-record-meta :is(dt, dd) { min-width: 0; margin: 0; overflow-wrap: anywhere; }
  .member-app .xm-record-table :is(.xm-record-meta dt, .xm-record-label) { display: block; color: var(--secondary); font-size: 12px; }
  .member-app .xm-record-table .xm-record-meta dd { color: var(--text); font-size: 13px; }
  .member-app .xm-record-table .xm-record-meta strong { color: var(--heading); font-size: inherit; font-weight: 550; }
  .member-app .xm-record-table .xm-record-reference { color: var(--secondary); }
  .member-app .xm-record-table .xm-record-outcome { display: grid; gap: 12px; min-width: 0; margin-bottom: 12px; }
  .member-app .xm-record-table .xm-record-outcome > div { display: grid; justify-items: start; gap: 4px; min-width: 0; }
  .member-app .xm-record-table .xm-record-outcome strong { color: var(--heading); font-size: 13px; font-weight: 550; }
  .member-app .xm-table-wrap .xm-record-table .n-status { max-width: 100%; padding: 4px 6px; white-space: normal; overflow-wrap: anywhere; font-size: 12px; }
  .member-app .xm-table-wrap .xm-record-table .n-inner-button {
    min-width: 0;
    min-height: 44px;
    max-width: 100%;
    margin: 0;
    padding: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.4;
  }
  .member-app .xm-record-table thead th:first-child { border-top-left-radius: 9px; }
  .member-app .xm-record-table thead th:last-child { border-top-right-radius: 9px; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  .member-app :is(.xm-orders-table, .xm-tickets-table) .xm-record-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
}
