/*
 * TAG Legal Desk v2.1: claims manager only jobs (register J179, js\v21_cmonly.js).
 * Everyone else's card: frosted glass tinted in the owner's own colour (--cmo-c, set through the CSSOM), shapes under
 * the frost and never words, a small lock, "Claims manager only" and "For {first name}". It is not a button: no hover
 * lift, no pointer hand, no text to select or drag. It sits at the very bottom of the board and is a little shorter
 * than a job, so it is not in the way.
 * The owner's own card, job and emails: a small chip in their colour, and the From line "Sends from your own email".
 * Nothing here moves, so Calm, reduced motion, the quiet states and the days that matter change nothing. High contrast,
 * reduced glass (and reduced transparency), forced colours and print each have their own plain rules below: the words
 * are always there and always read clearly; only the frost goes.
 */

/* ---------- everyone else: the frosted card ---------- */
/* Their own list, after the Clear panel: the very last thing on the board. */
.cards.cards-cm { margin-top: 12px; }
@media (max-width: 599px) { .cards.cards-cm { margin-top: 8px; } }
.cards > li > .cmo-card { width: 100%; }
.cmo-card {
  --cmo-c: var(--brand);
  position: relative; display: block; min-height: 68px; border-radius: var(--r-card); overflow: hidden; contain: layout paint;
  cursor: default; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; color: var(--ink);
  background: color-mix(in srgb, var(--cmo-c) 14%, var(--glass-1));
  border: 1px solid color-mix(in srgb, var(--cmo-c) 42%, var(--glass-edge));
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim), var(--shadow-1);
}
/* Under the frost: a disc, two bars and a pill, where a job's glyph, lines and count would be. Never words. */
.cmo-under {
  position: absolute; inset: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 14px 20px; filter: blur(6px); opacity: .6; pointer-events: none;
}
.cmo-dot { width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--cmo-c) 60%, transparent); }
.cmo-lines { display: grid; gap: 9px; min-width: 0; }
.cmo-bar { display: block; height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 34%, transparent); }
.cmo-bar-1 { width: 64%; }
.cmo-bar-2 { width: 38%; height: 9px; }
.cmo-pill { width: 104px; height: 24px; border-radius: 999px; background: color-mix(in srgb, var(--cmo-c) 45%, transparent); }
.cmo-frost {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, color-mix(in srgb, var(--cmo-c) 30%, transparent), color-mix(in srgb, var(--cmo-c) 12%, transparent) 60%, color-mix(in srgb, var(--cmo-c) 22%, transparent));
  -webkit-backdrop-filter: blur(10px) saturate(1.25); backdrop-filter: blur(10px) saturate(1.25);
}
/* The words, sharp on top of the frost, on a small plate so they read in every colour. */
.cmo-face { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 18px; pointer-events: none; }
.cmo-lock {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--solid); color: var(--ink); box-shadow: 0 0 0 3px var(--cmo-c), var(--shadow-1);
}
.cmo-words {
  display: grid; min-width: 0; padding: 5px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--solid) 84%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cmo-c) 35%, transparent);
}
.cmo-label { font-size: .9375rem; line-height: 1.25rem; font-weight: 700; color: var(--ink); }
.cmo-for { font-size: .8125rem; line-height: 1.125rem; font-weight: 600; color: var(--ink-2); }
/* A colleague's looking ring on it stays a ring: nothing on this card ever lifts or changes under a pointer. */
.cmo-card:hover { transform: none; }

/* ---------- the owner: the chip, the From line, the signature line ---------- */
.tag.cmo-tag {
  --cmo-c: var(--brand);
  color: var(--ink); background: color-mix(in srgb, var(--cmo-c) 16%, var(--solid));
  box-shadow: inset 0 0 0 1.5px var(--cmo-c);
}
.tag.cmo-tag .ico { color: var(--ink); }
.job-top .meta .cmo-jobchip { margin-left: 2px; align-self: center; }
.rcpt.cmo-from {
  --cmo-c: var(--brand);
  padding: 6px 10px 6px 8px; margin: 0 -2px 2px; border-radius: 10px;
  background: color-mix(in srgb, var(--cmo-c) 12%, transparent);
  box-shadow: inset 3px 0 0 var(--cmo-c);
}
.rcpt.cmo-from .k { width: 50px; color: var(--ink-2); }
.rcpt.cmo-from .ico { color: var(--ink-2); flex: none; }
/* The address is never cut short: it wraps rather than ending in dots. */
.rcpt.cmo-from { flex-wrap: wrap; row-gap: 2px; }
.rcpt.cmo-from .nm { color: var(--ink); max-width: none; }
.rcpt.cmo-from .ad { color: var(--ink-2); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.paper .cmo-sig { margin: 14pt 0 0; font-family: Arial, sans-serif; font-size: 9pt; line-height: 1.4; color: #4A4A4A; font-style: italic; }

/* ---------- phone width ---------- */
@media (max-width: 599px) {
  .cmo-card, .cmo-face { min-height: 60px; }
  .cmo-face { padding: 10px 14px; gap: 10px; }
  .cmo-lock { width: 32px; height: 32px; }
  .cmo-under { padding: 12px 14px; grid-template-columns: 32px minmax(0, 1fr); }
  .cmo-dot { width: 32px; height: 32px; }
  .cmo-pill { display: none; }
  .cmo-label { font-size: .875rem; }
}

/* ---------- dark: the frost is darker glass, the plate darker paper ---------- */
:root[data-theme="dark"] .cmo-card { background: color-mix(in srgb, var(--cmo-c) 18%, var(--glass-1)); border-color: color-mix(in srgb, var(--cmo-c) 50%, var(--glass-edge)); }
:root[data-theme="dark"] .cmo-bar { background: color-mix(in srgb, var(--ink) 26%, transparent); }
:root[data-theme="dark"] .cmo-words { background: color-mix(in srgb, var(--solid) 88%, transparent); }

/* ---------- reduced glass and reduced transparency: a plain tint, no frost ---------- */
:root[data-glass="reduced"] .cmo-card { background: color-mix(in srgb, var(--cmo-c) 14%, var(--solid)); }
:root[data-glass="reduced"] .cmo-frost { -webkit-backdrop-filter: none; backdrop-filter: none; background: none; }
:root[data-glass="reduced"] .cmo-under { opacity: .35; }
@media (prefers-reduced-transparency: reduce) {
  .cmo-card { background: color-mix(in srgb, var(--cmo-c) 14%, var(--solid)); }
  .cmo-frost { -webkit-backdrop-filter: none; backdrop-filter: none; background: none; }
  .cmo-under { opacity: .35; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .cmo-frost { background: color-mix(in srgb, var(--cmo-c) 20%, var(--solid)); opacity: .82; }
}

/* ---------- High contrast: white card, black edge, a thick bar in the owner's colour, black words ---------- */
:root[data-theme="high_contrast"] .cmo-card { background: #FFFFFF; border: 2px solid #000000; box-shadow: inset 10px 0 0 var(--cmo-c); color: #000000; }
:root[data-theme="high_contrast"] .cmo-under, :root[data-theme="high_contrast"] .cmo-frost { display: none; }
:root[data-theme="high_contrast"] .cmo-face { padding-left: 24px; }
:root[data-theme="high_contrast"] .cmo-lock { background: #FFFFFF; color: #000000; box-shadow: 0 0 0 2px #000000; }
:root[data-theme="high_contrast"] .cmo-words { background: none; box-shadow: none; padding-left: 4px; }
:root[data-theme="high_contrast"] .cmo-label, :root[data-theme="high_contrast"] .cmo-for { color: #000000; }
:root[data-theme="high_contrast"] .tag.cmo-tag { background: #FFFFFF; color: #000000; border: 2px solid #000000; box-shadow: inset 6px 0 0 var(--cmo-c); padding-left: 12px; }
:root[data-theme="high_contrast"] .rcpt.cmo-from { background: #FFFFFF; box-shadow: none; border-radius: 0; border-left: 4px solid #000000; }
:root[data-theme="high_contrast"] .rcpt.cmo-from .k, :root[data-theme="high_contrast"] .rcpt.cmo-from .ad, :root[data-theme="high_contrast"] .rcpt.cmo-from .ico { color: #000000; }

/* ---------- forced colours: the system's own colours, the words and the edge ---------- */
@media (forced-colors: active) {
  .cmo-under, .cmo-frost { display: none; }
  .cmo-card { border: 2px solid CanvasText; background: Canvas; color: CanvasText; }
  .cmo-lock, .cmo-words { background: Canvas; color: CanvasText; box-shadow: none; border: 1px solid CanvasText; }
  .cmo-label, .cmo-for { color: CanvasText; }
  .tag.cmo-tag, .rcpt.cmo-from { border: 1px solid CanvasText; background: Canvas; color: CanvasText; box-shadow: none; }
}

/* ---------- print: the words and a plain edge, no frost and no colour wash ---------- */
@media print {
  .cmo-under, .cmo-frost { display: none !important; }
  .cmo-card { background: none !important; border: 1px solid #000000 !important; box-shadow: none !important; color: #000000; min-height: 0; }
  .cmo-face { min-height: 0; padding: 6px 10px; }
  .cmo-lock { box-shadow: none; border: 1px solid #000000; }
  .cmo-words { background: none; box-shadow: none; }
  .cmo-label, .cmo-for { color: #000000; }
  .tag.cmo-tag, .rcpt.cmo-from { background: none; box-shadow: none; border: 1px solid #000000; color: #000000; }
}
