/* Shared table UI: sheet (docs/ux/table-v2-spec.md §5). Owner: C05.
   Classes: .tui-sheet*. Phone portrait first, then the landscape and desktop blocks. */
/* Phone portrait: a bottom sheet over the boards, sitting above the dock (so the main button stays reachable), up to 62% of the height. */
.tui-sheet[hidden] { display: none; }
.tui-sheet {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: var(--tui-sheet-bottom, var(--tui-dock-h)); max-height: calc(62dvh - var(--tui-sheet-bottom, var(--tui-dock-h))); display: flex; flex-direction: column;
  background: var(--tui-panel); border-top: 1px solid var(--tui-line); border-radius: calc(var(--tui-radius) * 1.5) calc(var(--tui-radius) * 1.5) 0 0;
  box-shadow: 0 -8px 24px rgb(0 0 0 / .5); animation: tui-sheet-up .18s ease-out;
}
.tui-sheet-grab { flex: none; width: 36px; height: 4px; margin: 6px auto 2px; border-radius: 2px; background: var(--tui-line); }
.tui-sheet-head { flex: none; display: flex; align-items: center; gap: var(--tui-gap); padding: 0 4px 0 8px; border-bottom: 1px solid var(--tui-line); }
.tui-sheet-tabs { flex: 1; min-width: 0; display: flex; gap: 2px; overflow-x: auto; }
.tui-sheet-tab, .tui-sheet-close {
  flex: none; min-height: var(--tui-tap); min-width: var(--tui-tap); padding: 0 12px; font: inherit; font-size: 14px; color: var(--tui-muted);
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; touch-action: manipulation;
}
.tui-sheet-tab.tui-on { color: var(--tui-text); border-bottom-color: var(--tui-accent); font-weight: 600; }
.tui-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--tui-accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.tui-sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.tui-sheet button:focus-visible, .tui-sheet-body:focus-visible { outline: 2px solid var(--tui-gold); outline-offset: -2px; }
@keyframes tui-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tui-sheet { animation: none; } }
/* Phone on its side: over the centre column, between the rails. */
@media (orientation: landscape) and (max-height: 500px) {
  .tui-sheet { left: var(--tui-rail-w-land); right: var(--tui-side-w-land); bottom: 0; max-height: 100dvh; top: 0; border-radius: 0; border-top: 0; animation-name: none; }
  .tui-sheet-grab { display: none; }
}
/* Desktop: the stack and log live in .tui-side, so the sheet never shows. */
@media (min-width: 900px) and (min-height: 501px) { .tui-sheet { display: none; } }
