/* Print layout.
   Row budget lives in render.js (PAGE_UNITS = 48, SECTION_HEADER_UNITS = 3).
   If you change type size, padding, or margins here, re-check that a full page still
   fits without spilling — the two must stay in sync (D-29). */

@page { size: letter portrait; margin: 0.4in 0.45in; }

.no-print { display: none !important; }

/* styles.css is loaded for ALL media and sets `font: 15px/1.5`. Its line-height leaks
   into print and made every row ~22px instead of ~18px, so each page overflowed and the
   browser split it in two — the print dialog showed roughly double the sheet count the
   app reported. Line-height is therefore pinned explicitly here (D-71). */
body { background: #fff; margin: 0; font-size: 10pt; line-height: 1.2; color: #000; }

#preview-wrap { display: block !important; max-width: none; margin: 0; padding: 0; }
#print-area { border: 0; border-radius: 0; padding: 0; background: #fff; overflow: visible; }

.page {
  page-break-after: always;
  break-after: page;
  page-break-inside: avoid;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  /* The footer is in normal flow so it can never sit on top of a table (D-77).
     It is deliberately NOT pinned to the bottom: forcing a full-sheet height made
     Safari — which uses the print dialog's margins, not @page — overflow every page and
     push the footer onto a sheet of its own, doubling the job (D-80). */
}
.page-body { display: block; }
.page:last-child { page-break-after: auto; break-after: auto; }

/* ---------- page header: one strip per sheet, not per roster ---------- */
.page-head {
  line-height: 1.2;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  border-bottom: 2px solid #000;
  padding-bottom: 3pt;
  margin-bottom: 6pt;
  font-size: 9pt;
}
.page-head .ph-left strong { font-size: 12pt; }
.page-head .role { font-weight: 400; font-size: 8.5pt; }
.page-head .ph-mid { color: #333; }
.page-head .pageno { font-weight: 700; font-size: 10pt; }

/* ---------- one roster within a page ---------- */
.sheet { margin-bottom: 7pt; page-break-inside: auto; }
.sheet:last-of-type { margin-bottom: 0; }
.sheet-title {
  line-height: 1.2;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #000;
  padding-bottom: 1.5pt;
  margin-bottom: 2.5pt;
}
.sheet-scope { font-size: 10.5pt; font-weight: 700; letter-spacing: .01em; }
.sheet-count { font-size: 7.5pt; color: #444; }

/* ---------- roster table ---------- */
table.roster {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.6pt;
  line-height: 1.15;
  table-layout: fixed;
}
table.roster th {
  text-align: left;
  font-size: 7pt;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 1px solid #000;
  padding: 1.5pt 2.5pt;
  white-space: nowrap;
}
table.roster td {
  padding: 1.7pt 2.5pt;
  border-bottom: 0.4pt solid #cfcfcf;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}
table.roster td.wrap { white-space: normal; }
table.roster tbody tr:nth-child(even) { background: #f2f2f2; }
table.roster .c { text-align: center; }

/* C2s stand out on every roster they appear on (D-59). */
table.roster tr.c2row td { font-weight: 700; }
.c2tag {
  display: inline-block;
  font-size: 6pt;
  font-weight: 700;
  line-height: 1;
  padding: 1pt 2pt;
  margin-right: 3pt;
  border: 0.6pt solid #000;
  border-radius: 2pt;
  vertical-align: 1pt;
}

.empty { font-style: italic; color: #555; font-size: 8.5pt; margin: 2pt 0; }

/* ---------- foot ---------- */
.page-foot {
  margin-top: 10pt;      /* always after the content, never overlapping it */
  padding-top: 3pt;
  border-top: 0.5pt solid #999;
  font-size: 6.5pt;
  color: #555;
}

/* ---------- cover ---------- */
.cover .cover-note { font-size: 9pt; margin: 8pt 0; }
.cover table.roster { font-size: 10pt; }
.cover table.roster td { padding: 3pt 3pt; }
