/* feature/device-records — the device table and its cells in the B look (tokens-b, light and dark).
 * Linked right after tasks.css. Scoped to a site's tables (#site-body .tw) so the shared .tw/.cell
 * classes used by other pages keep their rules.
 *
 * A table is a card with hairline rows: quiet sans column labels on a hairline (no header band, no
 * vertical cell borders), sans body cells with tabular numbers, B chips that keep their colour, and
 * switches that use the B primary when on. On a phone the card drops its frame and the table
 * scrolls inside the page gutter (device tables have a user-chosen column set, so rows do not stack).
 */
body[data-ui="b"] #site-body .tw{background:var(--ub-surface);border:1px solid var(--ub-border);border-radius:var(--ub-radius-lg)}
body[data-ui="b"] #site-body .tw table{font:var(--ub-fs-table)/1.45 var(--ub-font-sans);color:var(--ub-text)}
/* The header row stays sticky (.tw thead tr), so it needs the card's own surface: transparent, rows
 * scrolled under it showed through ("Name / CAM #" over the first camera, staging 11-26). */
body[data-ui="b"] #site-body .tw thead tr{background:var(--ub-surface)!important}
body[data-ui="b"] #site-body .tw th{padding:10px 12px;background:var(--ub-surface);border-right:0;border-bottom:1px solid var(--ub-border);font-weight:var(--ub-fw-medium)}
body[data-ui="b"] #site-body .tw th .th-sort-btn:hover{color:var(--ub-text)}
body[data-ui="b"] #site-body .tw th.col-dragover{outline-color:var(--ub-primary);background:color-mix(in srgb,var(--ub-primary) var(--ub-data-tint),transparent)}
body[data-ui="b"] #site-body .tw td{border-right:0;border-bottom:1px solid var(--ub-border)}
body[data-ui="b"] #site-body .tw tbody tr:last-child td{border-bottom:0}
body[data-ui="b"] #site-body .tw tbody tr:hover td,
body[data-ui="b"] #site-body .tw .crow:hover td{background:var(--ub-surface-hover)!important}
body[data-ui="b"] #site-body .tw tbody tr.sel td,
body[data-ui="b"] #site-body .tw tbody tr.dt-row-sel td{background:var(--ub-surface-selected)!important}

/* Cells: sans, tabular numbers (IPs, MACs, ports line up). */
body[data-ui="b"] #site-body .tw :is(.cell,.cro,.grid-ip,.grid-mono,.ci){font-family:var(--ub-font-sans);font-size:var(--ub-fs-table);font-variant-numeric:tabular-nums;color:var(--ub-text)}
body[data-ui="b"] #site-body .tw :is(.cro,.grid-mono){color:var(--ub-text-secondary)}
body[data-ui="b"] #site-body .tw .cell[readonly]{color:var(--ub-text-secondary)}
body[data-ui="b"] #site-body .tw .cell:focus{background:var(--ub-surface-raised);color:var(--ub-text);box-shadow:inset 0 0 0 2px var(--ub-primary)}
body[data-ui="b"] #site-body .tw .cell-unsaved{outline-color:var(--ub-warning)}
body[data-ui="b"] #site-body .tw .grid-ip{color:var(--ub-text)}
body[data-ui="b"] #site-body .tw a.grid-ip,body[data-ui="b"] #site-body .tw .grid-ip[onclick],body[data-ui="b"] #site-body .tw a .grid-ip{color:var(--ub-primary)}

/* Lead cell: the type chip keeps its system colour, the name sits beside it as plain text. */
body[data-ui="b"] #site-body .tw .grid-lead{margin:3px 8px;padding:0;border:0;background:transparent;font:var(--ub-fw-medium) var(--ub-fs-table)/1.4 var(--ub-font-sans);color:var(--ub-text)}
body[data-ui="b"] #site-body .tw .grid-lead-ic{border-radius:var(--ub-radius-sm);font:var(--ub-fw-medium) var(--ub-fs-label)/1.4 var(--ub-font-sans);letter-spacing:normal}

/* Badges: B chips, colour kept. */
body[data-ui="b"] #site-body .tw .grid-badge{margin:4px 8px;padding:2px 8px;border:0;border-radius:var(--ub-radius-sm);
  font:var(--ub-fw-medium) var(--ub-fs-label)/1.4 var(--ub-font-sans);letter-spacing:normal;text-transform:none;
  --badge-ink:var(--ub-text-secondary);color:var(--badge-ink);background:color-mix(in srgb,var(--badge-ink) var(--ub-data-tint),transparent)}
body[data-ui="b"] #site-body .tw .grid-badge.blue{--badge-ink:var(--ub-info)}
body[data-ui="b"] #site-body .tw .grid-badge.cyan{--badge-ink:var(--ub-sys-video)}
body[data-ui="b"] #site-body .tw .grid-badge.amber{--badge-ink:var(--ub-warning)}
body[data-ui="b"] #site-body .tw .bx{font-family:var(--ub-font-sans);letter-spacing:normal}

/* Switches: the B primary when on (green stays for success state only). */
body[data-ui="b"] #site-body .tw .tog{background:var(--ub-surface-raised);border-color:var(--ub-border-strong)}
body[data-ui="b"] #site-body .tw .tog.on{--g:var(--ub-primary);background:var(--ub-primary);border-color:var(--ub-primary)}
body[data-ui="b"] #site-body .tw .tog::after{background:var(--ub-text-secondary)}
body[data-ui="b"] #site-body .tw .tog.on::after{background:var(--ub-on-primary)}

/* Footer row ("Add camera") and empty states. */
body[data-ui="b"] #site-body .tw .add-row-btn{font-family:var(--ub-font-sans);font-size:var(--ub-fs-table);color:var(--ub-primary)}

@media (max-width:600px){
  body[data-ui="b"] #site-body .tw{border-left:0;border-right:0;border-radius:0;background:transparent}
}
