@page {
  margin: 0.75in;
}

.print-body {
  background: #ffffff;
  color: #0f172a;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.print-wrapper {
  max-width: 840px;
  margin: 0 auto;
  padding: 22px 20px 36px;
}

.print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.print-header__brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.print-logo {
  width: 96px;
  height: auto;
}

.print-header h1 {
  font-size: 24px;
  margin: 0;
}

.print-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: #475569;
}

.print-header__details {
  margin: 12px 0 0;
  display: grid;
  gap: 6px;
}

.print-header__details dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.print-header__details dd {
  margin: 2px 0 0;
  font-weight: 600;
  font-size: 13px;
  color: #0f172a;
}

.print-header__meta dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.print-header__meta dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.print-header__meta dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.print-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.print-contents {
  margin-top: 28px;
}

.print-contents h2 {
  font-size: 16px;
  margin: 0 0 4px;
}

.contents-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 12px;
}

.contents-card {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.contents-card h3 {
  margin: 0;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contents-card__title {
  font-weight: 600;
}

.contents-card__run-id {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
}

.contents-card__model {
  font-size: 11px;
  color: #475569;
  font-weight: 500;
  margin: 0 0 6px;
}

.contents-card__meta {
  margin: 4px 0 6px;
  font-size: 11px;
  color: #64748b;
}

.contents-card__list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #1f2937;
}

.contents-card__more {
  font-style: italic;
  color: #475569;
}

.page-break-after {
  margin-bottom: 0;
}

.summary-card {
  border: 1px solid #d1d5db;
  padding: 12px;
  border-radius: 8px;
}

.summary-card span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.print-section {
  margin-top: 24px;
}

.print-section h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.section-description {
  margin: 0 0 16px;
  color: #6b7280;
  font-size: 12px;
}

.print-letter {
  margin-top: 12px;
}

.print-letter h2 {
  font-size: 17px;
  margin: 0 0 6px;
  color: #0f172a;
}

.letter-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 18px 20px;
  background: #ffffff;
  line-height: 1.58;
}

.letter-section.prose :where(p) {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
}

.letter-section.prose :where(h2, h3, h4) {
  margin-top: 0.9em;
  margin-bottom: 0.4em;
}

.letter-section.prose :where(ul, ol) {
  margin-top: 0.35em;
  margin-bottom: 0.5em;
  padding-left: 1.25em;
}

.letter-section.prose :where(li) {
  margin-top: 0.2em;
  margin-bottom: 0.2em;
}

.letter-section.prose :where(blockquote) {
  margin: 0.6em 0;
  padding-left: 1em;
  border-left: 3px solid #cbd5f5;
}

.print-notice {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f8fafc;
  font-style: italic;
}

.print-run {
  margin: 0 0 24px;
  padding: 0.6in 0 0;
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-run__card {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  padding: 24px 20px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.print-run__header h3 {
  margin: 0;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.print-run__title {
  font-weight: 600;
  color: #0f172a;
}

.print-run__run-id {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}

.print-run__heading {
  font-size: 18px;
  margin: 0 0 6px;
}

.print-run__heading-description {
  margin: 0 0 18px;
  color: #6b7280;
  font-size: 12px;
}

.print-run__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid #e2e8f0;
}

.print-run__timestamp {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.print-run__model {
  margin: 4px 0 0;
  font-size: 12px;
  color: #1f2937;
  font-weight: 600;
}

.print-run__counts {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f172a;
}

.print-run__count-detail {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-tag--active {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.status-tag--rejected {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.print-run__body {
  padding: 16px 0 0;
  display: grid;
  gap: 16px;
}

.print-finding {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
}

.print-finding__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.print-finding__header h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.print-finding__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #1e293b;
  color: #ffffff;
}

.severity-badge--critical,
.severity-badge--high {
  background: #fee2e2;
  color: #b91c1c;
}

.severity-badge--medium {
  background: #fef3c7;
  color: #92400e;
}

.severity-badge--low {
  background: #e0f2fe;
  color: #0c4a6e;
}

.severity-badge--review {
  background: #e2e8f0;
  color: #475569;
}

.amount-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.amount-chip--positive {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.amount-chip--negative {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.print-finding__line-item {
  text-align: right;
  font-size: 12px;
  color: #475569;
}

.print-finding__line-item em {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: #0f172a;
}

.print-finding__content {
  display: grid;
  gap: 14px;
}

.print-block h5 {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.print-block p {
  margin: 0;
}

.print-block--highlight {
  background: #f8fafc;
  border-left: 3px solid #1d4ed8;
  padding: 12px 14px;
  border-radius: 8px;
}

.print-list {
  margin: 0;
  padding-left: 20px;
}

.print-list li {
  margin: 4px 0;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 12px;
}

.breakdown-table th,
.breakdown-table td {
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.breakdown-table tbody tr:nth-child(odd) {
  background: #f8fafc;
}

.total-positive {
  color: #166534;
  font-weight: 700;
}

.total-negative {
  color: #991b1b;
  font-weight: 700;
}

.source-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.source-list__heading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}

.source-list__url {
  font-size: 11px;
  margin-top: 4px;
  word-break: break-all;
}

.source-list__url .print-link {
  color: #1d4ed8;
  text-decoration: underline;
}

.source-list blockquote {
  margin: 6px 0 0;
  padding-left: 12px;
  border-left: 2px solid #cbd5f5;
  color: #334155;
  font-style: italic;
}

blockquote,
p {
  orphans: 3;
  widows: 3;
}

@media print {
  .page-break-after {
    break-after: page;
    page-break-after: always;
  }
}
