.reports-print-preview {
  display: grid;
  gap: 20px;
  min-width: 0;
  container: report-preview / inline-size;
}

.reports-preview-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.reports-preview-toolbar h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.875rem);
  line-height: 1.2;
}

.reports-preview-toolbar > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-inline-start: auto;
}

.reports-preview-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--border, #d0d8e4);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #112039);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.reports-preview-toolbar [data-report-pdf] {
  border-color: #1748aa;
  background: #1748aa;
  color: #fff;
}

.reports-preview-toolbar button:focus-visible {
  outline: 3px solid #5e93ed;
  outline-offset: 2px;
}

.report-print-document {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 20px;
}

.report-print-display {
  min-width: 0;
}

.report-print-mode,
.report-print-reader {
  display: none;
}

@container report-preview (max-width: 46rem) {
  .report-print-mode {
    display: flex;
    margin: 0 0 14px;
    padding: 3px;
    border: 1px solid var(--line, #ced8e6);
    border-radius: 9px;
    background: var(--surface, #fff);
  }

  .report-print-mode label {
    position: relative;
    flex: 1;
    min-width: 0;
    margin: 0;
    cursor: pointer;
  }

  .report-print-mode input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
  }

  .report-print-mode span {
    display: grid;
    place-items: center;
    min-height: 40px;
    padding-inline: 5px;
    border-radius: 6px;
    color: var(--text, #182a45);
    font-size: 15px;
    font-weight: 600;
  }

  .report-print-mode input:checked + span {
    background: #1748aa;
    color: #fff;
  }

  .report-print-mode input:focus-visible + span {
    outline: 3px solid #75a8ff;
    outline-offset: 1px;
  }

  .report-print-display:has([value="read"]:checked) .report-print-document {
    display: none;
  }

  .report-print-display:has([value="read"]:checked) .report-print-reader {
    display: block;
  }
}

.report-print-reader {
  padding: clamp(14px, 3vw, 24px);
  border: 1px solid var(--line, #d4dbe4);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text, #112039);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.report-print-reader header {
  margin-block-end: 18px;
  padding-block-end: 16px;
  border-bottom: 1px solid var(--line, #d4dbe4);
}

.report-print-reader header img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  margin-block-end: 12px;
}

.report-print-reader :is(h2, h3, h4) {
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
}

.report-print-reader h2 {
  font-size: 24px;
}

.report-print-reader h3,
.report-reader-table caption {
  margin: 18px 0 12px;
  font-size: 18px;
  font-weight: 700;
  text-align: start;
}

.report-print-reader p {
  margin: 8px 0 14px;
  color: var(--muted, #526074);
  font-size: 15px;
}

.report-reader-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.report-reader-table :is(th, td) {
  padding: 8px 5px;
  border-bottom: 1px solid var(--line, #d4dbe4);
  color: inherit;
  text-align: end;
  white-space: normal;
  overflow-wrap: anywhere;
  font: inherit;
}

.report-reader-table th:first-child {
  width: 43%;
  text-align: start;
}

.report-reader-table caption small {
  display: block;
  margin-top: .35rem;
  color: var(--muted, #526074);
  font-size: .88rem;
  line-height: 1.4;
  font-weight: 400;
}

.report-reader-table thead th,
.report-reader-total :is(th, td) {
  font-weight: 700;
}

.report-reader-rows > section {
  padding: 12px 0;
  border-top: 1px solid var(--line, #d4dbe4);
}

.report-reader-rows dl,
.report-reader-rows dd {
  margin: 0;
}

.report-reader-rows dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 8px;
  margin-block-start: 4px;
  font-size: 15px;
}

.report-reader-rows dt {
  color: var(--muted, #526074);
}

.report-print-page {
  display: block;
  width: 100%;
  height: auto;
  max-width: 1160px;
  aspect-ratio: 297 / 210;
  box-sizing: border-box;
  border: 1px solid #d4dbe4;
  background: #fff;
  box-shadow: 0 2px 8px rgb(17 32 57 / 8%);
}

.report-print-frame {
  position: fixed;
  inset: 0 auto auto -10000px;
  width: 1px;
  height: 1px;
  border: 0;
  pointer-events: none;
}

.report-print-only {
  margin: 0;
  background: #fff;
}

@media (max-width: 520px) {
  .reports-print-preview {
    gap: 14px;
  }

  .reports-preview-toolbar > div {
    flex-basis: 100%;
    margin-inline-start: 0;
  }
}

@page city-line-report {
  size: A4 landscape;
  margin: 0;
}

@media print {
  .report-print-only,
  .report-print-only .report-print-document {
    display: block;
    margin: 0;
    padding: 0;
  }

  .report-print-only .report-print-page {
    page: city-line-report;
    width: 297mm;
    height: 209.9mm;
    max-width: none;
    border: 0;
    box-shadow: none;
    break-inside: avoid;
    break-after: page;
    print-color-adjust: exact;
  }

  .report-print-only .report-print-page:last-child {
    break-after: auto;
  }
}
