/*
 * TAG Legal Desk v2.1: Desk updates (the Director, 28 Sep 2026). The item in your chip's menu, with its small dot when
 * something new is logged, and the wide panel: the live line in the header, the four tabs (Now, Done, Next, Waiting
 * on), the cards of current work, the timeline of every change, the roadmap and what waits on whom.
 * Desk tokens only, so Light, Dark, Eucalypt, Harbour, High contrast and the Canteen themes all hold. Each kind of change
 * and each state of work takes one of the desk's own colours through --v21dl-c; words always say it too, so colour is
 * never the only sign. Only transform and opacity animate (the live dot and the shimmer on work being built or tested),
 * and neither moves with reduced motion or Calm. 44 px targets, the desk's own focus ring, no sideways scroll at phone
 * width. No inline styles.
 */

/* ---------- your chip's menu: the mark and its dot ---------- */
.v21dl-mi { position: relative; display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; color: var(--ink-3); }
.v21dl-mi .ico { display: block; }
.v21dl-mdot { position: absolute; top: -3px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--info); box-shadow: 0 0 0 2px var(--solid); }

/* ---------- the panel: the desk's sheet, expanded wide ---------- */
.sheet.v21dl-sheet { width: 100%; border-radius: 0; }
/* The header keeps to the same width as the content under it, so the title lines up with the tabs (the extra 16 px
   is the body's scrollbar gutter). */
.v21dl-sheet .sheet-h { width: 100%; max-width: 1184px; margin: 0 auto; }
.v21dl-sheet .sheet-b { scrollbar-gutter: stable; }
.v21dl { display: grid; gap: 16px; width: 100%; max-width: 1120px; margin: 0 auto; min-width: 0; align-content: start; }

/* the live line in the header: a dot and "Updated 12:20" */
.v21dl-live { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 30px; padding: 3px 12px 3px 11px; border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--ink-2); background: color-mix(in srgb, var(--ok) var(--tint-alpha), transparent); white-space: nowrap; }
.v21dl-live.is-off { background: var(--solid-2); }
.v21dl-lt { color: var(--ink); font-variant-numeric: tabular-nums; }
.v21dl-pulse { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.v21dl-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: v21dl-ping 2.6s var(--ease-out) infinite; }
.v21dl-live.is-off .v21dl-pulse { background: var(--edge-strong); }
.v21dl-live.is-off .v21dl-pulse::after { display: none; }
@keyframes v21dl-ping { 0% { transform: scale(.4); opacity: .7; } 70%, 100% { transform: scale(1.5); opacity: 0; } }

/* the tabs: a segmented control in the desk's own look */
.v21dl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; min-width: 0; }
.v21dl-head[hidden] { display: none; }
.v21dl-tabs { display: inline-flex; gap: 2px; max-width: 100%; padding: 3px; border-radius: 14px; background: var(--brand-soft); }
.v21dl-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 11px; background: transparent; color: var(--ink-2); font-size: .875rem; font-weight: 700; line-height: 1.15; transition: background-color var(--t-small) var(--ease-out), color var(--t-small) var(--ease-out); }
.v21dl-tab:hover { color: var(--ink); background: var(--glass-hover); }
.v21dl-tab[aria-selected="true"] { background: var(--solid); color: var(--ink); box-shadow: var(--shadow-1); }
.v21dl-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.v21dl-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--solid); color: var(--ink-2); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.v21dl-tab[aria-selected="true"] .v21dl-n { background: var(--brand-soft); color: var(--brand-text); }
.v21dl-n.is-new, .v21dl-tab[aria-selected="true"] .v21dl-n.is-new { background: var(--info); color: var(--solid); }
.v21dl-note { margin: 0; flex: 1 1 260px; min-width: 0; }

/* one plain line when the updates could not load */
.v21dl-err { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 16px; border-radius: 14px; background: var(--solid); border: 1px solid var(--glass-rim); box-shadow: inset 4px 0 0 var(--warn), var(--shadow-1); color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.v21dl-err .ico { flex: none; color: var(--warn); }
.v21dl-err[hidden] { display: none; }

.v21dl-panel { display: grid; gap: 22px; min-width: 0; border-radius: 12px; }
.v21dl-panel[hidden] { display: none; }
.v21dl-panel:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.v21dl-loading { margin: 0; }
.v21dl-empty { margin: 0; padding: 18px 20px; border-radius: var(--r-card); color: var(--ink-2); font-weight: 600; }
.v21dl-gh { margin: 0; font-size: .75rem; line-height: 1rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.v21dl-gn { font-size: .75rem; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- colours: each kind of change and each state of work ---------- */
.v21dl-k-live { --v21dl-c: var(--ok); }
.v21dl-k-page { --v21dl-c: var(--info); }
.v21dl-k-rule { --v21dl-c: var(--ember); }
.v21dl-k-fix { --v21dl-c: var(--warn); }
.v21dl-k-restart { --v21dl-c: var(--ink-2); }
.v21dl-k-other { --v21dl-c: var(--ink-3); }
.v21dl-kind { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: .6875rem; line-height: 1.1rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: color-mix(in srgb, var(--v21dl-c, var(--ink-3)) 60%, var(--ink)); background: color-mix(in srgb, var(--v21dl-c, var(--ink-3)) var(--tint-alpha), transparent); }
.v21dl-kind::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--v21dl-c, var(--ink-3)); }

/* ---------- Now: a card for each piece of work ---------- */
.v21dl-nowlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); min-width: 0; }
.v21dl-nowlist > li { display: grid; min-width: 0; }
.v21dl-card { --v21dl-c: var(--ink-3); position: relative; display: grid; align-content: start; gap: 10px; min-width: 0; padding: 16px 18px 20px 20px; border-radius: var(--r-card); overflow: hidden; }
.v21dl-s-building { --v21dl-c: var(--info); }
.v21dl-s-testing { --v21dl-c: var(--warn); }
.v21dl-s-golive { --v21dl-c: var(--ok); }
.v21dl-s-waiting, .v21dl-s-other { --v21dl-c: var(--ink-3); }
.v21dl-card.g1 { box-shadow: inset 4px 0 0 var(--v21dl-c), inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim), var(--shadow-1); }
.v21dl-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-width: 0; }
.v21dl-state { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: color-mix(in srgb, var(--v21dl-c) 76%, var(--ink)); background: color-mix(in srgb, var(--v21dl-c) var(--tint-alpha), transparent); }
.v21dl-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--v21dl-c); }
.v21dl-ct { margin: 0; font-size: 1.0625rem; line-height: 1.45rem; font-weight: 700; overflow-wrap: anywhere; }
.v21dl-cd { margin: 0; color: var(--ink-2); font-size: .9375rem; line-height: 1.4rem; overflow-wrap: anywhere; }
.v21dl-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 2px 0 0; font-size: .8125rem; color: var(--ink-2); }
.v21dl-meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.v21dl-meta .ico { flex: none; color: var(--ink-3); }
.v21dl-meta time, .v21dl-due span { font-variant-numeric: tabular-nums; }
/* The shimmer on work being built or tested: a thin track, and a soft light that moves along it (transform only). */
.v21dl-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; overflow: hidden; background: color-mix(in srgb, var(--v21dl-c) 20%, transparent); }
.v21dl-prog > i { position: absolute; top: 0; bottom: 0; left: 0; width: 45%; background: linear-gradient(90deg, transparent, var(--v21dl-c), transparent); transform: translateX(-100%); animation: v21dl-sweep 2.4s var(--ease-glide) infinite; }
@keyframes v21dl-sweep { from { transform: translateX(-100%); } to { transform: translateX(230%); } }

/* who owns it: Fred or the migration AI */
.v21dl-owner { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.v21dl-on { min-width: 0; overflow-wrap: anywhere; }
.v21dl-oi { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); }
.v21dl-owner.is-mig .v21dl-oi { background: color-mix(in srgb, var(--info) var(--tint-alpha), transparent); color: var(--info); }

/* the latest changes under the cards */
.v21dl-latest { display: grid; gap: 10px; min-width: 0; }
.v21dl-mini { list-style: none; margin: 0; padding: 4px 6px; display: grid; border-radius: 16px; min-width: 0; }
.v21dl-mrow { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; min-width: 0; }
.v21dl-mrow + .v21dl-mrow { border-top: 1px solid var(--glass-rim); }
.v21dl-mt { font-size: .8125rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.v21dl-mx { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v21dl-seeall { justify-self: start; min-height: 44px; }
.v21dl-fwd { transform: scaleX(-1); }

/* ---------- Done: the timeline ---------- */
.v21dl-tools { display: grid; gap: 12px; min-width: 0; }
.v21dl-qwrap { position: relative; display: block; width: 100%; max-width: 560px; min-width: 0; }
.v21dl-qwrap > .ico { position: absolute; left: 12px; top: 50%; margin-top: -8px; color: var(--ink-3); pointer-events: none; }
.v21dl-search { width: 100%; min-height: 44px; max-width: 100%; box-sizing: border-box; padding: 0 12px 0 36px; border-radius: 12px; border: 1px solid var(--edge-strong); background: var(--solid); color: var(--ink); font: inherit; font-size: .9375rem; }
.v21dl-search::placeholder { color: var(--ink-3); opacity: 1; }
.v21dl-search:focus-visible { outline-offset: 0; border-color: var(--focus); }
.v21dl-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.v21dl-chip { min-height: 44px; gap: 8px; }
.v21dl-chip[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand-text); }
.v21dl-cdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--v21dl-c); }
.v21dl-cn { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.v21dl-chip[aria-pressed="true"] .v21dl-cn { color: inherit; }
.v21dl-count { margin: 0; font-size: .875rem; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }

.v21dl-days { display: grid; gap: 26px; min-width: 0; }
.v21dl-day { display: grid; gap: 14px; min-width: 0; }
.v21dl-tl { list-style: none; margin: 0; padding: 0; display: grid; min-width: 0; }
.v21dl-ev { position: relative; display: grid; grid-template-columns: 3.25rem 1.25rem minmax(0, 1fr); column-gap: .75rem; padding-bottom: 18px; min-width: 0; border-radius: 12px; }
.v21dl-ev:last-child { padding-bottom: 0; }
/* the line that joins one change to the next, through the middle of the dots */
.v21dl-ev::before { content: ""; position: absolute; top: 1.25rem; bottom: -.15rem; left: calc(3.25rem + .75rem + .625rem - 1px); width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--ink-3) 24%, transparent); }
.v21dl-ev:last-child::before { display: none; }
.v21dl-ev:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.v21dl-t { padding-top: 1px; text-align: right; font-size: .8125rem; line-height: 1.35rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.v21dl-node { position: relative; z-index: 1; justify-self: center; width: 12px; height: 12px; margin-top: .3rem; border-radius: 50%; background: var(--solid); border: 2.5px solid var(--v21dl-c); }
.v21dl-ev.is-new .v21dl-node { background: var(--v21dl-c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--v21dl-c) 22%, transparent); }
.v21dl-evb { display: grid; gap: 4px; min-width: 0; }
.v21dl-evh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; min-width: 0; }
.v21dl-evt { min-width: 0; font-size: .9375rem; line-height: 1.35rem; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.v21dl-evd { margin: 0; color: var(--ink-2); font-size: .875rem; line-height: 1.35rem; overflow-wrap: anywhere; }
.v21dl-by { margin: 0; color: var(--ink-3); font-size: .75rem; font-weight: 600; }
.v21dl-ref { display: inline-block; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--glass-rim); background: var(--solid-2); color: var(--ink-2); font-family: var(--font); font-size: .75rem; line-height: 1.1rem; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v21dl-new { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: .6875rem; line-height: 1.1rem; font-weight: 700; color: var(--solid); background: var(--info); }
.v21dl-more { display: flex; justify-content: center; }
.v21dl-more:empty { display: none; }
.v21dl-more .btn { min-width: 200px; }
.v21dl-more .meta { margin: 0; }

/* ---------- Next: the roadmap in three columns ---------- */
.v21dl-cols { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; min-width: 0; }
.v21dl-col { display: grid; gap: 10px; min-width: 0; padding: 12px; border-radius: var(--r-card); background: var(--brand-soft); }
/* The column headings and counts sit on brand-soft, where ink-3 falls short of 4.5:1 in Light, Eucalypt and Harbour. */
.v21dl-col .v21dl-gh, .v21dl-col .v21dl-gn { color: var(--ink-2); }
.v21dl-colh { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; padding: 0 6px; }
.v21dl-none { margin: 0; padding: 4px 6px 6px; font-size: .875rem; color: var(--ink-2); }
.v21dl-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.v21dl-item { display: grid; gap: 6px; min-width: 0; padding: 12px 14px; border-radius: 14px; }
.v21dl-ih { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 12px; min-width: 0; }
.v21dl-ih h4 { flex: 1 1 160px; min-width: 0; margin: 0; font-size: .9375rem; line-height: 1.35rem; font-weight: 700; overflow-wrap: anywhere; }
.v21dl-item p { margin: 0; color: var(--ink-2); font-size: .875rem; line-height: 1.35rem; overflow-wrap: anywhere; }

/* ---------- Waiting on: grouped by who ---------- */
.v21dl-groups { display: grid; gap: 22px; min-width: 0; }
.v21dl-group { display: grid; gap: 10px; min-width: 0; }
.v21dl-grh { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v21dl-grh h3 { margin: 0; min-width: 0; font-size: 1rem; line-height: 1.4rem; font-weight: 700; overflow-wrap: anywhere; }
.v21dl-wait { display: inline-flex; align-items: center; flex: none; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: var(--ink-2); background: var(--solid-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.v21dl-wait.is-long { color: color-mix(in srgb, var(--warn) 80%, var(--ink)); background: color-mix(in srgb, var(--warn) var(--tint-alpha), transparent); }

/* ---------- narrower screens ---------- */
@media (max-width: 899px) {
  .v21dl-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .v21dl-sheet .sheet-h { flex-wrap: wrap; row-gap: 6px; }
  .v21dl-sheet .sheet-h h2 { flex: 1 1 60%; min-width: 0; }
  .v21dl-sheet .v21dl-live { order: 3; }
  .v21dl-sheet .sheet-b { padding-left: 16px; padding-right: 16px; }
  .v21dl-tabs { display: flex; width: 100%; }
  .v21dl-tab { flex: 1 1 0; min-width: 0; padding: 0 6px; gap: 5px; font-size: .8125rem; white-space: normal; text-align: center; }
  .v21dl-n { min-width: 20px; height: 20px; padding: 0 5px; }
  .v21dl-card { padding: 14px 16px 18px 18px; }
  .v21dl-mrow { grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; }
  .v21dl-mrow .v21dl-kind { grid-column: 2; grid-row: 2; justify-self: start; }
  .v21dl-mrow .v21dl-mx { grid-column: 2; grid-row: 1; white-space: normal; overflow-wrap: anywhere; }
  .v21dl-qwrap { max-width: none; }
  .v21dl-ev { grid-template-columns: 2.75rem 1rem minmax(0, 1fr); column-gap: .5rem; }
  .v21dl-ev::before { left: calc(2.75rem + .5rem + .5rem - 1px); }
  .v21dl-more .btn { min-width: 0; width: 100%; }
}

/* ---------- High contrast and forced colours ---------- */
:root[data-theme="high_contrast"] .v21dl-card, :root[data-theme="high_contrast"] .v21dl-item, :root[data-theme="high_contrast"] .v21dl-mini, :root[data-theme="high_contrast"] .v21dl-empty, :root[data-theme="high_contrast"] .v21dl-err { border: 2px solid var(--ink); }
:root[data-theme="high_contrast"] .v21dl-col { border: 2px solid var(--ink); background: var(--solid); }
:root[data-theme="high_contrast"] .v21dl-kind, :root[data-theme="high_contrast"] .v21dl-state, :root[data-theme="high_contrast"] .v21dl-wait, :root[data-theme="high_contrast"] .v21dl-n, :root[data-theme="high_contrast"] .v21dl-new, :root[data-theme="high_contrast"] .v21dl-live, :root[data-theme="high_contrast"] .v21dl-ref { border: 1.5px solid currentColor; }
:root[data-theme="high_contrast"] .v21dl-tab[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
:root[data-theme="high_contrast"] .v21dl-chip[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--ink); }
:root[data-theme="high_contrast"] .v21dl-search { border: 2px solid var(--ink); }
:root[data-theme="high_contrast"] .v21dl-node { border-width: 3px; }
:root[data-theme="high_contrast"] .v21dl-mdot { box-shadow: 0 0 0 2px var(--ink); }
@media (forced-colors: active) {
  .v21dl-card, .v21dl-item, .v21dl-mini, .v21dl-err, .v21dl-empty, .v21dl-col { border: 1px solid CanvasText; }
  .v21dl-kind, .v21dl-state, .v21dl-wait, .v21dl-n, .v21dl-new, .v21dl-live, .v21dl-ref { border: 1px solid CanvasText; }
  .v21dl-tab[aria-selected="true"] { border: 2px solid Highlight; }
  .v21dl-chip[aria-pressed="true"] { outline: 2px solid Highlight; }
  .v21dl-mdot, .v21dl-pulse, .v21dl-node, .v21dl-cdot { forced-color-adjust: none; background: CanvasText; }
  .v21dl-ev::before { background: CanvasText; }
}

/* ---------- reduced motion and Calm: nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) .v21dl-pulse::after, :root:not([data-motion="full"]) .v21dl-prog > i { animation: none; display: none; }
  :root:not([data-motion="full"]) .v21dl-tab { transition: none; }
}
:root[data-motion="reduced"] .v21dl-pulse::after, :root[data-motion="reduced"] .v21dl-prog > i,
:root[data-calm="on"] .v21dl-pulse::after, :root[data-calm="on"] .v21dl-prog > i { animation: none; display: none; }
:root[data-motion="reduced"] .v21dl-tab, :root[data-calm="on"] .v21dl-tab { transition: none; }
