/* ── Bon-Darstellung (ReceiptPaper) ──
   Der Beleg bleibt ein Bon: feste Zeichenbreite, Breite in Zeichen aus dem Beleg-Layout
   (--ck-bon-width). Die Schriftgröße richtet sich nach dem Platz der Hülle (.ck-bon-host,
   Container-Query), damit die längste Zeile ohne waagrechtes Scrollen passt – auch neben einer
   Seitenleiste, wo die Bildschirmbreite (vw) zu viel verspricht. Ein Monospace-Zeichen ist rund
   0,6 em breit; 24px sind der waagrechte Innenabstand des Papiers. Papierweiß unabhängig vom Theme. */
.ck-bon-host {
    container-type: inline-size;
}

.ck-bon-paper {
    background-color: #fff;
    color: #000;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    padding: 16px 12px;
    overflow: hidden;
}

.ck-bon {
    font-family: ui-monospace, "Cascadia Mono", "Courier New", monospace;
    font-size: min(15px, calc((100cqw - 24px) / (var(--ck-bon-width) * 0.6)));
    line-height: 1.35;
    width: calc(var(--ck-bon-width) * 1ch);
    margin: 0 auto;
    white-space: pre;
}

.ck-bon-line {
    min-height: 1.35em;
}

.ck-bon-center {
    text-align: center;
}

.ck-bon-right {
    text-align: right;
}

.ck-bon-tall {
    min-height: 2.7em;
    padding-top: 0.675em;
}

.ck-bon-wide,
.ck-bon-high,
.ck-bon-double {
    display: inline-block;
}

.ck-bon-wide {
    transform: scaleX(2);
}

.ck-bon-high {
    transform: scaleY(2);
}

.ck-bon-double {
    transform: scale(2);
}

/* Die Streckung geht von der Seite aus, an der die Zeile ausgerichtet ist. */
.ck-bon-line .ck-bon-wide,
.ck-bon-line .ck-bon-double {
    transform-origin: left center;
}

.ck-bon-center .ck-bon-wide,
.ck-bon-center .ck-bon-double {
    transform-origin: center;
}

.ck-bon-right .ck-bon-wide,
.ck-bon-right .ck-bon-double {
    transform-origin: right center;
}

.ck-bon-bold {
    font-weight: 700;
}

.ck-bon-underline {
    text-decoration: underline;
}

.ck-bon-qr {
    display: flex;
    justify-content: center;
    padding: 6px 0;
}

.ck-bon-qr svg {
    width: min(160px, 60%);
    height: auto;
}

/* Kompakt: Vorschau in einer Seitenspalte (Kasse, Office) – höchstens 12px wie die bisherige
   Textvorschau, bei wenig Platz kleiner (gleiche Rechnung wie oben); der Bildlauf bleibt als
   Notausgang für sehr breite Layouts. */
.ck-bon-paper.ck-bon-compact {
    padding: 10px 12px;
    overflow-x: auto;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

.ck-bon-compact .ck-bon {
    font-size: min(12px, calc((100cqw - 24px) / (var(--ck-bon-width) * 0.6)));
}

.ck-bon-compact .ck-bon-qr svg {
    width: 140px;
}
