/*
 * Vereinsverwaltung Katholischer Burschenverein Velden
 * Gestaltung nach dem Skill „apple-design“: Systemschrift, Gold & Grün, Hell- und Dunkelmodus,
 * sofortiges Feedback beim Antippen, transluzente Leisten, große Touch-Ziele.
 */

/* ------------------------------------------------------------------ Farben & Maße */
:root {
  color-scheme: light dark;

  --green: #1f5f3d;
  --green-strong: #174a2f;
  --green-tint: rgba(31, 95, 61, 0.12);
  --gold: #b8912c;
  --gold-strong: #8a6a17;
  --gold-tint: rgba(200, 161, 58, 0.18);
  --red: #c4314b;
  --red-tint: rgba(196, 49, 75, 0.12);
  --blue-tint: rgba(10, 110, 200, 0.10);
  --blue: #0a64b4;

  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f7f7fa;
  --fill: rgba(118, 118, 128, 0.12);
  --text: #1c1c1e;
  --text-2: #5f5f66;
  --text-3: #8a8a90;
  --separator: rgba(60, 60, 67, 0.16);
  --on-accent: #ffffff;

  --bar-bg: rgba(249, 249, 251, 0.72);
  --bar-border: rgba(60, 60, 67, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.22);
  --scrim: rgba(0, 0, 0, 0.32);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --tap: 3rem;               /* Mindesthöhe für Touch-Ziele (48 px) */
  --gutter: 1rem;
  --tabbar-h: 3.5rem;
  --max: 46rem;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --green: #4fb37b;
    --green-strong: #6cc893;
    --green-tint: rgba(79, 179, 123, 0.18);
    --gold: #e0bc5a;
    --gold-strong: #ecd08a;
    --gold-tint: rgba(224, 188, 90, 0.18);
    --red: #ff6b81;
    --red-tint: rgba(255, 107, 129, 0.16);
    --blue: #64aef5;
    --blue-tint: rgba(100, 174, 245, 0.16);

    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #232326;
    --fill: rgba(118, 118, 128, 0.24);
    --text: #f2f2f7;
    --text-2: #a6a6ad;
    --text-3: #7c7c82;
    --separator: rgba(84, 84, 88, 0.6);
    --on-accent: #06210f;

    --bar-bg: rgba(22, 22, 24, 0.72);
    --bar-border: rgba(84, 84, 88, 0.5);
    --shadow-sm: none;
    --scrim: rgba(0, 0, 0, 0.55);
  }
}

/* ------------------------------------------------------------------ Grundlagen */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font: 100%/1.47 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem; /* 17 px wie iOS-Fließtext */
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
img, svg { display: block; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--fill); padding: 0.1em 0.35em; border-radius: 6px; }
p { margin: 0 0 0.75rem; }
h1, h2, h3 { margin: 0; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent);
  outline-offset: 2px;
  border-radius: 8px;
}

.icon { width: 1.375rem; height: 1.375rem; flex: none; }

.visually-hidden {
  position: absolute !important;
  left: 0 !important;
  width: 1px !important; height: 1px !important; min-height: 0 !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important;
  white-space: nowrap; border: 0 !important; padding: 0 !important; margin: -1px !important;
}
.card, .form { position: relative; }

.skip-link {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 100;
  background: var(--surface); padding: 0.75rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: calc(var(--safe-top) + 0.5rem); }

/* ------------------------------------------------------------------ Typografie (Tracking je Größe) */
.large-title { font-size: clamp(1.875rem, 1.5rem + 1.6vw, 2.25rem); line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; }
.title-1 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.022em; font-weight: 700; margin-bottom: 0.5rem; }
.title-2 { font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.018em; font-weight: 700; margin-bottom: 0.5rem; }
.title-3 { font-size: 1.1875rem; line-height: 1.25; letter-spacing: -0.014em; font-weight: 650; margin-bottom: 0.25rem; }
.eyebrow { font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; color: var(--gold-strong); margin: 0 0 0.25rem; }
.secondary { color: var(--text-2); }
.hint { display: block; font-size: 0.875rem; line-height: 1.4; letter-spacing: 0; color: var(--text-2); margin: 0.375rem 0 0; }
.footnote { font-size: 0.875rem; color: var(--text-2); text-align: center; margin: 1rem 0; }
.optional { font-weight: 400; color: var(--text-3); font-size: 0.875em; }
.subtitle { color: var(--text-2); margin: 0.375rem 0 0; }

/* ------------------------------------------------------------------ Feedback beim Antippen (sofort, auf pointer-down) */
.pressable {
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), opacity 160ms var(--ease-out);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.pressable:active { transform: scale(0.97); transition-duration: 60ms; }
.list-row.pressable:active, .check-row.pressable:active, .switch-row.pressable:active { transform: none; background-color: var(--fill); }

/* ------------------------------------------------------------------ Schlichtes Layout (Anmeldung, Einrichtung) */
.plain-main {
  max-width: 28rem;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 2rem) var(--gutter) calc(var(--safe-bottom) + 2rem);
}
.plain-brand { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.plain-verein { font-weight: 600; letter-spacing: -0.01em; text-align: center; margin: 0; color: var(--text-2); }
.logo-full {
  display: grid; place-items: center;
  width: 10rem; height: 10rem; border-radius: 50%;
  background: #1f5f3d; /* Vereinsgrün, in beiden Modi gleich: Logo ist weiß */
  box-shadow: 0 8px 24px rgba(31, 95, 61, 0.25);
}
.logo-full img { width: 86%; height: 86%; }

/* ------------------------------------------------------------------ App-Layout */
.app { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 1.5rem); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center;
  min-height: calc(3.25rem + var(--safe-top));
  padding: var(--safe-top) var(--gutter) 0;
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid var(--bar-border);
}
.brand { display: flex; align-items: center; gap: 0.625rem; color: var(--text); font-weight: 650; letter-spacing: -0.015em; min-height: var(--tap); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 2rem; height: 2rem; }
.brand-name { font-size: 0.9375rem; line-height: 1.2; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  padding: 0.25rem 0.5rem calc(var(--safe-bottom) + 0.25rem);
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid var(--bar-border);
}
.tab {
  flex: 1; max-width: 8rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem;
  min-height: var(--tabbar-h);
  color: var(--text-3);
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
}
.tab:hover { text-decoration: none; color: var(--text-2); }
.tab .icon { width: 1.625rem; height: 1.625rem; }
.tab.is-active { color: var(--green); }

.content {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.5rem var(--gutter) 2rem;
}

/* Am PC: Seitenleiste statt Tab-Leiste */
@media (min-width: 900px) {
  .app { padding-bottom: 2rem; padding-left: 15rem; }
  .topbar { position: fixed; left: 0; top: 0; bottom: auto; width: 15rem; border-bottom: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 1.25rem 1rem 0; }
  .tabbar {
    top: 5rem; bottom: 0; left: 0; right: auto; width: 15rem;
    flex-direction: column; justify-content: flex-start; gap: 0.125rem;
    padding: 0.5rem 0.75rem;
    background: transparent; border-top: 0;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  body.app::before {
    content: ""; position: fixed; inset: 0 auto 0 0; width: 15rem; z-index: 0;
    background: var(--surface-2); border-right: 0.5px solid var(--separator);
  }
  .tab { flex: none; max-width: none; flex-direction: row; justify-content: flex-start; gap: 0.75rem; min-height: 2.75rem; padding: 0 0.75rem; font-size: 0.9375rem; color: var(--text); }
  .tab .icon { width: 1.375rem; height: 1.375rem; color: var(--green); }
  .tab.is-active { background: var(--green-tint); color: var(--text); }
  .content { padding-top: 2rem; }
}

/* ------------------------------------------------------------------ Seitenkopf */
.page-header { margin: 0.75rem 0 1.25rem; }
.page-header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.125rem; min-height: 2.75rem; margin-left: -0.375rem; padding-right: 0.5rem; font-size: 1.0625rem; }
.back-link:hover { text-decoration: none; }
.back-link .icon { width: 1.5rem; height: 1.5rem; }

.section-title { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; color: var(--text-2); margin: 1.75rem 0 0.5rem 1rem; }
.section-hint { font-size: 0.875rem; color: var(--text-2); margin: -0.25rem 1rem 0.75rem; }

/* ------------------------------------------------------------------ Karten, Listen */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow-sm);
  border: 0;
  min-width: 0;
}
fieldset.card { margin-inline: 0; }
.card-center { text-align: center; }
.card-center .btn { margin-top: 0.5rem; }
legend.title-3 { float: left; width: 100%; padding: 0; margin-bottom: 0.75rem; }
legend.title-3 + * { clear: both; }

.list {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}
.list > form { margin: 0; }
.list-row {
  position: relative;
  display: flex; align-items: center; gap: 0.875rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.625rem 1rem;
  color: var(--text);
  background: none; border: 0; font: inherit; text-align: left;
}
.list-row-top { align-items: flex-start; }
a.list-row:hover { text-decoration: none; background: var(--surface-2); }
.list-row + .list-row, .list > form + .list-row, .list > .list-row + form, .list > form + form {
  box-shadow: inset 0 0.5px 0 var(--separator);
}
.list-row.is-inactive .row-title { color: var(--text-3); }
.row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.row-title { font-weight: 500; overflow-wrap: anywhere; }
.row-sub { font-size: 0.875rem; color: var(--text-2); overflow-wrap: anywhere; letter-spacing: 0; }
.row-icon {
  display: grid; place-items: center; flex: none;
  width: 2.125rem; height: 2.125rem; border-radius: 9px;
  background: var(--fill); color: var(--text-2);
}
.row-icon .icon { width: 1.25rem; height: 1.25rem; }
.row-icon-green { background: var(--green); color: var(--on-accent); }
.row-icon-gold { background: var(--gold); color: #1c1400; }
.chevron { color: var(--text-3); width: 1.125rem; height: 1.125rem; }
.list-muted .row-title { color: var(--text-2); font-weight: 400; }

.list-action { color: var(--green); cursor: pointer; font-weight: 500; gap: 0.625rem; }
.list-action-danger { color: var(--red); }
.danger-zone { margin-top: 2rem; }

.diff-old { color: var(--red); }
.diff-new { color: var(--green); }

.plain-list { padding-left: 1.25rem; margin: 0.75rem 0 1rem; }

.empty { text-align: center; color: var(--text-2); padding: 2rem 1rem; }
.empty-icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: 0 auto 0.75rem; border-radius: 50%; background: var(--gold-tint); color: var(--gold-strong); }
.empty-icon .icon { width: 1.75rem; height: 1.75rem; }
.empty-icon-green { background: var(--green-tint); color: var(--green); }

.stack { display: grid; gap: 0.625rem; margin-bottom: 1rem; }

/* Kacheln auf der Startseite */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.75rem; margin-bottom: 0.5rem; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.25rem;
  min-height: 7rem; padding: 1rem;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  color: var(--text);
}
.tile:hover { text-decoration: none; }
.tile-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 12px; background: var(--green); color: var(--on-accent); }
.tile-label { font-weight: 600; letter-spacing: -0.012em; line-height: 1.25; }

/* Hinweise */
.notice {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1rem; border-radius: var(--radius);
  background: var(--blue-tint); color: var(--text);
  margin-bottom: 0.75rem;
}
.notice:hover { text-decoration: none; }
.notice > span { flex: 1; }
.notice > .icon:first-child { color: var(--blue); }
.notice-warning { background: var(--gold-tint); }
.notice-warning > .icon:first-child { color: var(--gold-strong); }
.notice-info > .icon:first-child { color: var(--blue); }

/* Badges & Chips */
.badge {
  display: inline-flex; align-items: center; flex: none;
  padding: 0.125rem 0.5rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em;
  background: var(--fill); color: var(--text-2);
  vertical-align: middle;
}
.badge-gold { background: var(--gold-tint); color: var(--gold-strong); }
.badge-green { background: var(--green-tint); color: var(--green); }
.badge-red { background: var(--red-tint); color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.5rem 0 0; }
.chip { padding: 0.25rem 0.625rem; border-radius: 999px; background: var(--gold-tint); color: var(--gold-strong); font-size: 0.8125rem; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.75rem; border-radius: 999px; background: var(--fill); font-size: 0.9375rem; overflow-wrap: anywhere; }
.pill .icon { width: 1.125rem; height: 1.125rem; color: var(--text-2); }

.status-card { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: -0.5rem 0 1rem; font-size: 0.9375rem; }

/* Profil */
.profile { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.profile p { margin: 0; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 4rem; height: 4rem; border-radius: 50%;
  background: linear-gradient(145deg, var(--green), color-mix(in srgb, var(--green) 70%, var(--gold)));
  color: #fff; font-weight: 650; font-size: 1.375rem; letter-spacing: 0.02em;
}
.avatar-small { width: 2.375rem; height: 2.375rem; font-size: 0.875rem; }
.avatar-photo { object-fit: cover; background: var(--fill); }

/* Profilbild wählen: das ganze Bild ist der Knopf */
.avatar-form { margin: 0; flex: none; }
.avatar-picker { position: relative; display: block; cursor: pointer; border-radius: 50%; }
.avatar-picker .avatar { width: 5rem; height: 5rem; font-size: 1.625rem; }
.avatar-picker:focus-within { outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent); outline-offset: 3px; }
.avatar-badge {
  position: absolute; right: -0.125rem; bottom: -0.125rem;
  display: grid; place-items: center; width: 1.875rem; height: 1.875rem;
  border-radius: 50%; background: var(--green); color: var(--on-accent);
  border: 2px solid var(--bg);
}
.avatar-badge .icon { width: 1rem; height: 1rem; }
.avatar-form.is-uploading .avatar { opacity: 0.45; }
.avatar-form.is-uploading .avatar-badge { animation: avatar-pulse 1s ease-in-out infinite alternate; }
@keyframes avatar-pulse { from { opacity: 1; } to { opacity: 0.35; } }
.avatar-hint { margin: 0 0 0.5rem; }
.link-button { background: none; border: 0; padding: 0.5rem 0; margin-left: 0.25rem; font: inherit; color: var(--red); cursor: pointer; min-height: 2.75rem; }
.hint-top { margin: 0 0 1rem; }

/* Systemprüfung */
.checklist { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.625rem; }
.checklist li { display: flex; gap: 0.625rem; align-items: flex-start; }
.checklist li > div { display: flex; flex-direction: column; }
.checklist strong { font-weight: 500; }
.checklist small { color: var(--text-2); font-size: 0.875rem; }
.checklist .ok .icon { color: var(--green); }
.checklist .fail .icon { color: var(--red); }
.checklist .warn .icon { color: var(--gold-strong); }

/* ------------------------------------------------------------------ Formulare */
.form { margin: 0; }
.field { display: block; margin: 0 0 1rem; border: 0; padding: 0; min-width: 0; }
.label { display: block; font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.375rem; letter-spacing: -0.005em; }
.field-row { display: grid; gap: 0 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 30rem) { .field-row { grid-template-columns: 1fr 1fr; } }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="tel"], input[type="search"], input[type="date"], select, textarea {
  display: block; width: 100%;
  min-height: var(--tap);
  padding: 0.6875rem 0.875rem;
  font: inherit; font-size: 1.0625rem; /* ≥ 16 px: iOS zoomt nicht hinein */
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
  appearance: none; -webkit-appearance: none;
}
textarea { resize: vertical; min-height: 5.5rem; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1.125rem;
  padding-right: 2.5rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-tint);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { opacity: 0.65; }

.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 3.25rem; }
.reveal {
  position: absolute; right: 0.25rem; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border: 0; background: none; color: var(--text-3); border-radius: 8px; cursor: pointer;
}
.reveal.is-on { color: var(--green); }

/* Schalter im iOS-Stil */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--tap); margin: 0 0 1rem; cursor: pointer;
  border-radius: var(--radius-sm);
}
.switch-row.card { margin-bottom: 1rem; padding: 1rem 1.25rem; }
.switch-label { display: block; font-weight: 500; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  position: relative; width: 3.1875rem; height: 1.9375rem; margin: 0;
  border-radius: 999px; background: var(--fill); cursor: pointer;
  transition: background-color 250ms var(--ease-out);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 1.6875rem; height: 1.6875rem; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 300ms cubic-bezier(0.3, 1.3, 0.5, 1);
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(1.25rem); }

/* Auswahl-Liste (Rollen) */
.check-list { display: grid; gap: 0.25rem; margin: 0.5rem -0.5rem 0; }
.check-row { display: flex; align-items: center; gap: 0.875rem; padding: 0.625rem 0.5rem; border-radius: var(--radius-sm); cursor: pointer; min-height: var(--tap); }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  display: grid; place-items: center; flex: none;
  width: 1.625rem; height: 1.625rem; border-radius: 50%;
  border: 2px solid var(--separator); color: transparent;
  transition: background-color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}
.check-box .icon { width: 1rem; height: 1rem; stroke-width: 3; }
.check-row input:checked + .check-box { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.check-row input:focus-visible + .check-box { outline: 3px solid var(--green-tint); outline-offset: 2px; }
.check-row.is-locked { cursor: not-allowed; opacity: 0.6; }

/* Rechte-Raster */
.permission-group { padding: 1rem 1.25rem; }
.permission-head { display: flex; align-items: center; gap: 0.5rem; float: left; width: 100%; padding: 0; }
.permission-head .title-3 { margin: 0; }
.permission-group .hint { clear: both; margin-bottom: 0.75rem; padding-top: 0.25rem; }
.toggle-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toggle { position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  padding: 0.5rem 0.875rem; border-radius: 999px;
  background: var(--fill); color: var(--text); font-size: 0.9375rem; font-weight: 500;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}
.toggle input:checked + span { background: var(--green); color: var(--on-accent); }
.toggle input:checked + span::before { content: "✓"; margin-right: 0.375rem; font-weight: 700; }
.toggle input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent); outline-offset: 2px; }
.toggle input:disabled + span { opacity: 0.5; cursor: not-allowed; }

/* Segmentierte Auswahl */
.segmented { display: flex; padding: 0.1875rem; background: var(--fill); border-radius: 11px; gap: 0.1875rem; }
.segmented label { flex: 1; position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex; align-items: center; justify-content: center; min-height: 2.5rem;
  border-radius: 8px; font-size: 0.9375rem; font-weight: 500; color: var(--text);
  transition: background-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.segmented input:checked + span { background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 600; }
.segmented input:focus-visible + span { outline: 3px solid var(--green-tint); }
.mail-details[hidden], .smtp-details[hidden] { display: none; }
.mail-details { margin-top: 1rem; }

.copy-field { display: flex; gap: 0.5rem; }
.copy-field input { flex: 1; min-width: 0; font-size: 0.9375rem; }

.search { margin-bottom: 1rem; }
.search input {
  background-color: var(--fill); border-color: transparent;
  padding-left: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a90' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 0.75rem center; background-size: 1.125rem;
}

.sticky-actions {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 0.75rem); z-index: 5;
  margin-top: 1rem;
}
@media (min-width: 900px) { .sticky-actions { bottom: 1rem; } }

.logout-form { margin-top: 2rem; }
.form-inline { margin: -0.5rem 0 1rem; }

/* ------------------------------------------------------------------ Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--tap);
  padding: 0.75rem 1.25rem;
  font: inherit; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em;
  border: 0; border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn .icon { width: 1.25rem; height: 1.25rem; }
.btn-block { display: flex; width: 100%; margin-top: 0.5rem; }
.btn-compact { min-height: 2.5rem; padding: 0.5rem 0.875rem; font-size: 0.9375rem; border-radius: 999px; }
.btn-primary { background: var(--green); color: var(--on-accent); }
.btn-primary:hover { background: var(--green-strong); }
.btn-secondary { background: var(--green-tint); color: var(--green); }
.btn-plain { background: transparent; color: var(--green); font-weight: 500; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-plain { background: var(--surface); color: var(--red); box-shadow: var(--shadow-sm); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ------------------------------------------------------------------ Meldungen */
.flashes { display: grid; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.flash {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0.5rem 0.75rem 1rem; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--blue);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.flash > span { flex: 1; }
.flash-success { border-left-color: var(--green); }
.flash-success > .icon { color: var(--green); }
.flash-error { border-left-color: var(--red); background: color-mix(in srgb, var(--surface) 92%, var(--red)); }
.flash-error > .icon { color: var(--red); }
.flash-info > .icon { color: var(--blue); }
.flash-close { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; background: none; color: var(--text-3); cursor: pointer; border-radius: 8px; flex: none; }
.flash.is-leaving { opacity: 0; transform: translateY(-0.5rem); }

/* ------------------------------------------------------------------ Sheets (von unten, mit Wischgeste) */
dialog.sheet {
  position: fixed; inset: auto 0 0 0;
  width: 100%; max-width: 32rem; max-height: 90dvh;
  margin: 0 auto;
  padding: 0.5rem 1.25rem calc(var(--safe-bottom) + 1.25rem);
  border: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: auto; overscroll-behavior: contain;
  touch-action: pan-y;
}
dialog.sheet::backdrop { background: var(--scrim); opacity: var(--scrim-opacity, 1); }
dialog.sheet .title-3 { margin: 0.75rem 0 0.5rem; }
dialog.sheet form { margin: 0; }
.sheet-handle {
  width: 2.25rem; height: 0.3125rem; margin: 0.25rem auto 0.5rem;
  border-radius: 999px; background: var(--separator);
  cursor: grab;
}
/* Fallback ohne JavaScript: einfach einblenden */
@media (min-width: 40rem) {
  dialog.sheet { inset: 0; margin: auto; border-radius: var(--radius-lg); height: fit-content; padding-bottom: 1.25rem; }
  .sheet-handle { display: none; }
}

/* ------------------------------------------------------------------ Buchhaltung */
[hidden] { display: none !important; }
input[type="date"] { -webkit-appearance: none; appearance: none; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; letter-spacing: -0.01em; }
.amount-in { color: var(--green); }
.amount-negative { color: var(--red); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--text-3); }
.icon-inline { display: inline-block; width: 1rem; height: 1rem; vertical-align: -0.15em; }
.row-icon-out { background: var(--fill); color: var(--text); }

/* Schnell erfassen: drei große Knöpfe, sofort sichtbar */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.625rem; margin: 0 0 1.25rem; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.375rem;
  min-height: 5.5rem; padding: 0.75rem 0.5rem;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  color: var(--text); font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.01em; text-align: center;
}
.quick-action:hover { text-decoration: none; }
.quick-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--fill); color: var(--text); }
.quick-icon .icon { width: 1.5rem; height: 1.5rem; }
.quick-in .quick-icon { background: var(--green); color: var(--on-accent); }
.quick-out .quick-icon { background: var(--gold); color: #1c1400; }

/* Kennzahlen-Kacheln */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.625rem; margin: 0 0 0.75rem; }
.stat { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.875rem 1rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.stat-label { font-size: 0.8125rem; color: var(--text-2); }
.stat-value { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.list-total { background: var(--surface-2); }
.list-total .row-title { font-weight: 600; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; flex: none; }
.row-flags { display: flex; align-items: center; gap: 0.25rem; }
.flag-icon .icon { width: 1rem; height: 1rem; color: var(--text-3); }
.booking-row .row-title { overflow: hidden; text-overflow: ellipsis; }
.is-cancelled .row-title, .is-cancelled .amount, tr.is-cancelled td { text-decoration: line-through; text-decoration-color: var(--text-3); color: var(--text-2); }
.list-row .row-link { display: flex; align-items: center; gap: 0.875rem; flex: 1; min-width: 0; color: inherit; }
.list-row .row-link:hover { text-decoration: none; }
.icon-button {
  display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-button:hover { background: var(--fill); }
.large-section { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.018em; margin: 1.75rem 0 0; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1rem; }
.toolbar select { width: auto; min-width: 8rem; }
.label-inline { font-weight: 600; font-size: 0.9375rem; }
.hint-center { text-align: center; }
.small { font-size: 0.875rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0; color: var(--text-2); font-size: 0.9375rem; }

/* Segmented Control als Links (Art der Buchung) */
.segmented-links { margin: 0 0 1rem; }
.segmented-links a {
  flex: 1; display: grid; place-items: center; min-height: 2.5rem; padding: 0.375rem 0.5rem;
  border-radius: 8px; color: var(--text); font-size: 0.9375rem; font-weight: 500; text-align: center;
}
.segmented-links a:hover { text-decoration: none; }
.segmented-links a.is-active { background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 600; }

/* Buchungsformular */
.booking-form .card { margin-bottom: 1rem; }
.lines { display: grid; gap: 0.75rem; margin-bottom: 0.75rem; }
.line-card { margin: 0; padding: 1rem 1.25rem 0.25rem; border: 0; min-width: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.line-head { display: none; align-items: center; justify-content: space-between; margin: -0.5rem -0.75rem 0.25rem 0; }
.lines.has-many .line-head { display: flex; }
.line-number { font-size: 0.8125rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.03em; }
.line-tax { min-height: 1.25rem; margin: -0.5rem 0 0.75rem; font-size: 0.875rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.field-row-amount { grid-template-columns: 1.4fr 1fr; }
.field-compact { margin-bottom: 0.75rem; }
.money-wrap { position: relative; display: block; }
.money-wrap input { padding-right: 2.25rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.money-suffix { position: absolute; right: 0.875rem; top: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.money-wrap-large input { font-size: 1.75rem; min-height: 3.75rem; letter-spacing: -0.02em; }
.total-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0.75rem 0 1rem; padding: 0.875rem 1.25rem;
  background: var(--green-tint); border-radius: var(--radius); font-weight: 600;
}
.total-bar .amount { font-size: 1.25rem; }
.chips-recent { align-items: center; margin: 0 0 0.75rem; }
.chips-label { font-size: 0.8125rem; color: var(--text-2); margin-right: 0.125rem; }
.chip-button { border: 0; cursor: pointer; font: inherit; font-size: 0.875rem; font-weight: 600; min-height: 2.25rem; padding: 0.375rem 0.75rem; }
.more-fields { margin: 0 0 0.5rem; }
.more-fields > summary { cursor: pointer; color: var(--green); font-weight: 500; min-height: var(--tap); display: flex; align-items: center; list-style: none; }
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields > summary::before { content: "›"; display: inline-block; margin-right: 0.5rem; transition: transform 200ms var(--ease-out); font-size: 1.25rem; line-height: 1; }
.more-fields[open] > summary::before { transform: rotate(90deg); }
.upload-button {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--tap); margin: 0.375rem 0 0.5rem; padding: 0.75rem 1rem;
  border: 1.5px dashed color-mix(in srgb, var(--green) 45%, transparent); border-radius: var(--radius-sm);
  color: var(--green); font-weight: 600; cursor: pointer; background: var(--green-tint);
}
.upload-button input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload-button:focus-within { outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent); outline-offset: 2px; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.375rem; }
.file-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; color: var(--text-2); overflow-wrap: anywhere; }
.file-list img { width: 2.75rem; height: 2.75rem; object-fit: cover; border-radius: 6px; flex: none; }
.upload-inline { margin: 0; }
.upload-inline .list-row { position: relative; }
.sticky-actions-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0.5rem; }
.sticky-actions-row .btn { box-shadow: var(--shadow-lg); }
.sticky-actions-row .btn-secondary { background: color-mix(in srgb, var(--green) 16%, var(--surface)); }
.sticky-actions .btn-primary { box-shadow: 0 8px 24px color-mix(in srgb, var(--green) 35%, transparent); }

/* Buchungsdetails */
.booking-hero { text-align: center; padding-top: 1.25rem; }
.booking-hero .chips { justify-content: center; }
.booking-hero .badge .icon { width: 0.875rem; height: 0.875rem; display: inline-block; vertical-align: -0.1em; }
.hero-amount { font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 0.25rem 0; }
.booking-hero.is-cancelled .hero-amount { text-decoration: line-through; color: var(--text-2); }
.details { display: grid; gap: 0; margin: 0 0 1rem; padding-block: 0.25rem; }
.details > div { display: grid; grid-template-columns: minmax(7rem, 35%) 1fr; gap: 0.75rem; padding: 0.625rem 0; border-bottom: 0.5px solid var(--separator); }
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--text-2); font-size: 0.9375rem; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.explain { margin-bottom: 1rem; }
.explain > summary { cursor: pointer; font-weight: 600; color: var(--green); min-height: 2rem; list-style: none; }
.explain > summary::-webkit-details-marker { display: none; }
.explain[open] > summary { margin-bottom: 0.75rem; }
.filters { margin-bottom: 0.5rem; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }
.search-row .search { margin: 0; }
.search-row select { width: auto; }
.form-row { display: flex; gap: 0.5rem; align-items: flex-start; }
.form-row .field { flex: 1; margin: 0; }

/* Tabellen (Kassenbuch, Auswertungen) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap.card { padding: 0.5rem 0.75rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td { padding: 0.5rem 0.5rem; border-bottom: 0.5px solid var(--separator); text-align: left; vertical-align: top; }
.table thead th { font-size: 0.8125rem; color: var(--text-2); font-weight: 600; }
.table th.num, .table td.num { text-align: right; }
.table tfoot th, .table tfoot td { font-weight: 700; border-bottom: 0; }
.table-muted td { color: var(--text-2); }
.table-small { font-size: 0.8125rem; }
.table-report { margin-top: 0.5rem; }
.table-head-row th { padding-top: 1rem; font-size: 0.9375rem; color: var(--text); }
.report-card { margin-bottom: 1rem; min-width: 0; }
.nowrap { white-space: nowrap; }
.table-report .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Berichte am iPhone: Zahlen müssen in die Karte passen – kleinere Schrift, engere Spalten,
   und falls es trotzdem nicht reicht, scrollt nur die Tabelle (.table-wrap), nie die ganze Seite. */
@media (max-width: 40rem) {
  .report-card { padding: 1rem 0.875rem; }
  .table-report { font-size: 0.8125rem; }
  .table-report th, .table-report td { padding: 0.4375rem 0.3125rem; }
  .table-report th:first-child, .table-report td:first-child { padding-left: 0; }
  .table-report th:last-child, .table-report td:last-child { padding-right: 0; }
  .table-report thead th { font-size: 0.6875rem; letter-spacing: 0.01em; }
  .table-report td:first-child { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
}
/* Zwei Darstellungen derselben Daten: Tabelle ab Tablet-Breite (und im PDF), Liste am Handy */
.only-narrow { display: none; }
@media (max-width: 40rem) {
  .only-wide { display: none; }
  .only-narrow { display: block; }
}
.doc-list { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.doc-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.125rem 0.75rem; padding: 0.625rem 0; border-bottom: 0.5px solid var(--separator); font-size: 0.9375rem; }
.doc-list li:last-child { border-bottom: 0; }
.doc-list .doc-meta { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--text-2); }
.doc-list .amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-list li.is-cancelled > span:first-child, .doc-list li.is-cancelled .amount { text-decoration: line-through; color: var(--text-3); }

/* Umsatzsteuer */
.payable-card { text-align: center; }
.kz-row { gap: 0.75rem; }
.kz { flex: none; min-width: 3.25rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--green); }
.kz-value {
  display: inline-flex; align-items: center; gap: 0.375rem; flex: none;
  min-height: 2.5rem; padding: 0.375rem 0.75rem; border: 0; border-radius: 999px;
  background: var(--fill); color: var(--text); font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.kz-value.is-copied { background: var(--green); color: var(--on-accent); }

/* Druck: Kassenbericht */
.signatures { display: none; }
.print-head { margin-bottom: 1rem; }

/* ------------------------------------------------------------------ Barrierefreiheit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .pressable:active { transform: none; opacity: 0.7; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .tabbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --separator: color-mix(in srgb, var(--text) 45%, transparent); --text-2: color-mix(in srgb, var(--text) 82%, var(--bg)); --text-3: color-mix(in srgb, var(--text) 68%, var(--bg)); }
  .topbar, .tabbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border-color: var(--text); }
  .card, .list, .tile { border: 1px solid var(--separator); }
}

/* ------------------------------------------------------------------ Wechselgeld & Festkassen */
.quick-actions-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 23rem) { .quick-actions-4 { grid-template-columns: repeat(2, 1fr); } }
.card-flush { padding: 0.25rem 0; overflow: hidden; }
.card-flush > summary { padding: 0.875rem 1.25rem; }

/* Zählraster: Sorte | Rollen | Stück | Summe – auf dem iPhone in einer Zeile, große Eingabefelder */
.denom-grid { padding: 0 1rem; }
.denom-group + .denom-group { border-top: 0.5px solid var(--separator); margin-top: 0.25rem; }
.denom-head, .denom-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 4.25rem 4.25rem 5.25rem;
  gap: 0.5rem; align-items: center;
}
.denom-head { padding: 0.75rem 0 0.25rem; font-size: 0.75rem; font-weight: 600; color: var(--text-2); letter-spacing: 0.01em; }
.denom-head span:nth-child(2), .denom-head span:nth-child(3) { text-align: center; }
.denom-head span:last-child { text-align: right; }
.denom-row { padding: 0.3125rem 0; min-height: var(--tap); }
.denom-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.denom-name strong { font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.denom-name small { font-size: 0.75rem; color: var(--text-2); line-height: 1.25; }
.denom-name small.denom-low { color: var(--red); }
input.denom-input {
  min-height: 2.75rem; padding: 0.5rem 0.25rem; text-align: center;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
input.denom-input:placeholder-shown { font-weight: 400; }
.denom-sum { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.9375rem; color: var(--text-3); white-space: nowrap; }
.denom-row.has-value .denom-sum { color: var(--text); font-weight: 600; }
.denom-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0.5rem -1rem 0; padding: 0.875rem 1rem;
  background: var(--green-tint); font-weight: 600;
}
.denom-total .amount { font-size: 1.25rem; }
@media (max-width: 22.5rem) {
  .denom-head, .denom-row { grid-template-columns: minmax(0, 1fr) 3.5rem 3.5rem 4.5rem; gap: 0.375rem; }
  .denom-sum { font-size: 0.8125rem; }
}
.denom-settings input.denom-input { width: 4.5rem; min-height: 2.5rem; }
input.input-account { flex: none; width: 7rem; }
.switch-label .hint { display: block; margin-top: 0.125rem; font-weight: 400; }
.table-report td input.denom-input { width: 5rem; min-height: 2.5rem; }

.steps { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.steps li { margin: 0 0 0.5rem; }
.register-group > summary { list-style: none; cursor: pointer; }
.register-group > summary::-webkit-details-marker { display: none; }
.list-inset { border-radius: 0; box-shadow: none; margin: 0; border-top: 0.5px solid var(--separator); }
.total-bar[hidden] { display: none; }
.amount-negative.total-value, .total-bar .amount-negative { color: var(--red); }

/* Beitragsliste: Name links, Betrag rechts, große Touch-Ziele */
.fee-row { min-height: 3.5rem; }
.fee-row[hidden] { display: none; }
.fee-input { flex: none; width: 7.5rem; }
.fee-input input { text-align: right; min-height: 2.75rem; }
.fee-input input[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--red); }
.total-bar.card { position: sticky; top: calc(var(--safe-top) + 3.75rem); z-index: 2; }
@media (min-width: 900px) { .total-bar.card { top: 1rem; } }

/* Aufklappbare Zeile in einer Liste (z. B. Mitgliedsart bearbeiten) */
.list-row-details > summary { list-style: none; cursor: pointer; }
.list-row-details > summary::-webkit-details-marker { display: none; }
.list-row-details[open] > summary .chevron { color: var(--green); }
.list-row-details > form, .list-row-details > form + form { padding: 0 1rem 0.75rem; }
.list > .list-row-details + .list-row-details { box-shadow: inset 0 0.5px 0 var(--separator); }

/* QR-Code zur Anmeldung: immer schwarz auf weiß, sonst scannt die Kamera im Dunkelmodus schlecht */
.qr-figure { margin: 1rem 0 0.5rem; text-align: center; }
.qr-figure img { display: block; margin: 0 auto 0.5rem; width: 12.5rem; height: 12.5rem; padding: 0.5rem; background: #fff; border-radius: var(--radius); }
.qr-poster { text-align: center; }
.qr-poster .qr-large { display: block; width: 16rem; height: 16rem; margin: 1.5rem auto; padding: 0.75rem; background: #fff; border-radius: var(--radius); }
.qr-poster .qr-link { overflow-wrap: anywhere; font-size: 0.875rem; }

@media print {
  .only-narrow { display: none !important; }
  .only-wide { display: block !important; }
  .topbar, .tabbar, .btn, .flashes, .no-print, .toolbar, .back-link, .explain, .sticky-actions, .skip-link { display: none !important; }
  .app { padding: 0; }
  body, body.app::before { background: #fff !important; color: #000; }
  .content { max-width: none; padding: 0; }
  .card, .list, .stat { box-shadow: none !important; border: 0.5px solid #bbb; break-inside: avoid; }
  .table { font-size: 9pt; }
  .table-wrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
  table.signatures { display: table !important; width: 100%; margin-top: 2rem; break-inside: avoid; border-collapse: separate; border-spacing: 2rem 0; }
  table.signatures td { width: 50%; padding-top: 2.5rem; }
  table.signatures td span { display: block; border-top: 1px solid #000; padding-top: 0.25rem; font-size: 9pt; }
}

/* Eingangskorb */
.mailbox-card { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; padding: 0.875rem 1rem; }
.mailbox-card .row-main { flex: 1 1 12rem; min-width: 0; }
.mailbox-card .form-inline { margin: 0; }
.receipt-preview { display: block; padding: 0.5rem; border-bottom: 0.5px solid var(--separator); }
.receipt-preview img { display: block; width: 100%; max-height: 28rem; object-fit: contain; border-radius: var(--radius-sm); background: var(--surface-2); }
.mail-text { margin: 0; font-size: 0.9375rem; color: var(--text-2); overflow-wrap: anywhere; }
.copy-value { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.copy-value > span { font-variant-numeric: tabular-nums; }
.copy-value .btn.is-copied { color: var(--green); }
.payout-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.25rem 0 0; }
.payout-choice label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  min-height: 4.5rem; padding: 0.75rem; border-radius: var(--radius); background: var(--fill);
  font-weight: 600; text-align: center; cursor: pointer; border: 2px solid transparent;
}
.payout-choice input { position: absolute; opacity: 0; pointer-events: none; }
.payout-choice label:has(input:checked) { background: var(--green-tint); border-color: var(--green); color: var(--green-strong); }
.payout-choice label:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.payout-choice .icon { width: 1.5rem; height: 1.5rem; }
.steps-status { display: flex; gap: 0.25rem; margin: 0.75rem 0 0; padding: 0; list-style: none; justify-content: center; flex-wrap: wrap; }
.steps-status li { font-size: 0.8125rem; color: var(--text-3); }
.steps-status li.is-done { color: var(--green); font-weight: 600; }
.steps-status li + li::before { content: "›"; margin-right: 0.25rem; color: var(--text-3); }
.inbox-flags { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: flex-start; margin-top: 0.25rem; }

/* Spendenquittung: Vorschau wie auf Papier */
.zb-preview { font-size: 0.875rem; line-height: 1.45; overflow-wrap: anywhere; }
.zb-preview p { margin: 0 0 0.625rem; }
.zb-preview .zb-issuer { color: var(--text-2); margin-bottom: 1rem; }
.zb-preview .zb-issuer strong { color: var(--text); }
.zb-preview .zb-number { float: right; font-weight: 600; color: var(--gold-strong); }
.zb-preview .zb-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.25rem; }
.zb-preview .zb-subtitle, .zb-preview .zb-label { font-size: 0.75rem; color: var(--text-2); }
.zb-preview .zb-label { margin: 0.75rem 0 0.25rem; }
.zb-preview .zb-box { border: 1px solid var(--separator); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; }
.zb-preview .zb-grid { width: 100%; border-collapse: collapse; margin-bottom: 0.5rem; }
.zb-preview .zb-grid td { border: 1px solid var(--separator); padding: 0.5rem; vertical-align: top; }
.zb-preview .zb-grid .zb-label { margin-top: 0; }
.zb-preview .zb-place { margin-top: 1.25rem; }
.zb-preview .zb-sign { margin-top: 2rem; border-top: 1px solid var(--text); padding-top: 0.25rem; font-size: 0.75rem; color: var(--text-2); max-width: 22rem; }
.zb-preview .zb-note { margin-top: 1.25rem; font-size: 0.6875rem; color: var(--text-2); border-top: 1px solid var(--separator); padding-top: 0.5rem; }
.zb-preview .zb-annex { margin-top: 1.5rem; border-top: 2px dashed var(--separator); padding-top: 1rem; }
.zb-preview .zb-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.zb-preview .zb-table th, .zb-preview .zb-table td { border-bottom: 1px solid var(--separator); padding: 0.375rem 0.25rem; text-align: left; vertical-align: top; }
.zb-preview .zb-table .num { text-align: right; white-space: nowrap; }
.zb-preview .zb-table tfoot td { font-weight: 700; border-bottom: 0; }
.zb-preview .zb-draft { display: none; }

/* ------------------------------------------------------------------ Vereinsshop */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.75rem; margin: 0 0 1rem; }
.product-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); color: var(--text);
}
.product-card:hover { text-decoration: none; }
.product-image, .product-hero { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); }
.product-placeholder { display: grid; place-items: center; color: var(--gold-strong); background: var(--gold-tint); }
.product-placeholder .icon { width: 2.5rem; height: 2.5rem; }
.product-info { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.75rem 0.875rem 0.875rem; }
.product-name { font-weight: 600; letter-spacing: -0.012em; line-height: 1.25; }
.product-price { color: var(--text-2); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.product-detail { display: grid; gap: 1rem; }
.product-hero { border-radius: var(--radius-lg); max-height: 28rem; object-fit: contain; }
.product-hero.product-placeholder { max-height: 12rem; aspect-ratio: auto; height: 10rem; }
.product-description { margin: 0 0 1rem; line-height: 1.5; }
.product-price-large { text-align: left; margin: 0; }
@media (min-width: 48rem) {
  .product-detail { grid-template-columns: 1fr 1fr; align-items: start; }
}

.variant-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.5rem; }
.variant-option { position: relative; cursor: pointer; }
.variant-option input { position: absolute; opacity: 0; pointer-events: none; }
.variant-option span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem;
  min-height: var(--tap); padding: 0.5rem; text-align: center;
  border: 1.5px solid var(--separator); border-radius: var(--radius-sm); background: var(--surface);
}
.variant-option small { color: var(--text-2); font-size: 0.75rem; }
.variant-option input:checked + span { border-color: var(--green); background: var(--green-tint); }
.variant-option input:focus-visible + span { outline: 3px solid var(--green-tint); outline-offset: 2px; }

.cart-row { flex-wrap: wrap; }
.cart-qty select { width: auto; min-width: 5.5rem; min-height: 2.5rem; }

.filter-chips { display: flex; gap: 0.5rem; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 1rem; padding: 0.125rem var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none; display: inline-flex; align-items: center; gap: 0.375rem;
  min-height: 2.5rem; padding: 0.375rem 0.875rem; border-radius: 999px;
  background: var(--fill); color: var(--text); font-size: 0.9375rem; font-weight: 500; white-space: nowrap;
}
.filter-chip:hover { text-decoration: none; }
.filter-chip.is-active { background: var(--green); color: var(--on-accent); font-weight: 600; }
.filter-count { min-width: 1.375rem; padding: 0 0.375rem; border-radius: 999px; background: var(--gold-tint); color: var(--gold-strong); font-size: 0.75rem; font-weight: 700; text-align: center; }
.filter-chip.is-active .filter-count { background: rgba(255, 255, 255, 0.25); color: inherit; }

.stock-count {
  flex: none; min-width: 2.5rem; padding: 0.25rem 0.5rem; border-radius: 999px; text-align: center;
  background: var(--green-tint); color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums;
}
.stock-count.is-low { background: var(--gold-tint); color: var(--gold-strong); }
.stock-count.is-empty { background: var(--fill); color: var(--text-2); }
.variant-panel { display: grid; gap: 0.75rem; padding: 0.75rem 1rem 1rem; border-top: 0.5px solid var(--separator); }
.product-thumb { flex: none; width: 3rem; height: 3rem; border-radius: var(--radius-sm); object-fit: cover; }
.product-thumb.product-placeholder .icon { width: 1.5rem; height: 1.5rem; }
.product-thumb-large { display: block; width: 8rem; height: 8rem; border-radius: var(--radius); object-fit: cover; }
.article-image-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.qty-input { width: 4rem; min-height: 2.5rem; text-align: right; }
.only-print { display: none; }
