/* ULIX Getränke — ruhig, flach, ULIX-Farben (Tinte #0A0F1A, Blau #388BF8, Papier #F2F6FC) */

@font-face { font-family: "Jakarta"; font-weight: 400; font-display: swap; src: url("/static/fonts/jakarta-400.woff2") format("woff2"); }
@font-face { font-family: "Jakarta"; font-weight: 500; font-display: swap; src: url("/static/fonts/jakarta-500.woff2") format("woff2"); }
@font-face { font-family: "Jakarta"; font-weight: 600; font-display: swap; src: url("/static/fonts/jakarta-600.woff2") format("woff2"); }
@font-face { font-family: "Jakarta"; font-weight: 700; font-display: swap; src: url("/static/fonts/jakarta-700.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --ink: #0a0f1a;
  --ink-2: #4a5568;
  --ink-3: #7b8597;
  --line: #e2e7ef;
  --line-strong: #cfd6e2;
  --accent: #2f6fdf;          /* Flächen mit weißer Schrift: AA-Kontrast */
  --accent-press: #2559b8;
  --accent-ink: #1f5cc9;      /* Text/Links auf hell */
  --accent-soft: #e6effd;
  --accent-line: #b7cff7;
  --on-accent: #ffffff;
  --ok: #18794e;
  --ok-soft: #e3f4ea;
  --warn: #b4540a;
  --warn-soft: #fdf0e1;
  --danger: #c4322b;
  --danger-soft: #fdecea;
  --shadow: 0 1px 2px rgba(10, 15, 26, .05), 0 4px 16px rgba(10, 15, 26, .04);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Jakarta", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0a0f1a;
    --surface: #121a29;
    --surface-2: #1a2436;
    --ink: #f2f6fc;
    --ink-2: #b4bfd0;
    --ink-3: #8390a5;
    --line: #222d40;
    --line-strong: #2e3a50;
    --accent: #388bf8;
    --accent-press: #2f78dc;
    --accent-ink: #6aa8ff;
    --accent-soft: #15284a;
    --accent-line: #24467c;
    --on-accent: #06101f;
    --ok: #4cc38a;
    --ok-soft: #10301f;
    --warn: #f0a050;
    --warn-soft: #33220f;
    --danger: #ff6b61;
    --danger-soft: #3a1513;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
}
a { color: var(--accent-ink); }
svg { flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); margin: 0 0 .75rem; font-size: .92rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.shell { min-height: 100dvh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
body.auth-only .shell { padding-bottom: 24px; }

main { max-width: 30rem; margin: 0 auto; padding: .75rem 16px 1.5rem; }

h1 { font-size: 1.6rem; line-height: 1.15; letter-spacing: -0.025em; margin: .25rem 0 .5rem; font-weight: 700; }
.lead { color: var(--ink-2); margin: 0 0 1.25rem; }
.lead strong { color: var(--ink); }

/* —— Kopfzeile —— */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 30rem; margin: 0 auto;
  padding: calc(.6rem + var(--safe-t)) 16px .6rem;
  background: var(--bg);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.brand-mark { font-weight: 700; letter-spacing: .14em; font-size: .82rem; }
.brand-sep { width: 1px; height: 1rem; background: var(--line-strong); }
.brand-app { font-weight: 600; font-size: .95rem; color: var(--ink-2); }

.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; border-radius: 999px; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar {
  width: 2.25rem; height: 2.25rem; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: .85rem;
  border: 1px solid var(--line);
}
.usermenu[open] .avatar { border-color: var(--accent); }
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 12rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(10, 15, 26, .14); padding: .35rem; z-index: 60;
}
.usermenu-name { padding: .55rem .65rem .45rem; font-weight: 700; display: grid; }
.usermenu-name span { font-weight: 500; font-size: .8rem; color: var(--ink-3); }
.usermenu form { margin: 0; }
.menu-item {
  display: block; width: 100%; text-align: left; font: inherit; font-weight: 600; color: var(--ink);
  background: none; border: 0; border-radius: 8px; padding: .6rem .65rem; cursor: pointer; text-decoration: none;
}
.menu-item-danger { color: var(--danger); }
.menu-item:hover { background: var(--surface-2); }

/* —— Tab-Leiste —— */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  max-width: 30rem; margin: 0 auto;
  padding: 6px 8px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
@media (min-width: 30rem) {
  .tabbar { bottom: 12px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding-bottom: 6px; }
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 50px; border-radius: 12px;
  color: var(--ink-3); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--accent-ink); }
.tabbar a.active svg { stroke-width: 2.2; }

/* —— Bausteine —— */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem;
}
.card-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 .5rem; }
.card-accent { border-color: var(--accent-line); background: var(--accent-soft); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.page-head h1 { margin: .25rem 0; }
.back { display: inline-flex; align-items: center; gap: .15rem; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem; margin: .25rem 0 .25rem -.3rem; padding: .25rem; }
.back svg, .saldo-strip svg, .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty { color: var(--ink-3); text-align: center; padding: 1.25rem .5rem; margin: 0; list-style: none; }
.status { min-height: 1.4em; color: var(--ink-2); font-size: .9rem; margin: .6rem 0 0; }
.status:empty { min-height: 0; margin: 0; }

.badge {
  display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap;
  font-size: .75rem; font-weight: 700; padding: .25rem .55rem; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 12px; padding: .7rem 1rem; min-height: 44px;
  transition: background-color .15s ease, transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-press); }
.btn-primary[disabled] { background: var(--surface-2); color: var(--ink-3); cursor: default; transform: none; }
.btn-quiet { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--line-strong); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; margin-top: .75rem; }
.btn-lg { min-height: 52px; font-size: 1.02rem; }
.btn-sm { min-height: 34px; padding: .35rem .7rem; font-size: .84rem; border-radius: 9px; }

/* Formulare */
.form { display: grid; gap: .9rem; }
.form .btn-block { margin-top: .25rem; }
.field { display: grid; gap: .35rem; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
input, select {
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: .7rem .8rem; min-height: 46px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent-line); outline-offset: 0; border-color: var(--accent); }
input::placeholder { color: var(--ink-3); }
.input-euro { position: relative; display: block; }
.input-euro input { padding-right: 2.2rem; font-variant-numeric: tabular-nums; }
.input-euro > span { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; }
.inline-form { display: flex; gap: .5rem; margin-top: .75rem; }
.inline-form input[type="text"] { flex: 1; min-width: 0; }
.input-price { flex: 1 1 6rem; }
.inline-form-wrap { flex-wrap: wrap; }
.inline-form-wrap input[type="text"]:first-of-type { flex: 1 1 100%; }
.field-quiet input { margin-top: .6rem; text-align: center; background: transparent; border-style: dashed; color: var(--ink-2); }

/* Segment-Schalter (Radio) */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  margin-bottom: 1rem;
}
.form .segmented { margin-bottom: 0; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.segmented span {
  display: block; text-align: center; padding: .55rem .5rem; border-radius: 9px;
  font-weight: 700; font-size: .92rem; color: var(--ink-2);
  transition: background-color .15s ease, color .15s ease;
}
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(10, 15, 26, .1); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

/* Toast */
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin: 0 0 1rem; padding: .7rem .75rem .7rem 1rem; border-radius: 12px;
  font-weight: 600; font-size: .92rem;
  background: var(--ok-soft); color: var(--ok);
  animation: toast-in .25s ease;
  transition: opacity .4s ease, max-height .4s ease, margin .4s ease, padding .4s ease;
  max-height: 6rem; overflow: hidden;
}
.toast-warn { background: var(--warn-soft); color: var(--warn); }
.toast form { margin: 0; }
.toast-action {
  font: inherit; font-weight: 700; font-size: .88rem; color: inherit; cursor: pointer;
  background: none; border: 1px solid currentColor; border-radius: 8px; padding: .35rem .65rem;
}
.toast-out { opacity: 0; max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* —— Buchen —— */
.saldo-strip {
  display: flex; align-items: center; gap: .5rem;
  padding: .8rem .9rem .8rem 1rem; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
}
.saldo-strip-label { color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.saldo-strip-value { margin-left: auto; font-weight: 700; font-size: 1.1rem; }
.saldo-strip svg { color: var(--ink-3); }

.tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.tiles .empty { grid-column: 1 / -1; }
.tile { position: relative; }
.tile-hit {
  width: 100%; min-height: 9.5rem; padding: 1rem;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: .1rem;
  font: inherit; text-align: left; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  transition: border-color .15s ease, background-color .15s ease, transform .1s ease;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.tile-hit:active { transform: scale(.97); }
.tile-icon {
  position: absolute; top: 1rem; left: 1rem;
  width: 2.75rem; height: 2.75rem; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2);
}
.tile-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile-name { font-weight: 700; font-size: 1.08rem; letter-spacing: -0.01em; }
.tile-price { color: var(--ink-3); font-size: .86rem; font-weight: 500; }
.tile-qty {
  position: absolute; top: .85rem; right: .85rem;
  min-width: 2.1rem; height: 2.1rem; padding: 0 .5rem; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 1rem;
  transform: scale(0); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}
.tile-minus {
  position: absolute; right: .6rem; bottom: .6rem;
  width: 2.5rem; height: 2.5rem; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
.tile-minus svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.tile.has-qty .tile-hit { border-color: var(--accent); background: var(--accent-soft); }
.tile.has-qty .tile-icon { background: var(--surface); color: var(--accent-ink); }
.tile.has-qty .tile-qty { transform: scale(1); }
.tile.has-qty .tile-minus { opacity: 1; pointer-events: auto; }

.dock {
  position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 30;
  margin-top: 1rem; padding-top: .5rem;
  background: linear-gradient(to bottom, transparent, var(--bg) 40%);
}
@media (min-width: 30rem) { .dock { bottom: calc(var(--tab-h) + 24px); } }
.btn-dock { width: 100%; min-height: 56px; justify-content: space-between; padding: 0 1.1rem; font-size: 1.05rem; border-radius: 14px; }
.btn-dock[disabled] { justify-content: center; font-weight: 600; font-size: .95rem; border: 1px dashed var(--line-strong); background: transparent; }
.dock-sum:empty { display: none; }

/* —— Saldo —— */
.balance {
  text-align: center; padding: 1.5rem 1rem 1.25rem; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.balance-label { margin: 0; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.balance-value { margin: .2rem 0 .3rem; font-size: clamp(2.8rem, 14vw, 3.6rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.balance.is-credit .balance-value { color: var(--ok); }
.balance-hint { margin: 0; color: var(--ink-2); font-size: .95rem; }
.balance .btn-block { margin-top: 1.1rem; }

.ledger { margin: 0; }
.ledger div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.ledger div:last-child { border-bottom: 0; }
.ledger dt { color: var(--ink-2); }
.ledger dd { margin: 0; font-weight: 600; }
.ledger .ledger-total { border-top: 1.5px solid var(--ink); border-bottom: 0; margin-top: .1rem; padding-top: .7rem; }
.ledger .ledger-total dt, .ledger .ledger-total dd { color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.minus { color: var(--ok); }

/* Zeilenlisten (Saldo, Historie, Admin) */
.rows { list-style: none; margin: 0; padding: 0; }
.card.rows { padding: .25rem 1rem; }
.rows li {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main amount" "sub status";
  column-gap: .75rem; row-gap: .1rem; align-items: center;
  padding: .7rem 0; border-bottom: 1px solid var(--line);
}
.rows li:last-child { border-bottom: 0; }
.rows li.empty { display: block; }
.row-main { grid-area: main; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.row-sub { grid-area: sub; color: var(--ink-3); font-size: .84rem; min-width: 0; overflow-wrap: anywhere; }
.row-amount { grid-area: amount; font-weight: 700; text-align: right; }
.row-status { grid-area: status; justify-self: end; margin: 0; }
.rows li:not(:has(.row-amount)) .row-status { grid-row: 1 / span 2; grid-column: 2; }
.rows li.is-storno .row-main, .rows li.is-storno .row-amount { color: var(--ink-3); text-decoration: line-through; }
.rows li.is-off .row-main, .rows li.is-off .row-amount { color: var(--ink-3); }
.rows li.is-ausgleich .row-status { margin-top: .3rem; }

/* —— Historie —— */
.day { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 1.1rem 0 .45rem .25rem; }
.filters { margin-bottom: .25rem; }
.filters summary {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; list-style: none;
  font-weight: 700; font-size: .9rem; color: var(--ink-2);
  padding: .45rem .8rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
}
.filters summary::-webkit-details-marker { display: none; }
.filters summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s ease; }
.filters[open] summary::before { transform: rotate(-135deg) translateY(-1px); }
.filters .count { background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: .72rem; min-width: 1.2rem; height: 1.2rem; display: grid; place-items: center; padding: 0 .3rem; }
.filter-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
  margin-top: .6rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.filter-actions { grid-column: 1 / -1; display: flex; gap: .5rem; }
.filter-actions .btn { flex: 1; }

/* —— Admin —— */
.copy { display: flex; gap: .5rem; align-items: center; }
.copy code {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: .82rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem;
}
.card .btn-block + .status { margin-top: .5rem; }

/* —— Anmeldung / Einladung —— */
.auth { max-width: 22rem; margin: 2.5rem auto 0; text-align: center; }
.auth .lead { margin-bottom: 1.5rem; }
.auth .field { text-align: left; margin-bottom: .25rem; }
.auth-mark {
  width: 4rem; height: 4rem; margin: 0 auto 1rem; border-radius: 18px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
}
.auth-mark svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.steps { text-align: left; color: var(--ink-2); padding-left: 1.2rem; margin: 0 0 1.25rem; display: grid; gap: .35rem; }
.recovery { margin-top: 2rem; text-align: left; border-top: 1px solid var(--line); padding-top: 1rem; }
.recovery summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: .92rem; text-align: center; list-style: none; }
.recovery summary::-webkit-details-marker { display: none; }
.recovery[open] summary { margin-bottom: .85rem; }
.codes {
  text-align: left; margin: 1rem 0 0; padding: 1rem 1.1rem; border-radius: 12px;
  background: var(--ink); color: var(--bg);
  font: 600 1rem/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em;
  white-space: pre-wrap; word-break: break-all;
}

/* —— QR-Druck —— */
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.qr-card {
  background: #fff; color: #0a0f1a; border: 1px solid #cfd6e2; border-radius: 14px;
  padding: 1rem; text-align: center; break-inside: avoid;
}
.qr-card h2 { margin: .1rem 0 .4rem; font-size: 1.5rem; letter-spacing: -0.02em; }
.qr-card img { display: block; margin: 0 auto; width: 100%; max-width: 220px; height: auto; image-rendering: pixelated; }
.qr-brand { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #4a5568; }
.qr-price { margin: .4rem 0 0; font-size: .85rem; color: #4a5568; }

/* —— Gerätelink —— */
.narrow { max-width: 30rem; }
.note { margin-top: 1rem; font-size: .86rem; }
.link-card { text-align: center; }
.link-qr { display: block; margin: .25rem auto 1rem; width: 100%; max-width: 240px; height: auto; border-radius: 10px; background: #fff; image-rendering: pixelated; }
.link-actions { display: flex; gap: .5rem; margin-top: .75rem; }
.link-actions .btn { flex: 1; }
.link-meta { margin: .75rem 0 0; }

/* —— Admin: Personen mit ihren Passkeys —— */
.person + .person { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.person-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.person-head form { margin: 0; }
.person-name { font-weight: 700; font-size: 1.02rem; display: flex; align-items: baseline; gap: .5rem; }
.person-name span { font-weight: 500; font-size: .8rem; color: var(--ink-3); }
.person .rows li { padding: .55rem 0; }

/* —— Onboarding /start —— */
.auth-wide { max-width: 26rem; }
.auth-wide .form { text-align: left; }
.choice { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.choice legend { font-size: .86rem; font-weight: 600; color: var(--ink-2); margin-bottom: .4rem; padding: 0; }
.choice-item { position: relative; cursor: pointer; }
.choice-item input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.choice-item span {
  display: flex; align-items: center; gap: .65rem; min-height: 48px; padding: .6rem .9rem;
  border: 1.5px solid var(--line-strong); border-radius: 12px; font-weight: 600; background: var(--surface);
}
.choice-item span::before {
  content: ""; width: 1.1rem; height: 1.1rem; border-radius: 999px; border: 2px solid var(--line-strong); flex-shrink: 0;
}
.choice-item input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.choice-item input:checked + span::before { border: 5px solid var(--accent); }
.choice-item input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.neue-firma { margin-top: .25rem; }
.field small { font-weight: 500; color: var(--ink-3); font-size: .8rem; }

/* —— Saldo / Firmen —— */
.balance-mine { margin: .6rem 0 0; color: var(--ink-2); font-size: .92rem; }
.rows-link li { padding: 0; }
.rows-link a {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main amount" "sub sub";
  column-gap: .75rem; row-gap: .1rem; padding: .7rem 0; color: inherit; text-decoration: none;
}
.rows-link a:hover .row-main { color: var(--accent-ink); }
.row-main a { color: inherit; text-decoration: none; }
.row-main a:hover { color: var(--accent-ink); }

/* —— Personen —— */
.group-title { font-size: .78rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 1rem 0 .4rem; }
.group-title:first-of-type { margin-top: .25rem; }
.person-sub { margin: .15rem 0 0; }
.person-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.person-actions form { margin: 0; }

/* —— Aushang (A4) —— */
.aushang {
  margin: 1.5rem auto 0; max-width: 34rem; padding: 2.5rem 2rem; text-align: center;
  background: #fff; color: #0a0f1a; border: 1px solid #cfd6e2; border-radius: 16px;
}
.aushang-brand { margin: 0; font-size: .85rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #4a5568; }
.aushang-title { margin: .4rem 0 .6rem; font-size: 2.6rem; line-height: 1.05; letter-spacing: -0.03em; }
.aushang-sub { margin: 0 0 1.5rem; font-size: 1.15rem; color: #2d3748; }
.aushang-qr { display: block; margin: 0 auto 1.5rem; width: 70%; max-width: 320px; height: auto; image-rendering: pixelated; }
.aushang-steps { text-align: left; display: inline-grid; gap: .45rem; margin: 0 0 1.5rem; padding-left: 1.4rem; font-size: 1.1rem; }
.aushang-code { margin: 0 0 .75rem; font-size: 1rem; color: #2d3748; }
.aushang-preis { margin: 0; font-size: .95rem; color: #4a5568; border-top: 1px solid #e2e7ef; padding-top: 1rem; }

.desk-only { display: none; }

/* —— Desktop: Seitenleiste statt Tab-Leiste, Inhalt in die Breite —— */
@media (min-width: 900px) {
  body:not(.auth-only) .shell { padding: 0 0 0 15rem; }
  body:not(.auth-only) .top {
    position: fixed; left: 0; top: 0; width: 15rem; max-width: none; margin: 0;
    padding: 1.25rem 1rem 1rem 1.5rem; background: transparent; z-index: 55;
  }
  body:not(.auth-only) .tabbar {
    top: 0; bottom: 0; right: auto; width: 15rem; max-width: none; margin: 0;
    grid-auto-flow: row; grid-auto-rows: min-content; align-content: start; gap: 2px;
    padding: 5rem .75rem 1rem;
    background: var(--surface); border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .tabbar a {
    flex-direction: row; justify-content: flex-start; gap: .75rem;
    min-height: 44px; padding: 0 .85rem; font-size: .95rem; color: var(--ink-2);
  }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar a:hover { background: var(--surface-2); color: var(--ink); }
  .tabbar a.active { background: var(--accent-soft); color: var(--accent-ink); }
  .usermenu-pop { left: auto; right: 0; }

  body:not(.auth-only) main { max-width: 68rem; margin: 0; padding: 2rem 3rem 3rem; }
  h1 { font-size: 1.9rem; margin-bottom: 1.25rem; }
  .desk-only { display: block; }
  .page-head h1 { margin: 0; }
  .toast { max-width: 40rem; }

  /* Buchen: Kacheln links, Abschluss rechts */
  .buchen {
    display: grid; grid-template-columns: minmax(0, 1fr) 19rem; column-gap: 2rem; align-items: start;
    grid-template-areas: "tiles strip" "tiles seg" "tiles dock" "tiles .";
  }
  .buchen .tiles { grid-area: tiles; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 1rem; }
  .buchen .saldo-strip { grid-area: strip; }
  .buchen .segmented { grid-area: seg; }
  .buchen .dock { grid-area: dock; position: static; margin: 0; padding: 0; background: none; }
  .tile-hit { min-height: 11rem; }
  .tile-hit:hover { border-color: var(--line-strong); }
  .tile.has-qty .tile-hit:hover { border-color: var(--accent); }

  /* Saldo: Zahl links, Aufschlüsselung rechts */
  .saldo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .saldo-grid .balance { grid-row: span 2; margin: 0; padding: 3rem 2rem; position: sticky; top: 2rem; }
  .saldo-grid .card { margin: 0; }
  .saldo-grid .balance .btn-block { max-width: 18rem; }

  /* Historie: lesbare Zeilenbreite, Filter in einer Reihe */
  .historie { max-width: 48rem; }
  .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
  .filter-actions { grid-column: auto / span 4; justify-content: flex-end; }
  .filter-actions .btn { flex: 0 0 auto; }
  .rows li { padding: .8rem 0; }

  /* Admin: Karten in zwei Spalten */
  .admin { columns: 2; column-gap: 1.25rem; }
  .admin > .page-head, .admin > .card-accent { column-span: all; }
  .admin > .page-head { margin-bottom: 1.25rem; }
  .admin > .card { break-inside: avoid; margin: 0 0 1.25rem; }
  .auth { margin-top: 5rem; }
}

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

@media print {
  .top, .tabbar, .no-print, .toast { display: none !important; }
  body { background: #fff; }
  .shell { padding: 0; }
  main { max-width: none; padding: 0; }
  .qr-sheet { grid-template-columns: 1fr 1fr; gap: 1cm; margin: 0; }
  .qr-card { border: 1px dashed #000; border-radius: 0; }
  .aushang { border: 0; max-width: none; margin: 0; padding: 1.5cm 1cm; }
  .aushang-title { font-size: 44pt; }
  .aushang-sub, .aushang-steps { font-size: 16pt; }
  .aushang-qr { width: 9cm; max-width: none; }
  body:not(.auth-only) .shell { padding: 0 !important; }
}
