/* Letter Composer (Word-like) - always light; isolated from app dark mode */

.letter-standalone-shell {
    min-height: 100vh;
    color-scheme: light;
    background: #eef2f0;
    direction: rtl;
    font-family: "IRANSansX", Helvetica, Arial, serif;
    color: #5e5873;
    --app-bg: #f8f9fa;
    --app-text: #5e5873;
    --app-card-bg: #ffffff;
    --app-card-border: #ebe9f1;
    --app-border: #ebe9f1;
    --app-border-light: #ebe9f1;
    --app-muted-text: #6e6b7b;
    --app-heading-text: #5e5873;
    --app-input-border: #ccc;
    --app-link-color: #004f22;
    --bs-body-bg: #ffffff;
    --bs-body-color: #212529;
    --bs-emphasis-color: #000;
    --bs-secondary-color: rgba(33, 37, 41, 0.75);
    --bs-tertiary-color: rgba(33, 37, 41, 0.5);
    --bs-border-color: #dee2e6;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
}

html:has(.letter-standalone-shell),
html:has(.letter-standalone-shell) body {
    color-scheme: light;
    background: #eef2f0 !important;
    color: #5e5873;
    overflow-x: auto;
}

.letter-standalone-shell .form-control,
.letter-standalone-shell .form-select,
.letter-standalone-shell textarea.form-control {
    background-color: #fff;
    color: #212529;
    border-color: var(--app-input-border, #ccc);
}

.letter-standalone-shell .form-control:focus,
.letter-standalone-shell .form-select:focus {
    background-color: #fff;
    color: #212529;
}

.letter-standalone-shell .modal-content {
    background-color: #fff;
    color: #212529;
}

.letter-standalone-shell .modal-header,
.letter-standalone-shell .modal-footer {
    border-color: #dee2e6;
}

.letter-standalone-shell .btn-close {
    filter: none;
}

.letter-standalone-shell .text-muted {
    color: #6e6b7b !important;
}

.letter-standalone-shell .alert-warning {
    --bs-alert-color: #664d03;
    --bs-alert-bg: #fff3cd;
    --bs-alert-border-color: #ffecb5;
}

.letter-standalone-shell .btn-outline-secondary {
    --bs-btn-color: #6c757d;
    --bs-btn-border-color: #6c757d;
    --bs-btn-hover-bg: #6c757d;
    --bs-btn-hover-border-color: #6c757d;
}

.letter-standalone-shell a:not(.btn) {
    color: var(--app-link-color);
}

.letter-composer {
    --letter-top-bar-height: 120px;
    padding: 0 16px 20px;
    padding-top: var(--letter-top-bar-height);
    min-height: 100vh;
}

.letter-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    padding: 12px 16px 8px;
    background: #eef2f0;
    box-shadow: 0 4px 16px rgba(22, 38, 30, 0.07);
}

/* Ribbon */
.letter-ribbon {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border: 1px solid var(--app-border-light, #ebe9f1);
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 4px 18px rgba(22, 38, 30, 0.08);
}

.letter-ribbon-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 10px 0;
    background: rgba(0, 79, 34, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.letter-tab {
    border: none;
    background: transparent;
    padding: 8px 14px;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    color: #5e5873;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.letter-tab:hover {
    background: rgba(0, 79, 34, 0.08);
}

.letter-tab.active {
    background: #fff;
    color: #004f22;
    font-weight: 700;
    box-shadow: 0 -1px 0 #fff;
}

.letter-ribbon-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    min-height: 54px;
}

.letter-ribbon-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-inline: 8px;
    border-inline-start: 1px solid rgba(0, 79, 34, 0.15);
}

.letter-ribbon-group:first-child {
    border-inline-start: none;
    padding-inline-start: 0;
}

.letter-ribbon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: #4b4b4b;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    line-height: 1;
}

.letter-ribbon-btn i.feather,
.letter-ribbon-btn .feather {
    font-size: 16px !important;
    width: 16px;
    height: 16px;
    line-height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.letter-icon-text {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    font-family: "IRANSansX", Tahoma, Arial, sans-serif;
}

.letter-icon-text.letter-strike {
    text-decoration: line-through;
}

.letter-icon-text sup,
.letter-icon-text sub {
    font-size: 9px;
}

.letter-ribbon-btn:hover {
    background: rgba(0, 79, 34, 0.08);
    border-color: rgba(0, 79, 34, 0.2);
}

.letter-tab:focus-visible,
.letter-ribbon-btn:focus-visible,
.letter-ribbon-select:focus-visible,
.letter-ribbon-color:focus-within {
    outline: 2px solid rgba(0, 79, 34, 0.55);
    outline-offset: 2px;
}

.letter-ribbon-btn.is-active {
    background: rgba(0, 79, 34, 0.16);
    border-color: rgba(0, 79, 34, 0.35);
    color: #004f22;
}

.letter-ribbon-select-wrap {
    height: 34px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: inline-flex;
    align-items: center;
}

.letter-ribbon-select {
    border: none;
    background: transparent;
    min-width: 88px;
    height: 34px;
    padding: 0 8px;
    outline: none;
    color: inherit;
    font-size: 12px;
}

.letter-font-size-select {
    min-width: 64px;
}

.letter-ribbon-color {
    position: relative;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.letter-ribbon-color i.feather {
    font-size: 14px !important;
    z-index: 1;
    pointer-events: none;
}

.letter-color-swatch {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 3px;
    height: 4px;
    border-radius: 2px;
    pointer-events: none;
}

.letter-ribbon-color input[type="color"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    cursor: pointer;
}

.letter-work-and-html {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 14px;
    align-items: start;
}

.letter-work-and-html.letter-html-hidden {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1280px) {
    .letter-work-and-html {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
}

@media (max-width: 991px) {
    .letter-work-and-html {
        grid-template-columns: 1fr;
    }
}

/* A4 + rulers */
.letter-a4-wrap {
    background: #e6ebe8;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.letter-a4-shell {
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-rows: 26px 1fr;
    min-height: calc(100vh - 220px);
    direction: ltr;
}

.letter-ruler-corner {
    background: rgba(0, 0, 0, 0.03);
}

.letter-ruler-top {
    background:
        repeating-linear-gradient(to right,
            rgba(0, 0, 0, 0.18) 0 1px,
            transparent 1px 9px),
        repeating-linear-gradient(to right,
            rgba(0, 0, 0, 0.32) 0 1px,
            transparent 1px 49px);
    opacity: 0.55;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.letter-ruler-left {
    background:
        repeating-linear-gradient(to bottom,
            rgba(0, 0, 0, 0.18) 0 1px,
            transparent 1px 9px),
        repeating-linear-gradient(to bottom,
            rgba(0, 0, 0, 0.32) 0 1px,
            transparent 1px 49px);
    opacity: 0.55;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.letter-a4-scroll {
    grid-column: 2;
    grid-row: 2;
    overflow: auto;
    padding: 18px;
    background: #e6ebe8;
    scrollbar-gutter: stable;
    direction: rtl;
}

.letter-a4 {
    width: 794px;
    min-height: 1123px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 3px 18px rgba(25, 42, 33, 0.14);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.letter-layout-settling .letter-page-overlays {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.letter-a4.letter-layout-settling {
    transition: min-height 0.05s linear;
}

.letter-page-overlays {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.letter-page-chrome {
    position: absolute;
    left: 0;
    right: 0;
    padding: 12px 44px;
    font-size: 13px;
    line-height: 1.7;
    color: #555;
    background: rgba(255, 255, 255, 0.98);
    pointer-events: none;
    z-index: 2;
}

.letter-page-chrome-header {
    border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
    background: rgba(0, 79, 34, 0.02);
}

.letter-page-chrome-footer {
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
    background: rgba(0, 79, 34, 0.02);
}

.letter-page-chrome-screen-hidden {
    visibility: hidden;
}

.letter-page-gutter-mask {
    position: absolute;
    left: 0;
    right: 0;
    background: #e9ecef;
    z-index: 15;
    pointer-events: none;
    box-shadow: 0 0 0 4px #e9ecef;
}

.letter-auto-page-break {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    user-select: none;
    pointer-events: none;
}

.letter-page-footer-master {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    z-index: 6;
    flex-shrink: 0;
}

.letter-header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: right;
}

.letter-header-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 79, 34, 0.25);
    background: #fff;
    flex-shrink: 0;
}

.letter-header-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.letter-header-brand-text strong {
    font-size: 15px;
    color: #004f22;
}

.letter-pagenum-field {
    display: inline-block;
    padding: 0 6px;
    border-radius: 6px;
    background: rgba(0, 79, 34, 0.08);
    border: 1px dashed rgba(0, 79, 34, 0.35);
    font-weight: 700;
    color: #004f22;
    user-select: none;
}

.letter-table-tools .letter-ribbon-btn {
    width: auto;
    min-width: 34px;
    padding: 0 6px;
}

.letter-table-drag-handle {
    display: inline-block;
    cursor: grab;
    color: #0d6efd;
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
    user-select: none;
    vertical-align: middle;
}

.letter-table-dragging {
    opacity: 0.55;
    outline: 2px dashed #0d6efd;
}

.letter-block-drop-target {
    outline: 2px dashed #28a745;
    outline-offset: 4px;
}

.letter-table-row-draggable.letter-row-dragging {
    opacity: 0.55;
}

.letter-table-row-draggable.letter-row-drop-target {
    outline: 2px dashed #0d6efd;
    outline-offset: -2px;
}

.letter-size-a5 .letter-a4,
.letter-a4[data-page-size="a5"] {
    width: 559px;
    min-height: 794px;
}

.letter-print-root {
    width: 794px;
    margin: 0 auto;
}

.letter-size-a5 .letter-print-root,
.letter-print-root[data-page-size="a5"] {
    width: 559px;
}

.letter-page-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.letter-page-count-badge,
.letter-page-size-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(0, 79, 34, 0.1);
    color: #004f22;
    font-size: 12px;
}

.letter-page-size-badge {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.letter-size-btn {
    width: auto !important;
    min-width: 40px;
    padding: 0 8px !important;
}

.letter-page-break-mark {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 2px dashed #9aa0a6;
    pointer-events: none;
    z-index: 6;
}

.letter-page-break-mark::before,
.letter-page-break-mark::after {
    content: "";
    position: absolute;
    top: -10px;
    width: 100%;
    height: 18px;
    background: #e9ecef;
    z-index: -1;
}

.letter-page-break-mark span {
    position: absolute;
    inset-inline-start: 12px;
    top: -11px;
    background: #fff;
    border: 1px solid #cfd4da;
    border-radius: 999px;
    font-size: 11px;
    padding: 0 8px;
    color: #555;
}

.letter-page-header,
.letter-page-footer {
    padding: 12px 44px;
    outline: none;
    min-height: 56px;
    font-size: 13px;
    line-height: 1.7;
    color: #555;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.letter-page-header:focus,
.letter-page-footer:focus,
.letter-editor:focus {
    box-shadow: inset 0 0 0 2px rgba(0, 79, 34, 0.18);
}

.letter-page-header {
    border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
    background: rgba(0, 79, 34, 0.02);
    position: relative;
    z-index: 7;
}

.letter-page-footer {
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
    background: rgba(0, 79, 34, 0.02);
}

.letter-page-header:empty:before,
.letter-page-footer:empty:before {
    content: attr(data-placeholder);
    color: rgba(0, 0, 0, 0.3);
}

/* Editor — padding bottom so last page clears fixed footer band on page 1 */
.letter-editor {
    padding: 28px 44px;
    min-height: 900px;
    flex: 1 0 auto;
    outline: none;
    direction: rtl;
    text-align: right;
    overflow: visible;
    font-size: 14.5px;
    line-height: 1.9;
    position: relative;
    z-index: 3;
    padding-bottom: 28px;
}

.letter-size-a5 .letter-editor,
.letter-a4[data-page-size="a5"] .letter-editor {
    min-height: 620px;
    padding: 22px 32px;
    font-size: 13.5px;
}

.letter-editor:empty:before {
    content: "متن نامه را اینجا تایپ کنید...";
    color: rgba(0, 0, 0, 0.35);
}

.letter-editor p {
    margin: 0 0 10px 0;
}

.letter-editor h1 {
    font-size: 24px;
    margin: 12px 0 10px;
}

.letter-editor h2 {
    font-size: 20px;
    margin: 10px 0 8px;
}

.letter-editor h3 {
    font-size: 16px;
    margin: 8px 0 6px;
}

.letter-editor a {
    color: #0d6efd;
    text-decoration: underline;
}

.letter-editor ul,
.letter-editor ol {
    padding-inline-start: 22px;
    margin: 0 0 10px 0;
}

.letter-editor blockquote {
    border-inline-start: 4px solid rgba(0, 79, 34, 0.35);
    margin: 10px 0;
    padding-inline-start: 14px;
    color: rgba(0, 0, 0, 0.75);
}

.letter-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13.5px;
    position: relative;
    z-index: 1;
    break-inside: avoid;
}

.letter-table-caption {
    caption-side: top;
    padding: 0;
    margin: 0;
    height: 0;
    text-align: right;
}

.letter-table-move-handle {
    position: absolute;
    top: 2px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    cursor: grab;
    font-size: 11px;
    line-height: 1;
    color: #004f22;
    font-weight: 700;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(0, 79, 34, 0.16);
    box-shadow: 0 1px 4px rgba(25, 42, 33, 0.12);
    user-select: none;
    z-index: 3;
}

.letter-table-move-handle:hover,
.letter-table-move-handle:focus-visible {
    background: #fff;
    border-color: rgba(0, 79, 34, 0.28);
    outline: none;
}

.letter-table-edge-ui {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1200;
    display: none;
}

.letter-table-edge-ui.is-visible {
    display: block;
}

.letter-table-edge-line {
    position: fixed;
    background: #2b7cff;
    box-shadow: 0 0 0 1px rgba(43, 124, 255, 0.15);
    border-radius: 1px;
}

.letter-table-edge-highlight {
    position: fixed;
    background: rgba(43, 124, 255, 0.12);
    pointer-events: none;
    opacity: 0;
}

.letter-table-edge-ui.is-delete .letter-table-edge-highlight {
    opacity: 1;
}

.letter-table-edge-ui.is-add .letter-table-edge-line {
    opacity: 1;
}

.letter-table-edge-ui.is-delete .letter-table-edge-line {
    opacity: 0;
}

.letter-table-edge-btn {
    position: fixed;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #2b7cff;
    background: #fff;
    color: #2b7cff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 4px rgba(13, 110, 253, 0.25);
    z-index: 1201;
}

.letter-table-edge-ui.is-add .letter-table-edge-add {
    display: inline-flex;
}

.letter-table-edge-ui.is-delete .letter-table-edge-del {
    display: inline-flex;
    border-color: #dc3545;
    color: #dc3545;
    box-shadow: 0 1px 4px rgba(220, 53, 69, 0.25);
}

.letter-table-edge-btn:hover,
.letter-table-edge-btn:focus-visible {
    background: #2b7cff;
    color: #fff;
    outline: none;
}

.letter-table-edge-ui.is-delete .letter-table-edge-del:hover,
.letter-table-edge-ui.is-delete .letter-table-edge-del:focus-visible {
    background: #dc3545;
    color: #fff;
}

.letter-table-row-hover > td,
.letter-table-row-hover > th,
.letter-table-col-hover {
    background: rgba(43, 124, 255, 0.08) !important;
}

table[data-letter-table-part="continued"] {
    margin-top: 0;
}

.letter-table th,
.letter-table td {
    border: 1px solid rgba(0, 0, 0, 0.18);
    padding: 6px 8px;
    vertical-align: top;
}

.letter-table thead th {
    background: rgba(0, 79, 34, 0.09);
    font-weight: 700;
}

.letter-html-panels {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: calc(var(--letter-top-bar-height, 120px) + 8px);
    max-height: calc(100vh - var(--letter-top-bar-height, 120px) - 16px);
    overflow: auto;
    padding-left: 2px;
}

.letter-html-panel {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(25, 42, 33, 0.05);
}

.letter-html-panel-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.letter-html-panel-title h6 {
    margin: 0;
    font-size: 13px;
    color: var(--app-heading-text, #5e5873);
}

.letter-html-panel-title span {
    color: #7d817f;
    font-size: 10px;
}

.letter-html-textarea {
    width: 100%;
    resize: vertical;
    min-height: 200px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    direction: ltr;
    text-align: left;
    line-height: 1.55;
}

.letter-placeholder {
    background: rgba(0, 79, 34, 0.08);
    border: 1px dashed rgba(0, 79, 34, 0.35);
    padding: 1px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .letter-composer {
        padding-inline: 8px;
    }

    .letter-top-bar {
        padding: 8px 8px 6px;
    }

    .letter-ribbon-row {
        padding: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .letter-a4-scroll {
        padding: 8px;
    }

    .letter-ribbon-group {
        flex: 0 0 auto;
    }

    .letter-html-panels {
        position: static;
        max-height: none;
    }
}

@media print {
    html, body {
        background: #fff !important;
        height: auto !important;
        overflow: visible !important;
    }

    body.letter-printing .letter-top-bar,
    body.letter-printing .letter-ribbon,
    body.letter-printing .letter-html-panels,
    body.letter-printing .letter-link-alert,
    body.letter-printing .letter-table-drag-handle,
    body.letter-printing .letter-table-move-handle,
    body.letter-printing .letter-table-edge-ui,
    body.letter-printing .letter-ruler-corner,
    body.letter-printing .letter-ruler-top,
    body.letter-printing .letter-ruler-left,
    body.letter-printing .letter-page-meta,
    body.letter-printing .letter-page-break-mark,
    body.letter-printing .letter-page-gutter-mask,
    body.letter-printing .letter-auto-page-break,
    body.letter-printing #blazor-error-ui {
        display: none !important;
    }

    body.letter-printing .letter-page-chrome-screen-hidden {
        visibility: visible !important;
    }

    /* چاپ: سربرگ/فوتر واقعی در جریان سند — نه لایه absolute روی متن */
    body.letter-printing .letter-page-overlays {
        display: none !important;
    }

    body.letter-printing .letter-page-header {
        display: block !important;
        position: static !important;
        padding: 10px 44px !important;
        border-bottom: 1px solid #ccc !important;
        background: transparent !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.letter-printing .letter-page-footer-master,
    body.letter-printing .letter-page-footer {
        display: block !important;
        position: static !important;
        top: auto !important;
        padding: 10px 44px !important;
        border-top: 1px solid #ccc !important;
        background: transparent !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.letter-printing .letter-page-chrome {
        display: none !important;
    }

    body.letter-printing .letter-composer {
        padding: 0 !important;
    }

    body.letter-printing .letter-work-and-html {
        display: block !important;
        margin: 0 !important;
    }

    body.letter-printing .letter-a4-wrap,
    body.letter-printing .letter-a4-shell,
    body.letter-printing .letter-a4-scroll {
        display: block !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        min-height: 0 !important;
        height: auto !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
    }

    body.letter-printing .letter-print-root,
    body.letter-printing .letter-a4 {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }

    body.letter-printing .letter-editor {
        min-height: 0 !important;
        padding: 16px 44px 24px !important;
        position: static !important;
        overflow: visible !important;
    }

    body.letter-printing .letter-size-a5 .letter-editor,
    body.letter-printing .letter-a4[data-page-size="a5"] .letter-editor {
        padding: 12px 32px 20px !important;
    }

    body.letter-printing .letter-table thead th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.letter-printing .letter-table {
        break-inside: auto;
        page-break-inside: auto;
    }

    body.letter-printing .letter-table thead {
        display: table-header-group;
    }

    body.letter-printing .letter-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.letter-printing .letter-editor p,
    body.letter-printing .letter-editor blockquote {
        orphans: 3;
        widows: 3;
    }

    body.letter-printing .letter-table-dragging,
    body.letter-printing .letter-block-drop-target,
    body.letter-printing .letter-row-drop-target {
        outline: none !important;
        opacity: 1 !important;
    }
}
