/*
 * TAG Legal Desk v2.1, wp7_helpers: Explain it simply (the client's journey, J227), the jargon lens, each email's helpers row (Read it to me, the
 * tone chips, the claims manager's way) and the word and fact of the day.
 * Only the desk's own tokens (styles/desk.css), so Light, Dark, Eucalypt, Harbour and High contrast read the way the
 * desk does. Nothing here animates: the desk's own sheets and popovers carry the motion, and reduced motion, the Motion
 * setting and Calm already cover them. The email paper is white with black text in every theme, so the reading
 * highlight on it uses fixed colours. No inline styles anywhere (the page's policy forbids them).
 */

/* ---------------------------------------------------------------- 44 px targets (bible 5.4) */

.v21h-tools .btn, .v21h-cm .btn, .v21h-def .btn, .v21h-set .btn { min-height: 44px; }
.v21h-btn { white-space: normal; text-align: left; line-height: 1.2; }
.v21h-btn[aria-busy="true"] { opacity: .75; }

/* ---------------------------------------------------------------- D3 the jargon lens */

.v21h-term {
  display: inline; margin: 0; padding: 0 1px; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit;
  line-height: inherit; text-align: inherit; cursor: pointer;
  text-decoration-line: underline; text-decoration-style: dotted; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: var(--ink-3);
}
.v21h-term:hover, .v21h-term[aria-expanded="true"] { background: var(--brand-soft); text-decoration-color: var(--brand-text); }
.v21h-term:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
:root[data-theme="high_contrast"] .v21h-term { text-decoration-color: #000; text-decoration-thickness: 2px; }
.pop.v21h-def-pop { width: min(340px, calc(100vw - 24px)); }
.v21h-def { display: grid; gap: 8px; }
.v21h-def-line { margin: 0; color: var(--ink); font-size: .9375rem; line-height: 1.45; overflow-wrap: anywhere; }
.v21h-def-line b { color: var(--ink); }
.v21h-def-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* ---------------------------------------------------------------- D2 Explain it simply: the client's journey (J227)
   The desk's own Why fold. Inside, a gentle line of four stops down the left, "Where they are" marked Now with a
   filled dot and a small "Now" label (shape and words, never colour alone), each stop's name over one or two short
   sentences, then the word to know. Nothing moves. */

details.why.v21h-explain { margin-top: 8px; }
.v21h-ex-body { gap: 12px; }
details.why .why-body p.v21h-ex-wait { color: var(--ink-2); overflow-wrap: anywhere; }
.v21h-jr { list-style: none; margin: 0; padding: 0; display: grid; min-width: 0; }
.v21h-jr-stop { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 10px; padding: 0 0 14px; min-width: 0; }
.v21h-jr-stop:last-child { padding-bottom: 0; }
/* The line between one stop and the next. */
.v21h-jr-stop::before { content: ""; position: absolute; left: 10px; top: 21px; bottom: 1px; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--brand-text) 30%, transparent); }
.v21h-jr-stop:last-child::before { display: none; }
.v21h-jr-dot { box-sizing: border-box; width: 14px; height: 14px; margin: 3px 0 0 4px; border-radius: 50%; border: 2px solid var(--brand-text); background: var(--solid); }
.v21h-jr-stop.is-now .v21h-jr-dot { width: 18px; height: 18px; margin: 1px 0 0 2px; background: var(--brand-text); box-shadow: 0 0 0 4px var(--brand-soft); }
.v21h-jr-txt { display: grid; gap: 2px; min-width: 0; }
.v21h-jr-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .8125rem; line-height: 1.25rem; color: var(--ink); }
.v21h-jr-h b { font-weight: 700; }
.v21h-jr-now { font-size: .6875rem; line-height: 1rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: var(--brand-text); background: var(--brand-soft); }
details.why .why-body p.v21h-jr-p { color: var(--ink-2); overflow-wrap: anywhere; }
details.why .why-body p.v21h-jr-word { padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); color: var(--ink-2); font-size: .875rem; line-height: 1.35rem; overflow-wrap: anywhere; }
.v21h-jr-word b { color: var(--ink); font-weight: 700; }
.v21h-from { margin: 0; font-size: .75rem; line-height: 1.3; color: var(--ink-3); }
:root[data-theme="high_contrast"] .v21h-jr-stop::before { background: #000; }
:root[data-theme="high_contrast"] .v21h-jr-dot { border-color: #000; background: #fff; }
:root[data-theme="high_contrast"] .v21h-jr-stop.is-now .v21h-jr-dot { background: #000; box-shadow: none; }
:root[data-theme="high_contrast"] .v21h-jr-now { border: 2px solid #000; background: #fff; color: #000; }
:root[data-theme="high_contrast"] details.why .why-body p.v21h-jr-word { border: 2px solid #000; background: #fff; color: #000; }
@media (forced-colors: active) {
  .v21h-jr-stop::before { forced-color-adjust: none; background: CanvasText; }
  .v21h-jr-dot { forced-color-adjust: none; border-color: CanvasText; background: Canvas; }
  .v21h-jr-stop.is-now .v21h-jr-dot { background: Highlight; border-color: Highlight; box-shadow: none; }
  .v21h-jr-now, details.why .why-body p.v21h-jr-word { border: 1px solid CanvasText; }
}

/* ---------------------------------------------------------------- each email's helpers row (D8, D7, D5) */

.v21h-tools { display: grid; gap: 8px; min-width: 0; }
.v21h-tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.v21h-tools-row:empty { display: none; }
.v21h-tones { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.v21h-tools .btn { padding: 0 14px; font-size: .8125rem; }
.v21h-tools .btn-text { padding: 0 10px; }
.v21h-read[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand-text); }
:root[data-theme="high_contrast"] .v21h-read[aria-pressed="true"] { outline: 2px solid #000; outline-offset: -2px; }
.v21h-cm { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--ink); min-width: 0; }
.v21h-cm[hidden] { display: none; }
.v21h-cm p { margin: 0; font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; }
.v21h-cm .meta { color: var(--ink-2); }
.v21h-cm-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
:root[data-theme="high_contrast"] .v21h-cm { border: 2px solid #000; background: #fff; }

/* The sentence being read: the paper is white with black text in every theme, so fixed colours. */
::highlight(v21h-reading) { background-color: #FFE58F; color: #000000; }
.paper .v21h-reading-blk { outline: 2px solid #1F5FD1; outline-offset: 2px; border-radius: 4px; }
.subj.v21h-reading-blk { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 10px; }

/* ---------------------------------------------------------------- Settings (D3, D8) */

.v21h-set .set-row > span:first-child { min-width: 0; }
.v21h-voice { max-width: min(100%, 260px); min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--edge-strong); background: var(--solid); color: var(--ink); }
.v21h-rate-wrap { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.v21h-rate { width: 140px; max-width: 100%; min-height: 44px; accent-color: var(--brand); }
.v21h-rate-out { min-width: 7.5em; text-align: right; }
@media (max-width: 599px) {
  .v21h-set .set-row { flex-wrap: wrap; }
  .v21h-voice { max-width: 100%; width: 100%; }
}

/* ---------------------------------------------------------------- F4 the word and fact of the day */

/* FL-50 sits in the heading (the glyph in the icon's place, the watermark or the day's motif at the far end), never
   positioned, so the tile slides under the Today rail's sticky card like any other tile. */
.v21h-wod .v21h-wod-ico .fl-tile-glyph { display: block; }
.v21h-wod .v21-tile-h .fl-tile-watermark { position: static; flex: none; width: 56px; height: 56px; margin: -18px -12px -18px auto; }
.v21h-wod .v21-tile-h .fl-tile-motif { position: static; flex: none; width: 32px; height: 32px; margin: -8px 0 -8px auto; }
.v21h-word { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0; }
.v21h-word .v21h-term, .v21h-word .v21h-word-plain { font-size: 1.375rem; line-height: 1.75rem; font-weight: 700; color: var(--brand-text); }
.v21h-word-full { color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.v21h-wod-text { color: var(--ink-2); font-size: .9375rem; line-height: 1.45; }
.v21h-wod-day { font-weight: 700; color: var(--ink); }
.v21h-wod-src { font-size: .75rem; }
/* J151: the pool item's topic ("Navy fact", "Army slang", "SOP fact") as a small label over the words. */
.v21h-wod-topic { font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 2px; }

/* ---------------------------------------------------------------- help waits (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, the helpers step
   out of the way at once (the core also stops drawing them). The welfare band itself is never touched. */
:root[data-quiet="on"] .v21h-tools,
:root[data-quiet="on"] .v21h-explain { display: none !important; }
