/*
 * TAG Legal Desk v2.1: the earlier thread under each email (register J117, the Director, 28 Sep 2026).
 * js\v21_threadquote.js draws it. The chip on an email's header says how the email goes; the fold under the email
 * holds the earlier emails, set out on the paper the way they go under the new one (Arial 10pt, black on white, every
 * theme, like the email itself), each behind a thin left rule, a little smaller and softer than the new words.
 * The fold's bar reads like the original email thread in What came in, so the two are learnt once. The desk's tokens,
 * its focus ring, reduced motion (the desk's own rule stops the chevron's turn), high contrast and forced colours.
 * No inline styles anywhere.
 */

/* ---------- the chip on the email's header: how the email goes ---------- */
.tq-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin-top: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; line-height: 1.1rem; font-weight: 700; color: var(--brand-text); background: var(--brand-soft); }
.tq-chip .ico { flex: none; }
.tq-chip span { min-width: 0; overflow-wrap: anywhere; }

/* ---------- the fold under the email ---------- */
details.tq { min-width: 0; }
details.tq > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; font-size: .875rem; line-height: 1.25rem; cursor: pointer; }
details.tq > summary::-webkit-details-marker { display: none; }
details.tq > summary .ico { flex: none; }
details.tq > summary .lbl { min-width: 0; }
details.tq > summary .n { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
details.tq > summary .ico:last-child { margin-left: auto; transition: transform var(--t-small) var(--ease-out); }
details.tq[open] > summary .ico:last-child { transform: rotate(180deg); }
.tq-body { display: grid; gap: 10px; min-width: 0; padding-top: 10px; }
.tq-limit, .tq-left { margin: 0; font-size: .8125rem; line-height: 1.25rem; color: var(--ink-2); }
.tq-left { display: flex; align-items: flex-start; gap: 6px; font-weight: 600; color: var(--ink); }
.tq-left .ico { margin-top: 3px; color: var(--info); }
/* The check failed: Send waits (js\job.js holds it), and "Show me" on the bar focuses this fold's summary. */
.tq-hold { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: .8125rem; line-height: 1.25rem; font-weight: 700; color: var(--danger); }
.tq-hold .ico { margin-top: 3px; flex: none; }
details.tq.tq-unsafe > summary { box-shadow: inset 3px 0 0 var(--danger); }

/* ---------- the paper: the earlier emails as they go under the new one ---------- */
.tq-paper { min-width: 0; padding: 16px 20px; border-radius: 12px; background: var(--paper); color: var(--paper-ink); font: 10pt/1.45 Arial, Helvetica, sans-serif; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06); overflow-wrap: anywhere; }
:root[data-theme="dark"] .tq-paper { box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.4); }
.tq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14pt; }
.tq-msg { min-width: 0; padding-left: 12px; border-left: 3px solid #C8CFC6; color: #333333; font-size: 9.5pt; }
.tq-head { margin: 0; font-weight: bold; color: #333333; }
.tq-addr { font-weight: normal; color: #555555; }
.tq-subj { margin: 0 0 6pt; color: #555555; }
.tq-msg .mail-body { white-space: normal; }
.tq-msg .mail-p { margin: 0 0 8pt; white-space: pre-wrap; overflow-wrap: anywhere; }
.tq-msg .mail-p:last-child { margin-bottom: 0; }
.tq-msg .mail-footer { margin-top: 6pt; font-size: 9pt; color: #555555; }
.tq-msg .link, .tq-msg a { color: #1155CC; font-weight: normal; text-decoration: underline; }
.tq-none { margin: 0; color: #555555; font-style: italic; }
.tq-atts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 6pt 0 0; font-size: 9pt; color: #444444; }
.tq-atts .ico { color: #555555; }
/* An email already sent is dimmed (desk.css .email.sent .email-body-wrap opacity .72): the paper's greys and blue go
   darker there, so they still read at 4.5:1 or better after the dimming in Light, Eucalypt and Harbour. */
.email.sent .tq-msg, .email.sent .tq-head, .email.sent .tq-addr, .email.sent .tq-subj,
.email.sent .tq-none, .email.sent .tq-atts, .email.sent .tq-atts .ico,
.email.sent .tq-msg .mail-footer { color: #000; }
.email.sent .tq-msg a, .email.sent .tq-msg .link { color: #0B3D91; }
/* On the white paper the focus ring is the paper's own blue, in every theme but high contrast. */
:root:not([data-theme="high_contrast"]) .tq-paper :focus-visible { outline-color: #1F5FD1; }

/* ---------- high contrast and forced colours ---------- */
:root[data-theme="high_contrast"] .tq-chip, :root[data-theme="high_contrast"] details.tq > summary { border: 2px solid #000; background: #fff; color: #000; }
:root[data-theme="high_contrast"] details.tq > summary .n, :root[data-theme="high_contrast"] .tq-left .ico { color: #000; }
:root[data-theme="high_contrast"] details.tq.tq-unsafe > summary { border-width: 3px; box-shadow: none; }
:root[data-theme="high_contrast"] .tq-paper { border: 2px solid #000; box-shadow: none; }
:root[data-theme="high_contrast"] .tq-msg { border-left-color: #000; color: #000; }
:root[data-theme="high_contrast"] .tq-head, :root[data-theme="high_contrast"] .tq-addr, :root[data-theme="high_contrast"] .tq-subj,
:root[data-theme="high_contrast"] .tq-atts, :root[data-theme="high_contrast"] .tq-atts .ico, :root[data-theme="high_contrast"] .tq-none, :root[data-theme="high_contrast"] .tq-msg .mail-footer { color: #000; }
@media (forced-colors: active) {
  .tq-chip, details.tq > summary, .tq-paper { border: 1px solid CanvasText; }
  details.tq.tq-unsafe > summary { border-width: 3px; box-shadow: none; }
  .tq-msg { border-left-color: CanvasText; }
}

/* ---------- phone width ---------- */
@media (max-width: 599px) {
  .tq-paper { padding: 12px; }
  .tq-msg { padding-left: 8px; }
  details.tq > summary { padding: 8px 10px; }
}
