/* Reports: totals, tallies and the scene list on a sheet of typed paper. */

.report a, .part a { color: inherit; }

.report__totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.75rem; margin: 0 0 0.25rem; }
.report__totals div { padding: 0.5rem 0.6rem; border: 1px solid var(--sheet-rule); }
.report__totals dt { color: var(--sheet-soft); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.report__totals dd { margin: 0.2rem 0 0; font: 700 1.2rem var(--font-typed); }

.report__scroll { overflow-x: auto; }
.report__table { width: 100%; border-collapse: collapse; font: 0.9rem var(--font-typed); }
.report__table th, .report__table td { padding: 0.35rem 0.5rem 0.35rem 0; border-bottom: 1px solid var(--sheet-rule); text-align: left; vertical-align: top; }
.report__table thead th { color: var(--sheet-soft); font-size: 0.75rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em; }
.report__table tbody th { font-weight: 400; }
.report__table .report__number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report__scenes tbody td, .report__scenes tbody th { overflow-wrap: anywhere; }

/* A character's lines, set like the script's dialogue. */
.part__scene { margin: 1.25rem 0 0; font: 700 0.95rem var(--font-typed); text-transform: uppercase; }
.part__number { margin-right: 0.5rem; }
.part__speech { margin: 0.75rem 0 0; font: 1rem/1.35 var(--font-typed); }
.part__speech p { margin: 0; }
.part__character { margin-left: min(9rem, 30%) !important; }
.part__parenthetical { margin-left: min(6rem, 20%) !important; }
.part__dialogue { margin: 0 min(4rem, 10%) 0 min(4rem, 10%) !important; }
.report__none { color: var(--sheet-muted); }

/* A series: a column for each episode, scenes counted in each. */
.report__recurrences tbody th { overflow-wrap: anywhere; min-width: 8rem; }
.report__recurrences :is(th, td).report__number { padding-left: 0.6rem; }

/* What if we cut: the scenes to tick beside what goes with them, the sums kept in view while ticking. */
.what-if.title-page--wide { width: min(64rem, 100%); }
.report__what-if { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.75rem 0 0; }
.report__what-if .title-page__note { margin: 0; }
.what-if__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.what-if__scenes fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.what-if__list { margin: 0; padding: 0; list-style: none; }
.what-if__scene { display: grid; grid-template-columns: auto 2.5rem minmax(0, 1fr) auto; align-items: baseline; gap: 0.5rem; min-height: 44px; padding: 0.35rem 0; border-bottom: 1px solid var(--sheet-rule); font: 0.9rem var(--font-typed); cursor: pointer; }
.what-if__scene input { align-self: center; width: 1.1rem; height: 1.1rem; margin: 0; }
.what-if__number { font-weight: 700; text-align: right; }
.what-if__heading { overflow-wrap: anywhere; }
.what-if__length { white-space: nowrap; color: var(--sheet-soft); }
.what-if__scene:has(input:checked) .what-if__heading { text-decoration: line-through; text-decoration-thickness: 2px; }
.what-if__scene:has(input:checked) { background: var(--sheet-tint); }
.what-if__result { position: sticky; top: 1rem; display: block; max-height: calc(100dvh - 2rem); overflow-y: auto; }
.what-if__result > .title-page__label:first-child { margin-top: 0; }
.what-if__result .report__totals { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
.what-if__empty { padding: 1rem; border: 1px dashed var(--sheet-line); }
.what-if__actions .button[hidden] { display: none; }
.what-if__gone td:first-child { color: var(--sheet-soft); white-space: nowrap; }

/* On a phone the sums come first, then the scenes to tick. */
@media (max-width: 48rem) {
  .what-if__layout { grid-template-columns: minmax(0, 1fr); }
  .what-if__result { position: static; order: -1; max-height: none; overflow: visible; }
}
