/* Review: the queue and the detail side by side, the change in detail, its cited passages, and the decision bar. */
/* ---------- review: master-detail ---------- */
.queue { background: linear-gradient(var(--panel) 40%, transparent) top / 100% 24px no-repeat local, linear-gradient(transparent, var(--panel) 60%) bottom / 100% 24px no-repeat local,
  linear-gradient(rgb(var(--shade) / .12), transparent) top / 100% 8px no-repeat, linear-gradient(transparent, rgb(var(--shade) / .12)) bottom / 100% 8px no-repeat;
  max-height: calc(100vh - var(--bar-h) - 170px); min-height: 200px; overflow-y: auto; }
.progress { display: grid; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.progress progress { width: 100%; height: 6px; accent-color: var(--accent); }
/* filter tabs inside a panel header: text tabs with the current one underlined, wrapping instead of clipping */
.subtabs { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); }
.subtabs button { min-height: var(--ctl-sm); font: inherit; font-family: var(--font-brand); color: var(--ink-2); background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 2px; cursor: pointer; white-space: nowrap; }
.subtabs button:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.subtabs button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.queue-empty { padding: 24px 16px; }
.queue-empty p { margin: 0 0 4px; }
.qi { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; cursor: pointer; }
.qi:hover { background: var(--sunken); }
.qi[aria-current="true"] { background: var(--accent-soft); }
.qi .l1 { display: block; font-weight: 600; }
.qi .l2 { grid-column: 1; color: var(--ink-2); font-size: var(--fs-sm); }
.qi .qr { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: var(--fs-sm); white-space: nowrap; }
.md > .section:first-child { position: sticky; top: calc(var(--bar-h) + 16px); }
.group-count { color: var(--ink-3); font-weight: 400; }
/* review detail: the figures as a stat strip, labelled blocks, then the decision in the panel's footer */
.stats.compact { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.stats.compact .stat:first-child .v { white-space: nowrap; }
.stats.compact .stat { padding: 12px 18px; }
.stats.compact .v { font-size: var(--fs-md); font-weight: 600; }
.block h3 { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin: 0 0 8px; }
.block > p { max-width: 70ch; margin: 0 0 6px; }
.block .kv { margin-top: 2px; }
.block .kv td:first-child { width: 140px; color: var(--ink-2); }
.block .kv td { padding-left: 0; }
/* the decision: one bar pinned at the panel's foot that holds everything needed to decide, so nothing required sits below it.
   While it floats over the evidence it casts a shadow, which says there is more underneath; at the end of the panel the shadow goes */
.decide-bar { position: sticky; bottom: 0; z-index: 1; container-type: scroll-state; }
.decide-in { display: grid; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--sunken); border-radius: 0 0 var(--r) var(--r); }
@container scroll-state(stuck: bottom) { .decide-in { box-shadow: 0 -10px 16px -10px rgb(var(--shade) / .22); } }
.decide-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.decide-row textarea { flex: 1 1 260px; field-sizing: content; min-height: var(--ctl); max-height: 7.5em; resize: none; }
.decide-row label { display: inline-flex; align-items: center; gap: 6px; }
.decide-row input { min-height: var(--ctl-sm); padding: 2px 8px; }
.decide-row input[name="owner"] { width: 160px; }
/* at rest the bar is one line (reason, Accept, Reject); quick reasons, owner and due unfold once you start deciding.
   The grid row grows from 0fr to 1fr, so the rows unfold without a fixed height; folded, they leave the tab order */
.decide-more { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s cubic-bezier(.22, 1, .36, 1), opacity .18s ease-out, visibility .22s; }
.decide-more > div { display: grid; gap: 8px; min-height: 0; overflow: hidden; padding: 8px 4px 4px; margin: 0 -4px; }  /* the inset keeps focus rings unclipped */
/* the bar takes focus itself (tabindex=-1), so a click on its empty space keeps it open; only leaving the bar folds it */
.decide-in:not(:focus-within):has(textarea:placeholder-shown) .decide-more { grid-template-rows: 0fr; opacity: 0; visibility: hidden; }

/* a cited knowledge passage: document and section, opening to the passage */
.cite + .cite { margin-top: 4px; }
.cite p { max-width: 70ch; margin-top: 6px; color: var(--ink-2); }
@media (max-width: 860px) {
  .md > [data-region="detail"] { order: -1; }
  .queue { max-height: 320px; }
  .md > .section:first-child { position: static; }
}
@media (max-width: 600px) {
  .stats.compact { grid-template-columns: 1fr 1fr; }
  .stats.compact .stat:first-child .v { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .decide-more { transition: none; }
}
