/*
 * TAG Legal Desk v2.1 (Thu 1 Oct 2026): Team today, the actions taken tally (js\v21_tally.js). Theme tokens only, no
 * inline styles. A quiet chip in the board head and a plain list in the desk popover. High contrast, forced colours,
 * phone width and print each have their own plain rules below.
 */

/* ---------- the chip in the board head ---------- */
.v21tally-btn { min-height: 44px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.v21tally-btn .ico { color: var(--brand-text); }
.v21tally-btn[aria-expanded="true"] { background: var(--brand-soft); color: var(--ink); }

/* ---------- the list ---------- */
.pop.v21tally-pop { width: min(21rem, calc(100vw - 24px)); gap: 8px; }
.v21tally-body { display: grid; gap: 8px; }
.v21tally-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pop .v21tally-h { margin: 0; font-size: 1rem; }
.v21tally-y[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--brand-text); }
.v21tally-list { list-style: none; margin: 0; padding: 0; display: grid; }
.v21tally-row, .pop .v21tally-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 5px 0; border-top: 1px solid var(--glass-rim); font-size: .875rem; line-height: 1.25rem;
}
.v21tally-row:first-child { border-top: 0; }
.v21tally-l { color: var(--ink-2); min-width: 0; }
.v21tally-c { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pop .v21tally-total { margin: 0; padding-top: 8px; border-top-width: 2px; font-weight: 700; }
.pop .v21tally-total .v21tally-l { color: var(--ink); font-weight: 700; }
.pop .v21tally-total .v21tally-c { font-weight: 800; }
.pop .v21tally-total:empty { display: none; }
.v21tally-wait { padding: 5px 0; font-size: .875rem; color: var(--ink-3); }
.pop .v21tally-line { margin: 0; font-size: .8125rem; line-height: 1.125rem; color: var(--ink-3); }

/* ---------- phone width ---------- */
@media (max-width: 599px) {
  .v21tally-btn { padding-left: 6px; padding-right: 6px; }
  .v21tally-btn .v21tally-w { white-space: nowrap; }
}

/* ---------- High contrast ---------- */
:root[data-theme="high_contrast"] .v21tally-btn, :root[data-theme="high_contrast"] .v21tally-l,
:root[data-theme="high_contrast"] .v21tally-wait, :root[data-theme="high_contrast"] .pop .v21tally-line { color: #000000; }
:root[data-theme="high_contrast"] .v21tally-row, :root[data-theme="high_contrast"] .pop .v21tally-total { border-top-color: #000000; }

/* ---------- forced colours ---------- */
@media (forced-colors: active) {
  .v21tally-btn[aria-expanded="true"] { background: Highlight; color: HighlightText; }
  .v21tally-y[aria-pressed="true"] { outline: 2px solid CanvasText; box-shadow: none; }
  .v21tally-row, .pop .v21tally-total { border-top-color: CanvasText; }
}

/* ---------- print ---------- */
@media print {
  .v21tally-btn { display: none; }
}
