/*
 * TAG Legal Desk v2.1: lane t22-nostop (js\v21_nostop.js).
 * A "Your CM Task" card: a band down its left edge and a badge in the owner's own colour (--nst-c, set through the
 * CSSOM), a light wash of the same colour, and a due badge; never grey. The heads up lines of a card that goes with
 * something to say: plain lines in the warning token. Light, dark, high contrast, reduced glass, forced colours and
 * print each read clearly; nothing here moves.
 */

/* ---------- the task card ---------- */
.card.nst-taskcard {
  --nst-c: var(--brand);
  background: color-mix(in srgb, var(--nst-c) 10%, var(--glass-1));
  box-shadow: inset 6px 0 0 var(--nst-c), inset 0 1px 0 var(--glass-hi), 0 0 0 1px color-mix(in srgb, var(--nst-c) 45%, var(--glass-rim)), var(--shadow-1);
  opacity: 1; filter: none;
}
.nst-task { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; padding-left: 4px; }
.nst-badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: .8125rem; line-height: 1.25rem; font-weight: 700; color: var(--ink);
  background: color-mix(in srgb, var(--nst-c, var(--brand)) 22%, var(--solid));
  box-shadow: inset 0 0 0 1.5px var(--nst-c, var(--brand));
}
.nst-due {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: .8125rem; line-height: 1.25rem; font-weight: 700; color: var(--ink);
  background: color-mix(in srgb, var(--warn) 18%, var(--solid)); box-shadow: inset 0 0 0 1.5px var(--warn);
}
.nst-due.is-urgent { color: var(--solid); background: var(--danger); box-shadow: none; }

/* ---------- the open task job ---------- */
.job-top.nst-taskjob { box-shadow: inset 6px 0 0 var(--nst-c, var(--brand)); background: color-mix(in srgb, var(--nst-c, var(--brand)) 8%, transparent); }
.nst-task-job { flex-basis: 100%; margin: 6px 0 0 8px; }

/* ---------- heads up lines ----------
 * On a board card (a grid: glyph, body, side) the list sits on its own row under the body's words, never squeezed
 * into the glyph's 40px column; it is only as wide as its words, each line on its own row with a small warning dot. */
.nst-heads { list-style: none; margin: 2px 0 0; padding: 6px 12px 6px 10px; border-radius: 10px; display: grid; gap: 4px;
  min-width: 0; max-width: 100%; box-sizing: border-box;
  background: color-mix(in srgb, var(--warn) 10%, transparent); box-shadow: inset 3px 0 0 var(--warn); }
.card > .nst-heads { grid-column: 2 / 3; justify-self: start; position: relative; z-index: 0; pointer-events: none; }
.nst-head { display: grid; grid-template-columns: 6px minmax(0, 1fr); align-items: start; column-gap: 8px; min-width: 0;
  font-size: .8125rem; line-height: 1.25rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; text-wrap: pretty; }
.nst-head::before { content: ""; width: 6px; height: 6px; margin-top: calc((1.25rem - 6px) / 2); border-radius: 50%; background: var(--warn); }
.nst-heads-job { flex-basis: 100%; margin: 6px 0 0 8px; justify-self: start; }

/* ---------- phone width ---------- */
@media (max-width: 599px) {
  .nst-badge, .nst-due { font-size: .75rem; padding: 1px 8px; }
  .nst-head { font-size: .75rem; line-height: 1.125rem; }
  .nst-head::before { margin-top: calc((1.125rem - 6px) / 2); }
  .card > .nst-heads { grid-column: 2 / -1; }
}

/* ---------- dark ---------- */
:root[data-theme="dark"] .card.nst-taskcard { background: color-mix(in srgb, var(--nst-c) 16%, var(--glass-1)); }
:root[data-theme="dark"] .nst-heads { background: color-mix(in srgb, var(--warn) 16%, transparent); }

/* ---------- reduced glass and reduced transparency: a plain tint ---------- */
:root[data-glass="reduced"] .card.nst-taskcard { background: color-mix(in srgb, var(--nst-c) 10%, var(--solid)); }
@media (prefers-reduced-transparency: reduce) {
  .card.nst-taskcard { background: color-mix(in srgb, var(--nst-c) 10%, var(--solid)); }
}

/* ---------- high contrast: white, a black edge, a thick bar in the owner's colour, black words ---------- */
:root[data-theme="high_contrast"] .card.nst-taskcard { background: #FFFFFF; color: #000000; border: 2px solid #000000; box-shadow: inset 10px 0 0 var(--nst-c); }
:root[data-theme="high_contrast"] .nst-badge { background: #FFFFFF; color: #000000; box-shadow: none; border: 2px solid #000000; }
:root[data-theme="high_contrast"] .nst-due { background: #FFFFFF; color: #000000; box-shadow: none; border: 2px solid #000000; }
:root[data-theme="high_contrast"] .nst-due.is-urgent { background: #000000; color: #FFFFFF; }
:root[data-theme="high_contrast"] .nst-heads { background: #FFFFFF; box-shadow: none; border-left: 4px solid #000000; border-radius: 0; }
:root[data-theme="high_contrast"] .nst-head { color: #000000; }
:root[data-theme="high_contrast"] .nst-head::before { background: #000000; }
:root[data-theme="high_contrast"] .job-top.nst-taskjob { background: #FFFFFF; box-shadow: inset 10px 0 0 var(--nst-c); }

/* ---------- forced colours: the system's own colours, the words and the edge ---------- */
@media (forced-colors: active) {
  .card.nst-taskcard { border: 2px solid CanvasText; border-left-width: 8px; }
  .nst-badge, .nst-due, .nst-heads { border: 1px solid CanvasText; background: Canvas; color: CanvasText; box-shadow: none; }
  .nst-head { color: CanvasText; }
  .nst-head::before { background: CanvasText; forced-color-adjust: none; }
}

/* ---------- print ---------- */
@media print {
  .card.nst-taskcard { background: none !important; box-shadow: none !important; border: 1px solid #000000 !important; border-left: 6px solid #000000 !important; }
  .nst-badge, .nst-due, .nst-heads { background: none !important; box-shadow: none !important; border: 1px solid #000000; color: #000000; }
}
