/* Scoped receipt rules also apply to HTML generated after Tailwind compilation. */
.citizen-receipt {
    box-sizing: border-box;
    direction: rtl;
    color: #0f172a;
    background: #fff;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    min-width: 0;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.9;
    letter-spacing: 0;
    position: relative;
    overflow: hidden;
}
.citizen-receipt > :not(.receipt-watermark) { position: relative; }
.receipt-watermark { position: absolute; inset: 0; opacity: 0.06; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.receipt-watermark img { width: 50%; max-width: 320px; max-height: 260px; object-fit: contain; filter: grayscale(1); }
.receipt-header {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 80px;
    gap: 16px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #334155;
}
.receipt-logo {
    width: 80px;
    height: 64px;
    max-width: 100%;
    object-fit: contain;
    display: block;
}
.receipt-heading { text-align: center; min-width: 0; }
.receipt-heading h2 { font-size: 22px; font-weight: 800; line-height: 1.6; margin: 0; text-wrap: balance; }
.receipt-heading p { font-size: 13px; color: #475569; margin-top: 4px; }
.receipt-reference {
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 12px;
    margin: 24px 0;
    break-inside: avoid;
}
.receipt-reference p { color: #475569; font-size: 14px; }
.receipt-code {
    display: block;
    color: #be123c;
    font-size: 44px;
    font-weight: 800;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    letter-spacing: 0;
    margin: 4px 0;
}
.receipt-reference .receipt-code-note { font-size: 12px; }
.receipt-detail {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}
.receipt-detail dt { font-size: 14px; font-weight: 700; color: #334155; }
.receipt-detail dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.receipt-applicant { align-items: baseline; }
.receipt-applicant dd { font-size: 22px; font-weight: 800; line-height: 1.7; }
.receipt-details { margin: 0; }
.receipt-subject dd { line-height: 2; }
.receipt-detail bdi, .receipt-footer bdi { font-variant-numeric: tabular-nums; }
.receipt-notice {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
    font-size: 13px;
    break-inside: avoid;
}
.receipt-footer { margin-top: 20px; text-align: center; color: #475569; font-size: 11px; }
@media screen and (max-width: 480px) {
    #receipt-area { padding: 16px; }
    .citizen-receipt { padding: 16px; }
    .receipt-header { grid-template-columns: 52px minmax(0, 1fr) 52px; gap: 8px; }
    .receipt-logo { width: 52px; height: 48px; }
    .receipt-heading h2 { font-size: 18px; }
    .receipt-heading p { font-size: 11px; }
    .receipt-code { font-size: 34px; }
    .receipt-detail { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .receipt-applicant dd { font-size: 20px; }
}
@media print {
    @page { size: A4; margin: 14mm; }
    html, body { height: auto !important; min-height: 0 !important; overflow: visible !important; }
    body { margin: 0 !important; padding: 0 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    #main-container { border-radius: 0 !important; overflow: visible !important; }
    #receipt-area { padding: 0 !important; opacity: 1 !important; width: 100% !important; }
    #receipt-html-container { margin: 0 !important; width: 100% !important; }
    .citizen-receipt {
        border: 2px solid #334155;
        border-radius: 0;
        padding: 10mm;
        min-height: 267mm;
        font-size: 16px;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 6mm;
        overflow: visible;
    }
    .receipt-header { break-inside: avoid; }
    .receipt-heading h2 { font-size: 24px; }
    .receipt-heading p { font-size: 12px; }
    .receipt-reference { margin: 0; }
    .receipt-code { font-size: 40px; }
    .receipt-details { flex: 1; display: flex; flex-direction: column; }
    .receipt-detail { padding: 14px 0; break-inside: avoid; }
    .receipt-applicant dd { font-size: 22px; }
    .receipt-subject { display: block; flex: 1; border-bottom: 0; padding-top: 20px; }
    .receipt-subject dt { margin-bottom: 6px; }
    .receipt-notice { font-size: 14px; line-height: 1.9; margin-top: 0; }
    .receipt-footer { font-size: 12px; margin-top: 0; }
    .citizen-receipt, .citizen-receipt * { color: #000 !important; border-color: #999 !important; }
    .receipt-reference { background: #fff; }
    .receipt-notice { background: #f5f5f5; }
    .receipt-logo { filter: grayscale(1); }
}
