:root {
    --ink: #0b1220;
    --muted: #64748b;
    --line: #e7eaf0;
    --paper: #ffffff;
    --canvas: #f3f5f8;
    --brand-deep: #060a14;
    --brand-surface: #0f1628;
    --brand-gold: #d4a843;
    --brand-gold-light: #f0d478;
    --success: #13795b;
    --success-bg: #e7f7f0;
    --radius: 24px;
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 20% -10%, rgba(212, 168, 67, 0.12), transparent 32rem),
        linear-gradient(180deg, var(--brand-deep) 0 19rem, var(--canvas) 19rem 100%);
    -webkit-font-smoothing: antialiased;
}

button {
    font: inherit;
}

.receipt-shell {
    width: min(100% - 28px, 680px);
    margin: 0 auto;
    padding: max(20px, env(safe-area-inset-top)) 0 max(44px, env(safe-area-inset-bottom));
}

.receipt-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin-bottom: 18px;
    padding: 0 5px;
    color: #fff;
}

.brand-mark {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    color: #fff;
    letter-spacing: -0.04em;
    line-height: 1;
}

.brand-mark span {
    font-size: 1.65rem;
    font-weight: 800;
}

.brand-mark strong {
    color: var(--brand-gold);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-mark-compact span {
    font-size: 1.3rem;
}

.brand-mark-compact strong {
    font-size: 0.64rem;
}

.secure-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #b6c0d0;
    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.secure-label svg {
    width: 17px;
    fill: none;
    stroke: var(--brand-gold);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.receipt-card {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 24px 70px rgba(4, 10, 23, 0.16), 0 2px 8px rgba(4, 10, 23, 0.06);
}

.merchant-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 30px 30px 10px;
}

.merchant-monogram {
    display: grid;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid #ead9aa;
    border-radius: 16px;
    color: #71581f;
    background: linear-gradient(145deg, #fff9e9, #f5e6b9);
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0 0 5px;
    color: #9a7628;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.merchant-header h1 {
    margin: 0;
    font-size: clamp(1.35rem, 6vw, 1.9rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.merchant-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 30px 28px 97px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.payment-hero {
    position: relative;
    margin: 0 18px;
    padding: 28px 24px 25px;
    overflow: hidden;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 20%, rgba(212, 168, 67, 0.18), transparent 45%),
        linear-gradient(145deg, #101a30, var(--brand-deep));
    text-align: center;
}

.payment-hero::after {
    position: absolute;
    width: 170px;
    height: 170px;
    top: -100px;
    right: -80px;
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-radius: 50%;
    content: "";
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-pill svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
}

.status-approved {
    color: #b8f1db;
    background: rgba(19, 121, 91, 0.28);
}

.status-neutral {
    color: #f3db9c;
    background: rgba(212, 168, 67, 0.18);
}

.payment-hero p {
    margin: 0 0 2px;
    color: #aeb9ca;
    font-size: 0.76rem;
    font-weight: 600;
}

.hero-total {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    color: #fff;
    font-size: clamp(2.55rem, 12vw, 4rem);
    font-weight: 780;
    letter-spacing: -0.065em;
    line-height: 1;
}

.hero-total span {
    margin: 0.38em 0.15em 0 0;
    color: var(--brand-gold-light);
    font-size: 0.4em;
    font-weight: 750;
    letter-spacing: 0;
}

.payment-hero time {
    display: block;
    margin-top: 12px;
    color: #9aa8bd;
    font-size: 0.74rem;
}

.receipt-section {
    padding: 30px;
    border-bottom: 1px solid var(--line);
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 19px;
}

.section-heading h2,
.payment-details h2 {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 820;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.section-heading span {
    color: var(--muted);
    font-size: 0.76rem;
}

.line-items {
    display: grid;
    gap: 21px;
}

.line-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
}

.item-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.item-copy strong,
.line-total {
    font-size: 0.91rem;
    line-height: 1.3;
}

.quantity {
    color: #9a7628;
}

.modifier,
.unit-price {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.modifier {
    padding-left: 19px;
}

.line-total {
    white-space: nowrap;
}

.totals {
    display: grid;
    gap: 13px;
    padding: 26px 30px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfd;
}

.totals > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.83rem;
}

.totals strong {
    color: var(--ink);
    font-weight: 700;
}

.totals .grand-total {
    margin-top: 5px;
    padding-top: 17px;
    border-top: 1px dashed #cfd5df;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 750;
}

.grand-total strong {
    font-size: 1.22rem;
}

.payment-details h2 {
    margin-bottom: 18px;
}

.payment-details dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.payment-details dl > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-size: 0.83rem;
}

.payment-details dt {
    color: var(--muted);
    font-weight: 500;
}

.payment-details dd {
    margin: 0;
    font-weight: 690;
    text-align: right;
}

.receipt-references {
    display: grid;
    gap: 11px;
    padding: 24px 30px;
    border-bottom: 1px solid var(--line);
}

.receipt-references > div {
    display: grid;
    grid-template-columns: 1fr minmax(0, 1.7fr);
    gap: 14px;
    color: var(--muted);
    font-size: 0.7rem;
}

.receipt-references strong {
    overflow-wrap: anywhere;
    color: #344054;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 650;
    text-align: right;
}

.receipt-footer {
    padding: 28px 30px 31px;
    text-align: center;
}

.receipt-footer p {
    margin: 0 0 7px;
    font-size: 1rem;
    font-weight: 720;
}

.receipt-footer span {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.13em;
}

.receipt-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.primary-action {
    display: flex;
    min-height: 54px;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 16px;
    color: #211900;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-light));
    box-shadow: 0 10px 26px rgba(128, 94, 18, 0.22);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 800;
    transition: transform 160ms ease, filter 160ms ease;
}

.primary-action:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.primary-action:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.primary-action svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.receipt-actions p,
.powered-by {
    margin: 0;
    color: #667085;
    font-size: 0.69rem;
    text-align: center;
}

.powered-by {
    margin-top: 20px;
    color: #8a96a8;
}

.powered-by strong {
    color: #5d687a;
}

.landing-shell {
    display: grid;
    min-height: 100vh;
    padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
    place-items: center;
}

.landing-card {
    width: min(100%, 520px);
    padding: 34px clamp(28px, 8vw, 58px) 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(15, 22, 40, 0.98), rgba(6, 10, 20, 0.98));
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
    color: #fff;
    text-align: center;
}

.landing-card .brand-mark {
    margin-bottom: 52px;
}

.landing-icon {
    display: grid;
    width: 74px;
    height: 74px;
    margin: 0 auto 28px;
    place-items: center;
    border: 1px solid rgba(212, 168, 67, 0.35);
    border-radius: 23px;
    background: rgba(212, 168, 67, 0.09);
}

.landing-icon svg {
    width: 38px;
    fill: none;
    stroke: var(--brand-gold-light);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.landing-card h1 {
    margin: 0 0 15px;
    font-size: clamp(2rem, 8vw, 3.15rem);
    line-height: 1;
    letter-spacing: -0.055em;
}

.landing-card > p:last-child {
    max-width: 37ch;
    margin: 0 auto;
    color: #aab5c6;
    font-size: 0.94rem;
    line-height: 1.6;
}

.warning-icon {
    border-color: rgba(240, 212, 120, 0.3);
}

.unavailable-card h1 {
    font-size: clamp(1.85rem, 8vw, 2.8rem);
}

@media (max-width: 520px) {
    body {
        background: linear-gradient(180deg, var(--brand-deep) 0 15rem, var(--canvas) 15rem 100%);
    }

    .receipt-shell {
        width: min(100% - 18px, 680px);
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .secure-label {
        font-size: 0.68rem;
    }

    .receipt-card {
        border-radius: 20px;
    }

    .merchant-header {
        padding: 24px 21px 9px;
    }

    .merchant-monogram {
        width: 47px;
        height: 47px;
        border-radius: 14px;
    }

    .merchant-details {
        padding: 0 21px 23px 83px;
    }

    .payment-hero {
        margin: 0 11px;
    }

    .receipt-section,
    .totals,
    .receipt-references,
    .receipt-footer {
        padding-right: 21px;
        padding-left: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    @page {
        size: auto;
        margin: 6mm;
    }

    html,
    body {
        min-height: 0;
        background: #fff;
    }

    .receipt-shell {
        width: 100%;
        max-width: 190mm;
        padding: 0;
    }

    .receipt-topbar,
    .receipt-actions,
    .powered-by {
        display: none;
    }

    .receipt-card {
        border: 1px solid #d7dce4;
        border-radius: 0;
        box-shadow: none;
    }

    .merchant-header {
        gap: 4mm;
        padding: 7mm 8mm 2mm;
    }

    .merchant-monogram {
        width: 14mm;
        height: 14mm;
        border-radius: 4mm;
    }

    .merchant-header h1 {
        font-size: 1.45rem;
    }

    .merchant-details {
        gap: 1mm;
        padding: 0 8mm 6mm 26mm;
        font-size: 0.72rem;
    }

    .payment-hero {
        margin: 0 5mm;
        padding: 5mm;
        border: 1px solid #cbd1dc;
        color: #000;
        background: #f4f5f7;
        print-color-adjust: exact;
    }

    .payment-hero::after {
        width: 35mm;
        height: 35mm;
        top: -20mm;
        right: -15mm;
    }

    .status-pill {
        margin-bottom: 3mm;
        padding: 1.5mm 3mm;
    }

    .hero-total {
        font-size: 2.5rem;
    }

    .payment-hero time {
        margin-top: 2mm;
    }

    .payment-hero p,
    .payment-hero time,
    .hero-total,
    .hero-total span,
    .status-pill {
        color: #000;
    }

    .status-pill {
        border: 1px solid #777;
        background: transparent;
    }

    .receipt-section {
        padding: 6mm 8mm;
    }

    .section-heading {
        margin-bottom: 4mm;
    }

    .line-items {
        gap: 4mm;
    }

    .totals {
        gap: 2.5mm;
        padding: 5mm 8mm;
    }

    .totals .grand-total {
        margin-top: 1mm;
        padding-top: 3mm;
    }

    .payment-details h2 {
        margin-bottom: 4mm;
    }

    .payment-details dl {
        gap: 2.5mm;
    }

    .receipt-references {
        gap: 2mm;
        padding: 5mm 8mm;
    }

    .receipt-footer {
        padding: 5mm 8mm 6mm;
    }

    .receipt-footer p {
        margin-bottom: 1.5mm;
    }

    .line-item,
    .payment-details,
    .receipt-references {
        break-inside: avoid;
    }
}
