.table-sort-control { display:inline-flex; gap:var(--space-1); align-items:center; justify-content:inherit; padding:0; margin:0; border:0; background:transparent; color:inherit; font:inherit; font-weight:inherit; text-align:inherit; white-space:inherit; cursor:pointer; box-shadow:none; text-decoration:none; }
.table-sort-control:hover { background:transparent; color:var(--color-primary); text-decoration:none; }
.table-sort-control:focus-visible { outline:2px solid var(--color-focus); outline-offset:3px; border-radius:2px; }
.table-sort-arrow { flex:0 0 auto; font-size:var(--font-small); opacity:.6; }
th[aria-sort=ascending] .table-sort-arrow, th[aria-sort=descending] .table-sort-arrow { opacity:1; color:var(--color-primary); }
table[data-table-key] tfoot th, table[data-table-key] tfoot td { background:var(--color-surface-subtle); border-top:1px solid var(--color-border); font-weight:var(--weight-semibold); }

.table-sort-arrow::after { content:"↕"; }
th[aria-sort=ascending] .table-sort-arrow::after { content:"↑"; }
th[aria-sort=descending] .table-sort-arrow::after { content:"↓"; }

.table-load-status { min-height:1px; padding:var(--space-2) var(--space-3); color:var(--color-muted); font-size:var(--font-small); text-align:center; }
.table-load-status:empty { padding:0; }
[data-stream-key] { overflow-anchor:none; }

/* One width contract, independent of the full-width containing panel. */
table[data-table-key][data-column-layout=ready] {
  table-layout:fixed; width:var(--table-content-width); min-width:0; max-width:none;
}
table[data-table-key][data-column-layout=ready] > :is(thead,tbody,tfoot) > tr > :is(th,td) {
  box-sizing:border-box; width:auto; min-width:0; max-width:none; padding:8px 12px;
  white-space:normal; overflow-wrap:anywhere; vertical-align:top;
}
table[data-table-key][data-column-layout=ready] > thead > tr > th { position:relative; padding-right:20px; }
table[data-column-layout=ready] .table-sort-control { max-width:100%; white-space:normal; }
table[data-column-layout=ready] > :is(tbody,tfoot) > tr > :is(.numeric,.money,.number) { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.column-resizer { position:absolute; right:0; top:0; bottom:0; width:9px; cursor:col-resize; touch-action:none; z-index:2; }
.column-resizer::after { content:''; position:absolute; right:3px; top:20%; bottom:20%; border-right:1px solid var(--color-border); }
.column-resizer:hover::after,.column-resizer:focus-visible::after { border-color:var(--color-primary); border-width:2px; }
.column-resizer:focus-visible { outline:2px solid var(--color-focus); outline-offset:-2px; }
.resizing-column,.resizing-column * { cursor:col-resize !important; user-select:none !important; }
.table-width-reset { display:block; margin:4px 0 8px auto; padding:4px 8px; min-height:28px; background:transparent; border:0; color:var(--color-muted); font-size:var(--font-small); }
.table-width-reset[hidden] { display:none; }
.table-width-reset:hover { color:var(--color-primary); background:var(--color-surface-subtle); }

/* Financial presentation: every amount remains supplied by the original report. */
:root { --table-level-1:var(--color-accent-soft); --table-level-2:#f0f4f8; --table-level-3:var(--color-surface-subtle); --table-total-bg:var(--color-accent-soft); }
table[data-account-tree] > tbody > tr[data-account-kind=group]:not([data-total-kind]) > :is(td,th) { font-weight:var(--weight-semibold); background:var(--table-level-3); }
table[data-account-tree] > tbody > tr[data-account-kind=group]:not([data-total-kind])[data-level="1"] > :is(td,th) { font-weight:var(--weight-bold); background:var(--table-level-1); }
table[data-account-tree] > tbody > tr[data-account-kind=group]:not([data-total-kind])[data-level="2"] > :is(td,th) { background:var(--table-level-2); }
table[data-account-tree] > tbody > tr[data-account-kind=account] > :is(td,th) { font-weight:var(--weight-normal); background:var(--color-surface); }
table[data-account-tree] > tbody > tr[data-account-kind=account]:hover > :is(td,th) { background:var(--color-surface-subtle); }
table[data-table-key][data-account-tree] > tbody > tr > .account-label { padding-left:calc(12px + var(--account-indent, 0px)); }
table[data-account-tree] [data-level="2"] { --account-indent:18px; }
table[data-account-tree] [data-level="3"] { --account-indent:36px; }
table[data-account-tree] [data-level="4"] { --account-indent:54px; }
table[data-account-tree] [data-level="5"] { --account-indent:72px; }
.account-tree-toggle { display:inline-flex; align-items:center; justify-content:center; width:22px; min-height:22px; padding:0; margin:0 4px 0 0; border:0; background:transparent; color:inherit; font:inherit; }
.account-tree-toggle:focus-visible { outline:2px solid var(--color-focus); }
table[data-table-key] > :is(tfoot,tbody) > :is(.total-row,[data-total-kind]) > :is(th,td),
table[data-table-key] > tfoot > tr > :is(th,td) {
  font-weight:var(--weight-bold); background:var(--table-total-bg); border-top:2px solid var(--color-border); padding:9px 12px;
}
table[data-table-key] > tbody > [data-total-kind=subtotal] > :is(th,td),
table[data-table-key] > tbody > [data-total-kind=result] > :is(th,td) {
  background:var(--color-surface-subtle); font-weight:var(--weight-semibold); border-top:1px solid var(--color-border);
}
table[data-table-key] > :is(tbody,tfoot) > [data-total-kind=control] > :is(th,td) { border-top:3px double var(--color-border); }
.tenant-lease-values { list-style:none; padding:0; margin:0; }
.tenant-lease-values li + li { margin-top:4px; }
.tenant-lease-values small { display:block; color:var(--color-muted); }
@media print { .column-resizer,.table-width-reset,.account-tree-toggle { display:none; } table[data-account-tree] tr[hidden] { display:table-row; } }
table[data-account-tree] > tbody > tr[data-account-kind=group]:not([data-total-kind])[data-level="0"] > :is(td,th) { background:var(--table-level-1); font-weight:var(--weight-bold); }
table[data-table-key] > tbody > tr.total > :is(th,td) { font-weight:var(--weight-bold); background:var(--table-total-bg); border-top:2px solid var(--color-border); }
table[data-table-key] > :is(tbody,tfoot) > tr > [data-column-numeric] { text-align:right; font-variant-numeric:tabular-nums; }

/* The expanded six-column contract context uses the full available panel. */
.tenant-identity > :is(.tenant-contracts,.tenant-units) { grid-column:1 / -1; min-width:0; }
