/*
 * TAG Legal Desk v2.1: the core's styles (package wp1_core). Moment cards, tiles, the board head and header slots,
 * the small glass pieces, the art host and the practice extras sheet.
 * Every container is empty and takes no room until an extra is drawn into it, so with v2.1 off (or nothing to show)
 * the desk looks exactly as it does without them. Only transform and opacity ever animate (through the desk's motion
 * helper, never here). No v2.1 piece ever sits on the welfare band, the welfare view, the email paper or a board card.
 */

/* ---------- the containers ---------- */
.v21-top:empty, .v21-head:empty, .v21-foot:empty, .v21-motif:empty, .v21-hbar:empty { display: none; }
.v21-top { display: grid; gap: 12px; margin: 0 0 12px; }
.v21-head { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.v21-foot { display: grid; gap: 12px; margin-top: 16px; }
@media (min-width: 1440px) { .v21-foot { display: none; } }
/* Stage 26, the board head at 600 px and wider. The greeting and Cleared by Fred share the first line; the buttons
   (Show, Countdowns, Cheers, History, the rules line, Second opinion) take a row of their own under it, start at the
   left edge and wrap as a row. Six buttons used to squeeze the greeting into a narrow column beside them. An empty
   head changes nothing, so with v2.1 off (or nothing to show) the head looks exactly as before. Phone widths keep the
   desk's own stacked head (styles\desk.css). */
@media (min-width: 600px) {
  .board-head:has(> .v21-head:not(:empty)) { flex-wrap: wrap; row-gap: 10px; }
  .board-head:has(> .v21-head:not(:empty)) > div:first-child { flex: 1 1 16rem; min-width: 0; }
  .board-head:has(> .v21-head:not(:empty)) > .clr-link { flex: none; }
  .board-head > .v21-head:not(:empty) { display: flex; flex: 1 0 100%; justify-content: flex-start; }
}

/* The header slots sit inside the count: the day's motif beside it, the 6 px bar under it. */
:root[data-v21-core="on"] .count { position: relative; }
.v21-motif { display: inline-flex; align-items: center; align-self: center; line-height: 0; color: var(--ink-2); }
.v21-hbar { position: absolute; left: 0; right: 0; bottom: -9px; height: 6px; display: block; pointer-events: none; }

/* ---------- moments, cards and tiles ---------- */
.v21-moment { position: relative; display: grid; gap: 10px; padding: 16px 20px; border-radius: var(--r-card); min-width: 0; }
.v21-moment > .v21-card { padding: 0; border: 0; background: none; box-shadow: none; }
/* Integrator, 27 Sep 2026: the 620 px rule (bible 2). In the Zoho Web Tab at about 1366 by 620 a tall card (the Friday
   Wrap is about 520 px) would push the first board card below the fold, so on a short screen a card keeps to 250 px
   and scrolls inside itself. */
@media (min-width: 1024px) and (max-height: 700px) {
  #v21-top > .v21-moment { max-height: 250px; overflow-y: auto; overscroll-behavior: contain; }
}
.v21-card { display: grid; gap: 10px; padding: 16px 20px; border-radius: var(--r-card); min-width: 0; }
.v21-card-h, .v21-tile-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v21-moment h2, .v21-card h2 { margin: 0; font-size: 1.0625rem; line-height: 1.5rem; font-weight: 700; overflow-wrap: anywhere; }
.v21-ico { display: inline-grid; place-items: center; color: var(--brand-text); flex: none; }
.v21-card-b { display: grid; gap: 6px; }
.v21-card-b p, .v21-tile p, .v21-moment p { margin: 0; overflow-wrap: anywhere; }
.v21-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.v21-tile { display: grid; gap: 8px; padding: 16px 20px; border-radius: var(--r-card); min-width: 0; }
.v21-tile h2 { margin: 0; font-size: 1rem; line-height: 1.375rem; }
.rail > .v21-tile, .rail > [data-v21-tile] { margin-top: 16px; }
/* Integrator, 27 Sep 2026: the Today card sticks at the top of the rail, so tiles under it scrolled through it (seen
   at 1440, 1568 and 1920 px). While the rail carries v2.1 tiles, the card scrolls with them; with no tile it sticks
   exactly as the Friday desk does. */
#rail:has(> [data-v21-tile]) > .rail-card { position: static; }
.v21-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.v21-chip { min-height: 44px; }
.v21-chip[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-text); }
.v21-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: .875rem; line-height: 1.35rem; color: var(--ink-2); }
.v21-note .ico { flex: none; margin-top: 2px; color: var(--info); }
.v21-note-ok .ico { color: var(--ok); }
.v21-note-warn .ico { color: var(--warn); }
@media (max-width: 599px) {
  .v21-moment, .v21-card, .v21-tile { padding: 14px 16px; }
  .v21-actions { justify-content: stretch; }
  .v21-actions .btn { flex: 1 1 auto; white-space: normal; }
}
:root[data-theme="high_contrast"] .v21-chip[aria-pressed="true"] { outline: 2px solid #000; outline-offset: -2px; }

/* ---------- art ---------- */
.v21-art-host { position: absolute; width: 0; height: 0; overflow: hidden; }
.v21-art { display: inline-block; vertical-align: middle; flex: none; }

/* ---------- welfare first (plan section 2 rule 1) ----------
   While a welfare message is open, the quiet period runs or the "While nobody was here" band shows, every game, team
   and ambient element of v2.1 is hidden at once. A commemoration card hides only while a welfare message is open. */
:root[data-quiet="on"] [data-v21="game"],
:root[data-quiet="on"] [data-v21="team"],
:root[data-quiet="on"] [data-v21="info"],
:root[data-quiet="on"] [data-art="ambient"] { display: none !important; }
:root[data-v21-welfare="on"] [data-v21="commemoration"] { display: none !important; }

/* ---------- the practice extras sheet ---------- */
.v21-x-list { display: grid; gap: 12px; }
.v21-x-pkg { border-radius: 16px; padding: 2px 14px 12px; }
.v21-x-pkg > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; list-style: none; }
.v21-x-pkg > summary::-webkit-details-marker { display: none; }
.v21-x-pkg > summary .ico { transition: transform var(--t-small) var(--ease-out); }
.v21-x-pkg[open] > summary .ico { transform: rotate(180deg); }
.v21-x-feat { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--glass-rim); }
.v21-x-feat .nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.v21-x-feat .tag { white-space: normal; }
.tag.v21-off { color: var(--ink-2); background: var(--solid-2); }
.v21-x-runs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.v21-x-runs .btn { white-space: normal; text-align: left; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
.v21-x-runs .btn[aria-disabled="true"] { opacity: .6; }
.v21-x-empty { margin: 0; }
