/* ==========================================================================
   A TEMPLATE'S WORDS AND ITS VERSIONS, DRAWN (docs-templates, 5 Nov 2026;
   admin/js/quote-templates-view.mjs draws them, on the Quote templates page
   and in the quote drawer's template band).

   Its own prefix (tq-). The colours are the host's: the Office's --o-* in the
   drawer, the page's --tp-* on templates.html, each set for light and dark
   there; tokens only, as a fallback.

   NOTHING RESTS ON COLOUR. A value put in from a record is set apart by a
   dotted rule; a gap is boxed with a dashed line and named; a removed word
   is struck through and an added one underlined, and each run is also said
   in words to a screen reader ("Removed:", "Added:").
   ========================================================================== */
.tq-words, .tq-diff, .tq-band {
  --tq-ink: var(--tp-ink, var(--o-text, var(--tk-dark-ink)));
  --tq-dim: var(--tp-ink-2, var(--o-dim, var(--tk-dark-ink-2)));
  --tq-faint: var(--tp-ink-3, var(--o-faint, var(--tk-dark-ink-3)));
  --tq-line: var(--tp-line, var(--o-line-2, var(--tk-dark-line)));
  --tq-well: var(--tp-well, var(--o-inset, var(--tk-grey-10)));
  --tq-gap: var(--tp-attn, var(--o-warn-ink, var(--tk-attn)));
  --tq-del: var(--tp-del, var(--o-bad, var(--tk-bad-dark)));
  --tq-add: var(--tp-add, var(--o-ok, var(--tk-ok-dark)));
  --tq-mark: var(--tk-lime);
}

.tq-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- the words, filled ----------------------------------------------------------------- */
.tq-words { color: var(--tq-ink); overflow-wrap: anywhere; }
.tq-p { margin: 0 0 0.75em; line-height: 1.6; }
.tq-p:last-child { margin-bottom: 0; }
.tq-none { color: var(--tq-faint); }
.tq-val { text-decoration: underline dotted 1px var(--tq-faint); text-underline-offset: 3px; }
.tq-val--hand { text-decoration-style: dashed; }
.tq-gap {
  display: inline; padding: 0 0.3em; border: 1px dashed var(--tq-gap); border-radius: var(--tk-r-xs);
  color: var(--tq-gap); font-style: italic; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.tq-gap__name::before { content: "["; }
.tq-gap__name::after { content: "]"; }

/* ---- two versions, side by side ---------------------------------------------------------- */
.tq-diff { color: var(--tq-ink); }
.tq-diff__sum { margin: 0 0 4px; font-weight: 600; }
.tq-diff__same { margin: 0 0 12px; font-size: 0.8125rem; color: var(--tq-dim); }
.tq-diff__key { margin: 0 0 16px; font-size: 0.8125rem; color: var(--tq-dim); }
.tq-diff__part + .tq-diff__part { margin-top: 20px; }
.tq-diff__h { margin: 0 0 8px; font-size: 0.8125rem; font-weight: 600; color: var(--tq-dim); letter-spacing: 0.02em; }
.tq-diff__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tq-side { min-width: 0; padding: 12px 16px; border: 1px solid var(--tq-line); border-radius: var(--tk-r-md); background: var(--tq-well); }
.tq-side__h { margin: 0 0 8px; font-size: 0.75rem; font-weight: 600; color: var(--tq-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.tq-side__w { overflow-wrap: anywhere; }
.tq-del { color: var(--tq-del); text-decoration: line-through 2px; text-decoration-color: var(--tq-del); }
.tq-ins { color: var(--tq-add); text-decoration: underline 2px; text-decoration-color: var(--tq-add); text-underline-offset: 3px; font-weight: 600; }
.tq-para { padding: 0 0.15em; }
@media (max-width: 640px) {
  .tq-diff__row { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
  .tq-gap { border-color: CanvasText; color: CanvasText; }
  .tq-del, .tq-ins { color: CanvasText; text-decoration-color: CanvasText; }
}

/* ---- the quote drawer's band: which template, its gaps, its two actions -------------------------- */
.tq-band { flex-basis: 100%; margin: 0 0 0.75rem; padding: 0.75rem 1rem; border: 1px solid var(--tq-line); border-radius: var(--tk-r-md); }
.tq-band[hidden] { display: none; }
.tq-band__row { margin-top: 0.5rem; display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 0.75rem; }
.tq-band__row label { display: grid; gap: 4px; flex: 1 1 14rem; min-width: 0; font-size: 0.8125rem; color: var(--tq-dim); }
.tq-band__from { margin: 0; font-size: 0.8125rem; color: var(--tq-dim); }
.tq-band__from b { color: var(--tq-ink); font-weight: 600; }
.tq-band__acts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.tq-gaps { margin: 0.5rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.tq-gaps__h { margin: 0.75rem 0 0; font-size: 0.8125rem; font-weight: 600; color: var(--tq-gap); }
.tq-gaps li { display: grid; gap: 4px; }
.tq-gaps label { display: grid; gap: 4px; font-size: 0.8125rem; color: var(--tq-ink); }
.tq-gaps .tq-gaps__why { font-size: 0.75rem; color: var(--tq-dim); }
.tq-band__said { margin: 0.5rem 0 0; font-size: 0.8125rem; color: var(--tq-dim); }
.tq-band__said:empty { display: none; }
.ofc-qq__form textarea[readonly], .ofc-qq__form input[readonly] { color: var(--o-dim); border-style: dashed; }
.tq-band h3 { margin: 0 0 4px; font-size: 0.8125rem; font-weight: 600; color: var(--tq-dim); }
