/* Kasse – Farben aus der Android-App: Tannengrün + Orange */
:root {
  --bg: #f2f5f4; --panel: #ffffff; --sunk: #e9efed; --ink: #13231e; --ink2: #3b4c46; --muted: #63736d; --line: #dbe3e0;
  --brand: #1f6f5c; --brand-ink: #ffffff; --brand-strong: #15503f; --brand-soft: #e3f1ec; --accent: #e8833a;
  --ok: #1d7a4a; --warn: #9a5b00; --warn-bg: #fff1dc; --bad: #b4232c; --bad-bg: #fde7e8;
  --tile: #ffffff; --shadow: 0 1px 2px rgba(15, 40, 32, .06), 0 4px 14px -8px rgba(15, 40, 32, .25);
  --r: 12px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1513; --panel: #16201d; --sunk: #1d2925; --ink: #e5eeea; --ink2: #bfccc7; --muted: #8fa29b; --line: #2a3833;
    --brand: #47ac92; --brand-ink: #062019; --brand-strong: #6cc3ab; --brand-soft: #1b3730; --accent: #f0a060;
    --ok: #5cc48d; --warn: #f2b45a; --warn-bg: #3a2b12; --bad: #f07a80; --bad-bg: #3d1c1f;
    --tile: #1b2623; --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1513; --panel: #16201d; --sunk: #1d2925; --ink: #e5eeea; --ink2: #bfccc7; --muted: #8fa29b; --line: #2a3833;
  --brand: #47ac92; --brand-ink: #062019; --brand-strong: #6cc3ab; --brand-soft: #1b3730; --accent: #f0a060;
  --ok: #5cc48d; --warn: #f2b45a; --warn-bg: #3a2b12; --bad: #f07a80; --bad-bg: #3d1c1f;
  --tile: #1b2623; --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: 1.55rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; }
h3.sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
p { margin: 0 0 10px; }
a { color: var(--brand); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.mono { font-family: var(--mono); font-size: .85rem; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nowrap { white-space: nowrap; }
.loading { color: var(--muted); padding: 32px 16px; text-align: center; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Bedienelemente ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink);
  font: 600 .95rem var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; touch-action: manipulation;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.danger { color: var(--bad); }
.btn.primary.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn.small { min-height: 34px; padding: 0 11px; font-size: .85rem; border-radius: 8px; }
.btn.big { min-height: 54px; font-size: 1.1rem; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn .ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.link { background: none; border: 0; padding: 4px 0; color: var(--brand); font: 600 .9rem var(--font); cursor: pointer; text-decoration: none; }
.link.center { display: block; margin: 8px auto 0; }
.icon-btn { width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--sunk); color: var(--bad); }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  min-height: 44px; padding: 8px 12px; width: 100%;
}
input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
input:disabled { background: var(--sunk); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); margin: 0; flex: none; }
input[type=date] { width: auto; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--ink2); }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.inline { display: flex; gap: 8px; align-items: stretch; }
.inline input { flex: 1; min-width: 0; }
.hint { font-size: .85rem; color: var(--muted); margin: 4px 0 8px; }
.form-error { color: var(--bad); background: var(--bad-bg); border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: .92rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid2 .span2 { grid-column: 1 / -1; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 6px; margin: 4px 0 14px; }
.box legend { font-weight: 700; font-size: .85rem; padding: 0 6px; color: var(--ink2); }
.readonly { margin: 10px 0 0; font-weight: 600; }
.dim { opacity: .45; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink2); border-radius: 999px;
  min-height: 36px; padding: 0 14px; font: 600 .88rem var(--font); cursor: pointer;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.seg { display: flex; background: var(--sunk); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; min-height: 44px; border-radius: 9px; font: 700 1rem var(--font); color: var(--ink2); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--brand); box-shadow: var(--shadow); }
.seg.small { margin: 0; padding: 3px; } .seg.small button { min-height: 34px; font-size: .85rem; padding: 0 12px; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--sunk); color: var(--ink2); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.tag { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 6px; background: var(--sunk); color: var(--ink2); margin: 2px 4px 2px 0; }

/* ---------- Kopfzeile ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; flex: none; }
.brand.big { font-size: 1.4rem; margin-bottom: 16px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 8px 12px; border-radius: 8px; color: var(--ink2); text-decoration: none; font-weight: 600; font-size: .93rem; }
.tabs a:hover { background: var(--sunk); }
.tabs a.active { background: var(--brand-soft); color: var(--brand); }
.who { display: flex; align-items: center; gap: 8px; flex: none; }
.me { color: var(--ink2); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me.active { border-color: var(--brand); color: var(--brand); }
.net { font-size: .78rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); white-space: nowrap; }
.net.off { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 760px) {
  .top { flex-wrap: wrap; row-gap: 6px; }
  .tabs { order: 3; flex-basis: 100%; margin: 0 -8px; padding: 0 4px; }
  .who { margin-left: auto; }
}

/* ---------- Seiten ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right)) calc(40px + var(--safe-b)) max(16px, env(safe-area-inset-left)); }
.page.narrow { max-width: 640px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.page-head > p { margin: 0; flex-basis: 100%; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar.wrap { flex-wrap: wrap; }
.toolbar > input[type=search] { max-width: 340px; }
.toolbar .spacer { flex: 1; }
.dates { display: flex; align-items: center; gap: 6px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; min-width: 0; }
.panel > h2, .panel-head { margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-head h2 { margin: 0; }
details.panel > summary { cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: '▸ '; color: var(--muted); }
details.panel[open] > summary::before { content: '▾ '; }
.inline-h { display: inline; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--r); }
.empty.small { padding: 20px 8px; border: 0; background: none; }
.notice { display: block; background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; text-decoration: none; }
.range-title { margin: -4px 0 10px; font-weight: 600; }
.scroll { overflow-x: auto; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi > span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi strong.mid { font-size: 1.15rem; }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi.hero { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.kpi.hero > span, .kpi.hero small { color: inherit; opacity: .85; }
.kpi.hero strong { font-size: 1.9rem; }

.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .act { text-align: right; white-space: nowrap; width: 1%; }
.table .act .btn + .btn { margin-left: 4px; }
.table .sel { width: 36px; }
.table.click tbody tr { cursor: pointer; }
.table.click tbody tr:hover td { background: var(--sunk); }
#list > .table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.big-num { font-size: 1.1rem; font-weight: 700; }
.show-sm { display: none; }
@media (max-width: 640px) { .hide-sm { display: none; } .show-sm { display: block; } }
.qty-in { width: 84px; min-height: 38px; text-align: right; padding: 4px 8px; }

.sale-list { list-style: none; margin: 0; padding: 0; }
.sale-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.sale-list li:last-child { border-bottom: 0; }
.sale-list li.cancelled > div > strong, .sale-list li.cancelled > div > .muted.small { text-decoration: line-through; opacity: .6; }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: min(320px, 86vw); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
button.card { text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.card:hover { border-color: var(--brand); }
.card.inactive { opacity: .6; }
.u-head { display: flex; gap: 8px; align-items: center; margin-bottom: 2px; }
.u-perms { margin-top: 8px; }
.perms .presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.perms .presets .chip { min-height: 30px; font-size: .8rem; }
.perm { align-items: flex-start; }
.perm span { display: flex; flex-direction: column; }
.perm small { color: var(--muted); }
.perm.admin { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.perm input:disabled + span { opacity: .6; }

/* ---------- Anmeldung ---------- */
.center-card { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.center-card .card { width: 100%; max-width: 400px; padding: 24px; box-shadow: var(--shadow); }
.auth h1 { margin-bottom: 8px; }
.auth .btn { margin-top: 8px; }

/* ---------- Kasse ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100dvh - 57px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; padding: 14px 16px 0; gap: 10px; }
.pos-bar { display: flex; gap: 8px; }
.pos-bar .search { flex: 1; min-width: 0; }
.tiles { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: min-content; gap: 10px; padding: 2px 2px 16px; align-content: start; }
.tiles .empty { grid-column: 1 / -1; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 92px; padding: 12px;
  background: var(--tile); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-align: left; font: inherit; cursor: pointer;
  box-shadow: var(--shadow); touch-action: manipulation; user-select: none;
}
.tile:hover { border-color: var(--brand); }
.tile:active { transform: scale(.97); background: var(--brand-soft); }
.t-name { font-weight: 650; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.t-price { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--brand); }
.tile .badge { position: absolute; right: 8px; bottom: 10px; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
.t-qty { position: absolute; top: -7px; right: -7px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--accent); color: #fff; font-weight: 800; font-size: .85rem; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }

.cart { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cart-mini { display: none; }
.cart-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; }
.lines { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 1; }
.line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.line:hover { background: var(--sunk); }
.l-main { display: flex; flex-direction: column; min-width: 0; }
.l-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-sub { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.l-qty { display: flex; align-items: center; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.l-qty span { min-width: 22px; text-align: center; }
.qbtn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 1.15rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.qbtn:active { background: var(--brand-soft); }
.l-sum { font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }
.cart-foot { padding: 12px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.total strong { font-size: 1.9rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
@keyframes pulse { from { background: var(--brand-soft); } to { background: transparent; } }
.pulse, .pulse td { animation: pulse .9s ease-out; }

@media (max-width: 860px) {
  .pos { display: block; height: auto; }
  .pos-left { padding: 12px 12px 0; }
  .tiles { overflow: visible; padding-bottom: calc(96px + var(--safe-b)); grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
  .tile { min-height: 84px; padding: 10px; }
  .pos-bar .btn { padding: 0 12px; }
  .pos-bar #cam span { display: none; }
  .cart { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border: 0; border-top: 1px solid var(--line); box-shadow: 0 -6px 24px -12px rgba(0, 0, 0, .3); border-radius: 16px 16px 0 0; max-height: 78dvh; }
  .cart-mini { display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); }
  .cart.open .cart-mini { padding-bottom: 10px; }
  .cart-toggle { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); color: var(--ink); font: 600 .95rem var(--font); cursor: pointer; }
  .cart-toggle strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
  .cart-toggle::after { content: '▴'; color: var(--muted); margin-left: 4px; }
  .cart.open .cart-toggle::after { content: '▾'; }
  .cart-mini .btn { min-height: 48px; }
  .cart-body { display: none; }
  .cart.open .cart-body { display: flex; }
  .cart.open .cart-mini .btn { display: none; }
  .cart-head { padding-top: 4px; }
}

/* ---------- Dialoge ---------- */
dialog.dlg { border: 0; padding: 0; border-radius: 16px; background: var(--panel); color: var(--ink); width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45); }
dialog.dlg.wide { width: min(640px, calc(100vw - 24px)); }
dialog.dlg::backdrop { background: rgba(8, 20, 16, .5); }
dialog.dlg form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
dialog.dlg header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px; }
dialog.dlg header h2 { font-size: 1.15rem; }
dialog.dlg .x { border: 0; background: transparent; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; width: 36px; height: 36px; border-radius: 8px; }
dialog.dlg .x:hover { background: var(--sunk); }
.dlg-body { padding: 8px 18px; overflow-y: auto; }
dialog.dlg footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; flex-wrap: wrap; }
dialog.dlg footer .btn.danger:first-child { margin-right: auto; }
dialog.dlg.busy footer .btn { opacity: .6; pointer-events: none; }
@media (max-width: 560px) {
  dialog.dlg, dialog.dlg.wide { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  dialog.dlg form { max-height: 92dvh; }
  dialog.dlg footer { padding-bottom: calc(16px + var(--safe-b)); }
  dialog.dlg footer .btn { flex: 1; }
  .grid2 { grid-template-columns: 1fr; }
}
.pay-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.pay-total strong { font-size: 2.2rem; font-variant-numeric: tabular-nums; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.quick .btn { flex: 1; }
.change { display: flex; justify-content: space-between; align-items: baseline; background: var(--brand-soft); border-radius: 10px; padding: 10px 14px; }
.change strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; color: var(--brand); }
.change strong.neg { color: var(--bad); }
.pay-dlg input[name=given] { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.big-change { font-size: 3rem; font-weight: 800; text-align: center; margin: 8px 0 12px; color: var(--brand); font-variant-numeric: tabular-nums; }

.barcode-preview { margin-top: 6px; }
.barcode-preview svg { width: 190px; height: auto; display: block; border-radius: 4px; }

.count-panel .count-bar { display: flex; gap: 8px; }
.suggest { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; }
.suggest button { width: 100%; text-align: left; background: none; border: 0; padding: 10px; border-radius: 8px; font: inherit; color: var(--ink); cursor: pointer; }
.suggest button:hover { background: var(--sunk); }
.intro form { margin-top: 12px; max-width: 560px; }

/* ---------- Diagramm ---------- */
.chart { position: relative; }
.chart svg { display: block; overflow: visible; max-width: 100%; }
.chart .bar { fill: var(--brand); }
.chart .hit { fill: transparent; }
.chart .hit:hover + * { opacity: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.chart .base { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: .82rem; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-empty { padding: 24px 0; text-align: center; }

/* ---------- Scanner ---------- */
.scanner { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; display: flex; flex-direction: column; }
.scan-top, .scan-bottom { padding: max(12px, env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(0, 0, 0, .55); z-index: 2; }
.scan-bottom { flex-direction: column; align-items: stretch; padding: 12px 16px calc(14px + var(--safe-b)); }
.scan-actions { display: flex; gap: 8px; }
.btn.ghost-light { background: rgba(255, 255, 255, .14); border-color: transparent; color: #fff; }
.btn.ghost-light.on { background: #fff; color: #000; }
.scan-view { position: relative; flex: 1; overflow: hidden; }
.scan-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 50%; top: 50%; width: min(82vw, 520px); height: min(34vh, 240px); transform: translate(-50%, -50%); border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); outline: 3px solid rgba(255, 255, 255, .85); }
.scan-frame span { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.scanner.flash .scan-frame { animation: flash .5s ease-out; }
@keyframes flash { from { outline-color: #5cdd9b; outline-width: 6px; } }
.scan-msg { margin: 0 0 10px; text-align: center; font-weight: 600; min-height: 1.4em; }
.scan-manual { display: flex; gap: 8px; }
.scan-manual input { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.scan-manual input::placeholder { color: rgba(255, 255, 255, .6); }

/* ---------- Meldung ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 200; opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .18s, transform .18s; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--bad); color: #fff; }
#toast.warn { background: var(--warn-bg); color: var(--warn); }
main[data-view="kasse"] ~ #toast, body:has(main[data-view="kasse"]) #toast { bottom: calc(96px + var(--safe-b)); }
@media (min-width: 861px) { body:has(main[data-view="kasse"]) #toast { bottom: 24px; left: calc(50% - 180px); } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Etiketten drucken ---------- */
#print { display: none; }
@media print {
  @page { margin: 8mm; }
  body > *:not(#print) { display: none !important; }
  body { background: #fff; }
  #print { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .label { border: 1px dashed #bbb; border-radius: 2mm; padding: 2.5mm 3mm; break-inside: avoid; color: #000; text-align: center; font-family: var(--font); }
  .lbl-name { font-weight: 700; font-size: 10pt; line-height: 1.2; height: 2.4em; overflow: hidden; }
  .lbl-price { font-weight: 800; font-size: 13pt; margin: 1mm 0; }
  .label svg { width: 100%; max-width: 46mm; height: auto; }
}
