.rep-tabs, .rep-controls, .rep-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .6rem;
  margin-bottom: 1rem;
}
.journal-report [hidden], .rep-notice:empty { display: none; }
.rep-tabs button[aria-pressed="true"], .rep-counts button[aria-pressed="true"] { box-shadow: inset 0 -3px currentColor; }
.journal-report { min-width: 0; }
.rep-controls label, .rep-correction label { display: grid; gap: .35rem; }
.rep-result { padding: .8rem 0; border-top: 1px solid #c9d2cf; }
.rep-result summary, .rep-edit summary { cursor: pointer; }
.rep-result summary > small, .rep-reading { display: block; margin: .25rem 0 0 1.15rem; overflow-wrap: anywhere; }
.rep-result-head { display: inline-flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; }
.rep-status { font-size: .85em; font-weight: 600; }
.rep-ok { color: #236449; }
.rep-deviation, .rep-missing { color: #923a25; }
.rep-open, .rep-pending { color: #67521b; }
.rep-history { margin: .65rem 0; padding-left: 1.8rem; }
.rep-history li, .rep-edit, .rep-correction, .rep-form-sheet { margin-top: .8rem; }
.rep-amendment { margin: .6rem 0; padding-left: .8rem; border-left: 3px solid #709381; }
.rep-correction, .rep-correction-fields { display: grid; gap: .65rem; max-width: 30rem; }
.rep-correction button { justify-self: start; }
.rep-sheet h2, .rep-sheet h3, .rep-period { margin: .5em 0; }
.rep-legend, .rep-notes { font-size: .88em; }
.rep-table-wrap { max-width: 100%; overflow-x: auto; }
.rep-sheet table { border-collapse: collapse; width: 100%; }
.rep-sheet td, .rep-sheet th { padding: .25rem; border: 1px solid #81918b; text-align: center; }
.rep-sheet th:first-child { text-align: left; min-width: 8rem; }
.rep-sheet th small { display: block; font-weight: normal; }
.rep-notes { padding-left: 1.3rem; overflow-wrap: anywhere; }
@media print {
  @page journal-month { size: A4 landscape; margin: 8mm; }
  body:has(.rep-sheet) { page: journal-month; margin: 0; }
  body:has(.rep-sheet) *:not(:has(.rep-sheet)):not(.rep-sheet):not(.rep-sheet *) { display: none !important; }
  body:has(.rep-sheet) *:has(.rep-sheet) {
    display: block !important; overflow: visible !important; position: static !important;
    padding: 0 !important; margin: 0 !important; width: auto !important; max-width: none !important;
    min-height: 0 !important; height: auto !important; border: 0 !important; box-shadow: none !important;
  }
  .rep-sheet { background: white; color: black; font: 10pt/1.3 sans-serif; }
  .rep-sheet h2 { font-size: 15pt; }
  .rep-sheet h3 { font-size: 12pt; break-after: avoid; }
  .rep-sheet h4 { break-after: avoid; }
  .rep-sheet table { table-layout: fixed; font-size: 7pt; }
  .rep-sheet td, .rep-sheet th { padding: 1mm .2mm; overflow-wrap: anywhere; color: black; border-color: #444; }
  .rep-sheet th:first-child { width: 30mm; min-width: 0; }
  .rep-sheet th:nth-child(2) { width: 7mm; }
  .rep-sheet tr, .rep-notes li { break-inside: avoid; }
  .rep-sheet thead { display: table-header-group; }
  .rep-table-wrap { overflow: visible; }
}
