/*
 * J250 (30 Sep 2026): Hold and redo (js/v21_hold.js), and J253: the quiet line at the top of the board while Fred
 * reads what came in (js/board.js), and J248: the calm "Fred is fixing this" (js/v21_fixit.js, js/job.js).
 * In the desk's own tokens, so every theme follows. Nothing here moves under reduced motion or Calm. No inline styles
 * anywhere (the page CSP forbids them).
 */

/* ---------- J253: Fred is reading 3 new things ---------- */
.board-thinking { display: block; margin: 0 4px 10px; font-size: .875rem; line-height: 1.25rem; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.board-thinking[hidden] { display: none; }
.board-thinking .bt-dot { display: inline-block; vertical-align: middle; width: 8px; height: 8px; margin: -2px 8px 0 0; border-radius: 50%; background: var(--info); opacity: .75; animation: hld-breathe 2.4s ease-in-out infinite; }
.board-thinking .bt-w { font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.board-thinking .bt-old { color: var(--ink-3); overflow-wrap: anywhere; }
@keyframes hld-breathe { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }

/* ---------- J248: Fred is fixing this ---------- */
.fx-working { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 12px; border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--info); background: color-mix(in srgb, var(--info) var(--tint-alpha), transparent); }
.fx-working:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.fx-working .fx-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: hld-breathe 1.8s ease-in-out infinite; }
.fx-note .fx-why { margin: -4px 0 8px; color: var(--ink-2); overflow-wrap: anywhere; }
.fx-note .fx-why-k { font-weight: 700; color: var(--ink); }
.feedback .fx-note.fx-note-none { background: color-mix(in srgb, var(--info) 7%, var(--solid)); box-shadow: inset 3px 0 0 var(--info), 0 0 0 1px var(--glass-rim); }
.fx-note.fx-note-none .fx-note-h { color: var(--info); }

/* ---------- J250: the held card ---------- */
.card.hld-m { padding-right: 60px; }
.card > .hld-menu { position: absolute; z-index: 3; top: 50%; right: 12px; margin-top: -18px; width: 36px; height: 36px; min-height: 36px; padding: 0; display: grid; place-items: center; }
.card > .hld-menu:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.card.hld-on { cursor: default; }
.card.hld-on > .glyph, .card.hld-on > .body, .card.hld-on > .side { opacity: 0; }
.card > .hld-lock {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-radius: inherit;
  pointer-events: none; min-width: 0; overflow: hidden;
  background: color-mix(in srgb, var(--warn) 10%, var(--solid)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 55%, transparent);
}
.card.hld-m > .hld-lock { padding-right: 60px; }
.hld-lock .hld-ico, .hld-band .hld-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--solid); color: var(--warn); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 60%, transparent); }
.hld-lock .hld-words, .hld-band .hld-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hld-lock .hld-say { font-size: .9375rem; line-height: 1.25rem; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.hld-lock .hld-why { font-size: .8125rem; line-height: 1.125rem; font-weight: 600; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; }

/* ---------- J250: the held job ---------- */
.hld-band {
  position: relative; z-index: 3; flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-width: 0;
  background: color-mix(in srgb, var(--warn) 12%, var(--solid)); color: var(--ink); box-shadow: inset 4px 0 0 var(--warn);
}
.hld-band:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hld-band .hld-say { font-weight: 700; overflow-wrap: anywhere; }
.hld-band .hld-why { font-size: .875rem; color: var(--ink-2); overflow-wrap: anywhere; }
.job-top .hld-top { flex: none; }
.pop .hld-reason textarea { width: 100%; min-height: 72px; resize: vertical; box-sizing: border-box; font: inherit; }
.pop .hld-reason .hld-reason-what { margin: 0 0 12px; font-size: .875rem; color: var(--ink-2); }
.pop .hld-reason .hld-reason-l { display: block; margin: 0 0 6px; font-size: .8125rem; font-weight: 700; color: var(--ink); }

/* ---------- narrow screens ---------- */
@media (max-width: 480px) {
  .card.hld-m { padding-right: 52px; }
  .card > .hld-menu { right: 8px; }
  .card > .hld-lock { padding: 10px 14px; gap: 10px; }
  .card.hld-m > .hld-lock { padding-right: 52px; }
  .hld-lock .hld-ico { width: 28px; height: 28px; }
  .job-top .hld-top span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- reduced motion and Calm: still ---------- */
@media (prefers-reduced-motion: reduce) {
  .board-thinking .bt-dot, .fx-working .fx-dot { animation: none; }
}
:root[data-calm="on"] .board-thinking .bt-dot, :root[data-calm="on"] .fx-working .fx-dot,
:root[data-motion="reduced"] .board-thinking .bt-dot, :root[data-motion="reduced"] .fx-working .fx-dot { animation: none; }

/* ---------- High contrast: edges, not tints ---------- */
:root[data-theme="high_contrast"] .card > .hld-lock { background: #FFFFFF; box-shadow: inset 0 0 0 3px #000000; }
:root[data-theme="high_contrast"] .card.hld-on > .glyph, :root[data-theme="high_contrast"] .card.hld-on > .body, :root[data-theme="high_contrast"] .card.hld-on > .side { opacity: 0; }
:root[data-theme="high_contrast"] .hld-lock .hld-ico, :root[data-theme="high_contrast"] .hld-band .hld-ico { color: #000000; box-shadow: 0 0 0 2px #000000; }
:root[data-theme="high_contrast"] .hld-band { border: 2px solid #000000; box-shadow: none; }
:root[data-theme="high_contrast"] .fx-working { color: #000000; background: #FFFFFF; border: 1px solid #000000; }
:root[data-theme="high_contrast"] .board-thinking, :root[data-theme="high_contrast"] .board-thinking .bt-old { color: #000000; }

/* ---------- forced colours ---------- */
@media (forced-colors: active) {
  .card > .hld-lock { background: Canvas; border: 2px solid CanvasText; forced-color-adjust: none; color: CanvasText; }
  .card.hld-on > .glyph, .card.hld-on > .body, .card.hld-on > .side { opacity: 0; }
  .hld-lock .hld-say, .hld-lock .hld-why { color: CanvasText; }
  .hld-lock .hld-ico, .hld-band .hld-ico { border: 1px solid CanvasText; color: CanvasText; background: Canvas; }
  .hld-band { border: 2px solid CanvasText; }
  .fx-working { border: 1px solid CanvasText; }
  .board-thinking .bt-dot, .fx-working .fx-dot { background: CanvasText; }
}
