/*
 * TAG Legal Desk v2.1: Show on the board, and looking at a claims manager job together (register J239,
 * js\v21_boardshow.js). Theme tokens only, no inline styles. Show is a comfort piece: the quiet states never hide it.
 * The blurred card keeps J179's frost (styles\v21_cmonly.css): shapes under the frost, never blurred words; this file
 * adds its age, Ask to look and the countdowns. Reduced motion, Calm, High contrast, forced colours and print each have
 * their own plain rules below.
 */

/* ---------- Show in the board head ---------- */
.bsh-btn { min-height: 44px; }
.bsh-btn .ico { color: var(--brand-text); }
.bsh-btn .bsh-n {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink); font-size: .75rem; font-weight: 700; line-height: 1;
}
.bsh-btn .bsh-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-text); }
.bsh-btn .bsh-n[hidden], .bsh-btn .bsh-dot[hidden] { display: none; }
:root[data-theme="dark"] .bsh-btn .bsh-n { background: #3F7A47; color: #FFFFFF; }

/* ---------- the list of switches (and the invite) ---------- */
/* release 149k: never past the window. js\v21_boardshow.js sets --bsh-max to the room under the Show button (or the
   window less a margin); the title and the foot stay put and the list scrolls inside. */
.pop.bsh-pop {
  width: min(23rem, calc(100vw - 24px)); gap: 8px; display: flex; flex-direction: column; overflow: hidden;
  max-height: calc(100vh - 24px); max-height: var(--bsh-max, calc(100vh - 24px));
  transition-property: none; /* its height is read the moment it is set (reduced motion's 1 ms would delay it) */
}
.pop.bsh-pop.bsh-pop-wide { width: min(26rem, calc(100vw - 24px)); }
.bsh-body { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 0; }
.bsh-body > * { flex: none; }
.bsh-body > .bsh-scroll {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -10px; padding: 0 10px 2px; border-top: 1px solid var(--glass-rim);
}
.pop .bsh-h { margin: 0; font-size: 1rem; }
.pop .bsh-safe { font-size: .8125rem; color: var(--ink-3); }
.bsh-list { list-style: none; margin: 0; padding: 0; display: grid; }
.bsh-row { display: grid; padding: 2px 0 6px; border-top: 1px solid var(--glass-rim); }
.bsh-row:first-child { border-top: 0; }
.bsh-row > .switch { justify-content: flex-start; width: 100%; text-align: left; color: var(--ink); }
.pop .bsh-hint { margin: -8px 0 0 54px; font-size: .8125rem; line-height: 1.125rem; color: var(--ink-3); }
.bsh-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--glass-rim); }
.pop .bsh-now { font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.bsh-times { display: flex; flex-wrap: wrap; gap: 8px; }
.bsh-times .btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--brand-text); }

/* ---------- release 149k: folds and tick boxes (a leader's View as; the lead status boxes on the Leads tab) ---------- */
.bsh-folds { display: block; }
.bsh-fold { border-top: 1px solid var(--glass-rim); }
.bsh-fold:first-child { border-top: 0; }
.bsh-fold-h {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 2px; cursor: pointer; list-style: none;
  font-size: .875rem; font-weight: 700; color: var(--ink); border-radius: 8px;
}
.bsh-fold-h::-webkit-details-marker { display: none; }
.bsh-fold-h::marker { content: ''; }
.bsh-fold-h::before {
  content: ''; flex: none; width: 7px; height: 7px; margin: 0 5px 2px 3px; border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform var(--t-small) ease;
}
.bsh-fold[open] > .bsh-fold-h::before { transform: rotate(45deg); margin-bottom: 4px; }
.bsh-fold-h:hover { color: var(--brand-text); }
.bsh-fold-t { flex: none; }
.bsh-fold-s {
  flex: 1 1 auto; min-width: 0; text-align: right; font-size: .8125rem; font-weight: 600; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bsh-fold-s.bsh-lcount { color: var(--brand-text); font-weight: 700; white-space: normal; overflow: visible; line-height: 1.125rem; }
.bsh-ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; padding: 0 0 8px 22px; }
.bsh-ticks.is-wide { grid-template-columns: minmax(0, 1fr); }
.bsh-tick { display: flex; align-items: center; gap: 8px; min-height: 34px; min-width: 0; font-size: .875rem; color: var(--ink); cursor: pointer; }
.bsh-tick.is-all { grid-column: 1 / -1; font-weight: 600; }
.bsh-tick.is-wide { align-items: flex-start; padding: 6px 0; }
.bsh-tick.is-wide .bsh-tick-in { margin-top: 1px; }
.bsh-tick-in { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--brand-text); cursor: pointer; }
.bsh-tick-w { display: grid; min-width: 0; }
.bsh-tick-l { overflow-wrap: anywhere; }
.bsh-tick-h { font-size: .8125rem; line-height: 1.125rem; color: var(--ink-3); }
.pop .bsh-note { grid-column: 1 / -1; margin: 2px 0 2px; font-size: .8125rem; line-height: 1.125rem; color: var(--ink-3); }

/* ---------- t22-leadfilter: the lead status boxes, and its "3 hidden" ---------- */
.bsh-lcount { font-weight: 700; color: var(--brand-text); }
.bsh-lcount:empty { display: none; }
.bsh-lstat { display: grid; gap: 2px; margin: 4px 0 0 54px; padding: 0; border: 0; min-width: 0; }
.bsh-lstat-h { padding: 0; margin: 0 0 2px; font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.bsh-lstat-row { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: .875rem; color: var(--ink); cursor: pointer; }
.bsh-lstat-in { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--brand-text); cursor: pointer; }
.pop .bsh-lstat-note { margin: 2px 0 0 54px; }
/* in a fold: under the lead concierge's Leads switch, or at the top of a leader's list on the Leads tab */
.bsh-row .bsh-fold { margin: 0 0 0 54px; border-top: 0; }
.bsh-row.bsh-row-lonly .bsh-fold { margin-left: 0; } /* release 149n: the Leads tab with no Leads row */
.bsh-fold .bsh-lstat { margin: 0; padding: 0 0 2px 22px; }
.bsh-fold .bsh-lstat.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.pop .bsh-fold .bsh-lstat-note { margin: 0 0 8px 22px; }
@media (max-width: 599px) {
  .bsh-lstat, .pop .bsh-lstat-note { margin-left: 24px; }
  .bsh-lstat-row { min-height: 40px; }
  .bsh-row .bsh-fold { margin-left: 24px; }
  .bsh-fold .bsh-lstat, .pop .bsh-fold .bsh-lstat-note { margin-left: 0; }
  .bsh-ticks, .bsh-fold .bsh-lstat { padding-left: 8px; }
  .pop .bsh-fold .bsh-lstat-note { margin-left: 8px; }
  .bsh-tick { min-height: 40px; }
  .bsh-fold-h { min-height: 44px; }
}
@media (max-width: 359px) {
  .bsh-ticks, .bsh-fold .bsh-lstat.is-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- the blurred card: its age, and Ask to look ---------- */
.cmo-card.bsh-stub { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.cmo-card.bsh-stub > .cmo-face { grid-column: 1; min-width: 0; }
.bsh-age { font-size: .75rem; line-height: 1rem; font-weight: 600; color: var(--ink-3); }
.cmo-card .bsh-ask, .cmo-card .bsh-asking { position: relative; z-index: 2; grid-column: 2; margin-right: 14px; pointer-events: auto; }
.cmo-card .bsh-asking {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--solid); color: var(--ink); font-size: .8125rem; font-weight: 700; box-shadow: var(--shadow-1);
}
.bsh-dots { display: inline-flex; gap: 3px; align-items: center; }
.bsh-dots > i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .3; animation: bsh-dot 1.2s ease-in-out infinite; }
.bsh-dots > i:nth-child(2) { animation-delay: .2s; }
.bsh-dots > i:nth-child(3) { animation-delay: .4s; }
@keyframes bsh-dot { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- the whole card, read only, while its owner lets me look ---------- */
.card.bsh-look { cursor: default; box-shadow: inset 0 0 0 2px var(--brand-text), var(--shadow-1); }
.card.bsh-look:hover { transform: none; }
.card.bsh-look .tag.bsh-ro { background: var(--brand-soft); color: var(--brand-text); }
.bsh-band, .bsh-own { grid-column: 1 / -1; }
.bsh-band { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.bsh-band .ico { color: var(--brand-text); }

/* ---------- the owner's card: Invite to look, who is looking, an ask ---------- */
.card .bsh-own { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: -4px; }
.bsh-own .bsh-who { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 700; color: var(--ink); }
.bsh-own .bsh-who .ico { color: var(--brand-text); }
.bsh-left { font-size: .8125rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bsh-own .bsh-invite { min-height: 36px; padding: 0 8px; }

/* ---------- phone width ---------- */
@media (max-width: 599px) {
  .cmo-card .bsh-ask, .cmo-card .bsh-asking { margin-right: 10px; }
  .cmo-card .bsh-ask > span { white-space: nowrap; }
  .card .bsh-own { margin-top: 0; }
}

/* ---------- still: reduced motion and Calm ---------- */
@media (prefers-reduced-motion: reduce) { .bsh-dots > i { animation: none; opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .bsh-fold-h::before { transition: none; } }
:root[data-motion="reduced"] .bsh-dots > i, :root[data-calm="on"] .bsh-dots > i { animation: none; opacity: .7; }

/* ---------- High contrast ---------- */
:root[data-theme="high_contrast"] .bsh-btn .bsh-n { background: #000000; color: #FFFFFF; }
:root[data-theme="high_contrast"] .bsh-btn .bsh-dot { background: #000000; }
:root[data-theme="high_contrast"] .bsh-age, :root[data-theme="high_contrast"] .bsh-left, :root[data-theme="high_contrast"] .bsh-band,
:root[data-theme="high_contrast"] .pop .bsh-hint, :root[data-theme="high_contrast"] .pop .bsh-safe { color: #000000; }
:root[data-theme="high_contrast"] .cmo-card .bsh-asking { background: #FFFFFF; color: #000000; border: 2px solid #000000; box-shadow: none; }
:root[data-theme="high_contrast"] .card.bsh-look { box-shadow: inset 0 0 0 3px #000000; }
:root[data-theme="high_contrast"] .bsh-row { border-top-color: #000000; }
:root[data-theme="high_contrast"] .bsh-lcount, :root[data-theme="high_contrast"] .bsh-lstat-h, :root[data-theme="high_contrast"] .bsh-lstat-row { color: var(--ink); }
:root[data-theme="high_contrast"] .bsh-lstat-in { accent-color: var(--ink); }
:root[data-theme="high_contrast"] .bsh-fold, :root[data-theme="high_contrast"] .bsh-body > .bsh-scroll { border-top-color: #000000; }
:root[data-theme="high_contrast"] .bsh-fold-h, :root[data-theme="high_contrast"] .bsh-fold-s, :root[data-theme="high_contrast"] .bsh-tick,
:root[data-theme="high_contrast"] .bsh-tick-h, :root[data-theme="high_contrast"] .pop .bsh-note { color: var(--ink); }
:root[data-theme="high_contrast"] .bsh-fold-h::before { border-color: var(--ink); }
:root[data-theme="high_contrast"] .bsh-tick-in { accent-color: var(--ink); }

/* ---------- forced colours ---------- */
@media (forced-colors: active) {
  .bsh-btn .bsh-n { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  .bsh-btn .bsh-dot { background: CanvasText; forced-color-adjust: none; }
  .cmo-card .bsh-asking { background: Canvas; color: CanvasText; border: 1px solid CanvasText; box-shadow: none; }
  .card.bsh-look { border: 2px solid CanvasText; box-shadow: none; }
  .bsh-age, .bsh-left, .bsh-band { color: CanvasText; }
  .bsh-lcount, .bsh-lstat-h, .bsh-lstat-row { color: CanvasText; }
  .bsh-lstat-in { accent-color: auto; forced-color-adjust: auto; }
  .bsh-fold-h, .bsh-fold-s, .bsh-tick, .bsh-tick-h, .bsh-note { color: CanvasText; }
  .bsh-fold-h::before { border-color: CanvasText; }
  .bsh-tick-in { accent-color: auto; forced-color-adjust: auto; }
}

/* ---------- print ---------- */
@media print {
  .bsh-btn, .bsh-own, .cmo-card .bsh-ask, .cmo-card .bsh-asking { display: none; }
  .bsh-age, .bsh-left, .bsh-band { color: #000000; }
}
