:root{color-scheme:light;--ink:#18352b;--muted:#64756c;--green:#1d6849;--line:#d7e1d8;--paper:#fff;--wash:#f1f6f1;font-family:Georgia,"Times New Roman",serif}*{box-sizing:border-box}body{margin:0;background:#eaf0eb;color:var(--ink)}.preview-toolbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:1.25rem;justify-content:space-between;padding:1rem max(1rem,calc((100vw - 1100px)/2));background:#fff;border-bottom:1px solid var(--line);font-family:Arial,sans-serif}.preview-toolbar>div:first-child{display:grid;gap:.25rem}.preview-toolbar strong{font-size:.95rem}.preview-toolbar span,.preview-toolbar p{color:var(--muted);font-size:.82rem;margin:0}.preview-actions{display:flex;gap:.6rem;flex-shrink:0}.preview-actions button{border:0;border-radius:8px;padding:.75rem 1rem;background:var(--green);color:#fff;font-weight:700;cursor:pointer}.preview-actions button.secondary{background:#e8f1ea;color:var(--green);border:1px solid #c5d8c8}.preview-actions button:disabled{opacity:.65;cursor:wait}.issue-feedback{position:absolute;right:1rem;bottom:-1.5rem;color:#165b3e!important}.paper{position:relative;overflow:hidden;width:min(210mm,calc(100% - 2rem));min-height:297mm;margin:2rem auto;padding:22mm 22mm 18mm;background:var(--paper);box-shadow:0 12px 34px #1d38291c}.sample-watermark{position:absolute;z-index:0;top:43%;left:-8%;width:116%;transform:rotate(-28deg);text-align:center;color:#bd38241c;font:700 36pt/1.15 Arial,sans-serif;letter-spacing:.11em;border-block:3px solid #bd38241c;padding:.35em 0;pointer-events:none}.document-header,.document-kicker,.paper h2,.document-number,.document-body,.issued-date,.signature-row,.document-footer,.green-rule{position:relative;z-index:1}.document-header{display:grid;grid-template-columns:25mm 1fr 25mm;gap:5mm;align-items:center;text-align:center}.barangay-seal{width:22mm;height:22mm;object-fit:contain}.seal-spacer{width:22mm}.header-copy p{margin:.1em 0;font-size:10pt}.header-copy h1{margin:.25em 0;font:bold 14pt Arial,sans-serif;letter-spacing:.06em}.placeholder{border-bottom:1px dotted #888;color:#777}.green-rule{height:2px;margin:7mm 0 4mm;background:var(--green)}.document-kicker{text-align:center;text-transform:uppercase;letter-spacing:.14em;font:700 8pt Arial,sans-serif;color:var(--green)}.paper h2{text-align:center;margin:2mm 0 1mm;font:bold 16pt Arial,sans-serif;letter-spacing:.035em}.document-number{text-align:center;color:var(--muted);font:9pt Arial,sans-serif}.document-body{margin-top:15mm;font-size:12pt;line-height:1.8;text-align:justify}.document-body p{margin:0 0 1.05em}.document-body strong{font-weight:700}.issued-date{margin-top:12mm;font-size:11pt}.signature-row{display:grid;grid-template-columns:1fr 1fr;gap:16mm;margin-top:22mm;text-align:center;font-family:Arial,sans-serif}.signature-block{display:grid;justify-items:center;gap:2mm}.signature-line{display:block;width:100%;height:12mm;border-bottom:1px solid #52645a}.signature-block strong{font-size:9pt}.signature-block small{max-width:65mm;color:var(--muted);font-size:8pt;line-height:1.4}.document-footer{position:absolute;bottom:9mm;left:22mm;right:22mm;display:flex;justify-content:space-between;gap:1rem;border-top:1px solid var(--line);padding-top:3mm;color:var(--muted);font:8pt Arial,sans-serif}@media(max-width:700px){.preview-toolbar{position:relative;display:grid;gap:.75rem;padding:1rem}.preview-actions{display:grid;grid-template-columns:1fr 1fr}.preview-actions button{padding:.75rem .5rem;font-size:.83rem}.paper{width:calc(100% - 1rem);min-height:0;margin:.5rem auto;padding:12mm 10mm 22mm}.document-header{grid-template-columns:18mm 1fr 18mm;gap:2mm}.barangay-seal,.seal-spacer{width:16mm;height:16mm}.header-copy p{font-size:8pt}.header-copy h1{font-size:10pt}.document-body{margin-top:10mm;font-size:10.5pt}.signature-row{gap:7mm;margin-top:15mm}.document-footer{left:10mm;right:10mm;bottom:8mm;font-size:7pt}}@page{size:A4;margin:0}@media print{body{background:#fff}.preview-toolbar{display:none}.paper{width:210mm;min-height:297mm;margin:0;box-shadow:none;page-break-after:avoid}.document-footer{position:absolute}.sample-watermark{color:#bd382426;border-color:#bd382426}}

@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("assets/fonts/PlusJakartaSans-Variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
}

/* Keep the sample preview typography consistent with the portal UI. */
body,
.preview-toolbar,
.paper,
.paper--indigency,
.document-header,
.document-kicker,
.paper h2,
.document-number,
.document-body,
.issued-date,
.signature-row,
.document-footer,
.indigency-heading,
.indigency-certificate-body,
.indigency-signature,
.indigency-contact {
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
.preview-toolbar span,
.preview-toolbar p { color: #46514a; font-size: .9rem; line-height: 1.45; }
.preview-actions button { min-height: 42px; height: 42px; border-radius: 8px; font: 700 .875rem/1.2 "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif; }
.preview-actions button.secondary { border: 1.5px solid #0c5700; background: #fff; color: #0c5700; }
.preview-actions button.secondary:hover,
.preview-actions button.secondary:focus-visible { background: #f2f8ef; border-color: #084500; color: #084500; }
.paper { font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif; }
.paper h2,
.header-copy h1 { font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif; }
.document-kicker { font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif; }
.document-number {
    margin: 0 0 3mm;
    color: #3f4a43;
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
    font-size: 10pt;
    text-align: left;
}
.document-number-value {
    display: inline-block;
    min-width: 25mm;
    min-height: 1.1em;
    border-bottom: 1px solid currentColor;
    color: #252b27;
    font-weight: 700;
    text-align: center;
    vertical-align: baseline;
}
.document-body { margin-top: 0; font-size: 12.5pt; line-height: 1.7; }
.document-body p { margin-bottom: 1em; }
.issued-date { margin-top: 8mm; }
.signature-row { font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif; }
.signature-row { margin-top: 14mm; }
.signature-block .signature-name { color: #18352b; font-weight: 800; }
.document-footer { font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif; }



@media (max-width: 700px) {
    .preview-toolbar span,
    .preview-toolbar p { font-size: .85rem; }
    .document-number { font-size: 8.5pt; }
    .document-body { font-size: 10.5pt; }
}
@page { size: A4 portrait; margin: 0; }
@media print {
    html,
    body {
        width: 210mm;
        height: 297mm;
        min-height: 297mm;
        margin: 0 !important;
        background: #fff !important;
    }
    body { display: block; }
    .preview-toolbar { display: none !important; }
    .paper {
        width: 210mm;
        height: 297mm;
        min-height: 297mm;
        margin: 0 !important;
        overflow: hidden;
        box-shadow: none !important;
        page-break-after: avoid;
        page-break-inside: avoid;
        break-after: avoid-page;
        break-inside: avoid-page;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .paper--indigency { padding: 0; aspect-ratio: auto; }
    .sample-watermark,
    .indigency-top-ribbon,
    .indigency-bottom-ribbon,
    .indigency-watermark,
    .indigency-contact { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Indigency certificate: one paper-relative flow column between the fixed artwork. */
.paper--indigency {
    container-type: inline-size;
    isolation: isolate;
    display: block;
    position: relative;
    width: min(210mm, calc(100% - 2rem));
    height: auto;
    min-height: 0;
    aspect-ratio: 210 / 297;
    margin: 2rem auto;
    padding: 0;
    overflow: hidden;
    background: #fff;
    color: #1c1c1c;
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

.indigency-top-ribbon,
.indigency-seal,
.indigency-bottom-ribbon,
.indigency-contact,
.indigency-watermark {
    position: absolute;
}
.indigency-top-ribbon {
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 13.468%;
}
.indigency-seal {
    top: 3.03%;
    left: 7.62%;
    z-index: 3;
    width: 16.19%;
    height: 11.45%;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 1.2cqw #fff;
    object-fit: contain;
}
.indigency-content {
    position: absolute;
    z-index: 2;
    top: 18.5cqw;
    right: 10.48cqw;
    bottom: 25.7cqw;
    left: 10.48cqw;
    display: flex;
    min-width: 0;
    flex-direction: column;
}
.indigency-heading {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    display: grid;
    justify-items: center;
    gap: .35cqw;
    color: #0e5200;
    text-align: center;
}
.indigency-republic {
    font-size: 1.35cqw;
    letter-spacing: .12em;
}
.indigency-barangay {
    margin-top: .35cqw;
    font-size: 3.15cqw;
    letter-spacing: .02em;
    line-height: 1.15;
}
.indigency-city {
    font-size: 1.55cqw;
    letter-spacing: .1em;
}
.indigency-office {
    margin-top: .8cqw;
    font-size: 1.75cqw;
}
.indigency-document-title {
    max-width: 100%;
    margin: 2.2cqw 0 0;
    color: #0e5200;
    font-size: 3.2cqw;
    font-weight: 800;
    letter-spacing: .11em;
    line-height: 1.2;
    text-align: center;
}
.indigency-divider {
    width: 100%;
    height: .28cqw;
    min-height: 1px;
    flex: 0 0 auto;
    margin: 2.2cqw 0 1.8cqw;
    background: #0e5200;
}
.indigency-certificate-body {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    min-width: 0;
    color: #1c1c1c;
    font-size: 2.05cqw;
    line-height: 1.72;
    text-align: justify;
}
.indigency-certificate-body p {
    margin: 0 0 1.05em;
    text-align: justify;
}
.indigency-certificate-body .indigency-to {
    margin-bottom: 1.05em;
}
.indigency-certificate-body .indigency-indent {
    text-indent: 5%;
}
.indigency-field {
    display: inline-block;
    min-width: 3.2cqw;
    max-width: 100%;
    padding: 0 .35cqw;
    border-bottom: 1px solid #1c1c1c;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
    vertical-align: baseline;
}
.indigency-field:not(.indigency-field-wide):not(.indigency-field-fill) {
    white-space: nowrap;
    overflow-wrap: normal;
}
.indigency-field-wide,
.indigency-field-fill {
    display: inline;
    width: auto;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0 .25cqw;
    white-space: normal;
    overflow-wrap: anywhere;
    font-weight: 800;
}
.indigency-field-wide { border-bottom: 1px solid #1c1c1c; }
.indigency-field-fill { border-bottom: 1px solid #1c1c1c; }
.indigency-signature {
    position: relative;
    top: auto;
    right: auto;
    width: 34.29%;
    flex: 0 0 auto;
    margin: auto 0 0 auto;
    padding-top: 3cqw;
    color: #1c1c1c;
    text-align: center;
}
.indigency-signature-image {
    display: block;
    position: relative;
    top: 5cqw;
    z-index: 1;
    width: 20cqw;
    max-width: 100%;
    max-height: 14cqw;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}
.indigency-signature-line {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 1.4em;
    margin-top: -3.5cqw;
    padding: 0 .5cqw .45cqw;
    border-bottom: 1px solid #1c1c1c;
}
.indigency-signatory-label {
    margin-top: .8cqw;
    font-size: 2.05cqw;
    font-weight: 700;
}
.indigency-signature-role { font-size: 2.05cqw; }
.indigency-watermark {
    top: 50%;
    left: 50%;
    z-index: 1;
    width: 115cqw;
    aspect-ratio: 1;
    opacity: .05;
    pointer-events: none;
    transform: translate(-50%, -50%);
}
.indigency-watermark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.indigency-bottom-ribbon {
    bottom: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 13.468%;
    pointer-events: none;
    transform: scale(-1, -1);
}
.indigency-contact {
    top: 88.1%;
    right: 5%;
    left: 5%;
    z-index: 2;
    color: #303a33;
    font-size: 1.55cqw;
    line-height: 1.4;
    text-align: center;
}

@media (max-width: 700px) {
    .paper--indigency { width: calc(100% - 1rem); margin: .5rem auto; }
}

@media print {
    .paper--indigency {
        width: 210mm;
        height: 297mm;
        min-height: 297mm;
        margin: 0 !important;
        aspect-ratio: auto;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .indigency-top-ribbon,
    .indigency-seal,
    .indigency-bottom-ribbon,
    .indigency-watermark,
    .indigency-contact {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Business-clearance document: A4 layout sized independently from the other previews. */
@page business-clearance { size: A4 portrait; margin: 0; }
.paper--business {
    --business-green: #0c5700;
    --business-gold: #f2c201;
    page: business-clearance;
    display: flex;
    flex-direction: column;
    gap: 3.78mm;
    position: relative;
    overflow: hidden;
    width: min(210mm, calc(100% - 2rem));
    aspect-ratio: 210 / 297;
    min-height: 0;
    margin: 2rem auto;
    padding: 6.72mm 10.08mm 5.88mm;
    background: #fff;
    color: #202822;
    container-type: inline-size;
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}
.business-watermark {
    position:absolute;
    top:50%;
    left:50%;
    z-index:0;
    width:115cqw;
    aspect-ratio:1;
    opacity:.05;
    pointer-events:none;
    transform:translate(-50%, -50%);
}
.business-watermark img { display:block; width:100%; height:100%; object-fit:contain; }
.paper--business > :not(.business-watermark) { position:relative; z-index:1; }
.business-header {
    min-height: 11%;
    display: grid;
    grid-template-columns: 14% max-content 11cqw minmax(0, 1fr);
    gap: 2%;
    align-items: center;
    border-bottom: .38cqw solid var(--business-green);
    padding: 1cqw .6cqw 2.2cqw;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.business-header::after {
    content: "";
    position: absolute;
    top: 100%;
    right: -.6cqw;
    left: -.6cqw;
    height: 3.78mm;
    background: #fff;
    pointer-events: none;
}
.business-seal { display:block; width:100%; max-height:100%; aspect-ratio:1; object-fit:contain; }
.business-heading { min-width:0; text-align:left; }
.business-title-lockup { width:max-content; max-width:none; }
.business-jurisdiction {
    margin: 0 0 1cqw;
    color: var(--business-green);
    font-size: 2.35cqw;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.business-main-heading {
    width:max-content;
    max-width:none;
    margin: 0;
    color: var(--business-green);
    font-size: 4.8cqw;
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: normal;
    text-transform: uppercase;
    white-space: nowrap;
}
.business-header-bar { width:100%; height:.8cqw; margin:1.5cqw 0 0; background:var(--business-gold); }
.business-header-divider { width:.38cqw; height:7.8cqw; justify-self:center; align-self:center; background:#e5e9e6; }
.business-year {
    margin: 0;
    min-width: 0;
    padding-left: 0;
    color: var(--business-green);
    font-size: 10.5cqw;
    line-height: .95;
    font-weight: 800;
    letter-spacing: -.04em;
    text-align: center;
}
.business-year > #business-year-value,
.business-year > small {
    display:block;
    width:max-content;
    max-width:100%;
    margin-inline:auto;
    text-align:center;
}
.business-year small {
    display:block;
    margin-top: 1.2cqw;
    font-size: 1cqw;
    line-height:1.25;
    font-weight:800;
    letter-spacing:.09em;
    white-space:nowrap;
}
.business-fields {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap: 2.3cqw 3.2cqw;
}
.business-field { min-width:0; text-align:center; }
.business-field--wide { grid-column:1 / -1; }
.business-field-label {
    display:flex;
    min-height:4.6cqw;
    align-items:center;
    justify-content:center;
    padding:.7cqw 1.4cqw;
    background:var(--business-green);
    color:#fff;
    font-size:1.8cqw;
    line-height:1.15;
    font-weight:800;
    letter-spacing:.055em;
    text-transform:uppercase;
}
.business-field--wide .business-field-label { width:calc(50% - 1.6cqw); margin-inline:auto; }
.business-value {
    margin:1.25cqw 0 0;
    color:#202822;
    font-size:2.05cqw;
    line-height:1.25;
    font-weight:800;
    text-align:center;
    text-transform:uppercase;
    overflow-wrap:anywhere;
}
.business-legal {
    margin:0;
    padding:2.3cqw 2.6cqw;
    border-left:.75cqw solid var(--business-gold);
    background:rgba(246,248,244,.5);
    color:#26332b;
    font-size:2.05cqw;
    line-height:1.42;
    font-weight:400;
    text-align:left;
}
.business-bottom {
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
    gap:2.6cqw;
    align-items:start;
    margin-top:auto;
    padding-top:1.5cqw;
}
.business-receipt { color:#26332b; font-size:1.75cqw; line-height:1.3; }
.business-receipt p { margin:0 0 1.5cqw; }
.business-receipt span { display:block; color:#47564b; font-weight:600; }
.business-receipt strong { display:block; margin-top:.35cqw; color:#18251c; font-size:1.95cqw; font-weight:800; overflow-wrap:anywhere; }
.business-issued { color:#26332b; font-size:1.8cqw; line-height:1.35; text-align:center; }
.business-issued p { margin:0 0 2.4cqw; }
.business-issued span { display:block; font-weight:600; }
.business-issued strong { display:block; margin-top:.7cqw; color:#18251c; font-size:2.05cqw; font-weight:800; }
.business-signatory { min-width:0; color:#18251c; text-align:center; }
.business-signature-wrap { position:relative; height:auto; display:block; text-align:center; }
.business-signature-image { display:block; position:relative; top:5cqw; z-index:1; width:20cqw; max-width:100%; max-height:14cqw; height:auto; margin:0 auto; object-fit:contain; }
.business-signature-line { position:relative; z-index:2; width:100%; min-height:1.4em; margin-top:-3.5cqw; padding:0 .5cqw .45cqw; border-bottom:.22cqw solid #26332b; }
.business-signatory-name { margin:.8cqw 0 0; font-size:1.9cqw; line-height:1.25; font-weight:800; text-transform:uppercase; overflow-wrap:anywhere; }
.business-signatory-role { margin:.45cqw 0 0; font-size:1.8cqw; line-height:1.2; font-weight:500; }
.business-permit-label { margin:1.6cqw 0 .35cqw; color:var(--business-green); font-size:1.7cqw; font-weight:800; letter-spacing:.07em; }
.business-permit-number { margin:0; color:#18251c; font-size:2.2cqw; line-height:1.2; font-weight:800; letter-spacing:.025em; overflow-wrap:anywhere; }
.business-footer {
    display:flex;
    min-height:4.5cqw;
    align-items:center;
    justify-content:center;
    margin:0 -6.8cqw;
    padding:1cqw 3cqw;
    background:var(--business-green);
    color:#fff;
    font-size:2.1cqw;
    line-height:1.2;
    font-weight:700;
    letter-spacing:.035em;
    text-align:center;
    text-transform:uppercase;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
}
.business-document-note { margin:0; color:#46514a; font-size:1.18cqw; line-height:1.25; font-weight:500; text-align:center; }
@media(max-width:560px) {
    .paper--business { width:calc(100% - 1rem); margin:.5rem auto; }
}
@media print {
    .paper--business {
        width:210mm;
        height:297mm;
        min-height:297mm;
        margin:0 !important;
        aspect-ratio:auto;
        -webkit-print-color-adjust:exact;
        print-color-adjust:exact;
    }
    .business-header-bar,
    .business-field-label,
    .business-footer,
    .business-legal { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}
