/* ═══════════════════════════════════════════════════════════════════════════
   Helvetia Dry Cleaning & Schneiderei — Rechnungen
   1. Tokens & base      2. App shell      3. Controls
   4. Invoice document (A4)                5. QR-bill payment part
   6. Print
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens & base ───────────────────────────────────────────────────── */
:root {
  --green: #257d3e;
  --green-dark: #1c6231;
  --green-soft: #eaf3ed;
  --red: #da1f26;
  --ink: #16181a;
  --ink-2: #4a5158;
  --ink-3: #7b848c;
  --line: #dfe3e0;
  --line-2: #eef1ef;
  --bg: #f4f6f5;
  --card: #ffffff;
  --warn-bg: #fdf3e3;
  --warn-ink: #8a5a10;
  --err: #c0272d;
  --r: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 8px 24px -12px rgba(16, 24, 20, .18);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: calc(58px + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── 2. App shell ───────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px calc(10px + env(safe-area-inset-top));
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar__logo { height: 26px; width: auto; flex: none; }

.tabs { display: none; gap: 4px; margin-left: auto; }

.tabs__btn {
  border: 0;
  background: none;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 550;
}
.tabs__btn:hover { background: var(--line-2); }
.tabs__btn.is-active { background: var(--green); color: #fff; }

.main {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 14px calc(var(--tabbar-h) + 24px);
}

.view { display: none; }
.view.is-active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card--totals { position: sticky; bottom: calc(var(--tabbar-h) - 8px); z-index: 5; }

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.card__head h2 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.card__head > .btn, .card__head > .count, .card__head > .chips { margin-left: auto; }

.step {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.count { color: var(--ink-3); font-size: 13px; }
.hint { margin: 8px 0 0; color: var(--ink-3); font-size: 13px; }
.note { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.note.is-ok { color: var(--green-dark); }
.note.is-err { color: var(--err); }

/* ── 3. Controls ────────────────────────────────────────────────────────── */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.row--end { justify-content: flex-end; }
.row--split { justify-content: space-between; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--line-2);
  color: var(--ink);
  font-weight: 560;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); }
.btn--soft { background: var(--green-soft); color: var(--green-dark); }
.btn--soft:hover { background: #ddebe1; }
.btn--ghost { background: none; border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { background: var(--line-2); }
.btn--danger { color: var(--err); border-color: #f0d2d3; }
.btn--danger:hover { background: #fdf0f0; }
.btn--sm { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 16px; }
.btn--full { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }

.f { grid-column: span 3; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > span { font-size: 12px; font-weight: 560; color: var(--ink-2); }
.f > span b { color: var(--red); font-weight: 700; }
.f--wide { grid-column: 1 / -1; }
.f--street { grid-column: span 4; }
.f--nr { grid-column: span 2; }
.f--zip { grid-column: span 2; }
.f--city { grid-column: span 4; }
.f--sm { grid-column: span 2; }
.f--check { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 9px; }
.f--check span { font-size: 14px; color: var(--ink); }

input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 62px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(37, 125, 62, .14);
}
input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--green); }
input[type="file"] { padding: 7px; background: var(--line-2); border-style: dashed; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%237b848c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 11px; padding-right: 32px; }

.seg { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: 10px; margin-bottom: 12px; }
.seg__btn { border: 0; background: none; padding: 8px 18px; border-radius: 8px; cursor: pointer; font-weight: 550; color: var(--ink-2); }
.seg__btn.is-active { background: #fff; color: var(--green-dark); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-2);
}
.chip.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.chip--muted { background: var(--green-soft); border-color: transparent; color: var(--green-dark); cursor: default; }

/* Search + results */
.search { margin-bottom: 14px; }
.search__field { position: relative; display: flex; align-items: center; }
.search__field input { padding-left: 40px; min-height: 48px; }
.search__field--plain input { padding-left: 12px; }
.search__icon { position: absolute; left: 13px; width: 18px; height: 18px; fill: var(--ink-3); pointer-events: none; }
.search__hint { margin: 7px 2px 0; font-size: 12px; color: var(--ink-3); }
.search__spinner {
  position: absolute;
  right: 14px;
  width: 15px;
  height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results {
  position: relative;
  z-index: 20;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  max-height: 330px;
  overflow-y: auto;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.results__group {
  padding: 7px 12px;
  background: var(--line-2);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
  position: sticky;
  top: 0;
}
.res {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-top: 1px solid var(--line-2);
  background: none;
  text-align: left;
  cursor: pointer;
}
.res:first-child { border-top: 0; }
.res:hover, .res:focus-visible { background: var(--green-soft); }
.res__main { min-width: 0; flex: 1; }
.res__name, .res__sub { display: block; }
.res__name { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res__name mark { background: #fdf0b8; color: inherit; border-radius: 2px; }
.res__sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res__tag {
  flex: none;
  font-size: 11px;
  font-weight: 650;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--line-2);
  color: var(--ink-2);
}
.res__tag--saved { background: var(--green-soft); color: var(--green-dark); }
.res__empty { padding: 14px 12px; color: var(--ink-3); font-size: 13px; }

/* Items */
.items { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: grid;
  grid-template-columns: 1fr 62px 78px 92px 82px 34px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfdfc;
}
.item__lbl { font-size: 11px; color: var(--ink-3); display: block; margin-bottom: 3px; }
.item input, .item select { min-height: 40px; }
.item__sum {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding-bottom: 10px;
  white-space: nowrap;
}
.item__del {
  min-height: 40px;
  width: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.item__del:hover { color: var(--err); border-color: #f0d2d3; background: #fdf5f5; }
.item--empty { color: var(--ink-3); font-size: 13px; text-align: center; padding: 18px; border-style: dashed; }

/* Totals */
.totals { display: flex; flex-direction: column; gap: 5px; font-variant-numeric: tabular-nums; }
.totals__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.totals__row b { font-weight: 550; color: var(--ink); }
.totals__row--grand {
  margin-top: 6px;
  padding-top: 9px;
  border-top: 2px solid var(--ink);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

/* Lists */
.list { display: flex; flex-direction: column; }
.list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-top: 1px solid var(--line-2);
}
.list__item:first-child { border-top: 0; }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 560; }
.list__sub { font-size: 12.5px; color: var(--ink-3); }
.list__amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.list__actions { display: flex; gap: 6px; }
.list__empty { padding: 22px 0; text-align: center; color: var(--ink-3); font-size: 14px; }

.logo-preview { grid-column: 1 / -1; }
.logo-preview img { max-height: 46px; max-width: 100%; }

/* Bottom tab bar (mobile) */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__btn {
  flex: 1;
  border: 0;
  background: none;
  padding: 7px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--ink-3);
  font-size: 10.5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tabbar__btn svg { width: 22px; height: 22px; fill: currentColor; }
.tabbar__btn.is-active { color: var(--green); }

/* Overlay / preview */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #55605a;
  display: flex;
  flex-direction: column;
}
.overlay[hidden] { display: none; }
.overlay__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.overlay__title { font-weight: 600; font-size: 14px; }
.overlay__actions { margin-left: auto; display: flex; gap: 8px; }
.overlay__scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 16px 0 40px; }
.overlay__zoom { transform-origin: top center; margin: 0 auto; width: 210mm; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 14px);
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .5);
  animation: toast .2s ease;
}
.toast[hidden] { display: none; }
.toast--err { background: var(--err); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (min-width: 720px) {
  .tabs { display: flex; }
  .tabbar { display: none; }
  :root { --tabbar-h: 0px; }
  .main { padding-bottom: 40px; }
  .card--totals { bottom: 12px; }
}

@media (max-width: 560px) {
  .card { padding: 14px; }
  .card--totals { padding: 12px 14px; }
  .card--totals .row--split { flex-wrap: nowrap; margin-top: 9px; }
  .card--totals .row--split .btn--primary { flex: 1; }
  .card--totals .btn--ghost { flex: none; padding: 0 12px; }
  .totals__row { font-size: 13.5px; }
  .totals__row--grand { font-size: 17px; margin-top: 3px; padding-top: 7px; }
  .fields { grid-template-columns: repeat(4, 1fr); }
  .f, .f--street, .f--city { grid-column: 1 / -1; }
  .f--nr, .f--zip, .f--sm { grid-column: span 2; }
  .item { grid-template-columns: 1fr 1fr 1fr; }
  .item__desc { grid-column: 1 / -1; }
  .item__sumwrap { grid-column: span 2; }
  .item__sum { padding-bottom: 0; align-self: center; }
  .item__delwrap { justify-self: end; }
}

/* ── 4. Invoice document (A4) ───────────────────────────────────────────── */
#paper { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.sheet {
  position: relative;
  width: 210mm;
  height: 297mm;
  background: #fff;
  color: #000;
  font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  font-size: 9.5pt;
  line-height: 1.35;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .28);
}

.sheet__inner { position: absolute; inset: 0; padding: 14mm 20mm 0; }

.doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10mm; height: 24mm; }
.doc-head__logo { max-height: 18mm; max-width: 85mm; width: auto; }
.doc-head__co { text-align: right; font-size: 7.5pt; line-height: 1.45; color: #333; }
.doc-head__co b { display: block; font-size: 8.5pt; color: #000; }

.doc-cols { position: absolute; left: 20mm; right: 20mm; top: 45mm; height: 36mm; }

.doc-addr { position: absolute; top: 0; width: 85mm; font-size: 10pt; line-height: 1.4; }
.doc-addr--right { right: 0; }
.doc-addr--left { left: 0; }
.doc-addr__sender { font-size: 6.5pt; color: #444; border-bottom: .3pt solid #999; padding-bottom: .6mm; margin-bottom: 2.2mm; }
.doc-addr__line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.doc-meta { position: absolute; top: 0; width: 82mm; font-size: 8.5pt; }
.doc-meta--left { left: 0; }
.doc-meta--right { right: 0; }
.doc-meta__row { display: flex; gap: 3mm; padding: .35mm 0; }
.doc-meta__k { width: 34mm; color: #555; flex: none; }
.doc-meta__v { font-weight: 600; }

.doc-body { position: absolute; left: 20mm; right: 20mm; top: 86mm; }
.doc-body--cont { top: 40mm; }

.doc-title { font-size: 15pt; font-weight: 700; letter-spacing: -.2pt; margin-bottom: 1.5mm; }
.doc-sub { font-size: 9pt; color: #444; margin-bottom: 5mm; }
.doc-intro { margin-bottom: 4mm; }

.tbl { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.tbl th {
  text-align: left;
  font-size: 7.5pt;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: #257d3e;
  padding: 1.6mm 2mm;
}
.tbl td { padding: 1.5mm 2mm; border-bottom: .3pt solid #d8ddd9; vertical-align: top; }
.tbl .c-pos { width: 8mm; color: #666; }
.tbl .c-qty, .tbl .c-price, .tbl .c-sum { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .c-qty { width: 16mm; }
.tbl .c-unit { width: 16mm; }
.tbl .c-price { width: 24mm; }
.tbl .c-sum { width: 26mm; }
.tbl__note { font-size: 8pt; color: #555; }

.doc-sums { margin-top: 3mm; margin-left: auto; width: 82mm; font-size: 9.5pt; }
.doc-sums__row { display: flex; justify-content: space-between; padding: .8mm 2mm; font-variant-numeric: tabular-nums; }
.doc-sums__row--sep { border-top: .3pt solid #b9c1bb; }
.doc-sums__row--total {
  margin-top: 1mm;
  border-top: 1.2pt solid #000;
  border-bottom: 1.2pt solid #000;
  font-size: 11.5pt;
  font-weight: 700;
  padding: 1.3mm 2mm;
}
.doc-sums__lbl { color: #333; }

.doc-pay { margin-top: 4mm; font-size: 9pt; }
.doc-pay strong { font-weight: 650; }
.doc-note { margin-top: 3mm; font-size: 9pt; white-space: pre-line; }
.doc-vatnote { margin-top: 3mm; font-size: 8pt; color: #444; }

.doc-foot {
  position: absolute;
  left: 20mm;
  right: 20mm;
  bottom: 5mm;
  font-size: 7pt;
  color: #666;
  text-align: center;
  border-top: .3pt solid #d8ddd9;
  padding-top: 1.5mm;
}
.sheet--last .doc-foot { display: none; }
.doc-pagenum { position: absolute; right: 20mm; top: 8mm; font-size: 7.5pt; color: #666; }

/* ── 5. QR-bill payment part (210 × 105 mm, bottom of the last sheet) ────── */
.qrbill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 210mm;
  height: 105mm;
  color: #000;
  font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
}

.qrb-cut { position: relative; height: 0; }
.qrb-cut-label {
  position: absolute;
  bottom: 1.2mm;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 7pt;
  color: #000;
}
.qrbill::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 210mm;
  border-top: .5pt dashed #000;
}

.qrb-body { display: flex; height: 105mm; }

.qrb-receipt {
  width: 62mm;
  height: 105mm;
  padding: 5mm;
  border-right: .5pt dashed #000;
  display: flex;
  flex-direction: column;
}
.qrb-payment { width: 148mm; height: 105mm; padding: 5mm; display: flex; gap: 5mm; }

.qrb-title { font-size: 11pt; font-weight: 700; line-height: 1; margin: 0; }
.qrb-receipt .qrb-title { height: 7mm; }
.qrb-payment .qrb-title { height: 7mm; }

.qrb-receipt h3 { font-size: 6pt; font-weight: 700; line-height: 9pt; margin: 0; }
.qrb-receipt .qrb-val { font-size: 8pt; line-height: 9pt; margin-bottom: 2.2mm; }
.qrb-r-info { height: 56mm; overflow: hidden; }
.qrb-r-amount { height: 14mm; display: flex; gap: 4mm; }
.qrb-accept { height: 18mm; display: flex; align-items: flex-start; justify-content: flex-end; }
.qrb-accept h3 { font-size: 6pt; text-align: right; }

.qrb-left { width: 51mm; flex: none; }
.qrb-right { width: 87mm; flex: none; overflow: hidden; }
.qrb-right h3 { font-size: 8pt; font-weight: 700; line-height: 11pt; margin: 0; }
.qrb-right .qrb-val { font-size: 10pt; line-height: 11pt; margin-bottom: 2.5mm; }

.qrb-qr { width: 46mm; height: 46mm; margin: 5mm 0 0; }
.qrb-qr svg { display: block; width: 46mm; height: 46mm; }
.qrb-p-amount { height: 22mm; padding-top: 5mm; display: flex; gap: 5mm; }
.qrb-p-amount h3 { font-size: 8pt; font-weight: 700; line-height: 11pt; margin: 0; }
.qrb-p-amount .qrb-val { font-size: 10pt; line-height: 11pt; }
.qrb-r-amount h3 { font-size: 6pt; font-weight: 700; line-height: 9pt; margin: 0; }
.qrb-r-amount .qrb-val { font-size: 8pt; line-height: 9pt; margin-bottom: 0; }

.qrb-blank { position: relative; }
.qrb-blank i { position: absolute; width: 3mm; height: 3mm; border: .6pt solid #000; }
.qrb-blank i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.qrb-blank i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.qrb-blank i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.qrb-blank i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.qrb-blank-r { width: 52mm; height: 20mm; }
.qrb-blank-p { width: 65mm; height: 25mm; }
.qrb-blank-ar { width: 30mm; height: 10mm; }
.qrb-blank-ap { width: 40mm; height: 15mm; }

/* ── 6. Print ───────────────────────────────────────────────────────────── */
@page { size: A4 portrait; margin: 0; }

@media print {
  html, body { background: #fff; margin: 0; padding: 0; }
  .topbar, .tabbar, .main, .toast, .overlay__bar { display: none !important; }
  .overlay { position: static; display: block; background: #fff; }
  .overlay__scroll { overflow: visible; padding: 0; }
  .overlay__zoom { transform: none !important; width: auto; margin: 0; }
  #paper { display: block; gap: 0; }
  .sheet {
    box-shadow: none;
    margin: 0;
    page-break-after: always;
    break-after: page;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
