/* The period report. An ordinary page that the print stylesheet turns into a
   document; the browser's own "save as PDF" typesets it with the fonts already
   on the reader's machine. */

/* A report is paper whatever theme the console is wearing, so it carries its
   own light palette: inheriting the dark one put near-white text on a white
   page. */
.report, body.report-window {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-sunken: #f2f4f7;
  --surface-hover: #f7f9fc;
  --line: #dfe4ec;
  --line-strong: #c6cede;
  --text: #12161f;
  --text-2: #4d566a;
  --text-3: #77819a;
  --accent: #5b4fe0;
  --ok: #1a7f4b;
  --info: #2563eb;
  --warn: #b57200;
  --high: #d65d29;
  --danger: #d33a3a;
  --ok-soft: rgba(26, 127, 75, .12);
  --info-soft: rgba(37, 99, 235, .1);
  --warn-soft: rgba(181, 114, 0, .12);
  --high-soft: rgba(214, 93, 41, .12);
  --danger-soft: rgba(211, 58, 58, .1);
  color: var(--text);
}

body.report-window { margin: 0; padding-bottom: 48px; background: #e9ecf1; }
.report-overlay { position: fixed; inset: 0; z-index: 80; overflow-y: auto; background: #e9ecf1; padding-bottom: 48px; }
html.report-open, html.report-open body { overflow: hidden; }
.report-loading { padding: 40px 24px; text-align: center; color: #4d566a; }

.report-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid #dfe4ec;
  backdrop-filter: blur(8px);
  color: #12161f;
}

.report {
  width: 210mm;
  margin: 24px auto;
  padding: 16mm 14mm;
  background: #fff;
  box-shadow: 0 10px 30px rgba(18, 22, 31, .12);
  /* Bars and badges carry meaning; without this the browser drops their fills
     to save ink. */
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.report-head { border-bottom: 2px solid var(--text); padding-bottom: 12px; }
.report-brand { display: flex; align-items: center; gap: 12px; }
.report-brand h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.report-brand p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.report-meta { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 12px; margin: 14px 0 0; font-size: 12.5px; }
.report-meta dt { color: var(--text-2); }
.report-meta dd { margin: 0; font-weight: 500; }

.report-section { margin-top: 10mm; break-inside: avoid; }
.report-section.long { break-inside: auto; }
.report-section h2 { margin: 0 0 10px; font-size: 14px; font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); }
.report-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8mm; }
.report-figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.report-figure { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; }
.report-figure-label { font-size: 12px; color: var(--text-2); }
.report-figure-value { font-size: 24px; font-weight: 700; letter-spacing: -.6px; line-height: 1.25; }
.report-figure-note { font-size: 11.5px; color: var(--text-3); }
.report-note { margin: 10px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.65; }
.report table.data { font-size: 12px; margin-top: 10px; }
.report table.data th, .report table.data td { padding: 6px 8px; height: auto; }
.report .rank-row { cursor: default; }
.report .facts { font-size: 13px; }
.report-foot { margin-top: 12mm; padding-top: 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--text-3); }

@media print {
  @page { size: A4 portrait; margin: 14mm; }
  html.report-open, html.report-open body { overflow: visible; height: auto; }
  /* Everything that is not the report is chrome -- while a report is open;
     printing any other screen prints that screen. */
  html.report-open #app, html.report-open .toasts, html.report-open .modal-wrap,
  html.report-open .drawer, html.report-open .scrim, .report-bar { display: none !important; }
  body.report-window { padding: 0; background: #fff; }
  .report-overlay { position: static; overflow: visible; background: #fff; padding: 0; }
  .report { width: auto; margin: 0; padding: 0; box-shadow: none; }
  .report table.data { font-size: 11px; }
  /* The header again on every page a long table spills onto. */
  .report thead { display: table-header-group; }
  .report tr { break-inside: avoid; }
}

/* Screen only: an A4 page is 794px wide, and an unscoped query would give the
   printed report the narrow layout. */
@media screen and (max-width: 880px) {
  .report { width: auto; margin: 12px; padding: 16px; }
  .report-figures, .report-columns { grid-template-columns: repeat(2, 1fr); }
  .report-meta { grid-template-columns: auto 1fr; }
}
