/* Advisor table — all rules scoped under .styled-table-wrap / .styled-table */
.styled-table-wrap {
  --at-ink: #1c2733;
  --at-muted: #5b6876;
  --at-head-bg: #14304a;
  --at-head-ink: #ffffff;
  --at-line: #dde3ea;
  --at-stripe: #f5f8fb;
  --at-hover: #e8f0f8;
  --at-accent: #1f6fb2;

  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--at-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 48, 74, 0.08);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--at-ink);
}

.styled-table-wrap:focus-visible {
  outline: 2px solid var(--at-accent);
  outline-offset: 2px;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.styled-table caption {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 1.125rem;
  font-weight: 600;
  background: #fff;
  border-bottom: 1px solid var(--at-line);
}

.styled-table thead th {
  position: sticky;
  top: 0;
  padding: 0.85rem 1rem;
  background: var(--at-head-bg);
  color: var(--at-head-ink);
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}

.styled-table th.num,
.styled-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.styled-table tbody th,
.styled-table tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--at-line);
  vertical-align: middle;
  text-align: left;
}

.styled-table tbody th {
  font-weight: 600;
}

.styled-table tbody td.num {
  text-align: right;
}

.styled-table tbody tr:nth-child(even) {
  background: var(--at-stripe);
}

.styled-table tbody tr:hover {
  background: var(--at-hover);
}

.styled-table tbody tr:last-child th,
.styled-table tbody tr:last-child td {
  border-bottom: 0;
}

.styled-table a {
  color: var(--at-accent);
  text-decoration: none;
  white-space: nowrap;
}

.styled-table a:hover,
.styled-table a:focus-visible {
  text-decoration: underline;
}

/* Tablet: tighten spacing */
@media (max-width: 1024px) {
  .styled-table { font-size: 0.875rem; }
  .styled-table thead th,
  .styled-table tbody th,
  .styled-table tbody td { padding: 0.65rem 0.75rem; }
}

/* Mobile: each row becomes a labeled card */
@media (max-width: 720px) {
  .styled-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .styled-table,
  .styled-table tbody,
  .styled-table tr,
  .styled-table th,
  .styled-table td {
    display: block;
    width: 100%;
  }

  .styled-table caption {
    border: 1px solid var(--at-line);
    border-radius: 8px;
    margin-bottom: 0.75rem;
  }

  /* Hide header visually but keep it for screen readers */
  .styled-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .styled-table tbody tr {
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid var(--at-line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(20, 48, 74, 0.08);
  }

  .styled-table tbody tr:nth-child(even),
  .styled-table tbody tr:hover { background: #fff; }

  .styled-table tbody th {
    padding: 0.85rem 1rem;
    background: var(--at-head-bg);
    color: var(--at-head-ink);
  }

  .styled-table tbody th::before { content: none; }

  .styled-table tbody td,
  .styled-table tbody td.num {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1rem;
    text-align: right;
    white-space: normal;
  }

  .styled-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 45%;
    text-align: left;
    font-weight: 600;
    color: var(--at-muted);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .styled-table tbody tr { transition: background-color 0.15s ease; }
}

/* ---- Sortable headers (added by table-sort.js) ---- */
.styled-table .sort-btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.styled-table th.num .sort-btn { flex-direction: row-reverse; }

.styled-table .sort-btn::after {
  content: "\2195";            /* up/down arrow: sortable */
  opacity: 0.45;
  font-size: 0.8em;
}

.styled-table th[aria-sort="ascending"] .sort-btn::after  { content: "\25B2"; opacity: 1; }
.styled-table th[aria-sort="descending"] .sort-btn::after { content: "\25BC"; opacity: 1; }

.styled-table .sort-btn:hover::after { opacity: 1; }

.styled-table .sort-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 2px;
}
