/*
 * TAG Legal Desk v2.1: what goes with each draft (register J119, the Director, 28 Sep 2026: "they should always show
 * what is going to be attached"), and the busy state of Take it and Take over.
 * js\job.js draws the row under each draft's paper and above the thread fold: "Will be attached (3)" with a pill per
 * file, a lock on a file the rules require ("Always sent with a hand over"), one plain line for a file that could not
 * be attached, and "Nothing attached" when there is nothing. The desk's own tokens and glass pills (desk.css .file),
 * its focus ring, reduced motion (desk.css stops every animation), high contrast, forced colours and phone width.
 * No inline styles anywhere.
 */

/* ---------- the row under the paper ---------- */
.att-row { display: grid; gap: 8px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--glass-rim); }
.att-head { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; font-size: .875rem; line-height: 1.25rem; font-weight: 700; color: var(--brand-text); }
.att-head .ico { flex: none; }
.att-title { min-width: 0; overflow-wrap: anywhere; }
/* Nothing attached: quieter, so a row with files stands out, but still there so nobody has to guess. */
.att-row.att-empty { background: transparent; border-style: dashed; border-color: var(--edge-strong); }
.att-row.att-empty .att-head { color: var(--ink-2); font-weight: 600; }

/* ---------- the pills ---------- */
.att-files { gap: 6px 8px; }
.att-pill { max-width: 100%; }
.att-pill .ell { min-width: 0; max-width: 34ch; }
.att-lock { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; color: var(--brand-text); background: var(--brand-soft); }
.att-always { box-shadow: inset 3px 0 0 var(--brand-text); }

/* ---------- a file that could not be attached: Send waits (js\job.js holds it) ---------- */
.att-row.att-held { box-shadow: inset 3px 0 0 var(--danger); }
.att-bad { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: .8125rem; line-height: 1.25rem; font-weight: 700; color: var(--danger); overflow-wrap: anywhere; }
.att-bad .ico { flex: none; margin-top: 2px; }
.att-bad:focus { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

/* ---------- Take it and Take over, while the press is being settled ---------- */
.card .holder .btn[aria-busy="true"], #takeover-btn[aria-busy="true"] { cursor: progress; }
.card .holder .btn .ringspin { flex: none; width: 14px; height: 14px; margin-right: 6px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; opacity: .8; animation: spin .8s linear infinite; }

/* ---------- phone width and touch: 44 px targets ---------- */
@media (max-width: 599px), (pointer: coarse) {
  .att-row .file { min-height: 44px; }
  .att-row .file .x, .att-row .file .dl { width: 40px; height: 40px; }
  .att-row .file .link { min-height: 40px; }
  .att-pill .ell { max-width: 22ch; }
}

/* ---------- high contrast and forced colours ---------- */
:root[data-theme="high_contrast"] .att-row { background: #fff; border: 2px solid #000; }
:root[data-theme="high_contrast"] .att-row.att-empty { border-style: dashed; }
:root[data-theme="high_contrast"] .att-head, :root[data-theme="high_contrast"] .att-row.att-empty .att-head, :root[data-theme="high_contrast"] .att-lock { color: #000; background: #fff; }
:root[data-theme="high_contrast"] .att-lock { border: 2px solid #000; }
:root[data-theme="high_contrast"] .att-always { box-shadow: inset 4px 0 0 #000; }
:root[data-theme="high_contrast"] .att-row.att-held { box-shadow: inset 4px 0 0 #9A0000; }
@media (forced-colors: active) {
  .att-row { border: 1px solid CanvasText; }
  .att-row.att-held { border-left: 4px solid CanvasText; }
  .att-lock { border: 1px solid CanvasText; }
  .att-bad { color: CanvasText; }
}
