/* dash-review: session summary, recordings and reports views (scoped under .rv) */

.rv { grid-template-columns: minmax(0, 1fr); }
.rv > *, .rv-content { min-width: 0; }
.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; }
.rv .rv-block { display: block; }
.rv .rv-nowrap { white-space: nowrap; }
.rv .d-head h2 bdi { overflow-wrap: anywhere; }

/* notes under tables */
.rv-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }
.rv-note .icon { flex-shrink: 0; margin-top: 4px; color: var(--d-accent); }
.rv-note.rv-warn .icon { color: #fcd34d; }
:root[data-theme='light'] .rv-note.rv-warn .icon { color: #b45309; }

/* details card */
.rv-dl { grid-template-columns: max-content minmax(0, 1fr); align-items: center; }
.rv-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rv-group .select { width: auto; min-width: 180px; max-width: 100%; height: 40px; }
.rv-group .rv-block { flex-basis: 100%; }
.rv-kpis { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.rv-kpis li { display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 12px; background: var(--inset); border: 1px solid var(--border); }
.rv-kpis b { font-size: 20px; font-weight: 900; }
.rv-kpis span { color: var(--text-2); font-size: 13.5px; font-weight: 700; }

/* attendance table */
.rv .d-table-wrap { position: relative; }
.rv-att td { white-space: nowrap; }
.rv-att td:first-child { white-space: normal; min-width: 150px; }
.rv-name { display: grid; gap: 1px; }
.rv-name small { color: var(--text-2); font-size: 12.5px; }
.rv-phone { color: var(--text-3); font-size: 12.5px; text-align: end; justify-self: start; }
.rv-att tr.is-absent td { color: var(--text-2); }
.rv-kind { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 700; background: var(--ov-2); color: var(--text-2); border: 1px solid var(--border); }
.rv-kind-student { color: var(--d-accent); background: var(--d-tint); }
.rv-kind-guest { border-style: dashed; }
.rv-cell-action { text-align: end; }
.rv-details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 700; color: var(--text-2); }
.rv-details > summary::-webkit-details-marker { display: none; }
.rv-details > summary::before { content: '‹'; display: inline-block; font-size: 18px; transition: transform 0.15s; }
.rv-details[open] > summary::before { transform: rotate(-90deg); }
.rv-audit { margin-top: 8px; }
.rv-audit-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.rv-audit-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* link picker */
.rv-guest { color: var(--text-2); }
.rv-pick { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.rv-pick-item { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--border); cursor: pointer; }
.rv-pick-item:hover { background: var(--surface-2); }
.rv-pick-item:has(input:checked) { border-color: var(--d-accent); background: var(--d-tint); }
.rv-pick-item input { width: 18px; height: 18px; flex-shrink: 0; accent-color: #059669; }
.rv-pick-item > span { display: grid; min-width: 0; }
.rv-pick-item small { color: var(--text-2); font-size: 12.5px; }

/* polls */
.rv-polls { display: grid; }
.rv-poll { padding: 14px 0; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.rv-poll:first-child { padding-top: 0; }
.rv-poll:last-child { border-bottom: 0; padding-bottom: 0; }
.rv-poll-head h4 { font-size: 15.5px; font-weight: 800; overflow-wrap: anywhere; }
.rv-poll-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; }
.rv-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rv-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14px; }
.rv-option-label { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; overflow-wrap: anywhere; }
.rv-option.is-correct .rv-option-label { color: var(--success); font-weight: 700; }
:root[data-theme='light'] .rv-option.is-correct .rv-option-label { color: #047857; }
.rv-correct-tag { font-size: 12.5px; }
.rv-bar { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: var(--ov-2); overflow: hidden; }
.rv-bar i { display: block; height: 100%; border-radius: inherit; background: var(--text-3); }
.rv-option.is-correct .rv-bar i { background: #10b981; }
.rv-score { font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.rv-answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-answers li { padding: 8px 12px; border-radius: 12px; background: var(--inset); }
.rv-answers p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); font-size: 14px; }

/* recordings */
.rv-recs { display: grid; gap: 16px; }
.rv-rec { display: grid; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.rv-rec:last-child { border-bottom: 0; padding-bottom: 0; }
.rv-rec-head { display: flex; align-items: center; gap: 10px; }
.rv-rec-info { flex: 1; min-width: 0; display: grid; }
.rv-rec-info small { color: var(--text-2); font-size: 13px; }
.rv-video { width: 100%; max-width: 760px; max-height: 70vh; aspect-ratio: 16 / 9; border-radius: 12px; background: #000; border: 1px solid var(--border); }
.rv-rec-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rv-share { min-height: 40px; }
.rv-share span { display: grid; }
.rv-share b { font-size: 14px; }
.rv-share small { color: var(--text-2); font-size: 12px; }
.rv-watch { display: grid; gap: 12px; }

/* recordings page */
.rv-count { margin-bottom: 4px; font-size: 13.5px; }
.rv-recrow-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-recrow-actions { display: flex; align-items: center; gap: 4px; }
.rv-more { display: flex; justify-content: center; }
.rv-more:not(:empty) { margin-top: 14px; }

/* files & chat */
.rv-file-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--d-tint); color: var(--d-accent); flex-shrink: 0; }
.rv-chat > summary h3 { font-size: 16.5px; font-weight: 800; color: var(--text); }
.rv-chat-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; max-height: 480px; overflow-y: auto; }
.rv-chat-list li { padding: 8px 10px; border-radius: 12px; }
.rv-chat-list li.is-teacher { background: var(--d-tint); }
.rv-chat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rv-chat-meta small { margin-inline-start: auto; }
.rv-chat-list p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--text-2); }
.rv-chat-list .d-link { display: inline-flex; align-items: center; gap: 4px; }

/* reports */
.rv-filter-card { padding-block: 14px; }
.rv-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.rv-filters .field { min-width: 170px; }
.rv-filters .select, .rv-filters .input { height: 42px; }
.rv-custom { display: flex; flex-wrap: wrap; gap: 12px; }
.rv-custom[hidden] { display: none; }
.rv-filters .field[hidden] { display: none; }
.rv-def { padding: 12px 16px; border-radius: 14px; border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 13.5px; }
.rv-def-list { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; line-height: 1.7; }
.rv-content:focus { outline: none; }
.rv-matrix th, .rv-matrix td { text-align: center; }
.rv-matrix .rv-sticky { position: sticky; inset-inline-start: 0; z-index: 1; text-align: start; background: linear-gradient(var(--d-card), var(--d-card)), var(--bg); min-width: 130px; max-width: 200px; white-space: normal; }
.rv-col a { display: grid; justify-items: center; color: var(--text-2); font-weight: 700; }
.rv-col a:hover { color: var(--d-accent); }
.rv-col small { font-weight: 400; font-size: 11.5px; }
.rv-col .rv-guests { color: #fcd34d; }
:root[data-theme='light'] .rv-col .rv-guests { color: #b45309; }
.rv-ratio { white-space: nowrap; }
.rv-cell { white-space: nowrap; }
.rv-cell-before { color: var(--text-3); }
.rv-absent { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; color: #fda4af; }
:root[data-theme='light'] .rv-absent { color: #be123c; }
.rv-question { min-width: 200px; max-width: 360px; overflow-wrap: anywhere; }

/* phones: 40px touch targets, wrapping rows */
@media (max-width: 899px) {
  .rv .btn-sm { height: 40px; }
  .rv .icon-btn { width: 40px; height: 40px; }
  .rv .d-head-actions { width: 100%; }
  .rv .d-head-actions .btn { flex: 1; }
  .rv-filters .field { flex: 1 1 140px; min-width: 0; }
  .rv-filters .select, .rv-filters .input { width: 100%; }
  .rv-custom { flex: 1 1 100%; }
  .rv-custom .field { flex: 1 1 140px; }
  .rv .d-filters .d-search { flex-basis: 100%; min-width: 0; }
  .rv .d-filters .select { flex: 1; min-width: 0; }
  .rv-recrow .d-row-main { flex-basis: 100%; }
  .rv-recrow-actions { margin-inline-start: auto; }
  .rv-rec-actions .spacer { display: none; }
  .rv .d-live .btn { width: auto; flex: 1; }
}
/* the video player opens in a dialog outside .rv */
.modal .rv-video { max-height: 60vh; }
