/* پیش‌نمایش نامه داخلی — چیدمان شبیه نامه واقعی */

.letter-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.letter-preview-dialog {
  background: #e2e8f0;
  border-radius: 12px;
  width: min(960px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.letter-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
}

.letter-preview-toolbar .lp-spacer {
  flex: 1;
}

.letter-preview-toolbar label {
  font-size: 12px;
  color: #475569;
  margin: 0;
}

.letter-preview-toolbar .lp-page-badge {
  background: #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  color: #334155;
  font-weight: 600;
  font-size: 13px;
}

.letter-preview-toolbar select {
  max-width: 180px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.letter-preview-toolbar .lp-zoom-pct {
  min-width: 3.2em;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
  padding: 4px 2px;
}

.letter-preview-toolbar .lp-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.letter-preview-toolbar .lp-fa-stack {
  position: relative;
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  line-height: 1;
  vertical-align: -0.1em;
}
.letter-preview-toolbar .lp-fa-stack-base {
  font-size: 1.05em;
}
.letter-preview-toolbar .lp-fa-stack-badge {
  position: absolute;
  right: -0.2em;
  bottom: -0.15em;
  font-size: 0.58em;
  line-height: 1;
  background: #fff;
  border-radius: 2px;
  padding: 0 1px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.letter-preview-toolbar .lp-fa-stack-badge--plus {
  color: #2563eb;
}
.letter-preview-toolbar .lp-fa-stack-badge--times {
  color: #dc2626;
}

.letter-preview-toolbar .lp-toolbar-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  color: #475569;
  font-size: 14px;
}

.letter-preview-toolbar .lp-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.letter-preview-toolbar .lp-icon-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.letter-preview-toolbar .lp-toggle-btn {
  opacity: 0.55;
}

.letter-preview-toolbar .lp-toggle-btn.is-active {
  opacity: 1;
  background: #e2e8f0;
  border-color: #64748b;
  color: #0f172a;
}

.letter-preview-hint {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  padding: 8px 14px 0;
}

.letter-preview-path-host {
  flex: 0 0 auto;
  max-height: 42%;
  overflow: auto;
  padding: 10px 14px 14px;
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
}

.letter-preview-path-host[hidden] {
  display: none !important;
}

.letter-preview-path-host .letter-path-diagram {
  margin: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px 12px;
}

.letter-preview-stage {
  flex: 1;
  overflow: auto;
  padding: 20px 16px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* صفحهٔ کاغذ — ابعاد ثابت نمایش (۹۶dpi) */
.letter-preview-page {
  position: relative;
  background-color: #fff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.18);
  color: #111;
  direction: rtl;
  font-family: 'B Nazanin', Nazanin, Vazirmatn, Tahoma, serif;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.lp-letterhead-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.letter-preview-page.is-a5 {
  width: 559px; /* ۱۴۸mm @96dpi */
  height: 794px; /* ۲۱۰mm */
}

.letter-preview-page.is-a4 {
  width: 794px; /* ۲۱۰mm */
  height: 1123px; /* ۲۹۷mm */
}

/* خطوط راهنمای حاشیه — فقط پیش‌نمایش */
.lp-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.lp-guides span {
  position: absolute;
  background: transparent;
  border: 0;
}

.lp-guides .lp-guide-top,
.lp-guides .lp-guide-bottom {
  left: 0;
  right: 0;
  border-top: 1px dashed #94a3b8;
}

.lp-guides .lp-guide-left,
.lp-guides .lp-guide-right {
  top: 0;
  bottom: 0;
  border-left: 1px dashed #94a3b8;
}

/* موقعیت خطوط حاشیه از JS (از مشخصات سربرگ) تنظیم می‌شود */

/* شبکه سانتی‌متری نقطه‌چین — مبدأ بالا راست */
.lp-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  display: block;
}

.letter-preview-page.lp-guides-off .lp-guides,
.letter-preview-page.lp-grid-off .lp-grid,
.letter-preview-page.lp-letterhead-off .lp-letterhead-img,
.letter-preview-page.lp-signature-off .lp-signature,
.letter-preview-page.lp-signature-off .lp-sign-img,
.letter-preview-page.lp-stamp-off .lp-stamp,
.letter-preview-page.lp-stamp-off .lp-stamp-img {
  display: none !important;
}

.lp-grid {
  opacity: 1;
}

/* کادر محتوا — حاشیه‌ها از JS بر اساس سربرگ */
.lp-content-frame {
  position: absolute;
  top: 25mm;
  bottom: 20mm;
  right: 12mm;
  left: 12mm;
  z-index: 1;
  box-sizing: border-box;
  overflow: visible;
}

.lp-block {
  position: absolute;
  box-sizing: border-box;
  max-width: 100%;
  cursor: grab;
  padding: 2px 4px;
  border: 1px dashed transparent;
  border-radius: 4px;
  user-select: none;
  z-index: 3;
}

.lp-block.lp-signature,
.lp-block.lp-stamp {
  z-index: 6;
  overflow: visible;
}

.lp-block.lp-signature .lp-sign-img,
.lp-block.lp-stamp .lp-stamp-img {
  pointer-events: none;
}

.lp-block:hover,
.lp-block.is-dragging,
.lp-block.is-resizing {
  border-color: #94a3b8;
  background: rgba(248, 250, 252, 0.45);
}

.lp-block.lp-signature.is-dragging,
.lp-block.lp-signature.is-resizing,
.lp-block.lp-signature:hover,
.lp-block.lp-stamp.is-dragging,
.lp-block.lp-stamp.is-resizing,
.lp-block.lp-stamp:hover {
  background: transparent;
  border-color: #94a3b8;
}

.lp-block.is-dragging {
  cursor: grabbing;
  z-index: 5;
}

.lp-block.lp-signature.is-dragging,
.lp-block.lp-signature.is-resizing,
.lp-block.lp-stamp.is-dragging,
.lp-block.lp-stamp.is-resizing {
  z-index: 8;
  cursor: grabbing;
}

.lp-block.is-resizing {
  z-index: 9;
}

.lp-resize-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #fff;
  border: 1.5px solid #3b82f6;
  border-radius: 2px;
  box-sizing: border-box;
  z-index: 12;
  opacity: 0;
  pointer-events: none;
}

.lp-block:hover .lp-resize-handle,
.lp-block.is-dragging .lp-resize-handle,
.lp-block.is-resizing .lp-resize-handle {
  opacity: 1;
  pointer-events: auto;
}

.lp-resize-n {
  top: -5px;
  left: 50%;
  margin-left: -4.5px;
  cursor: ns-resize;
}
.lp-resize-s {
  bottom: -5px;
  left: 50%;
  margin-left: -4.5px;
  cursor: ns-resize;
}
.lp-resize-e {
  right: -5px;
  top: 50%;
  margin-top: -4.5px;
  cursor: ew-resize;
}
.lp-resize-w {
  left: -5px;
  top: 50%;
  margin-top: -4.5px;
  cursor: ew-resize;
}
.lp-resize-ne {
  top: -5px;
  right: -5px;
  cursor: nesw-resize;
}
.lp-resize-nw {
  top: -5px;
  left: -5px;
  cursor: nwse-resize;
}
.lp-resize-se {
  bottom: -5px;
  right: -5px;
  cursor: nwse-resize;
}
.lp-resize-sw {
  bottom: -5px;
  left: -5px;
  cursor: nesw-resize;
}

.lp-block.lp-sized.lp-signature .lp-sign-img,
.lp-block.lp-sized.lp-stamp .lp-stamp-img {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.lp-block.lp-sized.lp-body {
  overflow: hidden;
}

/* موضوع — همان فونت متن اصلی */
.lp-subject {
  text-align: justify !important;
  text-justify: inter-word;
  text-align-last: right;
  font-family: 'B Nazanin', Nazanin, Vazirmatn, serif !important;
  font-weight: 400 !important;
  font-size: 14px;
  line-height: 2;
  color: #111;
  padding-top: 14px;
}

.lp-subject-line {
  display: block;
}

.lp-subject-label {
  font-weight: 700;
}

/* عنوان درخواست داخلی — بولد و وسط‌چین */
.lp-subject:has(.lp-ir-title) {
  text-align: center !important;
  text-align-last: center !important;
  text-justify: auto;
}

.lp-ir-title {
  display: block;
  text-align: center !important;
  font-weight: 700 !important;
  font-size: 16px;
  line-height: 1.8;
  color: #111;
}

/* شرح جدولی درخواست داخلی (فقط نمایش) */
.ir-preview-details {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  background: #fafafa;
  width: 100%;
  box-sizing: border-box;
  font-family: 'B Nazanin', Nazanin, Vazirmatn, serif;
  font-size: 13px;
  line-height: 1.7;
  color: #111;
}

.ir-preview-details-title {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 10px;
  text-align: center;
}

.ir-preview-details-table,
.ir-preview-lines-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.ir-preview-details-table th,
.ir-preview-details-table td,
.ir-preview-lines-table th,
.ir-preview-lines-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #e4e4e7;
  vertical-align: top;
  text-align: right;
}

.ir-preview-details-table th {
  width: 32%;
  font-weight: 700;
  color: #3f3f46;
  white-space: nowrap;
}

.ir-preview-lines-table {
  margin-top: 12px;
}

.ir-preview-lines-table thead th {
  font-weight: 700;
  background: #f4f4f5;
  border-bottom: 1px solid #d4d4d8;
}

.ir-preview-details-table tr:last-child th,
.ir-preview-details-table tr:last-child td,
.ir-preview-lines-table tbody tr:last-child td {
  border-bottom: none;
}

/* ردیف امضاهای مسیر تأیید — RTL، حداکثر حدود دو ردیف با flex-wrap */
.ir-preview-signatories {
  margin-top: 16px;
  width: 100%;
  box-sizing: border-box;
}

.ir-preview-sign-row {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-items: flex-start;
  align-content: flex-start;
  gap: 10px 12px;
  width: 100%;
}

.ir-preview-sign-slot {
  flex: 1 1 calc(20% - 12px);
  min-width: 72px;
  max-width: 118px;
  text-align: center;
  font-family: 'B Nazanin', Nazanin, Vazirmatn, serif;
  font-size: 11px;
  line-height: 1.45;
  color: #111;
  box-sizing: border-box;
}

.ir-preview-sign-title {
  font-weight: 700;
  font-size: 10.5px;
  margin-bottom: 2px;
}

.ir-preview-sign-name {
  font-weight: 400;
  margin-bottom: 4px;
  word-break: break-word;
}

.ir-preview-sign-img {
  display: block;
  margin: 0 auto;
  max-width: 88px;
  max-height: 42px;
  object-fit: contain;
}

.ir-preview-sign-placeholder {
  display: block;
  height: 36px;
  margin: 0 auto;
  border-bottom: 1px solid #d4d4d8;
  width: 80%;
}

@media print {
  .ir-preview-details {
    background: transparent;
    border-color: #bbb;
    break-inside: avoid;
  }

  .ir-preview-signatories {
    break-inside: avoid;
  }
}

.lp-block-hide-btn {
  position: absolute;
  top: -2px;
  left: 2px;
  z-index: 14;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff;
  color: #b91c1c;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

.lp-block:hover > .lp-block-hide-btn,
.lp-block.is-dragging > .lp-block-hide-btn,
.lp-block.is-resizing > .lp-block-hide-btn {
  display: inline-flex;
}

.lp-block-hide-btn:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.letter-preview-page.lp-subject-off .lp-subject,
.letter-preview-page.lp-cc-off .lp-cc {
  display: none !important;
}

/* ۱) شماره / تاریخ / پیوست — راست‌چین، فونت نازک معمولی */
.lp-meta {
  text-align: right;
  direction: rtl;
  font-family: 'B Nazanin', Nazanin, Vazirmatn, serif !important;
  font-weight: 400 !important;
  font-size: 12.5px;
  line-height: 1.7;
  color: #111;
}

.lp-meta .lp-line {
  display: block;
  text-align: right;
  font-family: inherit !important;
  font-weight: 400 !important;
}

/* ۲) مخاطب — تراز راست */
.lp-recipient {
  text-align: right;
  font-family: 'B Zar', Zar, Titr, serif !important;
  font-weight: 700 !important;
  font-size: 14px;
  line-height: 1.8;
}

.lp-recipient .lp-line {
  display: block;
}

/* ۳) متن — تراز دوطرفه */
.lp-body {
  text-align: justify !important;
  text-justify: inter-word;
  text-align-last: right;
  font-family: 'B Nazanin', Nazanin, Vazirmatn, serif !important;
  font-weight: 400 !important;
  font-size: 14px;
  line-height: 2;
  overflow: hidden;
  user-select: text;
}

.lp-body-edit-btn {
  position: absolute;
  top: -2px;
  left: -2px;
  z-index: 14;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  opacity: 0.85;
}
.lp-body-format-bar {
  position: absolute;
  top: -2px;
  left: 30px;
  z-index: 14;
  display: inline-flex;
  gap: 4px;
  opacity: 0.9;
}
.lp-body:hover .lp-body-format-bar,
.lp-body:hover .lp-body-edit-btn,
.lp-body-editing .lp-body-edit-btn {
  opacity: 1;
}
.lp-body-format-bar button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}
.lp-body-format-bar button:hover:not(:disabled),
.lp-body-edit-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.lp-body-format-bar button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}
.lp-block-page-btns {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 13;
  display: inline-flex;
  gap: 2px;
  opacity: 0;
}
.lp-block:hover .lp-block-page-btns {
  opacity: 1;
}
.lp-block-page-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lp-block-page-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.lp-body-editing {
  overflow: visible !important;
  border-color: #3b82f6 !important;
  background: rgba(239, 246, 255, 0.55) !important;
  cursor: text !important;
  user-select: text !important;
  min-height: 80px;
  max-height: none;
  z-index: 12 !important;
}
.lp-body-editing .letter-body-html {
  outline: none;
  min-height: 60px;
  cursor: text;
  user-select: text;
}
.lp-body-edit-bar {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #cbd5e1;
}
.lp-body-edit-bar button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}
.lp-body-edit-bar .lp-body-save-btn {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.lp-body-edit-bar .lp-body-save-btn:hover {
  background: #1d4ed8;
}
.lp-body-edit-bar .lp-body-cancel-btn:hover {
  background: #f1f5f9;
}

.lp-body .letter-body-html,
.lp-body p,
.lp-body div,
.lp-body li,
.lp-body span {
  font-family: 'B Nazanin', Nazanin, Vazirmatn, serif !important;
  font-weight: 400 !important;
  text-align: justify !important;
  text-align-last: right;
  margin: 0 0 0.55em;
}

.lp-body .letter-body-html > :last-child {
  margin-bottom: 0;
}

.lp-body .letter-img-wrap {
  margin: 0.75em 0;
}

.lp-body .letter-img-wrap img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

.lp-body .letter-img-right {
  text-align: right !important;
  text-align-last: right !important;
}

.lp-body .letter-img-center {
  text-align: center !important;
  text-align-last: center !important;
}

.lp-body .letter-img-left {
  text-align: left !important;
  text-align-last: left !important;
}

.lp-body .letter-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75em 0;
  table-layout: fixed;
}

.lp-body .letter-table th,
.lp-body .letter-table td {
  padding: 6px 8px;
  vertical-align: top;
  word-break: break-word;
  text-align: right !important;
  text-align-last: right;
  margin: 0;
}

.lp-body .letter-table-all th,
.lp-body .letter-table-all td {
  border: 1px solid #333;
}

.lp-body .letter-table-inner {
  border: none;
}

.lp-body .letter-table-inner th,
.lp-body .letter-table-inner td {
  border: none;
  border-left: 1px solid #333;
  border-bottom: 1px solid #333;
}

.lp-body .letter-table-inner tr > :last-child {
  border-left: none;
}

.lp-body .letter-table-inner tr:last-child > * {
  border-bottom: none;
}

.lp-body .letter-table-header th,
.lp-body .letter-table-header td {
  border: none;
}

.lp-body .letter-table-header tr:first-child > * {
  border-bottom: 1px solid #333;
}

.lp-body .letter-table-none th,
.lp-body .letter-table-none td {
  border: none;
}

/* ۴) تصویر امضا / مهر — کادر جدا و قابل‌جابجایی */
.lp-signature,
.lp-stamp {
  text-align: center;
}

.lp-signature .lp-sign-img,
.lp-sign-img,
.lp-stamp .lp-stamp-img,
.lp-stamp-img {
  display: block;
  max-width: 120px;
  max-height: 70px;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border: none !important;
  background: transparent !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* عنوان و نام فرستنده — کادر جدا */
.lp-sender {
  text-align: center !important;
  direction: rtl;
  font-size: 13px;
}

.lp-sender-text {
  text-align: center !important;
}

.lp-sender .lp-line {
  display: block;
  text-align: center !important;
  font-family: 'B Zar', Zar, Titr, serif !important;
  font-weight: 700 !important;
  line-height: 1.75;
  white-space: nowrap;
}

/* ۵) رونوشت — تراز راست */
.lp-cc {
  text-align: right;
  font-family: 'B Nazanin', Nazanin, serif;
  font-size: 12px;
  line-height: 1.65;
  color: #222;
}

.lp-cc .lp-cc-title {
  font-family: 'B Zar', Zar, Titr, serif !important;
  font-weight: 700 !important;
  margin-bottom: 2px;
}

.lp-cc .lp-line {
  display: block;
}

.lp-cc-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lp-cc-box {
  width: 10px;
  height: 10px;
  border: 1px solid #111;
  flex-shrink: 0;
  display: inline-block;
  background: transparent;
  box-sizing: border-box;
  margin-inline-end: 2px;
}

.lp-cc-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* چاپ اصلی از iframe ایزوله انجام می‌شود؛ این قواعد فقط fallback هستند */
@media print {
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  /* فقط وقتی چاپ از خود صفحهٔ اصلی است؛ iframe استایل جدا دارد */
  body.letter-preview-open > *:not(.letter-preview-print-root):not(.letter-preview-print-frame) {
    display: none !important;
  }

  .letter-preview-overlay {
    display: none !important;
  }

  .letter-preview-print-root {
    display: block !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
  }

  .letter-preview-print-root .lp-guides,
  .letter-preview-print-root .lp-grid,
  .letter-preview-print-root .no-print {
    display: none !important;
  }

  .letter-preview-print-root .letter-preview-page {
    box-shadow: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    page-break-after: always;
    break-after: page;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .letter-preview-print-root .lp-content-frame {
    overflow: visible !important;
  }

  .letter-preview-print-root .lp-meta {
    overflow: visible !important;
    z-index: 4;
  }

  .letter-preview-print-root .letter-preview-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .letter-preview-print-root .letter-preview-page.is-a5 {
    width: 148mm !important;
    height: 210mm !important;
  }

  .letter-preview-print-root .letter-preview-page.is-a4 {
    width: 210mm !important;
    height: 297mm !important;
  }

  .lp-letterhead-img {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page {
    margin: 0;
  }
}
