/* Mitglieder-App – Design „Dunkel & Premium“ (immer dunkel, Goldakzente) */
body.app-body {
  color-scheme: dark;
  --ink: #ebe8e1; --ink-deep: #ffffff;
  --paper: #1b1b1a; --white: #262522;
  --k10: #2a2926; --k30: #4a4843; --line: rgba(255,255,255,.09); --muted: #a39d90;
  --gold: #c9ab72; --gold-deep: #e6cf9f; --gold-soft: #352d20;
  --gold-button: #a9884e; --gold-button-hover: #b8975c;
  --solid: #3b3a36; --solid-hover: #4a4844;
  --ok: #93c486; --ok-soft: #1e2b1b; --warn: #e3b465; --warn-soft: #362b17; --bad: #d0604b; --bad-soft: #3a1f1a;
  --shadow: 0 22px 60px rgba(0,0,0,.5); --shadow-s: 0 8px 28px rgba(0,0,0,.35);
  --field-bg: #11110f; --field-ink: #f3f0e8; --field-border: #55524b; --field-placeholder: #8b877e; --field-disabled: #1b1a18; --field-focus: rgba(201,171,114,.35);
  background: radial-gradient(120% 520px at 50% 0, #3b3426 0%, #232322 60%, #1b1b1a 100%) no-repeat, #1b1b1a;
  color: var(--ink);
}
body.app-body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), body.app-body select, body.app-body textarea { background-color: var(--field-bg); color: var(--field-ink); border-color: var(--field-border); }
body.app-body input:focus, body.app-body select:focus, body.app-body textarea:focus { border-color: var(--gold); }
body.app-body ::placeholder { color: var(--field-placeholder); opacity: 1; }
body.app-body input[type="checkbox"], body.app-body input[type="radio"] { accent-color: var(--gold); }
body.app-body .badge-ask { background: #3a2e17; color: #f0c574; }
body.app-body .code-box { background: #2a251c; }
body.app-body .btn-ghost { border-color: rgba(197,166,109,.5); color: #e6cf9f; background: transparent; }
body.app-body .chat-msg:not(.is-me) .chat-bubble { background: #262522; border-color: #33312e; }
body.app-body .chat-msg.is-me .chat-bubble { background: #4a3f2a; border-color: #4a3f2a; }
body.app-body .rsvp-btn { background: #262522; }
body.app-body .app-tabs, body.app-body .app-desk, body.app-body .app-foot { background: rgba(20,20,19,.94); border-color: rgba(255,255,255,.08); }
body.app-body .app-tabs a[aria-current] { color: #fff; }
body.app-body .app-tabs a[aria-current] svg { color: var(--gold); }
body.app-body .app-tile, body.app-body .app-event, body.app-body .app-panel, body.app-body .app-ev { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08); box-shadow: none; }

/* Startseite */
.home-hello { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 14px; }
.home-hello h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; color: #fff; }
.home-hello h1 span { color: var(--gold); }
.home-hello .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: #2c2c2b; display: grid; place-items: center; font-weight: 700; text-decoration: none; }
body.app-body .member-card { position: relative; box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 26px 60px -20px rgba(197,166,109,.45); }
.card-save { display: flex !important; justify-content: center; align-items: center; gap: 8px; width: 100%; border-radius: 99px !important; padding: 13px !important; font-weight: 700; margin-top: 6px; }
.home-k { margin: 24px 0 10px; font-size: 12.5px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.ev-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.ev-row::-webkit-scrollbar { display: none; }
.ev-card { flex: 0 0 74%; max-width: 270px; scroll-snap-align: start; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 14px; color: inherit; text-decoration: none; }
.ev-card .d { font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: .1em; text-transform: uppercase; }
.ev-card strong { display: block; font-size: 15px; margin: 6px 0 4px; color: #fff; }
.ev-card small { color: var(--muted); font-size: 12.5px; }
.ev-card.is-all { display: grid; place-items: center; flex-basis: 40%; font-weight: 700; color: var(--gold-deep); }
.home-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-tiles .app-tile { margin: 0; border-radius: 18px; }
@media (min-width: 960px) { .home-hello { display: none; } .ev-row { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; } .ev-card { flex: 1 1 100%; max-width: none; } }
.home-hello h1 { text-transform: none; }
.home-tiles > :only-child, .home-tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }
/* App: nicht zoombar, Tableiste bleibt unten */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body.app-body input, body.app-body select, body.app-body textarea { font-size: 16px; }
html, body.app-body { overflow-x: hidden; max-width: 100vw; }

/* ---------- Feinschliff 2.50 ---------- */
/* App-Rahmen: nur der Inhalt scrollt, Tableiste steht fest (kein Mitwandern/Federn) */
@media (max-width: 959px) {
  html:has(body.app-body.has-nav), body.app-body.has-nav { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body.app-body.has-nav { padding: 0; }
  .has-nav .app-main {
    position: fixed; top: 0; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom));
    width: auto; margin: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
    padding: calc(14px + env(safe-area-inset-top)) max(16px, calc((100% - 560px) / 2)) 28px;
  }
  .has-nav .app-main.app-chat { padding-bottom: 96px; }
  .has-nav .chat-compose { bottom: calc(66px + env(safe-area-inset-bottom)); }
  /* Statusleiste: weicher dunkler Verlauf, damit Inhalt nicht unter die Uhrzeit läuft */
  body.app-body.has-nav::before { content: ""; position: fixed; z-index: 29; left: 0; right: 0; top: 0; height: calc(env(safe-area-inset-top) + 6px); background: linear-gradient(#1f1e1c 70%, rgba(31,30,28,0)); pointer-events: none; }
}
/* Tableiste */
body.app-body .app-tabs { height: calc(66px + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom); background: rgba(22,22,21,.97); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid rgba(255,255,255,.06); }
body.app-body .app-tabs a { color: #8b877d; font-weight: 600; letter-spacing: .01em; padding: 7px 2px 5px; transition: color .2s; -webkit-tap-highlight-color: transparent; }
body.app-body .app-tabs a[aria-current] { background: none; color: #fff; }
body.app-body .app-tabs a[aria-current]::before { content: ""; position: absolute; top: -6px; left: 50%; width: 26px; height: 3px; margin-left: -13px; border-radius: 0 0 3px 3px; background: var(--gold); }
body.app-body .app-tabs a[aria-current] svg { color: var(--gold); }
body.app-body a, body.app-body button { -webkit-tap-highlight-color: transparent; }
/* Chat-Eingabe dunkel */
body.app-body .chat-compose { background: rgba(22,22,21,.97); border-top: 1px solid rgba(255,255,255,.06); -webkit-backdrop-filter: blur(16px); }
body.app-body .chat-compose textarea { background: #11110f; color: #f3f0e8; border-color: #3d3b37; font-size: 16px; }
/* Statusboxen lesbar */
body.app-body .app-reg { background: rgba(147,196,134,.12); color: #b9dcae; border: 1px solid rgba(147,196,134,.25); }
body.app-body .app-reg.is-waitlist { background: rgba(227,180,101,.12); color: #f0c574; border-color: rgba(227,180,101,.25); }
body.app-body .fee-tile.is-open { background: rgba(227,180,101,.1); border-color: rgba(227,180,101,.35); }
body.app-body .tile-ico { background: rgba(201,171,114,.14); color: var(--gold); }
body.app-body .tile-ico svg { display: block; }
body.app-body .fee-tile.is-ok .tile-ico { background: rgba(147,196,134,.14); color: #93c486; }
/* Kacheln & Karten */
.home-tiles .app-tile { padding: 14px; gap: 12px; align-items: flex-start; flex-direction: column; min-height: 104px; }
.home-tiles .app-tile .small { color: var(--muted); font-size: 12.5px; }
.ev-card { display: flex; flex-direction: column; min-height: 96px; }
.ev-card.is-all { flex: 0 0 auto; padding: 14px 20px; white-space: nowrap; }
body.app-body .app-panel, body.app-body .app-ev { border-radius: 20px; }
body.app-body .app-h1 { color: #fff; letter-spacing: -.02em; }
/* Hinweise, die in der installierten App nichts verloren haben */
.is-native [data-install], .is-native [data-push-ios] { display: none !important; }
/* Wallet */
.wallet-row { display: flex; gap: 10px; margin: 10px 0 0; }
.wallet-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 8px 16px; border-radius: 14px; background: #000; color: #fff !important; text-decoration: none; border: 1px solid rgba(255,255,255,.18); font-weight: 700; font-size: 16px; line-height: 1.1; }
.wallet-btn small { display: block; font-size: 11px; font-weight: 400; opacity: .8; }
.wallet-btn:active { transform: scale(.98); }
/* KI-Chat-Assistent (wie auf der Homepage) – in der App über der Menüleiste, im dunklen Design */
.itbc.in-app { right: 16px !important; bottom: calc(80px + env(safe-area-inset-bottom)) !important; z-index: 40 !important; }
.itbc.in-app .itbc-btn { width: 54px; height: 54px; }
.itbc.in-app .itbc-box { bottom: 66px; height: min(560px, calc(100dvh - 210px - env(safe-area-inset-bottom) - env(safe-area-inset-top))); width: min(390px, calc(100vw - 32px)); opacity: 1; background: #1f1e1c; color: #f3f0e8; border: 1px solid rgba(255,255,255,.08); }
.itbc.in-app .itbc-b { background: #2a2925; color: #f3f0e8; box-shadow: none; }
.itbc.in-app .itbc-m.me .itbc-b { background: #4a3f2a; color: #fff; }
.itbc.in-app .itbc-b a, .itbc.in-app .itbc-who { color: #e6cf9f; }
.itbc.in-app .itbc-t, .itbc.in-app .itbc-foot { color: #9a958a; }
.itbc.in-app .itbc-chip { background: #2a2925; color: #f3f0e8; border-color: rgba(201,171,114,.4); }
.itbc.in-app .itbc-f { background: #11110f; border: 1px solid #3d3b37; box-shadow: none; }
.itbc.in-app .itbc-f textarea { color: #f3f0e8; }
.itbc.in-app .itbc-send { background: var(--gold-button); }
.itbc.in-app .itbc-err { color: #f19a8b; }
/* Handy: Chat als ganze Fläche über der Menüleiste */
@media (max-width: 959px) {
  .itbc.in-app .itbc-box { position: fixed; left: 0; right: 0; top: 0; bottom: calc(66px + env(safe-area-inset-bottom)); width: auto; height: auto; max-width: none; border-radius: 0; border: 0; animation: itbcUp .25s ease-out; }
  .itbc.in-app .itbc-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .itbc.in-app.open .itbc-btn { display: none; }
}
@keyframes itbcUp { from { transform: translateY(24px); opacity: .6; } }
@media (min-width: 960px) { .itbc.in-app { bottom: 24px !important; right: 24px !important; } }
/* Offline-Hinweis */
.offline-pill { position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); padding: 9px 16px; border-radius: 99px; background: rgba(42,39,34,.96); border: 1px solid rgba(201,171,114,.45); color: #e6cf9f; font-size: 12.5px; font-weight: 700; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.offline-pill[hidden] { display: none; }
body.is-offline .itbc { display: none !important; }
/* Chat: nur noch der mittlere Knopf in der Menüleiste (kein schwebender Knopf) */
.itbc.in-app .itbc-btn { display: none !important; }
body.app-body .app-tabs a.tab-ki { overflow: visible; }
.tab-ki-btn { position: relative; display: grid; place-items: center; width: 58px; height: 58px; margin: -30px auto 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px #c9ab72, 0 10px 26px rgba(0,0,0,.55), 0 0 30px rgba(201,171,114,.35); transition: transform .2s; }
.tab-ki-btn img { width: 44px; height: 44px; border-radius: 50%; }
.tab-ki:active .tab-ki-btn { transform: scale(.94); }
.tab-ki-btn .tab-badge { position: absolute; top: -2px; right: -4px; }
body.app-body .app-tabs a.tab-ki span:last-child { color: #e6cf9f; }
@media (min-width: 960px) { .itbc.in-app .itbc-btn { display: grid !important; } }
/* Neuigkeiten mit Bild */
.news-img { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: contain; border-radius: 14px; margin: 8px 0 12px; background: #f3f1ec; }
dialog.news-pop { max-height: calc(100dvh - 24px); overflow: auto; }
/* Kennzeichnung „Mitglieder“ (Unterscheidung zur Verwaltungs-App) */
.app-kind-m { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px; padding: 4px 10px; border-radius: 99px; background: linear-gradient(135deg, #e8cf98, #c9ab72); color: #2a2418; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Mitgliedsausweis im Stil eines Apple-Wallet-Passes (ab 2.63) ---------- */
.wp-pass { --wp-bg: #24211d; --wp-gold: #d6b77a; display: block; width: 100%; max-width: 380px; margin: 0 auto; padding: 0; border: 0; text-align: left; font: inherit; color: #fff;
  background: linear-gradient(180deg, #2e2a24 0%, var(--wp-bg) 55%, #1c1a17 100%); border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 18px 40px rgba(0,0,0,.55), 0 26px 60px -24px rgba(214,183,122,.5); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wp-pass.is-full { cursor: default; max-width: 360px; }
.wp-pass.is-preview { transition: transform .2s ease; }
.wp-pass.is-preview:active { transform: scale(.985); }
.wp-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; }
.wp-logo { width: 34px; height: 34px; border-radius: 50%; background: #fff; padding: 2px; flex: none; }
.wp-org { font-weight: 700; font-size: 13px; line-height: 1.15; letter-spacing: .01em; flex: 1; }
.wp-hf { text-align: right; font-weight: 700; font-size: 17px; color: var(--wp-gold); line-height: 1.1; }
.wp-pass small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.62); margin-bottom: 2px; }
.wp-strip { position: relative; min-height: 132px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(20,18,15,.05) 0%, rgba(20,18,15,.78) 100%), var(--card-bg, linear-gradient(135deg, #5a4a30, #2b2620)) center/cover no-repeat; }
.wp-primary strong { display: block; font-size: 24px; line-height: 1.12; font-weight: 700; letter-spacing: -.01em; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.wp-primary small { color: rgba(255,255,255,.8); }
.wp-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 4px 14px rgba(0,0,0,.45); flex: none; }
.wp-credit { position: absolute; top: 6px; right: 10px; font-size: 9px; color: rgba(255,255,255,.6); }
.wp-fields { display: flex; gap: 18px; padding: 12px 16px 4px; flex-wrap: wrap; }
.wp-fields > div { min-width: 0; }
.wp-fields b { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.wp-fields .mc-no { color: var(--wp-gold); letter-spacing: .02em; }
.wp-aux b { font-size: 13.5px; font-weight: 600; }
.wp-pass.is-preview .wp-fields { padding-bottom: 14px; }
.wp-code { padding: 14px 16px 16px; display: flex; flex-direction: column; align-items: center; }
.wp-qr { display: inline-grid; justify-items: center; gap: 6px; background: #fff; color: #1c1a17; padding: 12px 12px 8px; border-radius: 12px; }
.wp-qr svg { width: 168px; height: 168px; display: block; }
.wp-qr span { font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.wp-live { margin: 10px 0 0; font-size: 11px; color: rgba(255,255,255,.6); display: inline-flex; align-items: center; gap: 6px; }
.wp-live span { width: 7px; height: 7px; border-radius: 50%; background: #6fd08c; box-shadow: 0 0 0 0 rgba(111,208,140,.6); animation: wpPulse 2s infinite; }
@keyframes wpPulse { 70% { box-shadow: 0 0 0 7px rgba(111,208,140,0); } 100% { box-shadow: 0 0 0 0 rgba(111,208,140,0); } }
.wp-open { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 380px; margin: 14px auto 0; }
/* Popup */
html.wp-lock { overflow: hidden; }
.wp-dialog { border: 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: transparent; color: #fff; width: 100%; max-width: 420px; max-height: 100dvh; overflow-y: auto; }
.wp-dialog::backdrop { background: rgba(8,8,7,.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.wp-dialog[open] .wp-pass { animation: wpIn .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes wpIn { from { transform: translateY(24px) scale(.96); opacity: 0; } }
.wp-x { position: sticky; top: 0; float: right; margin: -6px -4px 6px 0; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; z-index: 2; }
.wp-hint { clear: both; text-align: center; font-size: 12.5px; color: rgba(255,255,255,.7); margin: 14px 0 12px; }
.wp-actions { display: grid; gap: 10px; max-width: 360px; margin: 0 auto; }
.wp-wallet { display: flex; align-items: center; justify-content: center; gap: 10px; background: #000; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 12px; padding: 10px 16px; text-decoration: none; font-weight: 600; font-size: 17px; }
.wp-wallet small { display: block; font-size: 11px; font-weight: 500; opacity: .85; line-height: 1.1; }
.wp-wallet span { line-height: 1.15; text-align: left; }
.wp-wallet.is-soon { opacity: .75; }
.wp-actions .card-save { display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; border-color: rgba(255,255,255,.35); }
.wp-soon { max-width: 360px; margin: 12px auto 0; font-size: 13px; line-height: 1.45; background: rgba(214,183,122,.16); color: #f1e3c4; padding: 10px 12px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .wp-dialog[open] .wp-pass, .wp-live span { animation: none; } }
.member-card.wp-pass, .member-card.wp-pass.has-bg { background: linear-gradient(180deg, #2e2a24 0%, #24211d 55%, #1c1a17 100%); border-radius: 18px; margin: 4px auto 0; }
.member-card.wp-pass::after { display: none; }
/* 3.9.3 Kachel-Symbole: immer runde Kreise (auch in den zweispaltigen Kacheln) */
body.app-body .tile-ico { flex: none; width: 40px; height: 40px; min-width: 40px; border-radius: 50%; display: grid; place-items: center; }
@media (max-width: 380px) { body.app-body .tile-ico { width: 36px; height: 36px; min-width: 36px; } }

/* 3.9.7 Chat-Knopf: gleiche Höhe wie die anderen Menüpunkte (Logo als Symbol, goldener Ring), Beschriftung immer sichtbar */
body.app-body .app-tabs a.tab-ki { overflow: visible; }
.tab-ki-btn { width: 30px; height: 30px; margin: -2px auto 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #c9ab72, 0 0 14px rgba(201,171,114,.35); }
.tab-ki-btn img { width: 26px; height: 26px; }
.tab-ki-btn .tab-badge { top: -6px; right: -10px; }
body.app-body .app-tabs a.tab-ki span:last-child { color: #e6cf9f; }
body.app-body .app-tabs a.tab-ki[aria-current] .tab-ki-btn { box-shadow: 0 0 0 2px #e6cf9f, 0 0 18px rgba(230,207,159,.55); }
