@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(fonts/IBMPlexSans-Regular.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(fonts/IBMPlexSans-Medium.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(fonts/IBMPlexSans-SemiBold.woff2) format("woff2"); }

:root {
  --bg: #f4f5f8; --surface: #fff; --ink: #0d1117; --muted: #586070; --line: #dde1e9; --soft: #eef0f5;
  --accent: #2a49ee; --accent-ink: #fff; --accent-soft: #e6eaff;
  --ok: #1f8a5b; --ok-soft: #e3f5ec; --warn: #8a6100; --warn-soft: #fff3cd; --bad: #c03535; --bad-soft: #fde8e8;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; --mono: ui-monospace, Consolas, monospace;
  --radius: 12px;
  --age-ok: #5fd59b; --age-warn: #f0c24f; --age-bad: #ff8a8a;
}
/* Dunkel: nach Geräteeinstellung, außer in den Einstellungen ist für dieses Gerät „Hell“ oder „Dunkel“ gewählt (html[data-theme]) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --bg: #0a0c11; --surface: #121620; --ink: #e9ecf3; --muted: #98a0b2; --line: #232a38; --soft: #171c28;
    --accent: #7d92ff; --accent-ink: #0a0c11; --accent-soft: #1a2142; --ok-soft: #12301f; --warn-soft: #33290a; --bad-soft: #3a1515; --ok: #5fd59b; --warn: #f0c24f; --bad: #ff8a8a;
    --age-ok: #1f8a5b; --age-warn: #b07d00; --age-bad: #c03535; }
}
:root[data-theme="dark"] { color-scheme: dark; --bg: #0a0c11; --surface: #121620; --ink: #e9ecf3; --muted: #98a0b2; --line: #232a38; --soft: #171c28;
  --accent: #7d92ff; --accent-ink: #0a0c11; --accent-soft: #1a2142; --ok-soft: #12301f; --warn-soft: #33290a; --bad-soft: #3a1515; --ok: #5fd59b; --warn: #f0c24f; --bad: #ff8a8a;
  --age-ok: #1f8a5b; --age-warn: #b07d00; --age-bad: #c03535; }
:root[data-theme="light"] { color-scheme: light; }
/* Logo in der Kopfzeile folgt der gewählten Darstellung (das SVG selbst kennt nur die Geräteeinstellung) */
.brand-logo { width: 28px; height: 28px; flex: 0 0 auto; background: var(--ink); -webkit-mask: url(favicon.svg) center / contain no-repeat; mask: url(favicon.svg) center / contain no-repeat; }
/* Umschalter Hell/Dunkel */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--soft); flex-wrap: wrap; }
.seg label { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 9px; font: 600 14px/1 var(--font); color: var(--muted); cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; } /* bleibt im Knopf, sonst wird die Seite breiter */
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
/* Als App (Home-Bildschirm): Platz für Statusleiste und Notch */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
h1 { font-size: 26px; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0; }
textarea { resize: vertical; min-height: 64px; }
input[type="checkbox"] { width: auto; }
label { display: grid; gap: 5px; font-weight: 500; font-size: 13px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 14px/1 var(--font); padding: 10px 15px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn.sm { padding: 7px 11px; font-size: 13px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.wa svg { color: #25d366; }
.btn.danger-ghost { background: var(--surface); border-color: var(--line); color: var(--bad); }
.btn:disabled { opacity: .55; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.msg { color: var(--bad); margin: 0; }
.msg:empty { display: none; }

/* Anmeldung */
/* Handy: schwarze Fläche mit Logo oben, Formular als helles Blatt unten in Daumennähe. Rechner: beides nebeneinander in einer Karte */
.login:not([hidden]) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #0d1117; }
.login-hero { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: max(48px, env(safe-area-inset-top)) 28px 36px; color: #fff; }
.login-logo { width: 56px; height: 56px; margin-bottom: 18px; background: #fff; -webkit-mask: url(favicon.svg) center / contain no-repeat; mask: url(favicon.svg) center / contain no-repeat; }
.login-hero h1 { font-size: 40px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.login-hero p { margin: 0; font-size: 17px; color: rgba(255, 255, 255, .68); }
.login-box { display: grid; gap: 16px; background: var(--surface); border-top: 1px solid var(--line); border-radius: 24px 24px 0 0; padding: 28px 24px max(24px, env(safe-area-inset-bottom)); }
.login-box h2 { font-size: 22px; }
.login-box p { margin: 0; }
.login-box input { height: 50px; font-size: 16px; }
.field { display: grid; gap: 5px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 96px; }
.pw-toggle { position: absolute; top: 5px; right: 5px; bottom: 5px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--soft); color: var(--ink); font: 600 13px/1 var(--font); cursor: pointer; }
.login-go { height: 52px; font-size: 16px; }
@media (min-width: 721px) {
  .login:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 400px; width: min(880px, calc(100% - 48px)); min-height: 0; margin: max(12vh, 24px) auto; border-radius: 24px; overflow: hidden; box-shadow: 0 1px 0 var(--line); }
  .login-hero { padding: 40px; min-height: 480px; }
  .login-hero h1 { font-size: 48px; }
  .login-box { align-content: center; border-radius: 0; padding: 40px; border: 1px solid var(--line); border-left: 0; border-radius: 0 24px 24px 0; }
}

/* Kopfleiste */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 15px; white-space: nowrap; }
.brand b { font-weight: 600; }
.tabs { display: flex; gap: 2px; margin-right: auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { font: 600 14px/1 var(--font); padding: 10px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); background: var(--soft); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.who { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
@media (max-width: 1080px) { .brand span { display: none; } .who #who { display: none; } }
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; gap: 8px 12px; padding: 8px 16px; }
  .tabs { order: 3; width: 100%; margin: 0 -4px; }
  .who { margin-left: auto; }
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 80px; outline: none; }
/* Breitbild (16:9, Full HD und größer): die Breite nutzen statt schmaler Spalte in der Mitte */
@media (min-width: 1400px) { .wrap { max-width: none; padding: 28px clamp(24px, 3vw, 56px) 80px; } }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.head p { margin: 4px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tools input[type="search"] { flex: 1 1 260px; width: auto; }
.tools select { width: auto; }
.back { display: inline-block; margin-bottom: 8px; font-size: 14px; text-decoration: none; }

/* Karten und Kennzahlen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card, .card + .grid2, .grid2 + .card { margin-top: 14px; }
.card > h2 { margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; text-decoration: none; color: inherit; }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat.bad b { color: var(--bad); }
.stat.accent { border-color: var(--accent); }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: span 4; } .span6 { grid-column: 1 / -1; }
@media (max-width: 860px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr 1fr; } .form-grid > * { grid-column: span 2; } .form-grid > .half { grid-column: span 1; } }

/* Tabellen */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 600 12px/1.2 var(--font); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--soft); }
td.wrapcell { min-width: 180px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.more { padding: 10px 12px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

.pill { display: inline-block; font: 600 12px/1 var(--font); padding: 5px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* Rechnungs-Editor */
.editor { display: grid; gap: 14px; }
.cust-pick { position: relative; }
.suggest { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgb(0 0 0 / .14); max-height: 340px; overflow-y: auto; }
.suggest button { display: grid; gap: 2px; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; cursor: pointer; }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.active { background: var(--accent-soft); }
.suggest small { color: var(--muted); }
.cust-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--soft); border-radius: 10px; white-space: pre-line; }

.lines { display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: 28px minmax(0, 1fr) 82px 86px 120px 76px 110px 34px; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.line.text { grid-template-columns: 28px minmax(0, 1fr) 34px; background: var(--soft); }
.line .pos { color: var(--muted); font-size: 13px; padding-top: 10px; text-align: center; }
.line .stack { display: grid; gap: 6px; min-width: 0; }
.line textarea[data-f="description"] { min-height: 38px; font-size: 14px; line-height: 1.45; }
@media print { .bar, .head .actions, .tools, .toast { display: none !important; } body { background: #fff; } .wrap { padding: 0; } }
.line .amount { padding-top: 10px; text-align: right; font-weight: 600; }
.line .rm { width: 34px; height: 38px; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; border-radius: 8px; }
.line .rm:hover { background: var(--bad-soft); color: var(--bad); }
.line .move { display: grid; gap: 2px; }
.line .move button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px; }
.line .tag { font-size: 12px; color: var(--muted); }
.line-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) 82px 86px 120px 76px 110px 34px; gap: 8px; padding: 0 10px; font: 600 12px/1.2 var(--font); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
@media (max-width: 860px) {
  .line-head { display: none; }
  .line { grid-template-columns: 1fr 1fr 1fr; }
  .line .pos, .line .move { display: none; }
  .line .stack { grid-column: 1 / -1; }
  .line .amount { grid-column: span 2; }
  .line.text { grid-template-columns: 1fr 34px; }
  .line.text .stack { grid-column: auto; }
  .line [data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
}
.add-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.add-line .cust-pick { flex: 1 1 320px; }
.totals { display: grid; gap: 6px; margin-left: auto; width: min(360px, 100%); font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; gap: 16px; }
.totals .sum { font-size: 18px; font-weight: 600; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; }
@media (max-height: 640px), (max-width: 600px) { .sticky-actions { position: static !important; } }
@media (max-width: 600px) { .cust-card { flex-direction: column; } .sticky-actions .btn { flex: 1 1 45%; } .doc-head .actions .btn { flex: 1 1 45%; } }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }

/* Belegansicht */
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; }
.doc-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.addr { white-space: pre-line; }
.related { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.related li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.log { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 6px; }
.log li { display: flex; gap: 12px; }
.log time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.note.info { background: var(--accent-soft); color: var(--accent); }
.done-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 14px 16px; border-radius: 12px;
  background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.done-box b { font-size: 16px; } .done-box .small { color: var(--ink); margin-top: 2px; }

/* Dialog */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgb(0 0 0 / .3); }
dialog::backdrop { background: rgb(10 12 17 / .5); }
#dlg-form { display: grid; gap: 14px; padding: 22px; max-height: calc(100vh - 40px); overflow-y: auto; }
#dlg-form .actions { justify-content: flex-end; margin-top: 4px; }
dialog.wide { width: min(860px, calc(100vw - 24px)); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 10px; font-weight: 500; box-shadow: 0 12px 32px rgb(0 0 0 / .25); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
details.lines-detail summary { cursor: pointer; color: var(--accent); }
.mini { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }

/* Kassenterminal */
body.pos-mode .bar { display: none; }
body.pos-mode .wrap { max-width: none; padding: 0; }
.pos { height: 100vh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.pos-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pos-top-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.pos-main { display: grid; grid-template-columns: 1fr minmax(320px, 400px); min-height: 0; }
.pos-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); grid-auto-rows: 96px; gap: 10px; padding: 14px; overflow-y: auto; align-content: start; }
.pos-keys .empty { grid-column: 1 / -1; }
.pos-key { --k: #2a49ee; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left; padding: 10px 12px; border: 0; border-radius: 12px;
  background: var(--k); color: #fff; font: 600 16px/1.2 var(--font); cursor: pointer; box-shadow: 0 2px 0 rgb(0 0 0 / .18); touch-action: manipulation; user-select: none; overflow: hidden; }
.pos-key span { overflow-wrap: anywhere; }
.pos-key small { font-size: 14px; opacity: .9; font-variant-numeric: tabular-nums; }
.pos-key:active { transform: translateY(1px); box-shadow: none; filter: brightness(.92); }
.pos-key.add { background: var(--surface); color: var(--accent); border: 2px dashed var(--accent); box-shadow: none; }
.pos-side { display: grid; grid-template-rows: auto 1fr auto auto auto auto; gap: 8px; padding: 12px; background: var(--surface); border-left: 1px solid var(--line); min-height: 0; }
.pos-cust { font-size: 14px; }
.pos-lines { overflow-y: auto; min-height: 80px; border: 1px solid var(--line); border-radius: 10px; }
.pos-line { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pos-line small { display: block; color: var(--muted); font-size: 13px; }
.pos-line-r { display: grid; justify-items: end; gap: 4px; }
.pos-line-r button { width: 30px; height: 28px; margin-left: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 16px; cursor: pointer; }
.pos-entry { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 6px; min-height: 30px; font-size: 20px; }
.pos-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pos-pad button { height: 46px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); color: var(--ink); font: 600 18px var(--font); cursor: pointer; touch-action: manipulation; }
.pos-pad button.wide { grid-column: 1 / -1; font-size: 15px; }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 4px; border-top: 2px solid var(--ink); font-size: 18px; }
.pos-total b { font-size: 28px; }
.pos-pay { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.pos-pay .btn { height: 58px; font-size: 18px; }
.pos-due, .pos-change { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.pos-due b, .pos-change b { font-size: 26px; }
.pos-change.big b { font-size: 40px; color: var(--ok); }
.pos-colors { display: flex; gap: 6px; flex-wrap: wrap; }
.pos-colors label { display: block; }
.pos-colors input { position: absolute; opacity: 0; }
.pos-colors span { display: block; width: 30px; height: 30px; border-radius: 8px; background: var(--k); border: 3px solid transparent; cursor: pointer; }
.pos-colors input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
@media (max-width: 820px) {
  .pos { height: auto; min-height: 100vh; }
  .pos-main { grid-template-columns: 1fr; }
  .pos-keys { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); grid-auto-rows: 80px; }
  .pos-side { border-left: 0; border-top: 1px solid var(--line); }
  .pos-lines { max-height: 40vh; }
}

/* Kategorien */
.cat-chips, .pos-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pos-tabs { padding: 12px 14px 0; margin: 0; }
.chip { font: 600 13px/1 var(--font); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pos-tabs .chip { font-size: 15px; padding: 10px 16px; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.bulk select { width: auto; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cat-list li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.pos-left { display: flex; flex-direction: column; min-height: 0; }
.pos-left .pos-keys { flex: 1; }

/* Benutzer */
fieldset.areas { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 0; }
fieldset.areas legend { font-weight: 600; font-size: 13px; color: var(--muted); padding: 0 6px; }
fieldset.areas .actions { grid-column: 1 / -1; }
@media (max-width: 600px) { fieldset.areas { grid-template-columns: 1fr; } }

/* Drucker */
.pstation { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.pstation-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
textarea.mono { font: 13px/1.4 var(--mono); }

/* Als App (Home-Bildschirm): Platz für Statusleiste und Notch – am Ende, damit es die Angaben oben überschreibt */
.bar { padding-top: max(10px, env(safe-area-inset-top)); }
.pos-top { padding-top: max(8px, env(safe-area-inset-top)); }

/* Eingabefelder nicht kleiner als der Text (Beschriftungen haben 13 px). iPhone zoomt beim Antippen in Felder
   mit weniger als 16 px hinein und bleibt vergrößert – auf dem Handy daher 16 px. */
input, select, textarea { font-size: 15px; }
@media (max-width: 820px) { input, select, textarea { font-size: 16px; } }

/* Häkchen nicht zusammendrücken, wenn der Text daneben lang ist */
label.check input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; }
label.check { align-items: flex-start; } label.check input[type="checkbox"] { margin-top: 3px; }

/* Position ohne Preis hervorheben */
.line input.need { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-soft); }

/* Shop-Artikel bearbeiten */
.shop-edit { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: start; }
.shop-img { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.shop-img-box { width: 160px; height: 160px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: var(--bg); }
.shop-img-box img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 640px) { .shop-edit { grid-template-columns: 1fr; } }
.shop-img-box { cursor: pointer; transition: border-color .15s, background .15s; }
.shop-img-box.drop { border: 2px dashed var(--accent); background: var(--accent-soft); }

/* ===== Handy: App-Bedienung mit Leiste unten ===== */
/* Grundregel: eine Hauptaktion je Seite, nichts liegt über dem Inhalt. Kobalt nur für diese Aktion und den aktiven Reiter. */
.tabbar, .m-only, .m-create, .f-toggle, .a-morebtn { display: none; }
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink);
  padding-bottom: env(safe-area-inset-bottom); }
.sheet::backdrop { background: rgba(10, 14, 25, .45); }
.sheet #sheet-body { padding: 10px 12px 14px; }
.sheet #sheet-body::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 10px; }
.sheet h3 { margin: 4px 10px 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.sheet-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 12px 10px; border: 0; background: none; border-radius: 12px;
  font: 500 17px/1.2 var(--font); color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; }
.sheet-item:active, .sheet-item:hover { background: var(--soft); }
.sheet-item svg { color: var(--ink); flex: 0 0 auto; }
.sheet-item.bad { color: var(--bad); }
.sheet-sep { height: 1px; background: var(--line); margin: 8px 10px; }
.sheet-who { padding: 4px 10px; }
@media (max-width: 720px) {
  /* Kopfzeile: Logo links, „+ Erstellen“ rechts – Name und Abmelden stehen unter „Mehr“ */
  .bar .tabs, .bar #top-pos, .bar #logout, .who #who { display: none; }
  .bar { min-height: 56px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand span { display: inline; }
  .m-create:not([hidden]) { display: inline-flex; min-height: 40px; padding: 0 16px; font-size: 15px; border-radius: 999px; }
  .m-create b { font-size: 19px; font-weight: 400; line-height: 0; }
  body.no-fab .m-create, body.edit-mode .m-create { display: none; }
  .tabbar:not([hidden]) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px 4px max(4px, env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 2px; border: 0; background: none;
    color: var(--muted); font: 500 12px/1.1 var(--font); text-decoration: none; cursor: pointer; min-width: 0; }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .on { color: var(--accent); }
  .tabbar .on svg { stroke-width: 2.2; }
  #app-view:has(.tabbar:not([hidden])) .wrap { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .m-only { display: block; }
  .m-hide { display: none; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 36px; }
  .back { min-height: 32px; padding: 4px 0; }

  /* Start: offener Betrag auf schwarzer Karte (wie das Logo) mit Altersbalken, dann „Heute“, „Zu erledigen“, Schnellzugriff */
  .home-head .actions { display: none; }
  .home-head { margin-bottom: 14px; }
  .m-home { margin-bottom: 18px; }
  .owe { display: grid; gap: 6px; padding: 18px; border-radius: 16px; background: var(--ink); color: var(--bg); text-decoration: none; }
  .owe-label { font-size: 14px; opacity: .75; }
  .owe-sum { font-size: 36px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }
  .owe-bar { display: flex; gap: 3px; height: 8px; margin-top: 8px; }
  .owe-bar i { flex-basis: 0; min-width: 6px; border-radius: 4px; }
  .owe-legend { display: grid; gap: 3px; margin-top: 4px; font-size: 13px; }
  .owe-legend > span { display: flex; align-items: center; gap: 8px; }
  .owe-legend b { margin-left: auto; font-weight: 600; }
  .owe-legend i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
  .owe .ok { background: var(--age-ok); } .owe .warn { background: var(--age-warn); } .owe .bad { background: var(--age-bad); }
  .m-sec { margin: 22px 2px 8px; font-size: 17px; }
  .day { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
  .day > div { display: grid; gap: 2px; padding: 12px 14px; min-width: 0; }
  .day > div + div { border-left: 1px solid var(--line); }
  .day span, .m-rows span { font-size: 13px; color: var(--muted); }
  .day b { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
  .m-rows { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
  .m-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 14px; }
  .m-rows > div + div { border-top: 1px solid var(--line); }
  .m-rows b { font-weight: 600; }
  .todos { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .todo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
  .todo + .todo { border-top: 1px solid var(--line); }
  .todo > a { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; color: inherit; text-decoration: none; }
  .todo > a b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .todo-late { font-size: 13px; color: var(--bad); }
  .todo-side { display: grid; justify-items: end; gap: 6px; }
  .todo-link { min-height: 48px; font-weight: 500; justify-content: space-between; }
  .todo-link::after, .m-links a::after { content: "›"; font-size: 22px; line-height: 1; color: var(--muted); }
  .todo-none { margin: 0; padding: 14px; color: var(--muted); }
  .m-links { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .m-links a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; font-weight: 500; color: var(--ink); text-decoration: none; }
  .m-links a span { flex: 1 1 auto; }
  .m-links a + a { border-top: 1px solid var(--line); }
  .m-links a[hidden] { display: none; }

  /* Belegliste als Karten */
  table.mcards thead { display: none; }
  table.mcards, table.mcards tbody { display: block; }
  table.mcards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cust amt" "meta st" "meta open"; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.mcards td { display: block; padding: 0; border: 0; }
  table.mcards .c-cust { grid-area: cust; font-weight: 600; }
  table.mcards .c-amt { grid-area: amt; font-weight: 600; }
  table.mcards .c-st { grid-area: st; justify-self: end; }
  table.mcards .c-open { grid-area: open; font-size: 12px; color: var(--muted); }
  table.mcards .c-open.c-full { display: none; }
  table.mcards .c-no { grid-area: meta; font-size: 13px; color: var(--muted); }
  table.mcards .c-date { display: none; }
  table.mcards .c-by { display: none; }
  table.mcards .c-no::after { content: " · " attr(data-date); }
  /* Suche und „Filter“ in einer Zeile, die Auswahlfelder klappen darunter auf */
  .tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tools input[type="search"] { grid-column: 1 / -1; }
  .tools:has(.f-toggle) { grid-template-columns: minmax(0, 1fr) auto; }
  .tools:has(.f-toggle) input[type="search"] { grid-column: 1; }
  .tools:has(.f-toggle) > select { display: none; }
  .tools.open:has(.f-toggle) > select { display: block; grid-column: 1 / -1; }
  .f-toggle { display: inline-flex; }
  .tools.open .f-toggle { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .f-count:empty { display: none; }
  .f-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; line-height: 20px; text-align: center; }

  /* Beleg: Betrag groß, Teilen in einer Zeile, Hauptaktion fest unten, Seltenes unter „Weitere …“ */
  .doc-head h1 { font-size: 22px; }
  .doc-head h1 .pill { vertical-align: 4px; }
  .doc-sum { margin: 10px 0 2px; }
  .doc-sum b { display: block; font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
  .doc-sum span { display: block; margin-top: 2px; font-weight: 500; }
  .doc-head > div > p.muted { font-size: 13px; margin-top: 6px; }
  .doc-head .actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .doc-head .actions .btn { flex: 1 1 84px; padding-left: 8px; padding-right: 8px; }
  .doc-head .actions .a-morebtn { flex: 0 0 48px; padding: 0; }
  .doc-head .actions .a-more { display: none; }
  .a-morebtn:not([hidden]) { display: inline-flex; }
  .doc-head .actions .a-main { position: fixed; z-index: 25; left: 0; right: 0; bottom: calc(61px + env(safe-area-inset-bottom)); height: 52px; margin: 0; border-radius: 0;
    font-size: 16px; box-shadow: 0 -1px 0 var(--line); }
  #app-view:has(.a-main) .wrap { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
}

/* ===== Kassenterminal auf dem Handy ===== */
.m-only-i { display: none; }
.pos-foot { display: grid; gap: 8px; }
.pos-side { grid-template-rows: auto 1fr auto auto auto; }
.pos-key span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 720px) {
  .m-only-i { display: inline; }
  .pos-menu.m-only-i { display: inline-flex; margin-left: auto; }
  .d-only { display: none; }
  .pos-top { gap: 8px; }
  .pos-top-actions { display: none; }
  .pos-keys { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); grid-auto-rows: minmax(72px, auto); gap: 8px; padding: 10px; }
  .pos-key { font-size: 15px; padding: 8px 10px; }
  .pos-key span { -webkit-line-clamp: 2; }
  .pos-key small { font-size: 13px; }
  .pos-tabs { overflow-x: auto; flex-wrap: nowrap; padding: 10px 10px 0; }
  .pos-tabs .chip { flex: 0 0 auto; font-size: 14px; padding: 8px 12px; }
  .pos-entry { align-items: center; gap: 10px; }
  .pos-entry #p-entry { margin-left: auto; }
  .pos-entry .btn.m-only-i { display: inline-flex; }
  .pos-side:not(.pad-open) .pos-pad { display: none; }
  .pos-pad button { height: 44px; }
  .pos-lines { max-height: none; }
  .pos-foot { position: sticky; bottom: 0; z-index: 5; background: var(--surface); margin: 0 -12px -12px; padding: 8px 12px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0, 0, 0, .06); }
  .pos-foot .pos-total { border-top: 0; padding: 0 4px; }
  .pos-foot .pos-total b { font-size: 24px; }
  .pos-pay .btn { height: 52px; }
}
.pos-key span { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }

/* Handy: Rechnung schreiben – Positionen vor den Angaben; unten eine Zeile mit Summe, Vorschau und Ausstellen (Leiste unten ausgeblendet) */
@media (max-width: 720px) {
  .card { padding: 14px; }
  .editor > * { order: 3; }
  .editor > .c-cust { order: 1; }
  .editor > .c-lines { order: 2; }
  .editor > .sticky-actions { order: 9; position: sticky !important; bottom: 0; z-index: 10; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
    margin: 0 -16px; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0, 0, 0, .06); }
  .editor > .sticky-actions .sa-sum { display: grid; line-height: 1.15; min-width: 0; }
  .editor > .sticky-actions .sa-sum span { font-size: 12px; color: var(--muted); }
  .editor > .sticky-actions .sa-sum b { font-size: 19px; font-weight: 600; white-space: nowrap; }
  .editor > .sticky-actions .btn { height: 48px; padding: 0 14px; font-size: 15px; }
  .editor > .sticky-actions #issue { padding: 0 18px; }
  .editor > .ed-extra { order: 10; display: flex; gap: 8px; flex-wrap: wrap; }
  .editor > .ed-extra .btn { flex: 1 1 40%; }
  body.edit-mode #app-view .wrap { padding-bottom: calc(24px + var(--tabbar-h, 60px)); }
  body.edit-mode #app-view:has(.tabbar:not([hidden])) .editor > .sticky-actions { bottom: var(--tabbar-h, 60px); padding-bottom: 10px; }
}

/* Handy: Kassenbuch */
@media (max-width: 720px) {
  .k-more { display: none; }
  #k-morebtn { display: inline-flex; grid-column: 1 / -1; }
  table.kcards thead { display: none; }
  table.kcards, table.kcards tbody { display: block; }
  table.kcards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kind amt" "text text" "meta bal" "act act"; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.kcards td { display: block; padding: 0; border: 0; white-space: normal !important; }
  table.kcards td:empty, table.kcards .k-no, table.kcards .k-by { display: none; }
  table.kcards .k-kind { grid-area: kind; font-weight: 600; }
  table.kcards .k-in, table.kcards .k-out { grid-area: amt; font-weight: 600; }
  table.kcards .k-in { color: var(--ok); }
  table.kcards .k-out::before { content: "− "; }
  table.kcards .k-text { grid-area: text; }
  table.kcards .k-date { grid-area: meta; font-size: 13px; color: var(--muted); }
  table.kcards .k-date::after { content: " · " attr(data-no); }
  table.kcards .k-bal { grid-area: bal; font-size: 13px; color: var(--muted); }
  table.kcards .k-act { grid-area: act; text-align: left; margin-top: 6px; }
}
@media (max-width: 720px) { .stat { padding: 12px 14px; align-content: start; } .stat b { font-size: 19px; } .stat span { font-size: 12px; } .stats { margin-bottom: 12px; }
  .k-acts { display: grid; grid-template-columns: 1fr 1fr; width: 100%; } .k-acts .btn.primary { grid-column: 1 / -1; order: -1; } }

/* Handy: Kundenliste als Karten */
@media (max-width: 720px) {
  table.ccards thead { display: none; }
  table.ccards, table.ccards tbody { display: block; }
  table.ccards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name nr" "city contact"; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.ccards td { display: block; padding: 0; border: 0; }
  table.ccards .c-name { grid-area: name; font-weight: 600; }
  table.ccards .c-name .muted { font-weight: 400; }
  table.ccards .c-nr { grid-area: nr; font-size: 13px; color: var(--muted); }
  table.ccards .c-city { grid-area: city; font-size: 13px; color: var(--muted); }
  table.ccards .c-contact { grid-area: contact; font-size: 13px; color: var(--muted); max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 720px) { table.ccards .c-nr, table.ccards .c-contact { justify-self: end; text-align: right; } }

/* Handy: Artikellisten als Karten, Kategorien seitlich wischen */
@media (max-width: 720px) {
  .cat-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .cat-chips .chip { flex: 0 0 auto; }
  table.icards thead { display: none; }
  table.icards, table.icards tbody { display: block; }
  table.icards tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "sel name vk" "sel meta stock"; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: start; }
  table.icards td { display: block; padding: 0; border: 0; }
  table.icards td:empty, table.icards .i-unit, table.icards .i-ek, table.icards .i-cat .muted { display: none; }
  table.icards .i-sel { grid-area: sel; padding-top: 2px; }
  table.icards .i-name { grid-area: name; font-weight: 600; }
  table.icards .i-name .muted { font-weight: 400; }
  table.icards .i-vk { grid-area: vk; font-weight: 600; }
  table.icards .i-sku { grid-area: meta; font-size: 13px; color: var(--muted); }
  table.icards .i-cat { grid-area: meta; justify-self: end; margin-right: 0; display: none; }
  table.icards .i-stock { grid-area: stock; font-size: 13px; color: var(--muted); justify-self: end; }
  table.icards .i-stock[data-l]::before { content: attr(data-l); }
  table.icards .i-st { grid-area: meta; justify-self: end; }
}

/* Handy/Tablet: Kassenterminal ohne leere Flächen – Bereiche nur so hoch wie ihr Inhalt, Bezahlleiste fest am unteren Rand */
@media (max-width: 820px) {
  .pos { min-height: 100vh; grid-template-rows: auto auto; align-content: start; }
  .pos-main { align-content: start; }
  .pos-side { grid-template-rows: none; align-content: start; padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  .pos-lines { min-height: 0; }
  .pos-lines .empty { padding: 14px; }
  .pos-foot { position: fixed !important; left: 0; right: 0; bottom: 0; margin: 0 !important; z-index: 20; background: var(--surface);
    padding: 8px 12px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0, 0, 0, .06); }
}
@media (max-width: 820px) { .pos { background: var(--surface); } .pos-left { background: var(--bg); } }
.pos-pay:has(#p-inv) { grid-template-columns: 1fr 1fr 1fr 1.4fr; }
@media (max-width: 720px) { .pos-pay:has(#p-inv) .btn { font-size: 15px; padding-left: 4px; padding-right: 4px; } }
/* Artikel aus der Kategorie (ohne eigene Taste) */
.pos-key.art { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.pos-key.art small { color: var(--muted); opacity: 1; }

/* Viele Kategorie-Reiter dürfen die Seite nicht verbreitern: nur die Reiterzeile wischt seitlich */
.pos, .pos-main, .pos-left, .pos-side { min-width: 0; }
@media (max-width: 820px) { .pos { grid-template-columns: minmax(0, 1fr); } .pos-main { grid-template-columns: minmax(0, 1fr); } .pos-tabs { max-width: 100%; } }

/* Handy: Kategorie-Reiter in zwei Zeilen, bei sehr vielen seitlich wischen */
@media (max-width: 720px) { .pos-tabs { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: max-content; gap: 6px; overflow-x: auto; scrollbar-width: none; } .pos-tabs::-webkit-scrollbar { display: none; } }

/* Handy: Kassenterminal mit der Leiste unten (Start, Belege …) – Bezahlleiste sitzt direkt darüber */
@media (max-width: 720px) {
  body.pos-mode #app-view:has(.tabbar:not([hidden])) .pos-foot { bottom: var(--tabbar-h, 60px); }
  body.pos-mode #app-view:has(.tabbar:not([hidden])) .pos-side { padding-bottom: calc(150px + var(--tabbar-h, 60px)); }
}
/* gesetzter Filter in der Belegliste */
.tools select.f-set { border-color: var(--accent); background-color: var(--accent-soft); color: var(--accent); font-weight: 600; }
.f-reset { justify-self: start; }

/* Kassentasten verschieben (nur im Bearbeiten-Modus) */
.pos-key.edit { position: relative; cursor: grab; outline: 2px dashed color-mix(in srgb, #fff 55%, transparent); outline-offset: -5px; }
.pos-key.edit.dragging { opacity: .4; }
.pos-key.edit.over { box-shadow: 0 0 0 3px var(--accent); transform: scale(1.03); }
.pos-key .mv { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; font-style: normal; }
.pos-key .mv b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgb(0 0 0 / .32); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
.pos-key .mv b:hover { background: rgb(0 0 0 / .55); }
.pos-edit-hint { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 2px 2px 0; }
/* im Bearbeiten-Modus bekommt jede Taste unten eine eigene Zeile für die Pfeile, damit sie den Preis nicht überdecken */
.pos-keys:has(.pos-key.edit) { grid-auto-rows: minmax(128px, auto); }
.pos-key.edit { padding-bottom: 46px; }
.pos-key .mv { left: 8px; right: 8px; bottom: 8px; justify-content: space-between; }
.pos-key .mv b { width: 44%; height: 30px; }

/* Bildschirmschoner am Kassenterminal */
#saver { position: fixed; inset: 0; z-index: 10000; background: #05070b; color: #fff; cursor: none; opacity: 0; transition: opacity .6s; overflow: hidden; touch-action: none; }
#saver.on { opacity: 1; }
#saver .sv-box { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 6px; padding: 28px 36px; text-align: center; transition: transform 3s ease-in-out; }
#saver img { width: 92px; height: 92px; filter: brightness(0) invert(1); margin-bottom: 6px; }
#saver b { font-size: 26px; letter-spacing: .02em; }
#saver .sv-time { font: 600 88px/1 var(--font); font-variant-numeric: tabular-nums; margin-top: 10px; }
#saver .sv-date { font-size: 20px; opacity: .75; }
#saver .sv-cart { font-size: 18px; color: #ffd166; min-height: 1.2em; margin-top: 8px; }
#saver .sv-hint { font-size: 15px; opacity: .55; margin-top: 14px; }
@media (max-width: 720px) { #saver .sv-time { font-size: 60px; } #saver img { width: 70px; height: 70px; } }
@media (prefers-reduced-motion: reduce) { #saver .sv-box { transition: none; } }

/* Testumgebung */
#testbar { position: sticky; top: 0; z-index: 10001; background: repeating-linear-gradient(-45deg, #f5c400 0 18px, #ffd84d 18px 36px); color: #0d1117; font: 700 13px/1.3 var(--font); text-align: center; padding: 5px 10px; }
body.is-test .bar { top: var(--testbar-h, 0px); }
body.is-test.pos-mode #testbar { position: fixed; left: 0; right: 0; top: 0; opacity: .9; pointer-events: none; }
