/* Data tables: sticky header and first column, horizontal scroll on phones */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14.5px; }
table.data th, table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface);
  font-weight: 600; font-size: 13.5px; color: var(--ink); text-align: right; border-bottom: 1px solid var(--line-strong);
}
table.data thead th:first-child, table.data td:first-child { text-align: left; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink); }
table.data th .arrow { font-size: 10px; margin-left: 3px; color: var(--brand); }
table.data td:first-child, table.data th:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}
table.data thead th:first-child { z-index: 3; background: var(--surface); }
table.data tbody tr:nth-child(even) td { background: var(--surface-2); }
table.data tbody tr:hover td { background: var(--brand-soft); }
table.data td.name a { color: var(--brand); font-weight: 500; }
table.data td.name .tk { color: var(--ink-3); font-size: 12px; margin-left: 6px; }
table.data tr.highlight td { background: var(--brand-soft); }
table.data .idx { color: var(--ink-3); width: 1%; padding-right: 0; }

/* Financial statements */
table.fin td:first-child { min-width: 190px; color: var(--ink-2); }
table.fin tr.total td { font-weight: 600; color: var(--ink); }
table.fin tr.total td:first-child { color: var(--ink); }
table.fin tr.sub td { color: var(--ink-3); font-size: 13px; }
table.fin tr.sub td:first-child { padding-left: 24px; }
table.fin th a { color: inherit; }
table.fin th .src { color: var(--ink-3); font-weight: 400; margin-left: 2px; }
table.fin th .src:hover { color: var(--accent); text-decoration: none; }

.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px 0; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-3); }
.pager { display: flex; gap: 6px; align-items: center; }

@media (max-width: 760px) {
  table.data { font-size: 13.5px; }
  table.data th, table.data td { padding: 9px 10px; }
  table.data td.name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  table.data td.name .tk { display: block; margin: 0; }
  table.fin td:first-child { min-width: 140px; max-width: 160px; white-space: normal; }
  .table-wrap { border-radius: var(--r-sm); }
}
