/* ---------- tables: a column or a row sized alone, and the editor (section 16b) ---------- */

/* The line between two columns or rows, under the pointer or being dragged (tlShow): two screen pixels in the
   table's colour, a little past the table at both ends and ticked there, as a dimension on a drawing is (the
   lining-up line's way, selection.css). Over the canvas, under the bar and the rail. */
#tline { position: fixed; left: 0; top: 0; z-index: 3; pointer-events: none; background: var(--c-table); border-radius: 1px; }
#tline::before, #tline::after { content: ""; position: absolute; background: inherit; border-radius: 1px; }
#tline[data-axis="c"] { width: 2px; }
#tline[data-axis="c"]::before, #tline[data-axis="c"]::after { left: -3px; width: 8px; height: 2px; }
#tline[data-axis="c"]::before { top: 0; }
#tline[data-axis="c"]::after { bottom: 0; }
#tline[data-axis="r"] { height: 2px; }
#tline[data-axis="r"]::before, #tline[data-axis="r"]::after { top: -3px; width: 2px; height: 8px; }
#tline[data-axis="r"]::before { left: 0; }
#tline[data-axis="r"]::after { right: 0; }

/* The rail's card: columns and rows side by side, each its count between − and + in a press (rail.css's .ip-seg). */
.ip-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ip-step {
  display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; height: 38px; padding: 3px; box-sizing: border-box;
  border-radius: 7px; background: var(--press-bg); box-shadow: var(--press);
}
.ip-step .ip-o { height: 32px; }
.ip-step output { font: 500 13px/1 var(--f-mono); font-variant-numeric: tabular-nums; text-align: center; color: var(--ink); }
.ip-step .ip-o[aria-disabled="true"], .ip-act[aria-disabled="true"] { color: var(--ink-3); cursor: default; }
.ip-act[aria-disabled="true"] svg { color: var(--ink-3); }
@media (hover: hover) {
  .ip-step .ip-o:not([aria-disabled="true"]):hover { color: var(--ink); background: var(--surface); box-shadow: var(--raise-sm), var(--edge); }
  .ip-act[aria-disabled="true"]:hover { background: transparent; }
}

/* Over a table selected alone (rail.js, section 21): its columns and rows in a small bar in the board switch's look
   (#bview, style.css), each count after a glyph of what it counts and between its − and +, a hairline between the two. */
#tgbar {
  position: fixed; left: 0; top: 0; z-index: 9; display: flex; align-items: center; height: 26px; padding: 0 2px 0 7px; box-sizing: border-box;
  border-radius: 8px; color: var(--ink-2); background: var(--surface); box-shadow: var(--raise-sm), var(--edge);
  user-select: none; -webkit-user-select: none;
  transition: opacity 140ms ease-out, translate 200ms cubic-bezier(.2,.8,.2,1), visibility 0s;
}
.tgb-g { display: flex; align-items: center; }
.tgb-g + .tgb-g::before { content: ""; width: 1px; height: 14px; margin: 0 7px 0 3px; background: var(--rule-2); }
.tgb-k { flex: none; width: 13px; height: 13px; margin-right: 2px; color: var(--ink-3); }
#tgbar svg * { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.tgb-o {
  display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  color: var(--ink-2); background: transparent; cursor: pointer; transition: color 120ms ease-out, background-color 120ms ease-out;
}
.tgb-o svg { width: 12px; height: 12px; }
#tgbar output { min-width: 2ch; font: 500 11px/1 var(--f-mono); font-variant-numeric: tabular-nums; text-align: center; color: var(--ink); }
@media (hover: hover) { .tgb-o:not([aria-disabled="true"]):hover { color: var(--ink); background: var(--press-bg); } }
.tgb-o:not([aria-disabled="true"]):active { background: var(--press-bg); box-shadow: var(--press); }
.tgb-o[aria-disabled="true"] { color: var(--ink-3); cursor: default; }
body.moving #tgbar, body.drawing #tgbar, body.sizing #tgbar, body.marking #tgbar, body.panning #tgbar, body.dv #tgbar { opacity: 0; pointer-events: none; transition-duration: 100ms; }
body.inking #tgbar, body.sm-tool #tgbar { visibility: hidden; }
#tgbar.off { opacity: 0; translate: 0 5px; visibility: hidden; pointer-events: none; transition: opacity 120ms ease-in, translate 120ms ease-in, visibility 0s linear 120ms; }
@media (pointer: coarse) { #tgbar { height: 36px; } .tgb-o { width: 32px; height: 32px; } }
@media (prefers-reduced-motion: reduce) { #tgbar { transition: none; } }

/* The menu's group on a cell: its head (the AI group's, ai.css), then its items two to a row. While it shows, the menu
   is a little wider, so "Delete column" is whole (and the AI group under it keeps the same two columns). */
#menu:has(> .mtab:not([hidden])) { width: 248px; }
.mtab { display: grid; grid-template-columns: 1fr 1fr; padding-left: 24px; }
.mtab .mi { min-width: 0; padding: 0 4px 0 10px; }
.mtab-at { font-variant-numeric: tabular-nums; }
