/* Creator table layout (17 Nov, picked: tight grid), set up by table.js. Only applies to the creator table once table.js has rebuilt it (.tbl.tb).
   DS tokens only. One rule for every cell: 12px each side (24px gutters), vertically centred, numbers tabular and right-aligned,
   headers aligned exactly like their cells. */

.tbl.tb { table-layout: fixed; width: 100%; font-variant-numeric: tabular-nums; font-feature-settings: var(--font-feature-tabular); }
.tbl.tb th, .tbl.tb td { padding: 0 var(--space-3); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.tbl.tb th:first-child, .tbl.tb td:first-child { padding-left: var(--space-4); }
.tbl.tb th:last-child, .tbl.tb td:last-child { padding-right: var(--space-3); }
.tbl.tb th { height: 40px; font-size: var(--tiny); font-weight: var(--font-weight-medium); color: var(--color-text-secondary); white-space: nowrap; }
.tbl.tb th.r, .tbl.tb td.r { text-align: right; }
.tbl.tb th.c, .tbl.tb td.c, .tbl.tb .tb-fl { text-align: center; }
.tbl.tb th .tip { margin: -2px -4px 0 2px; }
.tb-ls { display: none; }
.tbl.tb td { height: 56px; }
.tbl.tb tr.cut td { height: auto; padding: 0; overflow: visible; }

/* Rank · move: one cell, the rank in a fixed slot so the move marks line up */
.tb-pl { display: inline-flex; align-items: center; gap: var(--space-1); }
.tb-pl > b { min-width: 3ch; font-weight: var(--font-weight-semibold); color: var(--color-text-primary); }
.tb-rk.none .tb-pl > b { color: var(--color-text-tertiary); font-weight: var(--font-weight-regular); }
.tb-pl .mv { font-size: 11px; gap: 1px; white-space: nowrap; }
.tbl.tb td.tb-rk { text-overflow: clip; }
.tb-pl .mv svg { width: 11px; height: 11px; }

/* Creator */
.tbl.tb .who { gap: var(--space-3); min-width: 0; }
.tbl.tb .nm { min-width: 0; }
.tbl.tb .nm small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Weeks: the squares sit on the row's centre line, not the text baseline */
.tb-wk .wks { display: flex; align-items: center; gap: 3px; vertical-align: middle; }
.tb-wk .wk { display: block; flex: none; }

/* Numbers */
.tbl.tb .score { font-size: 14px; font-weight: var(--font-weight-semibold); }
.tb-pv { color: var(--color-text-tertiary); }
.tb-pv .same, .tb-pv .n { color: var(--color-text-tertiary); }
.tb-sp .split { font-size: var(--tiny); color: var(--color-text-tertiary); }
.tb-line { font-size: var(--tiny); color: var(--color-text-secondary); white-space: nowrap; }
.tb-line.close { color: var(--color-text-primary); font-weight: var(--font-weight-semibold); }
td.tb-ln .tb-line.n { font-size: var(--row); }

/* Stacked value: main line + quiet second line, right-aligned as one block */
.tb-stk { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 100%; line-height: 1.25; }
.tb-sub { display: inline-flex; align-items: baseline; gap: var(--space-1); font-size: var(--tiny); color: var(--color-text-tertiary); white-space: nowrap; }
.tb-sub:empty { display: none; }
.tb-sub .tb-line { color: var(--color-text-tertiary); }
.tb-sub .tb-line.close { color: var(--color-text-primary); }
.tb-dot { color: var(--color-text-tertiary); }

/* Flag: an icon with its reason on hover / focus */
.tbl.tb th.tb-h-fl svg, .tb-flag svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.tbl.tb th.tb-h-fl svg { color: var(--color-text-tertiary); vertical-align: middle; }
.tbl.tb td.tb-fl { overflow: visible; }
.tb-flag { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-xs); color: var(--color-status-warning-fg); vertical-align: middle; }
.tb-flag svg { fill: color-mix(in srgb, currentColor 18%, transparent); }
.tb-flag::after { content: attr(data-tt); position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; width: max-content; max-width: 260px; padding: 6px 10px; border-radius: var(--radius-xs); background: var(--color-bg-inverse); color: var(--color-text-inverse); font-size: var(--tiny); font-weight: var(--font-weight-medium); line-height: 1.35; text-align: left; white-space: normal; opacity: 0; pointer-events: none; transform: translateY(2px); transition: opacity var(--motion-duration-fast) var(--motion-easing-standard), transform var(--motion-duration-fast) var(--motion-easing-standard); }
.tb-flag:focus-visible::after { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) { .tb-flag:hover::after { opacity: 1; transform: none; } }
.tbl.tb tbody tr:first-child .tb-flag::after { bottom: auto; top: calc(100% + 6px); }

/* ═════════ Tight grid ═════════ */
.tb-h-rk { width: 88px; }
.tb-h-sd { width: 148px; }
.tb-h-sc { width: 136px; }
.tb-h-pv { width: 104px; }
.tb-h-rf { width: 112px; }
.tb-h-sn, .tb-h-si, .tb-h-sa { width: 72px; }
.tb-sp .n { color: var(--color-text-secondary); }
.tb-h-vw { width: 120px; }
.tb-h-wk { width: 96px; }
.tb-h-ln { width: 104px; }
.tb-h-fl { width: 48px; }
.tb-narrow { display: none; }

/* ═════════ Responsive · container widths (the page pane) ═════════ */
@container page (max-width: 1300px) { .tbl.tb .tb-h-sn, .tbl.tb .tb-h-si, .tbl.tb .tb-h-sa, .tbl.tb .tb-sp { display: none; } }
@container page (max-width: 1180px) {
  .tbl.tb .tb-h-pv, .tbl.tb .tb-pv,
  .tbl.tb .tb-h-vw, .tbl.tb .tb-vw { display: none; }
}
@container page (max-width: 900px) {
  .tbl.tb .tb-h-ln, .tbl.tb .tb-ln { display: none; }
  .tb-narrow { display: inline-flex; }
}
@container page (max-width: 640px) {
  .tbl.tb .tb-h-sd, .tbl.tb .tb-sd, .tbl.tb .tb-h-rf, .tbl.tb .tb-rf, .tbl.tb .tb-h-fl, .tbl.tb .tb-fl { display: none; }
  .tbl.tb th, .tbl.tb td { padding: 0 var(--space-2); }
  .tbl.tb th:first-child, .tbl.tb td:first-child { padding-left: var(--space-2); }
  .tbl.tb .tb-h-rk { width: 52px; }
  .tbl.tb .tb-h-sc { width: 96px; }
  .tbl.tb .tb-h-wk { width: 76px; }
  .tb-lf { display: none; } .tb-ls { display: inline; }
  .tbl.tb .who small { display: block; }
  .tb-pl .mv { display: none; }
  .tbl.tb .face { --fs: 32px; }
  .tbl.tb th { white-space: nowrap; }
}
