/* Review (review-ui.js): the waiting count, the type and status toggles, one row per item. Every colour is a theme
   token from theme-tokens.css. Square corners throughout. Quiz, shadow and help keep one mark each: warn, info, bad. */
.rv { display: flex; flex-direction: column; gap: var(--s-4, 16px); }
.rv .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Hero: one navy tile, the count and its split. */
.rv-hero { --rv-tile: var(--th-surface-ink); display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-2, 8px) var(--s-5, 24px); padding: var(--s-5, 24px); border-radius: 0;
  background: var(--rv-tile); color: var(--th-on-ink); }
/* Dark: the navy tile sinks into the charcoal page, so it lifts to the panel colour inside a gradient edge. */
:root[data-theme="dark"] .rv-hero { --rv-tile: var(--th-surface); border: 2px solid transparent;
  background: linear-gradient(var(--rv-tile), var(--rv-tile)) padding-box, var(--th-grad-bar) border-box; box-shadow: var(--th-shadow-card); }
.rv-hero-l { flex-basis: 100%; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--th-on-ink-2); }
.rv-herofig { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(3.5rem, 6vw, 5.25rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--th-hero-num); }
.rv-herofig.rv-zero { font-size: 3.5rem; }
/* The split: one segment per type. Pattern carries the type as well as colour, in the squares' language:
   quiz solid, shadow half, help hatched. A light edge sets each apart on the tile; its count sits on a tile-coloured backing. */
.rv-split { flex: 1 1 220px; display: flex; gap: 3px; height: 28px; margin-bottom: 6px; min-width: 160px; }
.rv-split button { flex-basis: 0; min-width: 36px; min-height: 24px; height: 100%; padding: 0 4px; border: 1.5px solid var(--th-on-ink-2); border-radius: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: flex-start; font: inherit; color: var(--th-on-ink); forced-color-adjust: none; }
.rv-split button:hover { box-shadow: 0 0 0 1px var(--th-on-ink); }
.rv-split button:focus-visible { outline: 2px solid var(--th-on-ink); outline-offset: 2px; }
.rv-seg-n { font-family: 'DM Mono', ui-monospace, monospace; font-weight: 500; font-size: 0.8125rem; line-height: 1; padding: 2px 4px; background: var(--rv-tile); color: var(--th-on-ink); }
.rv-seg-quiz { background: var(--th-warn); }
.rv-seg-shadow { background: linear-gradient(to top, var(--th-info) 50%, var(--th-info-tint) 50%); }
.rv-seg-help { background: repeating-linear-gradient(135deg, var(--th-bad) 0 3px, var(--th-bad-tint) 3px 6px); }

/* Type mark: an 8px square, the same colour as its split segment. */
.rv-mark { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 0; vertical-align: middle; margin-right: 6px; }
.rv-mark-quiz { background: var(--th-warn); }
.rv-mark-shadow { background: linear-gradient(to top, var(--th-info) 50%, var(--th-info-tint) 50%); box-shadow: inset 0 0 0 1px var(--th-info); }
.rv-mark-help { background: repeating-linear-gradient(135deg, var(--th-bad) 0 2px, var(--th-bad-tint) 2px 4px); box-shadow: inset 0 0 0 1px var(--th-bad); }

/* Toolbar: two square segmented toggles and the search box. */
.rv-tools { display: flex; flex-wrap: wrap; gap: var(--s-2, 8px) var(--s-3, 12px); align-items: center; }
.rv-seg { display: inline-flex; border: 1px solid var(--th-border); border-radius: 0; overflow: hidden; flex-shrink: 0; }
.rv-seg button { display: inline-flex; align-items: center; font: inherit; font-weight: 600; font-size: 0.8125rem; line-height: 1; min-height: 32px; padding: 8px 14px;
  border: 0; border-radius: 0; background: var(--th-surface); color: var(--th-text-2); cursor: pointer; }
.rv-seg button + button { border-left: 1px solid var(--th-border); }
.rv-seg button[aria-pressed="true"] { background: var(--th-surface-ink); color: var(--th-on-ink); }
.rv-seg button:focus-visible { outline: 2px solid var(--th-focus); outline-offset: -3px; }
.rv-seg button[aria-pressed="true"]:focus-visible { outline-color: var(--th-on-ink); }
.rv-n { font-family: 'DM Mono', ui-monospace, monospace; font-weight: 500; margin-left: 4px; }
.rv-q { flex: 1 1 180px; min-width: 160px; max-width: 320px; min-height: 32px; padding: 6px 8px; font: inherit; border: 1px solid var(--th-border); border-radius: 0;
  background: var(--th-surface); color: var(--th-text); }
.rv-q:focus-visible { outline: 2px solid var(--th-focus); outline-offset: 1px; }

/* Rows. The left stripe is the row's state: its kind while open, its decision once done. */
.rv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 0 var(--s-3, 12px);
  background: var(--th-surface); border: 1px solid var(--th-border); border-left: 3px solid var(--th-warn); border-radius: 0; padding: 0 var(--s-3, 12px) 0 0; }
.rv-row.rv-shadow { border-left-color: var(--th-info); }
.rv-row.rv-help { border-left-color: var(--th-bad); }
.rv-row.rv-is-approved, .rv-row.rv-is-resolved { border-left-color: var(--th-ok); }
.rv-row.rv-is-denied, .rv-row.rv-is-retake { border-left-color: var(--th-bad); }
.rv-row details { min-width: 0; }
.rv-row summary { display: grid; grid-template-columns: 6.5rem minmax(8rem, 12rem) minmax(0, 1fr) auto; align-items: center; gap: var(--s-3, 12px);
  min-height: 44px; padding: 6px 0 6px var(--s-3, 12px); cursor: pointer; list-style: none; }
.rv-row summary::-webkit-details-marker { display: none; }
.rv-row summary:focus-visible { outline: 2px solid var(--th-focus); outline-offset: -2px; }
.rv-row details[open] summary { border-bottom: 1px solid var(--th-border); }
.rv-type { display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--th-text-2); }
.rv-rep { font-weight: 600; color: var(--th-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-subj { color: var(--th-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-actions { display: flex; gap: var(--s-2, 8px); align-items: center; min-height: 44px; }
.rv-actions .btn { border-radius: 0; }

/* Age: days waiting as a square bar, full at two weeks. */
.rv-age { display: inline-flex; align-items: center; gap: 6px; }
.rv-age-bar { display: inline-block; width: 64px; height: 6px; background: var(--th-surface-3); border-radius: 0; overflow: hidden; }
.rv-age-bar > span { display: block; height: 100%; background: var(--th-text-3); }
.rv-age-warn .rv-age-bar > span { background: var(--th-warn); }
.rv-age-late .rv-age-bar > span { background: var(--th-bad); }
.rv-age-n { font-family: 'DM Mono', ui-monospace, monospace; font-size: 0.8125rem; color: var(--th-text-2); min-width: 3ch; text-align: right; }

/* Done: the decision word and its date. */
.rv-state { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 0; }
.rv-state-approved, .rv-state-resolved { background: var(--th-ok-tint); color: var(--th-ok); }
.rv-state-denied, .rv-state-retake { background: var(--th-bad-tint); color: var(--th-bad); }
.rv-decided { display: inline-flex; align-items: center; gap: 8px; }
.rv-when { font-family: 'DM Mono', ui-monospace, monospace; font-size: 0.8125rem; color: var(--th-text-2); }

/* Detail behind a row: the blocks the old queue showed. */
.rv-detail { padding: var(--s-2, 8px) 0 var(--s-3, 12px) var(--s-3, 12px); }
.rv-detail .meta { font-size: 0.8125rem; color: var(--th-text-2); margin-top: 4px; }
.rv-detail .detail-block { background: var(--th-surface-2); border: 1px solid var(--th-border); border-radius: 0; padding: var(--s-3, 12px); margin: var(--s-2, 8px) 0 0; font-size: 0.875rem; color: var(--th-text); white-space: pre-wrap; }
.rv-detail .detail-block .label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--th-text-3); margin-bottom: 4px; white-space: normal; }

.rv-empty { margin: 0; padding: var(--s-3, 12px) 0; border-top: 1px solid var(--th-border); color: var(--th-text-2); }

@media (max-width: 720px) {
  .rv-row { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .rv-row summary { grid-template-columns: auto minmax(0, 1fr) auto; padding-right: var(--s-3, 12px); }
  .rv-row summary .rv-subj { grid-column: 1 / -1; grid-row: 2; }
  .rv-actions { padding: 0 var(--s-3, 12px) var(--s-2, 8px); }
}
