/* 80mm thermal / POS receipt — screen preview + print. */

:root {
    --thermal-width: 72mm;
    --thermal-ink: #111;
    --thermal-muted: #444;
    --thermal-line: #222;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body.thermal-body {
    margin: 0;
    padding: 0;
    background: #e8e8e8;
    color: var(--thermal-ink);
    font-family: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, 'Courier New', monospace;
    -webkit-font-smoothing: antialiased;
}

.thermal-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: #111;
    color: #fff;
}

.thermal-toolbar__link {
    color: #fff;
    text-decoration: none;
    font: 600 .9rem/1.2 system-ui, sans-serif;
}

.thermal-toolbar__btn {
    border: 0;
    border-radius: .5rem;
    background: #fff;
    color: #111;
    font: 700 .9rem/1 system-ui, sans-serif;
    min-height: 2.4rem;
    padding: 0 1rem;
    cursor: pointer;
}

.thermal-stage {
    display: grid;
    place-items: start center;
    padding: 1.25rem 1rem 2.5rem;
}

.thermal-receipt {
    width: var(--thermal-width);
    max-width: 100%;
    margin: 0 auto;
    padding: 4mm 3.5mm 5mm;
    background: #fff;
    color: var(--thermal-ink);
    box-shadow: 0 .75rem 1.75rem rgb(0 0 0 / .18);
    font-size: 11px;
    line-height: 1.35;
}

.thermal-receipt__brand {
    text-align: center;
    margin-bottom: 2.5mm;
}

.thermal-receipt__brand strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.thermal-receipt__brand span,
.thermal-receipt__meta,
.thermal-receipt__foot {
    display: block;
    color: var(--thermal-muted);
    font-size: 10px;
}

.thermal-receipt__title {
    margin: 2mm 0;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.thermal-rule {
    border: 0;
    border-top: 1px dashed var(--thermal-line);
    margin: 2.5mm 0;
}

.thermal-rule--double {
    border-top-style: double;
    border-top-width: 3px;
}

.thermal-row {
    display: flex;
    justify-content: space-between;
    gap: 2mm;
    align-items: flex-start;
}

.thermal-row dt,
.thermal-row .label {
    color: var(--thermal-muted);
    flex: 0 0 auto;
}

.thermal-row dd,
.thermal-row .value {
    margin: 0;
    text-align: end;
    word-break: break-word;
}

.thermal-block {
    margin: 0;
}

.thermal-block dt {
    margin: 0;
    color: var(--thermal-muted);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.thermal-block dd {
    margin: 0 0 1.6mm;
    word-break: break-word;
}

.thermal-totals {
    display: grid;
    gap: 1mm;
}

.thermal-totals .thermal-row.total {
    font-size: 13px;
    font-weight: 800;
    margin-top: 1mm;
}

.thermal-center {
    text-align: center;
}

.thermal-barcode {
    margin-top: 3mm;
    text-align: center;
    font-size: 13px;
    letter-spacing: .18em;
    font-weight: 700;
}

.thermal-cut {
    margin-top: 3mm;
    text-align: center;
    font-size: 9px;
    color: var(--thermal-muted);
}

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

    html,
    body.thermal-body {
        width: 80mm;
        max-width: 80mm;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .no-print {
        display: none !important;
    }

    .thermal-stage {
        padding: 0;
        place-items: start stretch;
    }

    .thermal-receipt {
        width: 72mm;
        max-width: 72mm;
        margin: 0 auto;
        padding: 3mm 2.5mm 4mm;
        box-shadow: none;
    }
}
