:root {
  --brand: #1f3a4d;
  --brand-dark: #142833;
  --brand-accent: #c46b2c;
  --brand-muted: #5d7380;
  --ink: #1c2430;
  --muted: #4a5563;
  --line: #c5d0dc;
  --paper: #f3f0ea;
  --card: #ffffff;
  --accent: #1f3a4d;
  --accent-2: #142833;
  --danger: #8a2b2b;
  --warn: #6b4e16;
  --warn-bg: #f6edd4;
  --ok: #2f6f4e;
  --focus: #1f3a4d;
  --shadow: 0 1px 2px rgba(20, 40, 51, 0.06), 0 8px 24px rgba(20, 40, 51, 0.08);
  --radius: 10px;
  --font: "Source Sans 3", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Source Sans 3", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max: 60rem;
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  line-height: 1.45;
  padding-bottom: var(--bar-space, 3.25rem);
}

[hidden] {
  display: none !important;
}

.app-header,
.app-main,
.app-footer {
  width: min(100% - 1.5rem, var(--max));
  margin-inline: auto;
}

.app-header {
  padding: 1.25rem 0 0.75rem;
}

.brand-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.15rem;
  padding: 0.85rem 1rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--brand-dark);
  border-radius: var(--radius);
}

.brand-logo {
  display: block;
  width: 48px;
  height: 48px;
}

.brand-company {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: 0.01em;
}

.brand-bar-copy h1 {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.lede {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.lede-en {
  font-size: 0.88rem;
}

html[lang="en"] .lede-en {
  display: none;
}

.brand-bar-copy {
  flex: 1 1 16rem;
}

.lang-switch {
  margin-left: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.lang-switch a {
  color: inherit;
  text-decoration: none;
  padding: 0.1rem 0.2rem;
}

.lang-switch a[aria-current="true"] {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 0.15rem;
}

.lang-switch a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.watermark-chip {
  position: relative;
  z-index: 5;
  display: inline-block;
  margin: 0.85rem 0 0;
  padding: 0.28rem 0.6rem;
  border: 2px solid #9f1d1d;
  color: #9f1d1d;
  background: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: rotate(-2deg);
}

.journey {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.journey li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.92rem;
}

.journey li > span:first-child {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #e7edf1;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.journey li.is-now {
  border-color: var(--brand);
  color: var(--brand-dark);
  font-weight: 700;
}

.journey li.is-done {
  border-color: var(--ok);
  color: var(--brand-dark);
}

.journey li.is-done > span:first-child,
.journey li.is-now > span:first-child {
  background: var(--brand);
  color: #fff;
}

.app-watermark {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  font-size: clamp(1.8rem, 7vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(159, 29, 29, 0.16);
  transform: rotate(-24deg);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.doc-watermark {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 2;
  margin: 0;
  transform: translate(-50%, -50%) rotate(-28deg);
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(159, 29, 29, 0.32);
  white-space: nowrap;
  pointer-events: none;
}

.doc-stamp {
  position: relative;
  z-index: 3;
  display: block;
  width: fit-content;
  margin: 0.45rem 0 0 auto;
  padding: 0.12rem 0.4rem;
  border: 2px solid #9f1d1d;
  color: #9f1d1d;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: rotate(-6deg);
}

.banner {
  margin: 0.9rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 0.92rem;
}

.banner-warn {
  background: var(--warn-bg);
  border-color: #e2d2a4;
  color: var(--warn);
}

.banner-example {
  background: #efe7d4;
  border-color: #d7c79a;
  font-weight: 600;
}

.banner-hybrid {
  background: var(--card);
  border-color: #b7c6d6;
}

.hybrid-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}

.hybrid-lede {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.hybrid-list {
  margin: 0.45rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.92rem;
}

.hybrid-list li + li {
  margin-top: 0.35rem;
}

.hybrid-derived {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-weight: 400;
}

.akte-hint {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.akte-hint h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.akte-hint p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  min-height: 2.75rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  border-color: #b9b2a4;
}

.btn:focus-visible,
.item-toggle:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-2);
}

.btn-danger {
  color: var(--danger);
  border-color: #e0c8c8;
}

.btn-block {
  width: 100%;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  margin: 1rem 0 0;
  padding: 0.9rem 1rem 1rem;
}

legend {
  font-family: var(--serif);
  font-size: 1.15rem;
  padding: 0 0.35rem;
}

.hint {
  margin: 0.15rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.grid {
  display: grid;
  gap: 0.45rem;
}

.grid-2 {
  grid-template-columns: 1fr;
}

label,
.field-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.item-card textarea {
  min-height: 2.35rem;
}

.radio-row,
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
}

.radio-row label,
.check-row label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  margin: 0;
  min-height: 2.5rem;
}

input[type="radio"],
input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
}

.field-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 0.25rem;
  min-height: 1.1em;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  overflow: hidden;
}

.item-card + .item-card {
  margin-top: 0.4rem;
}

.item-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 2.6rem;
  background: #f4f7fb;
  user-select: none;
}

.item-card.is-expanded .item-bar {
  border-bottom: 1px solid var(--line);
}

.item-drag {
  flex: 0 0 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: #6b7c8d;
  user-select: none;
  touch-action: none;
}

.item-drag:hover {
  background: rgba(4, 81, 157, 0.06);
}

.item-drag:active,
body.is-reordering .item-drag {
  cursor: grabbing;
}

body.is-reordering {
  cursor: grabbing;
  user-select: none;
}

.item-drag:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.item-drag-icon {
  display: block;
  width: 0.72rem;
  height: 1.05rem;
  background-image: radial-gradient(circle, #5d6e80 1.15px, transparent 1.25px);
  background-size: 0.36rem 0.34rem;
  background-repeat: repeat;
}

.item-toggle {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0.4rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.item-toggle:hover {
  background: rgba(4, 81, 157, 0.04);
}

.item-chevron {
  flex: 0 0 auto;
  width: 0.42rem;
  height: 0.42rem;
  margin: 0 0.1rem 0 0.05rem;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.item-card.is-expanded .item-chevron {
  transform: rotate(45deg);
  margin-top: -0.15rem;
}

.item-pos {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: 0.01em;
}

.item-summary {
  display: none;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.55rem 0.75rem;
  min-width: 0;
}

.item-card.is-collapsed .item-summary {
  display: flex;
}

.item-summary-desc {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.item-summary-meta,
.item-summary-amt {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.item-summary-amt {
  font-weight: 600;
  color: var(--brand-dark);
}

.item-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.35rem 0.2rem 0;
}

.item-bar-actions .btn {
  min-height: 2rem;
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.78rem;
}

.item-move:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.item-body {
  padding: 0.5rem 0.55rem 0.55rem;
}

.item-card.is-collapsed .item-body {
  display: none;
}

.item-card.is-dragging {
  opacity: 0.42;
}

.item-card.drop-before {
  box-shadow: inset 0 2px 0 var(--brand);
}

.item-card.drop-after {
  box-shadow: inset 0 -2px 0 var(--brand);
}

.unit-field .unit-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

@media (max-width: 520px) {
  .item-bar {
    flex-wrap: wrap;
  }

  .item-toggle {
    flex: 1 1 calc(100% - 2.4rem);
  }

  .item-bar-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
    padding-left: 2.4rem;
    padding-bottom: 0.35rem;
  }

  .item-summary {
    flex-wrap: wrap;
  }
}

.item-derived {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
}

.custom-rate-wrap {
  margin-top: 0.3rem;
}

.workspace-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 -4px 16px rgba(28, 25, 20, 0.12);
}

.workspace-bar-row {
  width: min(100% - 1rem, var(--max));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  padding: 0.35rem 0;
  min-height: 2.75rem;
}

.workspace-bar-brutto {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.78rem;
  flex: 1 1 auto;
}

.workspace-bar-brutto strong {
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}

.workspace-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

.btn-on-bar,
.btn-bar-toggle {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  min-height: 2.15rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
}

.btn-on-bar:hover,
.btn-bar-toggle:hover {
  border-color: #fff;
}

.btn-primary-bar {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
}

.workspace-bar-detail {
  width: min(100% - 1rem, var(--max));
  margin: 0 auto;
  padding: 0 0 0.45rem;
  font-size: 0.8rem;
}

.totals-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.totals-table th {
  text-align: left;
  font-weight: 500;
  padding: 0.08rem 0.5rem 0.08rem 0;
}

.totals-table td {
  text-align: right;
  padding: 0.08rem 0;
}

.totals-table .grand th,
.totals-table .grand td {
  padding-top: 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.totals-table .rounding {
  color: #ffe08a;
}

.workspace-bar .disclaimer {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  opacity: 0.92;
}

.status {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.preview {
  margin: 1.25rem 0 1rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.print-page {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 0 1.15rem 1.25rem;
  margin-bottom: 0.85rem;
  border-top: 6px solid var(--brand-dark);
}

.doc-letterhead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 0 0.7rem;
  border-bottom: 1px solid var(--brand-muted);
  margin-bottom: 0.75rem;
}

.doc-letterhead-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: min(100%, 18rem);
}

.doc-company {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.doc-company-place {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.doc-logo {
  display: block;
  width: 48px;
  height: 48px;
}

.doc-letterhead-meta {
  flex: 1 1 12rem;
  text-align: right;
}

.preview h2 {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.preview-doc {
  color: #111;
}

.preview-doc .doc-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
  margin: 0 0 0.2rem;
}

.preview-doc .doc-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  margin: 0;
  color: var(--brand-dark);
  font-weight: 700;
}

.preview-meta,
.preview-parties {
  display: grid;
  gap: 0.75rem;
  margin: 0.85rem 0;
}

.preview-parties .party h3 {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
}

.preview-parties .party p {
  margin: 0;
  white-space: pre-wrap;
}

.preview-table-wrap {
  overflow-x: auto;
}

.preview-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.preview-table thead th {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  border-bottom: 0;
  padding: 0.45rem 0.4rem;
}

.preview-table th,
.preview-table td {
  border-bottom: 1px solid #d5deea;
  padding: 0.42rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.preview-table tbody tr:nth-child(even) td {
  background: #f3f7fb;
}

.preview-table .col-pos {
  width: 2.4rem;
}

.preview-table .col-qty {
  width: 3.5rem;
  white-space: nowrap;
}

.preview-table .col-unit {
  width: 5.8rem;
  white-space: nowrap;
}

.preview-table .col-ep,
.preview-table .col-amt {
  width: 5.8rem;
  white-space: nowrap;
}

.preview-table .col-ust {
  width: 3.3rem;
  white-space: nowrap;
}

.preview-table .col-desc {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
}

/* Phone: the fixed print table crushes the description into one letter per line.
   Stack each position as a card. Print stays a real table. */
@media (max-width: 720px) {
  .preview-table:not(.preview-totals) {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  .preview-table:not(.preview-totals) thead {
    display: none;
  }

  .preview-table:not(.preview-totals) tbody {
    display: block;
  }

  .preview-table:not(.preview-totals) tr {
    display: block;
    margin: 0 0 0.65rem;
    border: 1px solid #d5deea;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }

  .preview-table:not(.preview-totals) td {
    display: grid;
    grid-template-columns: minmax(6.75rem, 40%) minmax(0, 1fr);
    gap: 0.15rem 0.75rem;
    align-items: start;
    width: auto;
    border: 0;
    border-bottom: 1px solid #e6edf4;
    padding: 0.45rem 0.7rem;
    text-align: left;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    background: #fff;
  }

  .preview-table:not(.preview-totals) td:last-child {
    border-bottom: 0;
  }

  .preview-table:not(.preview-totals) td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.78rem;
  }

  .preview-table:not(.preview-totals) td.col-desc {
    display: block;
    font-weight: 600;
    background: #f4f7fb;
  }

  .preview-table:not(.preview-totals) td.col-desc::before {
    content: none;
  }
}

.preview-table th.col-qty,
.preview-table td.col-qty,
.preview-table th.col-ep,
.preview-table td.col-ep,
.preview-table th.col-ust,
.preview-table td.col-ust,
.preview-table th.col-amt,
.preview-table td.col-amt,
.preview-table .num {
  text-align: right;
}

@media (max-width: 720px) {
  .preview-table:not(.preview-totals) td.col-pos,
  .preview-table:not(.preview-totals) td.col-qty,
  .preview-table:not(.preview-totals) td.col-unit,
  .preview-table:not(.preview-totals) td.col-ep,
  .preview-table:not(.preview-totals) td.col-ust,
  .preview-table:not(.preview-totals) td.col-amt {
    width: auto;
    text-align: left;
    white-space: normal;
  }
}

.preview-totals {
  margin-left: auto;
  width: min(100%, 18rem);
  margin-top: 0.85rem;
}

.preview-note,
.preview-legal,
.uebertrag,
.page-num {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: #333;
}

.uebertrag {
  font-weight: 600;
}

.page-num {
  text-align: right;
  color: #666;
  margin-bottom: 0;
}

.print-page-foot {
  margin-top: 0.75rem;
}

.app-footer {
  padding: 0 0 2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.app-footer p {
  margin: 0.35rem 0;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .unit-field .unit-row {
    grid-template-columns: minmax(7.25rem, 0.85fr) minmax(6.5rem, 1.15fr);
  }

  .item-summary-meta {
    min-width: 6.25rem;
    text-align: right;
  }

  .item-summary-amt {
    min-width: 5.75rem;
    text-align: right;
  }

  .preview-meta,
  .preview-parties {
    grid-template-columns: 1fr 1fr;
  }

  .btn {
    width: auto;
  }
}

@media print {
  body {
    background: #fff;
    padding-bottom: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

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

  .app-header,
  .app-main,
  .app-footer {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .preview {
    margin: 0;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .preview > h2 {
    display: none;
  }

  .doc-watermark,
  .doc-stamp {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .print-page {
    break-after: page;
    page-break-after: always;
    display: flex;
    flex-direction: column;
    min-height: 250mm;
    margin: 0;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

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

  .print-page-body {
    flex: 1 1 auto;
  }

  .print-page-foot {
    margin-top: auto;
  }

  a[href]::after {
    content: none !important;
  }

  .preview-table:not(.preview-totals) {
    display: table;
    width: 100%;
    table-layout: fixed;
  }

  .preview-table:not(.preview-totals) thead {
    display: table-header-group;
  }

  .preview-table:not(.preview-totals) tbody {
    display: table-row-group;
  }

  .preview-table:not(.preview-totals) tr {
    display: table-row;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
  }

  .preview-table:not(.preview-totals) td {
    display: table-cell;
    width: auto;
    border: 0;
    border-bottom: 1px solid #d5deea;
    text-align: left;
    white-space: normal;
    background: transparent;
  }

  .preview-table:not(.preview-totals) td::before {
    content: none;
  }

  .preview-table:not(.preview-totals) th.col-qty,
  .preview-table:not(.preview-totals) td.col-qty,
  .preview-table:not(.preview-totals) th.col-ep,
  .preview-table:not(.preview-totals) td.col-ep,
  .preview-table:not(.preview-totals) th.col-ust,
  .preview-table:not(.preview-totals) td.col-ust,
  .preview-table:not(.preview-totals) th.col-amt,
  .preview-table:not(.preview-totals) td.col-amt {
    text-align: right;
    white-space: nowrap;
  }
}
