/* Printable report layout (B2.16, #1916). Loaded only by layouts/report.html.erb, so
   the app itself stays dark. Everything here is scoped to .report-page: a light sheet
   with near-black text that prints on one A4 page (10pt type, 14mm margins). Meaning
   never rides on colour: states are words and glyphs. */

.report-page {
  --report-bg: #ffffff;
  --report-backdrop: #e7e5e0;
  --report-text: #1c1b19;
  --report-secondary: #4a4843;
  --report-rule: #cfccc4;
  --report-rule-strong: #1c1b19;
  --report-head-bg: #f1efea;

  margin: 0;
  background: var(--report-backdrop);
  color: var(--report-text);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.report-page *,
.report-page *::before,
.report-page *::after {
  box-sizing: border-box;
}

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 210mm;
  margin: 0 auto;
  padding: 16px;
}

.report-toolbar a,
.report-toolbar button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border-radius: 10px;
  padding: 0 16px;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.report-toolbar a {
  color: var(--report-secondary);
  text-decoration: underline;
  padding-left: 0;
}

.report-toolbar button {
  border: 0;
  background: var(--report-text);
  color: #ffffff;
}

.report-toolbar button:focus-visible,
.report-toolbar a:focus-visible {
  outline: 2px solid #1c1b19;
  outline-offset: 2px;
}

.report-sheet {
  width: 210mm;
  max-width: 100%;
  margin: 0 auto 32px;
  padding: 14mm;
  background: var(--report-bg);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}

.report-kicker {
  margin: 0;
  color: var(--report-secondary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-title {
  margin: 4px 0 12px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.report-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0 0 16px;
  padding: 10px 0;
  border-top: 2px solid var(--report-rule-strong);
  border-bottom: 1px solid var(--report-rule);
}

.report-meta dt {
  color: var(--report-secondary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-meta dd {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.report-mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.report-summary li {
  border: 1px solid var(--report-rule);
  border-radius: 6px;
  padding: 6px 10px;
}

.report-summary .report-figure-label {
  display: block;
  color: var(--report-secondary);
  font-size: 11px;
}

.report-summary .report-figure {
  display: block;
  font-size: 17px;
  font-weight: 500;
}

.report-section {
  margin: 0 0 16px;
  break-inside: avoid;
}

.report-section h2 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.report-note {
  margin: 4px 0 0;
  color: var(--report-secondary);
  font-size: 12px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--report-rule);
  padding: 5px 8px 5px 0;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.report-table th {
  white-space: nowrap;
  border-bottom: 1px solid var(--report-rule-strong);
  color: var(--report-secondary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.report-table tbody th {
  color: inherit;
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  border-bottom: 1px solid var(--report-rule);
}

.report-table thead {
  display: table-header-group;
}

.report-table tr {
  break-inside: avoid;
}

.report-table td.report-mono {
  font-size: 11.5px;
}

.report-empty {
  margin: 0;
  color: var(--report-secondary);
  font-size: 12px;
}

.report-footer {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--report-rule);
  color: var(--report-secondary);
  font-size: 11px;
}

.report-footer p {
  margin: 0 0 2px;
}

@media (max-width: 720px) {
  .report-sheet {
    padding: 16px;
  }

  .report-meta {
    grid-template-columns: 1fr;
  }

  .report-table {
    display: block;
    overflow-x: auto;
  }
}

/* One A4 page: no app chrome, no backdrop, no button. The page number sits in the
   margin box of browsers that draw one; the footer text carries the same note. */
@page {
  size: A4;
  margin: 14mm;

  @bottom-right {
    content: "Page " counter(page) " of " counter(pages);
    font-family: "Geist", system-ui, sans-serif;
    font-size: 8pt;
    color: #4a4843;
  }
}

@media print {
  .report-page {
    background: #ffffff;
    font-size: 10pt;
    line-height: 1.4;
  }

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

  .report-sheet {
    width: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .report-title {
    font-size: 20pt;
  }

  .report-meta dd {
    font-size: 10pt;
  }

  .report-table {
    display: table;
    font-size: 9pt;
  }

  .report-table th {
    font-size: 8pt;
  }

  .report-table tbody th {
    font-size: 9pt;
  }

  .report-table td.report-mono {
    font-size: 8.5pt;
  }

  .report-summary .report-figure {
    font-size: 13pt;
  }

  .report-note,
  .report-empty {
    font-size: 9pt;
  }

  .report-footer {
    font-size: 8pt;
  }
}
