/* FlohCash – Kassengrün und Preisschild-Gelb. Nur Systemschriften: keine externen Anfragen. */
:root {
  color-scheme: light;
  --ground: #EDF1EC; --surface: #FFFFFF; --surface-2: #F4F7F3; --ink: #15211B; --ink-2: #4B5A52; --line: #D3DCD5;
  --box: #1F4D3A; --box-ink: #F3F7F4; --tag: #F2C230; --tag-ink: #2A2206;
  --good: #1E7A4C; --bad: #B3372B; --focus: #2C6BD8; --warn-bg: #FBEDEA;
  --display: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #0E1612; --surface: #16211B; --surface-2: #1C2A23; --ink: #E6EEE8; --ink-2: #9FB1A6; --line: #2B3B33;
    --box: #2A684E; --box-ink: #F3F7F4; --tag: #E9BC2E; --tag-ink: #231C04;
    --good: #4CC486; --bad: #F07A6C; --focus: #7FA8F5; --warn-bg: #3A1F1B;
  }
}
* { box-sizing: border-box; }
/* Schnelles Tippen (Tastenfeld, Scheine) darf nicht als Doppeltipp-Zoom gelten; Zwei-Finger-Zoom bleibt */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
button, .money, .keypad button { touch-action: manipulation; }
/* iOS zoomt beim Antippen von Feldern unter 16 px automatisch heran */
input[type=text], input[type=password] { font-size: max(16px, 1em); }
body {
  margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.45 var(--body);
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
  padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px));
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2 { font-family: var(--display); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 19px; font-weight: 700; }
.wrap { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.label { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }

/* Kopf */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; border-radius: 10px; background: var(--box); color: var(--tag); display: grid; place-items: center; font: 800 26px var(--display); transform: rotate(-4deg); }
h1 { font-size: 26px; font-weight: 800; line-height: 1.1; }
.day-label { margin: 0; font-size: 13px; color: var(--ink-2); }
.top-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.who input { width: 140px; }
.status { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.dot.off { background: var(--bad); }
.banner { margin: 0; font-size: 13.5px; background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); border-radius: 10px; padding: 10px 12px; }
.loading { color: var(--ink-2); text-align: center; padding: 40px 0; margin: 0; }

/* Grundbausteine */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
input[type=text] { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; min-width: 0; width: 100%; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.grow { flex: 1; }
.money-in { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 2px 12px; }
.money-in:focus-within { border-color: var(--focus); }
.money-in input[type=text] { border: 0; background: transparent; padding: 8px 0; text-align: right; font: 500 22px var(--mono); font-variant-numeric: tabular-nums; outline: none; }
.money-in span { font: 18px var(--mono); color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 14px var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; }
.chip:hover { border-color: var(--ink-2); }
.chip.strong { background: var(--tag); color: var(--tag-ink); border-color: transparent; font-family: var(--body); font-weight: 650; }
.btn { font-weight: 650; border-radius: 10px; padding: 13px 18px; border: 1px solid var(--line); background: var(--surface-2); }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn.primary { background: var(--tag); color: var(--tag-ink); border-color: transparent; font-family: var(--display); font-weight: 800; font-size: 18px; flex: 1; }
.btn.small.primary { font-size: 14px; flex: none; }
.btn.big { padding: 16px; font-size: 19px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; align-self: flex-start; }
.seg button { background: transparent; border: 0; color: var(--ink-2); padding: 6px 11px; font-size: 13px; font-weight: 550; }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--surface); }

/* Geldauswahl */
.picker { display: flex; flex-direction: column; gap: 10px; }
.picker .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.money { position: relative; background: none; border: 0; padding: 0; border-radius: 4px; line-height: 0; transition: transform .12s ease; -webkit-tap-highlight-color: transparent; flex: none; }
.money svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.28)); }
.money:active { transform: scale(.93); }
.money.coin { border-radius: 50%; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--ink); color: var(--surface); font: 600 12px/22px var(--mono); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.tally { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; align-items: center; font-size: 13px; color: var(--ink-2); }
.tally .chip { display: inline-flex; align-items: center; gap: 7px; }
.tally .chip b { color: var(--bad); font-weight: 600; }

/* Layout */
.grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

/* Anmeldung */
.login { max-width: 420px; width: 100%; margin: 24px auto 0; }
.login h2 { font-size: 24px; }
.login .lead { margin: -8px 0 0; }
input[type=password] { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; font-size: 17px; }
.login input { font-size: 17px; padding: 11px 12px; }
.login-error { margin: 0; color: var(--bad); font-weight: 600; font-size: 14px; }
.who b { color: var(--ink); }
.who .link { margin-left: 6px; font-size: 13px; }

/* Kasse öffnen */
.setup { max-width: 820px; width: 100%; margin: 0 auto; }
.setup-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.setup-head h2 { font-size: 24px; }
.lead { margin: 6px 0 0; color: var(--ink-2); max-width: 56ch; }
.setup-sum { background: var(--box); color: var(--box-ink); border-radius: 12px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 150px; }
.setup-sum .label { color: color-mix(in srgb, var(--box-ink) 70%, transparent); }
.setup-sum b { font: 500 28px var(--mono); font-variant-numeric: tabular-nums; }
.setup .money-in { max-width: 240px; }

/* Schrittanzeige */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.stepper li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink); font: 700 13px var(--mono); flex: none; }
.stepper li.on { background: var(--box); color: var(--box-ink); }
.stepper li.on span { background: var(--tag); color: var(--tag-ink); }
.stepper li.done span { background: var(--good); color: #fff; }
.step { display: flex; flex-direction: column; gap: 16px; animation: slide .22s ease; }
@keyframes slide { from { opacity: .4; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* Schritt 1 */
.last { border-radius: 12px; padding: 12px 14px; background: color-mix(in srgb, var(--good) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.last b { font: 600 22px var(--mono); }
.last span { font-size: 13.5px; color: var(--ink-2); }
.price-display { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 14px 18px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid var(--line); }
.price-display.shake { animation: shake .3s; border-color: var(--bad); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.price-display output { font: 500 clamp(40px, 9vw, 56px)/1.05 var(--mono); font-variant-numeric: tabular-nums; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { padding: 14px 0; font: 500 24px var(--mono); border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.keypad button:active { background: var(--surface-2); transform: scale(.97); }

/* Schritt 2 */
.due { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line); }
.due div { display: flex; flex-direction: column; }
.due b { font: 600 28px var(--mono); font-variant-numeric: tabular-nums; }
.given-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.given-row .field { flex: 0 1 220px; }
.change { background: var(--box); color: var(--box-ink); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.change-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.change .label, .change .hint { color: color-mix(in srgb, var(--box-ink) 72%, transparent); }
.hint { font-size: 13px; }
.change-val { font: 500 clamp(36px, 8vw, 52px)/1 var(--mono); font-variant-numeric: tabular-nums; }
.change-val.short { color: #FFB4A8; }
.change-pics { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-height: 20px; font-size: 13px; }
.change-pics .pic { position: relative; line-height: 0; flex: none; }
.change-pics .pic svg { width: 100%; height: 100%; display: block; }
.change-pics .pic i { position: absolute; bottom: -5px; right: -7px; font: 600 11px/18px var(--mono); font-style: normal; background: var(--tag); color: var(--tag-ink); border-radius: 9px; padding: 0 5px; }

/* Zahlart */
.paymode { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.paymode button { background: var(--surface-2); border: 0; padding: 12px; font-weight: 700; font-size: 16px; color: var(--ink-2); }
.paymode button + button { border-left: 1.5px solid var(--line); }
.paymode button[aria-pressed=true] { background: var(--box); color: var(--box-ink); }
.pane { display: flex; flex-direction: column; gap: 16px; }
.qr-card { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: center; }
/* QR immer schwarz auf weiß mit Ruhezone – sonst scheitern manche Kameras */
.qr { background: #fff; padding: 2px; border-radius: 12px; border: 1px solid var(--line); line-height: 0; flex: none; }
.qr svg { width: 220px; height: 220px; display: block; }
.qr-info { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 200px; }
.qr-amount { font: 600 36px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.qr-to { color: var(--ink-2); }
.qr-to b { color: var(--ink); }
.ff-hint { margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--tag) 30%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tag) 70%, transparent); font-size: 14px; }
.qr-link { font: 12px var(--mono); color: var(--ink-2); word-break: break-all; }
.hint-line { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.money-in.prefix span:first-child { font-size: 15px; }
.money-in.prefix input[type=text] { text-align: left; font-size: 17px; }
.cash-rows .apart { padding-top: 6px; margin-top: 4px; border-top: 1px dashed var(--line); }
.cash-rows .open dt, .cash-rows .open dd { color: var(--bad); }
.pill.paypal { background: #1C3F94; color: #fff; border-color: transparent; }
.pill.due { background: var(--warn-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.row-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.confirm-paid { font-size: 12px; font-weight: 650; color: #fff; background: var(--good); border: 0; border-radius: 6px; padding: 5px 8px; }

.big-show { align-self: flex-start; font-size: 16px; }

/* PayPal-Vollbild: bewusst immer hell – Kameras lesen dunkel auf weiß am zuverlässigsten */
.qr-full {
  position: fixed; inset: 0; z-index: 30; background: #fff; color: #15211B;
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
           calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
}
.qr-full-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.qr-full-main p { margin: 0; }
.qr-full-label { font-size: 13px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: #4B5A52; }
.qr-full-amount { font: 600 clamp(44px, 13vw, 96px)/1 var(--mono); font-variant-numeric: tabular-nums; }
.qr-full-code { width: min(78vw, 52vh, 520px); aspect-ratio: 1; max-width: 100%; line-height: 0; }
.qr-full-code svg { width: 100%; height: 100%; display: block; }
.qr-full-to { font-size: clamp(15px, 3.6vw, 20px); color: #4B5A52; }
.qr-full-to b { color: #15211B; }
.qr-full-hint { font-size: clamp(16px, 4.2vw, 24px); line-height: 1.35; background: #FCEFC0; border: 2px solid #F2C230; border-radius: 14px; padding: 12px 18px; max-width: 34ch; }
.qr-full-actions { display: flex; gap: 10px; justify-content: center; }
.qr-full-actions .btn { flex: 0 1 240px; background: #F4F7F3; color: #15211B; border-color: #D3DCD5; }
.qr-full-actions .btn.primary { background: #F2C230; color: #2A2206; border-color: transparent; }
/* Handy quer: Code links, Text rechts */
@media (orientation: landscape) and (max-height: 560px) {
  .qr-full-main { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto auto 1fr; column-gap: 24px; align-content: center; text-align: left; justify-items: start; }
  .qr-full { gap: 8px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .qr-full-code { grid-row: 1 / span 5; width: min(62vh, 45vw); }
  .qr-full-amount { font-size: clamp(34px, 13vh, 64px); }
  .qr-full-hint { font-size: 15px; padding: 8px 12px; }
  .qr-full-to { font-size: 14px; }
  .qr-full-actions .btn { padding: 9px 14px; font-size: 15px; }
}

.settle { display: flex; flex-direction: column; gap: 12px; }
/* Handy: Rückgeld und Kassieren bleiben unten sichtbar, während man Geld antippt */
@media (max-width: 900px) {
  .settle {
    position: sticky; bottom: 0; z-index: 2;
    margin: 0 -18px -18px; padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 -8px 16px -12px rgba(0, 0, 0, .35);
  }
  .settle .change { padding: 10px 14px; gap: 6px; }
  .settle .change-val { font-size: 34px; }
  .settle .change-pics { gap: 8px; }
  .settle .btn { padding: 12px 14px; }
  .history .stats b { font-size: 16px; }   /* spezifischer als die Grundregel weiter unten */
  .who { white-space: nowrap; }
}

/* Kassenbestand */
.cash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cash-total { font: 500 28px var(--mono); font-variant-numeric: tabular-nums; }
.cash-rows { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.cash-rows div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.cash-rows dt { color: var(--ink-2); }
.cash-rows dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.float-detail { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.cash-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.move { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.move .money-in { max-width: 220px; }

/* Historie */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stats div { background: var(--surface-2); padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.stats b { font: 500 19px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats span { font-size: 12px; color: var(--ink-2); }
.hist-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.hist { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; }
.hist li { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 2px; border-top: 1px solid var(--line); }
.hist li:first-child { border-top: 0; }
.hist li.fresh { animation: flash 1.4s ease; }
@keyframes flash { from { background: color-mix(in srgb, var(--tag) 40%, transparent); } to { background: transparent; } }
.hist .t { font: 13px var(--mono); color: var(--ink-2); }
.hist .amt { font: 500 17px var(--mono); font-variant-numeric: tabular-nums; }
.hist .amt.in { color: var(--good); }
.hist .amt.out { color: var(--bad); }
.hist .meta { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .meta em { font-style: normal; color: var(--ink); }
.hist li.void .amt, .hist li.void .meta em { text-decoration: line-through; opacity: .55; }
.pill { font: 650 11px var(--body); border-radius: 999px; padding: 2px 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); vertical-align: 2px; margin-left: 6px; }
.pill.wait { background: var(--tag); color: var(--tag-ink); border-color: transparent; }
.storno { font-size: 12px; font-weight: 550; color: var(--ink-2); background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.storno.confirm { color: #fff; background: var(--bad); border-color: var(--bad); }
.hist li.empty { display: block; color: var(--ink-2); padding: 16px 0; }
.hist-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 10px; font-size: 14px; transition: .25s ease; pointer-events: none; max-width: calc(100% - 32px); z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
