/* Official print letterhead: isolated from the portal's application styles. */
html:root:root body.letterhead-page .document-title { color: #111 !important; }
body.letterhead-page { margin: 0; padding: 24px; background: #eceef1; color: #111; font-family: 'Times New Roman', serif; }
.letterhead-page .download-actions { max-width: 210mm; margin: 0 auto 16px; text-align: right; }
.letterhead-page .download-actions button { padding: 12px 20px; border: 0; border-radius: 6px; background: var(--primary, #2600bc); color: #fff; font: 600 14px Arial, sans-serif; cursor: pointer; }
.letterhead-page .download-actions button:hover { background: var(--primary-hover, #1d0094); }
.letterhead-page .download-actions button:focus-visible { outline: 3px solid #fdc500; outline-offset: 3px; }
.letterhead-page .paper { box-sizing: border-box; width: 210mm; max-width: 100%; min-height: 297mm; margin: auto; padding: 7mm 12mm 7mm; background: #fff; box-shadow: 0 2px 16px #00000016; display: flex; flex-direction: column; }
.letterhead-page .letterhead { text-align: center; color: #111; margin: 0 0 15mm; }
.letterhead-page .municipal-seal { display: block; width: 20mm; height: 20mm; object-fit: contain; margin: 0 auto 2mm; }
.letterhead-page .letterhead p { margin: 0; font: 10pt/1.05 'Times New Roman', serif; }
.letterhead-page .municipality-name, .letterhead-page .mayor-office, .letterhead-page .pio-office { font-family: 'Old English Text MT', 'Lucida Blackletter', 'Times New Roman', serif; font-weight: normal; line-height: 1.1; }
.letterhead-page .municipality-name { font-size: 13pt; }
.letterhead-page .mayor-office { font-size: 19pt; }
.letterhead-page .pio-office { font-size: 13pt; text-decoration: underline; text-underline-offset: 2px; margin-top: 1mm; }
.letterhead-page .building-logo { display: block; width: 39mm; height: 20mm; object-fit: contain; margin: 2mm auto 0; }
.letterhead-page .document-body { padding: 0 12mm; flex: 1; }
.letterhead-page .doc-label { margin: 0 0 6mm; text-align: center; font-size: 12pt; font-weight: bold; }
.letterhead-page .document-title { margin: 0 0 9mm; font: bold 14pt/1.35 'Times New Roman', serif; text-align: center; color: #111; }
.letterhead-page .document-content { font-size: 12pt; line-height: 1.5; text-align: justify; overflow-wrap: anywhere; }
.letterhead-page .document-content img { max-width: 100%; height: auto; }
.letterhead-page .document-content table { max-width: 100%; }
.letterhead-page .qr-section { margin-top: 12mm; display: flex; align-items: center; gap: 5mm; border-top: 1px solid #ddd; padding-top: 6mm; font: 10pt/1.5 Arial, sans-serif; break-inside: avoid; }
.letterhead-page .qr-section img { display: block; width: 120px; height: 120px; }
.letterhead-page .qr-section p { margin: 2mm 0; }
.letterhead-page .qr-section small { overflow-wrap: anywhere; }
.letterhead-page .letterhead-footer { border-top: .5pt solid #666; margin-top: 14mm; padding-top: 1.5mm; display: flex; justify-content: center; align-items: center; gap: 5mm; break-inside: avoid; }
.letterhead-page .contact-details { font: italic 7pt/1.2 'Times New Roman', serif; }
.letterhead-page .contact-details strong { display: inline-block; min-width: 12mm; font-weight: normal; }
.letterhead-page .verification-qr img { display: block; width: 14mm; height: 14mm; }
@page { size: A4; margin: 10mm 12mm; }
@media print {
    body.letterhead-page { padding: 0; background: #fff; }
    .letterhead-page .download-actions { display: none; }
    .letterhead-page .paper { width: auto; max-width: none; min-height: 277mm; padding: 0; box-shadow: none; display: block; }
    .letterhead-page .letterhead { break-inside: avoid; }
    .letterhead-page .document-body { padding: 0 12mm; }
    .letterhead-page .document-title, .letterhead-page .doc-label { break-after: avoid; }
    .letterhead-page .document-content p { orphans: 3; widows: 3; }
    .letterhead-page .letterhead-footer { margin-top: 14mm; }
}
@media screen and (max-width: 640px) {
    body.letterhead-page { padding: 12px; }
    .letterhead-page .paper { padding: 20px 14px; min-height: 85vh; }
    .letterhead-page .document-body { padding: 0 6px; }
    .letterhead-page .contact-details { font-size: 6pt; }
}
.download-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;

    background: #ffffff;
    color: var(--primary);

    border: 1px solid var(--primary);
    border-radius: 8px;

    text-decoration: none;
    font-weight: 600;

    cursor: pointer;
}

.back-button:hover {
    background: var(--primary);
    color: #ffffff;
}
