/* The Brief workspace (pre-production part 2, js/briefws.js). Tokens only. Outline, document, selected item.
   The Brief is for reading, so it alone uses the reading sizes (--fs-read…); the rest of the app keeps its compact ones. */
#briefPanel { display: none; }
.app.ws-brief { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--bar-h) minmax(0, 1fr); grid-template-areas: "bar" "brief"; }
.app.ws-brief > .panel:not(#briefPanel) { display: none; }
.app.ws-brief #briefPanel { display: flex; grid-area: brief; }
.led-dot.hot { background: var(--hot); box-shadow: 0 0 6px var(--hot-glow); }

/* Outline | document | inspector (always shown on desktop; empty until something is selected) */
.bcols, .bcols.open { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr) 340px; }
.bside[hidden] { display: none; }

/* ---------- the outline ---------- */
.boutline { overflow-y: auto; padding: 16px 12px 24px; border-right: 1px solid var(--groove); display: grid; align-content: start; gap: 14px; }
.bdoc { display: grid; gap: 2px; padding: 0 8px; }
.bdoc b { color: var(--bright); font-weight: var(--fw-on); }
.bdoc small { color: var(--label); font-size: var(--fs-s); }
.bdoc a { color: var(--blue-text); font-size: var(--fs-s); }
.bcounts { display: grid; gap: 4px; }
.bcount { display: flex; align-items: baseline; gap: 10px; text-align: left; padding: 6px 8px; border-radius: var(--r-s); color: var(--text); background: var(--panel2); }
.bcount .n { color: var(--bright); font-size: var(--fs-l); min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.bcount:hover:not(:disabled) { background: var(--hover); color: var(--bright); }
.bcount:disabled { cursor: default; }
.bcount:disabled .n { color: var(--label); }
.bcount.on { box-shadow: inset 2px 0 0 var(--blue); background: var(--sel); }
.otl { display: grid; gap: 1px; }
.otl button { text-align: left; padding: 5px 8px; border-radius: var(--r-s); color: var(--text); display: flex; gap: 8px; align-items: baseline; font-size: var(--fs); }
.otl button.act { padding-left: 30px; color: var(--label); }
.otl button:hover { background: var(--hover); color: var(--bright); }
.otl button.on { background: var(--sel); color: var(--bright); box-shadow: inset 2px 0 0 var(--blue); }
.otl .sn { color: var(--label); min-width: 1.4em; font-size: var(--fs-s); }
.otl button.on .sn { color: var(--blue-text); }
.bhint { color: var(--label); font-size: var(--fs-s); line-height: 1.5; margin: 0; padding: 0 8px; }

/* ---------- the document: a centred reading column ---------- */
.bdocv { overflow-y: auto; padding: 32px 32px 96px; }
.bread { max-width: var(--measure); margin: 0 auto; font-size: var(--fs-read); line-height: var(--lh-read); color: var(--text); }
.bread h1 { color: var(--bright); font-size: var(--fs-read-h1); line-height: 1.25; font-weight: var(--fw-on); margin: 0 -12px 8px; }
.bread h2 { color: var(--bright); font-size: var(--fs-read-h2); line-height: 1.3; font-weight: var(--fw-on); margin: 56px -12px 16px; padding: 20px 12px 0; border-top: 1px solid var(--row-line2); scroll-margin-top: 16px; display: flex; align-items: baseline; gap: 12px; }
.bread h1 + h2 { margin-top: 32px; }
.bread h2 .sn { color: var(--label); font-size: var(--fs-read); font-weight: var(--fw-quiet); min-width: 1.2em; }
.bread h3 { color: var(--bright); font-size: var(--fs-read-h3); line-height: 1.4; font-weight: var(--fw-on); margin: 0; }
.bread h4.bi { color: var(--bright); font-size: var(--fs-read-h3); line-height: 1.4; font-weight: var(--fw-on); margin-top: 28px; }
.bread p:not(.bi) { margin: 0; }
.bread b { color: var(--bright); font-weight: var(--fw-on); }
.bread .lead { font-weight: var(--fw-on); }

/* Every item is selectable */
.bi { cursor: pointer; border-radius: var(--r-m); padding: 4px 12px; margin: 0 -12px 10px; display: block; }
.bi:hover { background: var(--hover); }
.bi.sel { background: var(--sel); box-shadow: inset 0 0 0 1px var(--blue); }
.bi:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.bi.chg { box-shadow: inset 3px 0 0 var(--hot); }
.bi.chg.sel { box-shadow: inset 3px 0 0 var(--hot), inset 0 0 0 1px var(--blue); }
.bi .led-dot { margin-left: 8px; vertical-align: 2px; }
.bi .bn { margin-left: 8px; font-size: var(--fs-s); color: var(--note); white-space: nowrap; }
h2.bi { cursor: pointer; }
.k-act { margin-top: 32px; }
.aq { color: var(--label); font-style: italic; margin-top: 2px; }
.k-movement { margin: 20px -12px 8px; padding-bottom: 0; }
.mv { color: var(--muted); font-weight: var(--fw-on); font-size: var(--fs-s); }
blockquote.bi { color: var(--muted); font-style: italic; border-left: 2px solid var(--edge2); border-radius: 0 var(--r-m) var(--r-m) 0; margin-left: 0; padding-left: 16px; }
.bi.gone { color: var(--faint); text-decoration: line-through; }
.bi .dot { color: var(--label); margin-right: 8px; }

/* Lists: runs of points, "Order of work", the open questions */
.blist { margin: 0 0 16px; padding-left: 1.4em; }
.blist > li.bi { display: list-item; margin: 0 -12px 4px; padding: 4px 12px; }
.blist > li::marker { color: var(--label); font-family: var(--mono); font-size: var(--fs-s); }
ul.blist > li::marker { content: "–  "; }
ul.blist.qs > li::marker { content: "?  "; }

/* Cards: core messages, sequences and beats */
.k-message, .k-sequence, .k-beat { background: var(--panel2); padding: 16px 18px; margin: 0 0 12px; display: grid; gap: 8px; }
.k-message:hover, .k-sequence:hover, .k-beat:hover { background: var(--hover); }
.k-message.sel, .k-sequence.sel, .k-beat.sel { background: var(--sel); }
.bhead { display: flex; align-items: baseline; gap: 10px; }
.bhead b { color: var(--bright); font-weight: var(--fw-on); }
.bhead .no { color: var(--label); font-size: var(--fs-s); min-width: 18px; }
.bq { color: var(--text); }
.k-beat .bq, .k-sequence .bq { padding-left: 28px; }
.k-beat .bhead + .bq { color: var(--muted); }
.blbl { color: var(--label); font-size: var(--fs-s); }
.bline { color: var(--muted); }
.bline .blbl { margin-right: 6px; }
.bfield { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 12px; align-items: baseline; padding-top: 8px; border-top: 1px solid var(--row-line2); color: var(--muted); }
.k-beat .bfield, .k-sequence .bfield { margin-left: 28px; }
.bfield .chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bfield .chip { font-size: var(--fs-s); }
.bfield .chip.live { color: var(--bright); border-color: var(--edge3); }
.bfield .chip.live .led-dot { background: var(--ok); box-shadow: 0 0 5px var(--ok); }
.bfield .chip:hover { background: var(--hover); color: var(--bright); }
.bfield .said { color: var(--muted); }
.bnone { color: var(--label); }
.btodo { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.btodo li { display: flex; gap: 8px; }
.btodo li::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: .45em; border: 1px solid var(--edge3); border-radius: var(--r-xs); }

/* ---------- the inspector ---------- */
.bside { overflow-y: auto; padding: 14px 16px 30px; border-left: 1px solid var(--groove); }
.bshead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bside .bk { color: var(--label); font-size: var(--fs-s); }
.bx { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-s); color: var(--dim); font-size: var(--fs-l); line-height: 1; }
.bx:hover { background: var(--hover); color: var(--bright); }
.bx:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.bside h3 { margin: 2px 0 8px; color: var(--bright); font-size: var(--fs-l); font-weight: var(--fw-on); line-height: 1.35; }
.bside p { margin: 0 0 4px; color: var(--text); line-height: 1.5; }
.bside .lbl { margin: 16px 0 6px; color: var(--label); font-size: var(--fs-s); display: flex; justify-content: space-between; gap: 8px; }
.bside .note { width: 100%; }
.bside .bhint { padding: 0; margin-top: 6px; }
.bnote { display: grid; gap: 1px; padding: 6px 10px; margin-bottom: 6px; border-left: 2px solid var(--note); background: var(--panel2); border-radius: 0 var(--r-s) var(--r-s) 0; }
.bnote b { color: var(--bright); font-weight: 500; font-size: var(--fs-s); }

@media (max-width: 1100px) {
  .bcols, .bcols.open { grid-template-columns: 220px minmax(0, 1fr) 300px; }
}
@media (max-width: 820px) {
  .bcols, .bcols.open { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .boutline { border: 0; border-bottom: 1px solid var(--groove); }
  .bdocv { overflow: visible; padding: 20px 16px 64px; }
  .bread h2 { margin-top: 40px; }
  .k-message, .k-sequence, .k-beat { padding: 14px; }
  .k-beat .bq, .k-sequence .bq, .k-beat .bfield, .k-sequence .bfield { padding-left: 0; margin-left: 0; }
  .bfield { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  /* the inspector covers the brief as a sheet; × or Esc closes it */
  .bside { position: fixed; inset: 0; z-index: 30; background: var(--panel); border: 0; padding: 12px 16px 40px; }
}

/* ---------- links (pre-production part 3, js/links.js): filmed bites, the live Have, "Why is this here?" ---------- */
.lbites { display: grid; gap: 4px; }
.lbite, .whyrow { display: grid; gap: 1px; text-align: left; padding: 6px 10px; border-left: 3px solid var(--c, var(--blue)); background: var(--panel2); border-radius: 0 var(--r-s) var(--r-s) 0; }
.lbite:hover, .whyrow:hover { background: var(--hover); }
.lbite b, .whyrow b { font-weight: 450; color: var(--text); }
.lbite small, .whyrow small { color: var(--dim); font-size: var(--fs-s); }
.bside .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.why { display: grid; gap: 6px; min-width: 420px; }
.why .lbl { margin-top: 8px; }
.why .key { justify-self: start; margin-top: 8px; }
.lseq { display: grid; gap: 10px; }
.lsg { display: grid; gap: 4px; }
.lsh { text-align: left; color: var(--bright); font-weight: 500; }
.lsh:hover { color: var(--blue-text); }
