/*
 * Physical QR asset tag: 50mm x 25mm, QR 16.5mm.
 * Shared by the on-screen preview and the print frame so both render identically.
 */
.tag {
    box-sizing: border-box;
    width: 50mm;
    height: 25mm;
    position: relative;
    padding: 0 1.8mm 0 2.5mm;
    display: flex;
    align-items: center;
    gap: 2.5mm;
    background: #fff;
    color: #000;
    overflow: hidden;
    font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Thin rounded outline, inset 1mm so it survives small feed/cut variations. */
.tag.tag-outline::before {
    content: "";
    position: absolute;
    inset: 1mm;
    border: 0.35mm solid #000;
    border-radius: 1.6mm;
    pointer-events: none;
}

.tag-qr {
    flex: 0 0 16.5mm;
    width: 16.5mm;
    height: 16.5mm;
}

.tag-qr svg {
    display: block;
    width: 100%;
    height: 100%;
    shape-rendering: crispEdges;
}

.tag-text {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 700;
    font-size: 2.6mm;
    line-height: 3.7mm;
    letter-spacing: -0.01mm;
}

.tag-line {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-line b {
    font-weight: 700;
}

/* Print document: one tag per 50x25mm page. */
@media print {
    @page {
        size: 50mm 25mm;
        margin: 0;
    }

    html,
    body.tag-print {
        margin: 0;
        padding: 0;
        background: #fff;
    }

    body.tag-print .tag {
        break-after: page;
        page-break-after: always;
    }

    body.tag-print .tag:last-child {
        break-after: auto;
        page-break-after: auto;
    }
}
