/* PROJ-44 ShopTour2-Kasse — Oberfläche, angelehnt an ShopTour2-Kasse (standalone).
   Palette: Primär #0E4E9E · Akzent #14A5DC/#1463C2 · Rot #C62828 · Grün #1B873F · Amber #9A5B00 */
:root {
    --blue:#0E4E9E; --blue-2:#1463C2; --accent:#14A5DC; --ink:#16202e; --muted:#5c6b7f;
    --line:#dbe4f0; --line-2:#c9d6e5; --bg:#eef3fa; --panel:#f4f7fb; --white:#fff;
    --red:#c62828; --green:#1b873f; --amber:#9a5b00; --amber-bg:#fbf4e6; --amber-line:#e8d7b0;
    --r:10px; --shadow:0 1px 3px rgba(14,78,158,.10);
}
* { box-sizing: border-box; }
/* Muss vor den display:grid/flex-Regeln gewinnen: sonst überschreiben .overlay
   und .bon-banner das hidden-Attribut und das Overlay blockiert alle Klicks. */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg); color: var(--ink); height: 100vh; overflow: hidden;
    display: flex; flex-direction: column; font-size: 14px;
}
kbd { font: inherit; font-size: 10px; color: var(--muted); background: rgba(0,0,0,.04);
      border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; margin-left: 6px; }
/* Auf dem grünen Bezahlen-Button: helles kbd, damit F12 lesbar ist. */
.bezahlen kbd { color: #fff; background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.35); font-size: 12px; }

#pos-testbanner {
    background: repeating-linear-gradient(45deg,#c62828,#c62828 12px,#a81f1f 12px,#a81f1f 24px);
    color: #fff; text-align: center; font-weight: 800; letter-spacing: 1px; padding: 3px; font-size: 11px;
}

/* ---- Topbar ---- */
#pos-topbar { background: var(--blue); color: #fff; display: flex; align-items: center; gap: 18px; padding: 10px 16px; }
.tb-user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff;
          display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.tb-user-txt { display: flex; flex-direction: column; line-height: 1.15; }
.tb-user-txt b { font-size: 15px; cursor: pointer; }
.tb-user-txt small { opacity: .75; font-size: 12px; }
.tb-block { background: none; border: none; color: #fff; text-align: left; cursor: pointer;
            display: flex; flex-direction: column; line-height: 1.2; padding: 2px 6px; border-radius: 8px; }
.tb-block:hover { background: rgba(255,255,255,.12); }
.tb-block small { opacity: .7; font-size: 11px; }
.tb-block b { font-size: 15px; }
.badge { background: rgba(255,255,255,.2); border-radius: 999px; font-size: 11px; padding: 1px 9px; font-weight: 600; vertical-align: middle; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.pills { display: flex; gap: 6px; }
.pill { background: var(--blue-2); border-radius: 999px; padding: 4px 11px 4px 9px; font-size: 12px;
        display: inline-flex; align-items: center; gap: 6px; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: #6fcf97; display: inline-block; }
.pill.bad i { background: #ef6b6b; }
.tb-help { background: rgba(255,255,255,.15); color: #fff; border: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 16px; line-height: 1; cursor: pointer; flex: 0 0 auto; }
.tb-help:hover { background: rgba(255,255,255,.3); }
.clock { text-align: right; line-height: 1.1; }
.clock b { font-size: 18px; font-variant-numeric: tabular-nums; }
.clock small { display: block; opacity: .8; font-size: 11px; }

/* ---- Bon-Tabs ---- */
.bon-tabs { display: flex; gap: 0; background: var(--white); border-bottom: 1px solid var(--line); padding: 0 8px; }
.bon-tab { padding: 9px 16px; cursor: pointer; border-bottom: 3px solid transparent; display: flex; flex-direction: column;
           line-height: 1.25; background: none; border-top: none; border-left: none; border-right: none; }
.bon-tab b { font-size: 14px; }
.bon-tab small { font-size: 11px; color: var(--muted); }
.bon-tab.active { border-bottom-color: var(--blue); color: var(--blue); }
.bon-tab.add { font-size: 20px; color: var(--muted); align-self: center; }
/* Bon-Reiter: Bezeichnung (dblclick = umbenennen) + Löschen-Button */
.bon-tab.parked { flex-direction: row; align-items: center; gap: 4px; padding: 6px 10px 6px 14px; }
.tab-label { display: flex; flex-direction: column; line-height: 1.25; cursor: pointer; }
.tab-del { margin-left: 4px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); background: none; cursor: pointer; color: var(--red); font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s; }
.tab-del:hover { background: #fdecec; border-color: var(--red); }

/* ---- Main ---- */
#pos-main { flex: 1; display: grid; grid-template-columns: minmax(0,1.7fr) minmax(360px,1fr); gap: 14px; padding: 14px; min-height: 0; }
.col-left { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; box-shadow: var(--shadow); }
.col-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden; }
/* Oben fixierter Block (Kontrollzählung, Summen, Karte/Bezahlen, Bestellung aufnehmen)
   bleibt sichtbar; nur das Aktionsmenü darunter scrollt. */
.col-right-fixed  { display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
.col-right-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
/* Kompakt: Kontrollzählung + Summen NEBENEINANDER und gleich hoch; die Bezahl-Zeile
   (Karte/Bezahlen) liegt darunter über die VOLLE Breite. #pos-bottombar wird per
   display:contents aufgelöst, damit Summen + Bezahlen direkt im Grid platzierbar
   sind (mobil ≤560px wird es unten wieder zur fixen Leiste, siehe Media-Query). */
.fixed-top-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
.fixed-top-row > #pos-bottombar { display: contents; }
.fixed-top-row > .counts { grid-column: 1; grid-row: 1; margin: 0; min-width: 0; display: flex; flex-direction: column; }
.fixed-top-row > .counts .count-grid.two { margin-top: auto; }   /* Leergut-Kacheln an den unteren Rand */
.fixed-top-row .totals    { grid-column: 2; grid-row: 1; margin: 0; min-width: 0; display: flex; flex-direction: column; }
/* „Zu zahlen" an den unteren Rand, damit die Summen-Karte die (gleiche) Höhe füllt
   statt oben zu klumpen — beide Blöcke exakt gleich hoch, ohne Leerraum-Optik. */
.fixed-top-row .totals .grand { margin-top: auto; }
.fixed-top-row .pay-row   { grid-column: 1 / -1; grid-row: 2; }
.fixed-top-row .count-grid { padding: 4px 8px 8px; gap: 6px; }
.fixed-top-row .count { padding: 8px 4px; }
.fixed-top-row .count b { font-size: 20px; }
.fixed-top-row .count span { font-size: 10px; }
.take-order-btn { background: var(--accent, #1a7fc1); color: #fff; font-weight: 600; border: none; border-radius: var(--r); padding: 14px; font-size: 14px; cursor: pointer; box-shadow: var(--shadow); }
.take-order-btn:hover { filter: brightness(1.06); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px 6px;
             font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.card-head small { font-size: 11px; font-weight: 500; text-transform: none; color: var(--accent); }

/* Pfandausgleich-Hinweis: kompakte Pille in der Topbar (kein Layout-Shift im Bon) */
.bon-banner { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border-radius: 999px;
              background: #e9f6ee; color: #14622f; border: 1px solid #bfe3cd; font-size: 12px; line-height: 1.2;
              max-width: 460px; white-space: nowrap; overflow: hidden; }
.bon-banner span { overflow: hidden; text-overflow: ellipsis; }
.bon-banner button { background: none; border: none; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; }

/* Bon Tabelle */
.bon-head, .bon-row { display: grid; grid-template-columns: 1fr 130px 90px 90px 100px; align-items: center; }
.bon-head { padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 11px; text-transform: uppercase;
            letter-spacing: .4px; color: var(--muted); }
.bon-head span:not(.bh-art) { text-align: right; }
.bh-menge { text-align: center !important; }
.bon-scroll { flex: 1; overflow: auto; }
.bon-row { padding: 11px 16px; border-bottom: 1px solid var(--panel); cursor: pointer; position: relative; }
.bon-row:hover { background: #f7faff; }
.bon-row.sel { background: #eaf2fc; box-shadow: inset 4px 0 0 var(--blue); }
.li-name { font-weight: 600; }
.li-name .gb { background: #eaf2fc; color: var(--blue-2); border-radius: 6px; font-size: 11px; padding: 1px 8px; margin-left: 8px; font-weight: 600; }
.li-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.col-r { text-align: right; font-variant-numeric: tabular-nums; }
.col-r.muted { color: var(--muted); }
.pf-add { color: #b45309; font-weight: 600; }
.li-inclpf { font-size: 10px; color: var(--muted); font-weight: 400; line-height: 1.2; margin-top: 1px; }
.col-r.total { font-weight: 700; }
.stepper { display: inline-flex; align-items: center; gap: 8px; justify-content: center; width: 100%; }
.stepper button { width: 26px; height: 26px; border: 1px solid var(--line-2); background: #fff; border-radius: 7px; cursor: pointer; font-size: 15px; line-height: 1; }
.stepper button:hover { background: var(--panel); }
.stepper span { min-width: 16px; text-align: center; }

/* Expanded gebinde detail */
.gb-detail { grid-column: 1 / -1; margin-top: 10px; }
.gb-detail .gb-bar { display: flex; justify-content: space-between; align-items: center; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .4px; }
.gb-bar .gb-actions button { font-size: 12px; border: 1px solid var(--line-2); background: #fff; border-radius: 7px; padding: 5px 10px; margin-left: 6px; cursor: pointer; text-transform: none; }
.gb-bar .gb-actions .danger { color: var(--red); }
.gb-hint { font-size: 11px; color: var(--muted); margin: 6px 0; }
.gb-cards { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.gb-card { border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 14px; cursor: pointer; min-width: 150px; }
.gb-card:hover { border-color: var(--accent); }
.gb-card.active { background: var(--blue-2); color: #fff; border-color: var(--blue-2); }
.gb-card b { display: block; font-size: 14px; }
.gb-card small { font-size: 12px; opacity: .85; }
.gb-comp { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* Leergut-Sektion */
.leergut-head { background: var(--amber-bg); color: var(--amber); font-weight: 700; font-size: 12px; letter-spacing: .4px;
                text-transform: uppercase; padding: 8px 16px; border-top: 1px solid var(--amber-line); border-bottom: 1px solid var(--amber-line); }
.bon-row.empties { background: #fdfaf2; box-shadow: inset 4px 0 0 var(--amber-line); }
.bon-row.empties .li-name { color: var(--amber); }
.bon-row.invoice-line { background: #fffbf0; box-shadow: inset 4px 0 0 var(--amber); grid-template-columns: 1fr; }
.col-r.credit { color: var(--green); font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 36px; }

/* Scanbar */
.scanbar { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: stretch; }
.scan-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.scan-ico { position: absolute; left: 12px; color: var(--muted); }
#scan { width: 100%; padding: 13px 12px 13px 34px; font-size: 15px; border: 2px solid var(--line-2); border-radius: 9px; outline: none; }
#scan:focus { border-color: var(--accent); }
.search-results { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line-2);
                  border-radius: 9px; box-shadow: 0 -4px 16px rgba(0,0,0,.12); max-height: 320px; overflow: auto; z-index: 20; }
.search-results:empty { display: none; }
.sr-item { padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; cursor: pointer; border-bottom: 1px solid var(--panel); }
.sr-item:hover, .sr-item.active { background: var(--bg); }
.sb-btn { border: 1px solid var(--line-2); background: var(--white); border-radius: 9px; padding: 0 16px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.sb-btn:hover { background: var(--panel); }
.sb-btn.accent { border-color: var(--accent); color: var(--blue-2); }
/* Aktiver Kasten-Scan-Modus: deutlich hervorgehoben, damit kein versehentlicher Kastenverkauf passiert. */
.sb-btn.scanmode-kasten { background: #b45309; border-color: #b45309; color: #fff; font-weight: 700; }
.sb-btn.scanmode-kasten:hover { background: #a04607; }
.sb-btn.scanmode-flasche { background: #1a7fc1; border-color: #1a7fc1; color: #fff; font-weight: 700; }
.sb-btn.scanmode-flasche:hover { background: #156aa3; }
.sb-btn.sb-camera { padding: 0 14px; font-size: 18px; flex-shrink: 0; }

/* Kontrollzählung */
.count-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 4px 14px 14px; }
.count-grid.two { grid-template-columns: repeat(2,1fr); padding-top: 0; }
.count { border: 1px solid var(--line); border-radius: 9px; padding: 12px; text-align: center; }
.count b { display: block; font-size: 26px; color: var(--blue); line-height: 1; }
.count span { font-size: 11px; color: var(--muted); }
.count-grid.amber .count { background: var(--amber-bg); border-color: var(--amber-line); }
.count-grid.amber .count b { color: var(--amber); }

/* Totals */
.totals { padding: 14px; }
.totals .row { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; font-size: 15px; }
.totals .row b { font-variant-numeric: tabular-nums; }
.totals .row.sub { color: var(--muted); font-size: 12px; }
.totals .row.sub i { font-style: normal; }
.totals .grand { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.totals .grand span { font-size: 16px; font-weight: 600; }
.totals .grand b { font-size: 32px; font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }

.bezahlen { background: var(--green); color: #fff; border: none; border-radius: var(--r); padding: 14px; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.bezahlen:hover { filter: brightness(1.05); }
.bezahlen:disabled { opacity: .45; cursor: not-allowed; }

.action-sections { display: flex; flex-direction: column; gap: 14px; }
.action-section-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 6px 2px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-grid button { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; font-size: 14px; cursor: pointer; box-shadow: var(--shadow); }
.action-grid button:hover { background: var(--panel); }
.action-grid .btn-clear { color: var(--muted); }
.action-grid .btn-clear:hover { color: var(--red); border-color: var(--red); }
.action-grid .btn-clear.confirming { color: var(--red); border-color: var(--red); background: #fdecec; font-weight: 600; }
.action-grid .btn-clear.confirming span { padding: 2px 8px; margin-left: 6px; border-radius: 6px; border: 1px solid var(--red); cursor: pointer; }
.action-grid .btn-clear.confirming span[data-c=yes] { background: var(--red); color: #fff; }

/* Schnellartikel */
.quick-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 6px 14px 14px; }
.qa { border: 1px solid var(--line); border-radius: 9px; padding: 10px; text-align: left; cursor: pointer; background: var(--white); min-height: 64px; }
.qa:hover { border-color: var(--accent); background: #f7faff; }
.qa b { display: block; font-size: 12px; line-height: 1.25; }
.qa span { font-size: 13px; color: var(--blue); font-weight: 700; }

/* Overlay / Modal / Toast */
.overlay { position: fixed; inset: 0; background: rgba(11,61,124,.45); display: grid; place-items: center; z-index: 50; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: min(460px,92vw); box-shadow: 0 12px 48px rgba(0,0,0,.3); }
.modal h2 { margin: 0 0 14px; color: var(--blue); font-size: 19px; }
.modal label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.modal input, .modal select { width: 100%; padding: 12px; font-size: 16px; border: 1px solid var(--line-2); border-radius: 9px; }
.modal .actions { display: flex; gap: 8px; margin-top: 18px; }
.modal .actions button { flex: 1; padding: 12px; border-radius: 9px; border: none; font-size: 15px; cursor: pointer; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2) !important; }
/* Grundstyling, damit Buttons AUCH außerhalb von .modal .actions (Umschalt-/
   Schnellbuttons in Dialogen) konsistent zur restlichen Kasse aussehen. Buttons in
   .actions behalten ihr eigenes (spezifischeres) Padding. Inline-Styles gewinnen. */
.btn-primary, .btn-ghost { padding: 10px 12px; border-radius: 9px; font-size: 14px; line-height: 1.1; cursor: pointer; }
/* Aktiver Zustand eines Segment-/Umschaltbuttons (z.B. Preis/%/€ im Rabatt-Dialog). */
.btn-ghost.seg-on { background: var(--blue); color: #fff; border-color: var(--blue) !important; font-weight: 700; }
.numpad { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 10px; }
.numpad button { padding: 14px; font-size: 18px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 9px; cursor: pointer; }
.quick-amounts { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-top: 8px; }
.quick-amounts button { padding: 10px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; cursor: pointer; }
.change-out { margin-top: 14px; text-align: center; font-size: 24px; font-weight: 800; color: var(--green); }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; z-index: 60; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

/* =========================================================================
   Responsiv — Tablet & Handy (MVP §20.3). Auf schmalen Schirmen stapeln die
   Spalten, die Bon-Zeilen brechen um, die Topbar wird kompakt.
   ========================================================================= */
@media (max-width: 900px) {
    body { overflow: auto; height: auto; min-height: 100vh; }
    #pos-main { grid-template-columns: 1fr; overflow: visible; }
    .col-left { min-height: 60vh; }
    .col-right { overflow: visible; }
    .bon-scroll { max-height: none; }
}

@media (max-width: 560px) {
    body { font-size: 13px; }
    /* Topbar kompakt: Pills + Datum aus, Blöcke umbrechen */
    #pos-topbar { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
    .tb-right { width: 100%; justify-content: space-between; gap: 8px; }
    .pills { display: none; }
    .clock small { display: none; }
    .avatar { width: 32px; height: 32px; }

    .bon-tabs { overflow-x: auto; }

    /* Spaltenköpfe weg; Zeile als Karte mit Name oben, Stepper + Gesamt unten */
    .bon-head { display: none; }
    .bon-row { grid-template-columns: 1fr auto; row-gap: 8px; padding: 12px; }
    .bon-row > div:nth-child(1) { grid-column: 1 / -1; }
    .bon-row > div:nth-child(2) { grid-column: 1; justify-self: start; }   /* Stepper */
    .bon-row > div:nth-child(3), .bon-row > div:nth-child(4) { display: none; } /* Einzel/Pfand */
    .bon-row > div:nth-child(5) { grid-column: 2; align-self: center; font-size: 16px; } /* Gesamt */
    .stepper button { width: 34px; height: 34px; font-size: 18px; }     /* größere Touch-Ziele */
    .gb-detail { grid-column: 1 / -1; }
    .gb-cards { flex-direction: column; }
    .gb-card { min-width: 0; }

    /* Scanbar: Eingabe volle Breite, Buttons darunter */
    .scanbar { flex-wrap: wrap; }
    .scan-wrap { flex: 1 1 100%; }
    .sb-btn { flex: 1; padding: 12px 8px; }

    /* Rechte Spalte: enger gerasterte Kacheln */
    .count-grid { grid-template-columns: repeat(3,1fr); gap: 6px; }
    .quick-grid { grid-template-columns: repeat(2,1fr); }
    .totals .grand b { font-size: 28px; }
    .bezahlen { padding: 16px; font-size: 18px; position: sticky; bottom: 8px; }
}

/* =========================================================================
   Handy-Kompaktmodus (≤ 400 px) — für gängige Smartphones (375 px Breite).
   Ziele: maximale Tippfläche, kein horizontales Scrollen, klarer Fokus.
   ========================================================================= */
@media (max-width: 400px) {
    /* Topbar: nur noch Name + Kassenname + Uhrzeit, kein Avatar */
    .avatar { display: none; }
    .tb-block small { font-size: 10px; }
    .tb-block b { font-size: 13px; }
    .tb-user-txt b { font-size: 13px; }
    .clock b { font-size: 15px; }

    /* Tabs: minimal */
    .bon-tab { padding: 7px 10px; }
    .bon-tab b { font-size: 12px; }
    .bon-tab small { display: none; }

    /* Bon-Zeilen: kompaktere Abstände */
    .bon-row { padding: 10px; row-gap: 6px; }
    .li-name { font-size: 13px; }
    .stepper button { width: 38px; height: 38px; font-size: 20px; }

    /* Kontrollzählung: kleinere Zahlen, 2-spaltig */
    .count-grid { grid-template-columns: repeat(2,1fr); padding: 4px 10px 10px; }
    .count-grid.two { grid-template-columns: repeat(2,1fr); }
    .count b { font-size: 20px; }

    /* Schnellartikel auf Handy ausblenden (zu klein zum Antippen) */
    .card.quick { display: none; }

    /* Aktions-Buttons: 2×2-Grid mit genug Tippfläche */
    .action-grid button { padding: 16px 8px; font-size: 13px; }
    kbd { display: none; }

    /* Bezahlen-Button maximal präsent */
    .bezahlen { font-size: 17px; padding: 18px 12px; }

    /* Scanbar-Buttons: volle Breite */
    .sb-btn { font-size: 13px; padding: 12px 6px; }

    /* Totals: geringerer Abstand */
    .totals .row { font-size: 14px; padding: 4px 0; }
    .totals .grand b { font-size: 24px; }

    /* Modal etwas kompakter */
    .modal { padding: 16px; }
    .modal h2 { font-size: 16px; margin-bottom: 10px; }
    .numpad button { padding: 12px; font-size: 16px; }
}

/* ── Mobile Kasse (PROJ-44): QR-Beleg + Bezahlen sticky ──────────────── */
.qr-wrap svg { display: block; }
@media (max-width: 560px) {
    /* Bezahlen immer erreichbar, auch bei langem Bon */
    .bezahlen { position: sticky; bottom: 8px; z-index: 5; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
}

/* =========================================================================
   Ansicht-Umschalter · Kompakt-Preis · Übersichtsmodus · fixe Summenleiste
   ========================================================================= */
.tb-view { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font-size: 13px; line-height: 1; cursor: pointer; flex: 0 0 auto; white-space: nowrap; }
.tb-view:hover { background: rgba(255,255,255,.3); }

/* Kompakt-Preis je Bon-Zeile: „3,99 € zzgl. 3,30 Pfand" — standardmäßig aus
   (Desktop zeigt die Spalten Einzel/Pfand/Gesamt). */
.li-cprice { display: none; }
.li-cprice .zzgl { display: block; font-size: 10px; color: var(--muted); font-weight: 400; line-height: 1.15; }

/* --- Übersicht / Kompaktmodus (pro Gerät gespeichert) --- */
body.compact .bon-head { display: none; }
body.compact .bon-row { grid-template-columns: 1fr auto auto; gap: 8px; padding: 8px 12px; align-items: center; }
body.compact .bon-row > div:nth-child(1) { grid-column: 1; min-width: 0; }
body.compact .bon-row > div:nth-child(2) { grid-column: 2; }
body.compact .bon-row > div:nth-child(3),
body.compact .bon-row > div:nth-child(4),
body.compact .bon-row > div:nth-child(5) { display: none; }
body.compact .li-cprice { display: block; grid-column: 3; text-align: right; white-space: nowrap; }
body.compact .li-name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.compact .li-name .gb { display: none; }   /* Badges (MHD/Auftrag/…) weg */
body.compact .li-sub { display: none; }         /* ArtNr/EAN-Zeile weg */
body.compact .gb-detail { display: none; }      /* Gebindeauswahl/Rabatt/MHD weg */
body.compact .stepper button { display: none; } /* nur Mengenzahl, kein +/− */
body.compact .stepper { min-width: auto; }
body.compact .stepper [data-qa=num] { font-weight: 600; }

/* --- Handy: Ware+Pfand kompakt statt Gesamt, Summen fix am unteren Rand --- */
@media (max-width: 560px) {
    /* Kompakt-Nebeneinander (Desktop/Tablet) aufheben: Zählung im Fluss, #pos-bottombar
       wird wieder ein echtes Element und weiter unten als fixe Leiste positioniert. */
    .fixed-top-row { display: block; }
    .fixed-top-row > #pos-bottombar { display: flex; }
    .bon-row > div:nth-child(5) { display: none; }             /* Gesamt-Spalte */
    .li-cprice { display: block; grid-column: 2; align-self: center; text-align: right; }

    #pos-bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0;
                     background: var(--white); box-shadow: 0 -3px 14px rgba(0,0,0,.18);
                     padding: 6px 10px 8px; display: flex; gap: 8px; align-items: stretch; }
    #pos-bottombar .totals { flex: 1; padding: 4px 6px; border: 0; box-shadow: none; }
    #pos-bottombar .totals .row { padding: 2px 0; font-size: 12px; }
    #pos-bottombar .totals .row.sub { display: none; }         /* Pfanddifferenz spart Platz */
    #pos-bottombar .totals .grand { margin-top: 4px; padding-top: 6px; }
    #pos-bottombar .totals .grand b { font-size: 20px; }
    #pos-bottombar .bezahlen { position: static; margin: 0; box-shadow: none;
                               flex: 0 0 42%; align-self: center; }
    body { padding-bottom: 150px; }                            /* Platz für die fixe Leiste */
    .tb-view .tv-label { display: none; }                      /* nur Symbol in der Topbar */
}
