.receipt-workspace {
    width: min(920px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.receipt-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.receipt-page-header h1,
.receipt-unavailable h2,
.paper-header h2,
.receipt-payments h3 {
    margin: 0;
    letter-spacing: 0;
}

.receipt-page-header h1 {
    margin-top: 6px;
    font-size: 1.8rem;
}

.receipt-currency {
    padding: 5px 9px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.receipt-unavailable {
    min-height: 420px;
    display: grid;
    align-content: center;
    justify-items: center;
    margin-top: 24px;
    padding: 32px;
    border: 1px dashed #aebbb4;
    border-radius: var(--radius);
    background: var(--color-surface);
    text-align: center;
}

.receipt-unavailable p {
    max-width: 520px;
    margin: 8px 0 20px;
    color: var(--color-text-muted);
}

.receipt-result {
    display: grid;
    grid-template-columns: minmax(0, 520px) minmax(190px, 1fr);
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 14px 24px;
    margin-top: 28px;
}

.receipt-animation {
    width: 100%;
    grid-row: 1 / span 2;
    margin: 0;
}

.printer-shell {
    position: relative;
    z-index: 2;
    height: 92px;
    border: 1px solid #111815;
    border-radius: 8px 8px 3px 3px;
    background: #202925;
    box-shadow: 0 14px 28px rgba(25, 33, 29, 0.2);
}

.printer-slot {
    position: absolute;
    right: 34px;
    bottom: 18px;
    left: 34px;
    height: 9px;
    border-radius: 2px;
    background: #070a09;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.08);
}

.printer-status-light {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #5bc487;
    box-shadow: 0 0 0 3px rgba(91, 196, 135, 0.16);
}

.receipt-paper {
    position: relative;
    z-index: 1;
    width: calc(100% - 60px);
    max-height: 70vh;
    margin: -9px auto 0;
    padding: 30px 28px 34px;
    overflow-y: auto;
    border: 1px solid #d8ddd9;
    border-top: 0;
    background: #ffffff;
    color: #1b231f;
    box-shadow: 0 16px 32px rgba(25, 33, 29, 0.14);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.receipt-line {
    transition: opacity 120ms ease, transform 120ms ease;
}

.receipt-line.is-queued {
    height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-5px);
}

.receipt-line.is-printed {
    opacity: 1;
    transform: translateY(0);
}

.paper-header {
    display: grid;
    justify-items: center;
    text-align: center;
}

.paper-header p,
.paper-header span,
.paper-footer span {
    margin: 0;
    color: #65706a;
    font-size: 0.72rem;
}

.paper-header h2 {
    max-width: 100%;
    margin: 5px 0;
    font-size: 1.1rem;
    overflow-wrap: anywhere;
}

.receipt-metadata,
.receipt-totals,
.receipt-payment {
    display: grid;
    gap: 6px;
    margin: 20px 0 0;
}

.receipt-metadata > div,
.receipt-totals > div,
.receipt-payment > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
}

.receipt-metadata dt,
.receipt-totals dt,
.receipt-payment dt {
    color: #65706a;
}

.receipt-metadata dd,
.receipt-totals dd,
.receipt-payment dd {
    min-width: 0;
    margin: 0;
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

.receipt-rule {
    height: 0;
    margin: 18px 0;
    border-top: 1px dashed #98a39d;
}

.receipt-items {
    display: grid;
    gap: 14px;
}

.receipt-item {
    display: grid;
    gap: 4px;
}

.receipt-item-heading {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
}

.receipt-item-heading strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.receipt-item-detail {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-left: 32px;
    color: #65706a;
    font-size: 0.72rem;
}

.receipt-discount {
    color: #9b4e36;
}

.receipt-grand-total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #1b231f;
    font-size: 1.05rem;
}

.receipt-payments h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
}

.receipt-payment + .receipt-payment {
    padding-top: 12px;
    border-top: 1px dotted #b6beb9;
}

.paper-footer {
    display: grid;
    gap: 5px;
    justify-items: center;
    margin-top: 24px;
    text-align: center;
}

.receipt-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
}

.receipt-animation.is-running + .receipt-actions {
    visibility: hidden;
}

.receipt-verification {
    margin: 0;
    color: #246746;
    font-size: 0.78rem;
    text-align: left;
}

@media (max-width: 760px) {
    .receipt-result {
        display: block;
    }

    .receipt-animation {
        width: min(100%, 520px);
        margin: 0 auto;
    }

    .receipt-actions {
        display: flex;
        justify-content: center;
        margin-top: 22px;
    }

    .receipt-verification {
        margin-top: 14px;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .receipt-workspace {
        width: min(100% - 24px, 920px);
        padding-top: 20px;
    }

    .receipt-paper {
        width: calc(100% - 24px);
        padding: 26px 18px 30px;
    }

    .printer-slot {
        right: 18px;
        left: 18px;
    }

    .receipt-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 600px) {
    .receipt-metadata > .receipt-identifier-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }

    .receipt-payment > .receipt-identifier-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }

    .receipt-identifier-row dd {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .receipt-line {
        transition: none;
    }
}

@media print {
    .app-header,
    .app-footer,
    .receipt-page-header,
    .printer-shell,
    .receipt-actions,
    .receipt-verification {
        display: none !important;
    }

    .app-main,
    .receipt-workspace,
    .receipt-result,
    .receipt-animation {
        width: 100%;
        display: block;
        margin: 0;
        padding: 0;
    }

    .receipt-paper {
        width: 80mm;
        max-height: none;
        margin: 0 auto;
        padding: 6mm;
        overflow: visible;
        border: 0;
        box-shadow: none;
    }

    .receipt-line,
    .receipt-line.is-queued {
        height: auto;
        opacity: 1;
        transform: none;
    }
}
