/* The free screenplay analysis page (screenplay-analysis.html), on top of
   formatter-page.css, which gives it the opening, the input card, the
   buttons, the sections and the questions. This file styles the report:
   the measurements the page draws beside the input. Light only, like the
   site. See .claude/script-stats-registry.md. */

/* The input card holds a drop zone and a button, so it takes a third of the
   row and the report the rest (the formatter splits 5:7 because its left
   side is the pasted script). Only while the two sit side by side: below
   980px formatter-page.css stacks them, and an unconditioned rule here would
   undo that (it did until 2026-10-31, leaving a 211px report on a phone). */
@media (min-width: 981px) {
  .tool { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}

.report {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px 22px;
  display: flex; flex-direction: column; gap: 18px; min-width: 0;
}
.report-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 13.5px; flex-wrap: wrap; }
#st-caption { font-weight: 600; }
#st-summary { color: var(--muted); font-variant-numeric: tabular-nums; }
.report .note { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--accent-wash); color: var(--accent-deep); font-size: 13.5px; line-height: 1.5; }
.report .note[hidden] { display: none; }

.report-controls { display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.report .paper legend { color: var(--muted); }
.report .paper .seg { border-color: var(--line); background: var(--bg); }
.report .paper span { color: var(--muted); }
.report .paper input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.report .paper input:focus-visible + span { outline-color: var(--accent); }
.report .copy { display: flex; align-items: center; gap: 12px; }
.report .copy .btn { padding: 9px 16px; font-size: 13.5px; }
.copied { font-size: 13px; color: var(--accent-deep); }
.copied:empty { display: none; }

/* the five figures. Each tile takes three rows of the grid (label, figure,
   line under it) as a subgrid, so when one label wraps ("Speaking parts" in a
   narrow tile) every figure in that row moves down with it, not only its own. */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.tile { grid-column: span 1; grid-row: span 3; grid-template-rows: subgrid; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 12px 11px; display: grid; row-gap: 4px; min-width: 0; }
.tile-wide { grid-column: span 2; }
.tile-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
/* A figure never breaks across lines: "15,610" and "2 h 13 min" shrink to fit instead. */
.tile b { font-family: var(--serif); font-size: clamp(22px, 2.3vw, 30px); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile small { font-size: 12.5px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }

.compare { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); padding: 0 2px; }
.compare[hidden] { display: none; }
.compare a { color: var(--accent); font-weight: 600; }
.compare a:hover { text-decoration: underline; }

/* the three splits */
.bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.barblock h3, .tbl h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; }
/* The three bars sit on one line, so their headings must too. */
.barblock { min-width: 0; }
.barblock h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line-soft); gap: 2px; }
.seg { display: block; flex: 1 1 0; min-width: 3px; }
.seg.a, .dot.a { background: var(--accent); }
.seg.b, .dot.b { background: #6ee7b7; }
.seg.c, .dot.c { background: #bbf7d0; }
.seg.d, .dot.d { background: #d4d4d1; }
.seg.none { background: var(--line-soft); }
/* the headings' own words, where no list knew the slot */
.seg.o1, .dot.o1 { background: #0f766e; }
.seg.o2, .dot.o2 { background: #5eead4; }
.seg.o3, .dot.o3 { background: #ccfbf1; }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); }
.legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-label { min-width: 0; overflow-wrap: anywhere; }
.legend b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.legend-empty { grid-template-columns: minmax(0, 1fr); color: var(--muted); }

/* the tables */
.tables { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; min-width: 0; }
.tbl { min-width: 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 12px; }
.report table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.4; }
.report th, .report td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.report th { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--bg); white-space: nowrap; }
.report tbody tr:last-child td { border-bottom: 0; }
.report tbody:empty::after { content: "Nothing to show yet."; display: block; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.report .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report td.name, .report td.heading { font-weight: 500; min-width: 10em; }
.report td.heading { font-family: var(--mono); font-size: 12.5px; }
.report td.faint { color: var(--muted); font-family: var(--sans); font-weight: 400; }
.report td.idx { color: var(--muted); }
.tbl-more { margin: 8px 2px 0; font-size: 12.5px; color: var(--muted); }
.tbl-more:empty { display: none; }
.tbl .text-btn { margin-top: 10px; }
.tbl .text-btn[hidden] { display: none; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.facts li strong { color: var(--ink); font-weight: 600; }
.facts:empty { display: none; }

.summary-text { width: 100%; min-height: 160px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--ink); background: var(--bg); resize: vertical; }
.summary-text[hidden] { display: none; }
.report .fine { color: var(--muted); }

/* what is typical */
.typical { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.typical li { padding: 18px 20px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: grid; gap: 6px; }
.typical b { font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.typical span { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.page-facts a { color: var(--accent); font-weight: 600; }
.page-facts a:hover { text-decoration: underline; }

/* Below 980px the report takes the full width under the input card, as wide
   as it is beside it on a laptop, so the tiles and bars keep their rows. */
@media (max-width: 980px) {
  .typical { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Two tiles to a row, with the running time across both; dense packing puts
   Scenes beside Pages instead of leaving a hole there. */
@media (max-width: 720px) {
  .report { padding: 16px 14px 18px; border-radius: 18px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; }
  .tile-wide { grid-column: span 2; }
  .bars { grid-template-columns: minmax(0, 1fr); }
  .tile b { font-size: 26px; }
  .typical { grid-template-columns: minmax(0, 1fr); }
  .report-controls { align-items: stretch; }
  .report .copy { justify-content: space-between; }
}
