:root {
  --red: #b91c1c;
  --red-dark: #8f1414;
  --red-soft: #fde8e8;
  --bg: #f4f4f5;
  --card: #ffffff;
  --text: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --green: #15803d;
  --green-soft: #dcfce7;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --blue-soft: #e0f2fe;
  --grey-soft: #f4f4f5;
  --admin: #1e3a5f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .04);
  --tabbar-h: 62px;
  --sticky-bottom: 0px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --card: #1c1c1f;
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --border: #2e2e33;
    --red-soft: #3b1515;
    --green: #4ade80;
    --green-soft: #12301d;
    --amber: #fbbf24;
    --amber-soft: #3a2a0c;
    --blue-soft: #10283a;
    --grey-soft: #26262a;
    --admin: #2c5282;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--red); }
h1 { font-size: 1.5rem; margin: .25rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { margin: 0 0 .5rem; }

/* ---------- Kopf & Navigation ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: var(--red); color: #fff;
  padding: .6rem 1rem; padding-top: max(.6rem, env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 10;
}
.is-admin-area .topbar { background: var(--admin); }
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; min-width: 0; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font-weight: 400; opacity: .8; }
.brand img { background: #fff; border-radius: 8px; padding: 2px; flex: none; }
.topbar-right { display: flex; gap: .4rem; flex: none; }
.chip {
  color: #fff; text-decoration: none; font-size: .85rem;
  border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; padding: .2rem .7rem; white-space: nowrap;
}
.chip-admin { background: rgba(0, 0, 0, .18); }

.nav {
  display: flex; gap: .25rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  background: var(--card); border-bottom: 1px solid var(--border); padding: .4rem .75rem;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--text); text-decoration: none; white-space: nowrap;
  padding: .4rem .8rem; border-radius: 999px; font-size: .95rem;
}
.nav a.active { background: var(--red-soft); color: var(--red); font-weight: 600; }
.is-admin-area .nav a.active { background: var(--blue-soft); color: var(--admin); }
@media (prefers-color-scheme: dark) { .is-admin-area .nav a.active { color: #93c5fd; } .nav a.active { color: #fca5a5; } }
.badge {
  display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 999px;
  background: #f59e0b; color: #111; font-size: .75rem; font-weight: 700; text-align: center;
}

.container { max-width: 960px; margin: 0 auto; padding: 1rem; padding-bottom: 3rem; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 1rem 2rem; }

/* ---------- Karten & Layout ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.card-warn { border-color: #f59e0b; background: var(--amber-soft); }
.card-admin { border-color: var(--admin); border-width: 2px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.actions, .btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }
.right { margin-left: auto; text-align: right; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.big { font-size: 1.4rem; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.danger { color: var(--red) !important; }
.info-box { background: var(--blue-soft); border-radius: var(--radius); padding: .75rem 1rem; margin: 1rem 0; }

/* ---------- Kennzahlen ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .stats-3 { grid-template-columns: 1fr; } }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem;
  display: flex; flex-direction: column; text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-value { font-size: 1.35rem; font-weight: 700; }
.stat-sub { font-size: .8rem; color: var(--amber); }
.stat-warn { border-color: #f59e0b; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.neg { color: var(--red); }
.money.pos { color: var(--green); }
@media (prefers-color-scheme: dark) { .money.neg { color: #f87171; } }

/* ---------- Formulare ---------- */
label { display: block; margin-bottom: .85rem; font-weight: 500; }
label small { display: block; font-weight: 400; margin-top: .2rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .7rem;
  min-height: 44px;
}
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; min-height: 0; margin: 0 .5rem 0 0; accent-color: var(--red); }
input[type=file] { padding: .5rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: transparent; }
.pin-input { letter-spacing: .4em; font-size: 1.2rem; }
label.check { display: flex; align-items: center; font-weight: 400; margin-bottom: .5rem; cursor: pointer; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 600; padding: 0 .3rem; }
.checklist .check { padding: .4rem 0; border-bottom: 1px solid var(--border); }
.checklist .check:last-child { border-bottom: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 1rem; }
.share-picker { margin: .5rem 0 0 1.6rem; }
.inline-label { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0; font-weight: 400; }
.inline-label select { width: auto; margin: 0; }
.upload-row { display: flex; gap: .5rem; align-items: center; margin-top: .75rem; }
.upload-row input { margin: 0; }
.for-select select { max-width: 320px; }
.total { font-size: 1.15rem; margin: 1rem 0; text-align: right; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 10px; padding: .6rem 1.1rem; min-height: 44px;
}
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.is-admin-area .btn-primary, .card-admin .btn-primary { background: var(--admin); border-color: var(--admin); }
.btn-danger { color: var(--red); border-color: var(--red); }
.btn-ghost { background: transparent; }
.btn-small { padding: .3rem .7rem; min-height: 34px; font-size: .9rem; }
.btn-lg { padding: .9rem 1.4rem; font-size: 1.1rem; }
.btn-block { display: flex; width: 100%; margin-bottom: 1rem; }
.btn-paypal { background: #ffc439; border-color: #ffc439; color: #111; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--red); cursor: pointer; text-decoration: underline; }

/* ---------- Getränke ---------- */
.drink-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin-bottom: .5rem; }
.drink-btn {
  width: 100%; min-height: 84px; border-radius: var(--radius); cursor: pointer;
  border: 2px solid var(--red); background: var(--red-soft); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  font: inherit; transition: transform .08s;
}
.drink-btn:active { transform: scale(.96); background: var(--red); color: #fff; }
.drink-name { font-weight: 700; font-size: 1.05rem; }
.drink-price { font-size: .85rem; color: var(--muted); }
.drink-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.drink-row input { margin: 0; flex: 1 1 140px; width: auto; }
.drink-row .w-price { flex: 0 0 90px; }
.drink-row .w-sort { flex: 0 0 70px; }
.drink-row .check { margin: 0; }
.inactive { opacity: .55; }

/* ---------- Listen & Tabellen ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list.card li { padding: .75rem 0; }
.stretch { display: flex; align-items: center; gap: .75rem; width: 100%; color: inherit; text-decoration: none; }
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: .55rem .7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--grey-soft); position: sticky; top: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot th { border-bottom: 0; }
.table tr.me td { background: var(--red-soft); }
.table.summary td { border: 0; padding: .3rem 0; }
.table.summary tr.sep td { border-top: 1px solid var(--border); padding-top: .5rem; }
.table.summary .total-row td { font-size: 1.1rem; }
.tally { font-weight: 600; }

.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { text-decoration: none; color: var(--text); padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: .9rem; }
.tabs a.active { background: var(--text); color: var(--card); border-color: var(--text); }
.tabs a.active .muted { color: inherit; opacity: .7; }

/* ---------- Status ---------- */
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: .05rem .5rem; border-radius: 999px; background: var(--grey-soft); color: var(--muted); vertical-align: middle; }
.pill-eingereicht, .pill-gemeldet { background: var(--amber-soft); color: var(--amber); }
.pill-genehmigt { background: var(--blue-soft); color: #0369a1; }
.pill-bezahlt, .pill-bestaetigt { background: var(--green-soft); color: var(--green); }
.pill-abgelehnt { background: var(--grey-soft); color: var(--muted); text-decoration: line-through; }

/* Beitragsmatrix */
.matrix th, .matrix td { text-align: center; padding: .45rem .4rem; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; }
.matrix tr.me td { background: transparent; }
.matrix tr.me td:first-child { background: var(--red-soft); }
.matrix th.current { color: var(--red); }
.cell { font-weight: 700; min-width: 3rem; }
.cell-bezahlt { background: var(--green-soft) !important; color: var(--green); }
.cell-gemeldet { background: var(--amber-soft) !important; color: var(--amber); }
.cell-teilweise { background: var(--amber-soft) !important; color: var(--amber); }
.cell-offen { background: var(--red-soft) !important; color: var(--red); }
.cell-zukunft, .cell-frei, .cell-befreit { color: var(--muted); }
.cell-btn { width: 100%; background: none; border: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; padding: .2rem; border-radius: 6px; }
.cell-btn:hover { outline: 2px dashed currentColor; }
.cell-link { color: inherit; text-decoration: none; display: block; }
.legend { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; font-size: .8rem; }
.legend span { padding: .15rem .55rem; border-radius: 999px; }
.legend .cell-zukunft { background: var(--grey-soft); }
.admin-hint { padding: .6rem 1rem; }

/* Rechnungen */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: .5rem; } }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.file { border: 1px solid var(--border); border-radius: 10px; padding: .5rem; display: flex; flex-direction: column; gap: .4rem; }
.file > a { display: flex; flex-direction: column; gap: .3rem; color: inherit; text-decoration: none; word-break: break-all; }
.file img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; background: var(--grey-soft); }
.file-icon { height: 140px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--red-soft); color: var(--red); font-weight: 800; font-size: 1.4rem; }
.file-actions { display: flex; justify-content: space-between; align-items: center; }

/* Meldungen */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.flash-success { background: var(--green-soft); border-color: transparent; color: var(--green); }
.flash-error { background: var(--red-soft); border-color: transparent; color: var(--red); }
.flash-undo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
@media (prefers-color-scheme: dark) { .flash-error { color: #fca5a5; } }

/* Anmeldung */
.auth-card { max-width: 420px; margin: 2rem auto; }
.auth-links { text-align: center; margin-top: 1rem; }

/* =====================================================================
   Handy-Optimierung (Teilnehmeransicht)
   ===================================================================== */

a, button, .drink-btn, label.check, input[type=checkbox], input[type=radio] { touch-action: manipulation; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.chip { display: inline-flex; align-items: center; gap: .3rem; }
.chip .icon { width: 1.05em; height: 1.05em; }
.grow { flex: 1 1 auto; min-width: 0; }
[hidden] { display: none !important; }

/* ---------- Tab-Leiste unten ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 500;
}
.tabbar a .icon { width: 26px; height: 26px; }
.tabbar a.active { color: var(--red); font-weight: 700; }
@media (prefers-color-scheme: dark) { .tabbar a.active { color: #f87171; } }

@media (min-width: 768px) {
  .tabbar { display: none; }
  .only-mobile { display: none !important; }
}
@media (max-width: 767px) {
  :root { --sticky-bottom: 0px; }
  .has-tabbar { --sticky-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .has-tabbar .nav-desktop, .has-tabbar .hide-mobile-tabbar { display: none; }
  .has-tabbar .container { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 1.5rem); }
  .only-desktop { display: none !important; }
  .topbar { padding: .5rem .9rem; padding-top: max(.5rem, env(safe-area-inset-top)); }
  .brand { font-size: 1rem; }
  .container { padding: .9rem .9rem 2rem; }
  h1 { font-size: 1.35rem; }
  .card { padding: .9rem; border-radius: 14px; }
  .stat-value { font-size: 1.2rem; }
  .matrix { font-size: .85rem; }
  .tabs-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -.9rem; padding-right: .9rem; }
  .tabs-scroll::-webkit-scrollbar { display: none; }
  .tabs-scroll a { white-space: nowrap; }
}
@media (max-width: 380px) { .hide-xs { display: none; } }

/* ---------- Toast (Rückmeldung ohne Neuladen) ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30;
  bottom: calc(var(--sticky-bottom) + 14px + env(safe-area-inset-bottom));
  width: min(92vw, 440px); display: flex; align-items: center; gap: .75rem;
  background: #18181b; color: #fff; border-radius: 14px; padding: .8rem 1rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3); animation: toast-in .18s ease-out;
}
@media (prefers-color-scheme: dark) { .toast { background: #f4f4f5; color: #18181b; } }
.toast-text { flex: 1; font-weight: 500; }
.toast-action {
  background: none; border: 0; color: #fbbf24; font: inherit; font-weight: 700; padding: .4rem .2rem; cursor: pointer;
}
@media (prefers-color-scheme: dark) { .toast-action { color: var(--red); } }
.toast.error { background: var(--red); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.flash { transition: opacity .3s; }
.flash.fade { opacity: 0; }

/* ---------- Getränke ---------- */
.drink-grid { gap: .7rem; }
.drink-btn { position: relative; min-height: 96px; user-select: none; -webkit-user-select: none; }
.drink-count {
  position: absolute; top: .35rem; right: .45rem;
  font-size: .7rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px;
  background: var(--red); color: #fff;
}
.drink-btn.bump { animation: bump .28s ease-out; }
.drink-btn.busy { opacity: .7; }
@keyframes bump { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.for-select { margin-bottom: .75rem; }
.for-select select { width: auto; min-width: 12rem; }
#tally-list li.new { animation: toast-in .25s ease-out; }

/* ---------- Start ---------- */
.greeting { font-size: 1.15rem; font-weight: 600; margin: .1rem 0 .8rem; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.quick {
  display: flex; align-items: center; gap: .6rem; padding: .9rem; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600;
  box-shadow: var(--shadow); min-height: 56px;
}
.quick .icon { color: var(--red); width: 1.5em; height: 1.5em; }
.card-head a { display: inline-flex; align-items: center; gap: .1rem; text-decoration: none; }
.card-head a .icon { width: 1em; height: 1em; }

/* ---------- Kasse ---------- */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin-bottom: 1rem;
  background: var(--grey-soft); border: 1px solid var(--border); border-radius: 12px;
}
.segmented a { text-align: center; padding: .55rem; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; }
.segmented a.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.hero {
  background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff;
  border-radius: 18px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; display: flex; flex-direction: column;
}
.hero .money, .hero .money.neg, .hero .money.pos { color: #fff; }
.hero-label { opacity: .85; font-size: .9rem; }
.hero-value { font-size: 2rem; font-weight: 800; line-height: 1.2; }
.hero-sub { font-size: .85rem; opacity: .9; margin-top: .2rem; }
.hero-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .8rem; padding-top: .7rem;
  border-top: 1px solid rgba(255, 255, 255, .25); font-size: .85rem; opacity: .95; }
.hero-small .hero-value { font-size: 1.5rem; }
.hero-small { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.hero-small .money.neg { color: var(--red); }
.hero-small .money.pos { color: var(--green); }
.hero-warn { border-color: #f59e0b; }
.card-flush { padding: .25rem 1rem; }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger-group { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .9rem 0 .3rem; }
.ledger-item { display: flex; align-items: flex-start; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.ledger-item:last-child { border-bottom: 0; }
.ledger-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .45rem; flex: none; background: var(--green); }
.ledger-dot.neg { background: var(--red); }
.ledger-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ledger-title { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.ledger-title { color: var(--text); }
.ledger-sub, .ledger-meta { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.ledger-meta { font-size: .78rem; }
.ledger-amount { text-align: right; display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; }
.ledger-balance { font-size: .75rem; font-weight: 400; color: var(--muted); }
.section-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1.2rem 0 .5rem; }
.my-fees h2 { margin-bottom: .5rem; }
.month-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.month-chip { display: inline-flex; gap: .35rem; align-items: center; padding: .3rem .65rem; border-radius: 999px; font-size: .85rem; background: var(--grey-soft); }

/* ---------- Strichliste (Handy) ---------- */
.tally-people li { align-items: flex-start; }
.tally-people li.me { background: var(--red-soft); margin: 0 -.9rem; padding-left: .9rem; padding-right: .9rem; }
.tally-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.tally-chip { font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; background: var(--grey-soft); }
.tally-total { padding-top: .8rem !important; }

/* ---------- Ich ---------- */
.me-card { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-weight: 800; font-size: 1.3rem;
}
.menu { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.menu a, .menu-logout {
  display: flex; align-items: center; gap: .8rem; padding: .95rem 1rem; min-height: 54px;
  color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border);
  background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; font: inherit; text-align: left; cursor: pointer;
}
.menu a span, .menu-logout span { flex: 1; }
.menu a .icon:first-child { color: var(--red); }
.menu a .icon:last-child { color: var(--muted); width: 1em; height: 1em; }
.menu form { margin: 0; }
.menu-logout { border-bottom: 0; color: var(--red); }

/* ---------- Formulare ---------- */
.input-big { font-size: 1.5rem; font-weight: 700; }
fieldset.plain { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.plain legend { padding: 0; margin-bottom: .5rem; }
.step-title { font-weight: 600; margin: .5rem 0 .75rem; }
.sticky-actions {
  position: sticky; bottom: var(--sticky-bottom); z-index: 5;
  display: flex; align-items: center; gap: .6rem;
  margin: 1rem -1rem -1rem; padding: .75rem 1rem;
  background: var(--card); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
}
@media (max-width: 767px) { .sticky-actions { margin: 1rem -.9rem -.9rem; padding: .7rem .9rem; } }
.sticky-actions .btn { min-height: 50px; }
.sticky-total { display: flex; flex-direction: column; line-height: 1.2; min-width: 6.5rem; }
.sticky-total strong { font-size: 1.25rem; }
.form-with-sticky { padding-bottom: 1rem; }

/* ---------- Upload ---------- */
.upload-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.upload-add { min-height: 64px; flex-direction: column; gap: .2rem; font-size: .9rem; }
.upload-add .icon { width: 1.6em; height: 1.6em; color: var(--red); }
.upload-preview { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .5rem; }
.upload-preview li { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--grey-soft); border: 1px solid var(--border); }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-preview .upload-doc { display: flex; height: 100%; align-items: center; justify-content: center; flex-direction: column;
  font-weight: 800; color: var(--red); font-size: .9rem; padding: .3rem; text-align: center; word-break: break-all; }
.upload-preview .upload-doc small { font-weight: 400; color: var(--muted); font-size: .65rem; }
.upload-remove {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 1rem; line-height: 1;
}
.upload-form { display: flex; flex-direction: column; gap: .6rem; margin-top: .75rem; }
.upload-form .btn { align-self: flex-start; }

/* ---------- Protokoll ---------- */
.log-list li { padding: .75rem 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.checklist .check > span:first-of-type { flex: 1; }
.checklist .check .right { white-space: nowrap; padding-left: .5rem; }
.matrix th .m-head, .matrix th .m-sub { display: block; white-space: nowrap; }
.matrix th .m-sub { font-size: .7rem; font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ---------- Eingeschränkte Ansicht / Schalter ---------- */
.stats-1 { grid-template-columns: 1fr; }
.toggle {
  font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  border-radius: 999px; padding: .25rem .7rem; border: 1px solid var(--border); min-height: 32px;
}
.toggle.on { background: var(--green-soft); color: var(--green); border-color: transparent; }
.toggle.off { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.legend .cell-befreit { background: var(--grey-soft); }

/* ---------- Rechnungsverwaltung ---------- */
.badge-count { font-size: .75rem; font-weight: 700; padding: 0 .4rem; border-radius: 999px; background: var(--grey-soft); }
.tabs a.active .badge-count { background: rgba(255, 255, 255, .25); }
.invoice-admin { display: flex; flex-direction: column; gap: .5rem; }
.ia-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.ia-title { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.ia-amount { font-weight: 800; font-size: 1.15rem; }
.ia-meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; font-size: .85rem; color: var(--muted); }
.ia-facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .9rem; margin: .2rem 0; font-size: .9rem; }
.ia-facts dt { color: var(--muted); }
.ia-facts dd { margin: 0; }
.ia-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding-top: .5rem; border-top: 1px solid var(--border); }
.pay-quick { display: inline-flex; gap: .3rem; align-items: center; }
.pay-quick select { width: auto; margin: 0; min-height: 34px; padding: .2rem .5rem; font-size: .9rem; }
.warn-text { color: var(--amber); font-weight: 600; }
fieldset.allocation .check { align-items: flex-start; }
fieldset.allocation .check input { margin-top: .3rem; }

/* ---------- PayPal-Pool ---------- */
.pool-steps h2 { margin-bottom: .5rem; }
.steps { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.steps li { padding-left: .2rem; }
.steps li::marker { font-weight: 800; color: var(--red); }
.step-label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  background: var(--grey-soft); border-radius: 10px; padding: .5rem .5rem .5rem .8rem; }
.copy-value { overflow-wrap: anywhere; }
