/* Digipunkt Kunden-App – baut auf /lib/ui.css auf */
body { display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
main {
  flex: 1; overflow-y: auto; width: 100%; max-width: 520px; margin: 0 auto;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(120px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 18px;
}
main > * { flex-shrink: 0; }

/* Kopfzeile */
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kopf .gruss { font-size: 14px; color: var(--muted); font-weight: 600; }
.kopf h1 { font-size: 24px; }
.rund { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-2); color: var(--fg); text-decoration: none; }

/* Navigation: schwebende Leiste mit Scan-Knopf in der Mitte */
.nav {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(480px, calc(100% - 24px));
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 8px;
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-radius: 24px; box-shadow: var(--shadow-3), inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 14px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; }
.nav a .ico { width: 23px; height: 23px; }
.nav a[aria-current="page"] { color: var(--accent); }
.nav .scan-knopf { padding: 0; }
.nav .scan-knopf span {
  width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; margin-top: -2px;
  background: var(--ink); color: var(--stamp); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--ink) 70%, transparent);
}
:root[data-theme="dunkel"] .nav .scan-knopf span { background: var(--stamp); color: var(--stamp-ink); }
.nav .scan-knopf .ico { width: 26px; height: 26px; }

/* Konto-Karte: dunkle Markenfläche wie eine Bankkarte */
.konto {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 22px; color: #fff; display: flex; flex-direction: column; gap: 18px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--ink-2) 90%, #6b7bff) 0%, transparent 55%),
    linear-gradient(160deg, var(--ink-2), var(--ink) 70%);
  box-shadow: 0 18px 40px -18px rgba(11, 18, 48, 0.7);
}
.konto::before { /* weicher Lichtpunkt oben rechts */
  content: ""; position: absolute; right: -60px; top: -80px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--stamp) 35%, transparent), transparent 65%); opacity: 0.55;
}
.konto > * { position: relative; }
.konto .oben { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.konto .klein-titel { font-size: 13px; font-weight: 600; opacity: 0.72; }
.konto .punkte { font-size: 48px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; margin-top: 6px; }
.konto .punkte small { font-size: 16px; font-weight: 700; opacity: 0.7; letter-spacing: 0; margin-left: 6px; }
.konto .wert { font-size: 13px; opacity: 0.72; font-weight: 600; }
.konto .level-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.konto .level { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; opacity: 0.9; }
.konto .balken { flex: 1; height: 6px; border-radius: 9px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.konto .balken b { display: block; height: 100%; background: var(--stamp); border-radius: 9px; }
.konto .btn.marke { box-shadow: 0 8px 20px -8px rgba(255, 201, 58, 0.6); }

/* Schnellzugriffe */
.schnell { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.schnell a, .schnell button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: var(--r-lg); border: 0; text-align: left;
  background: var(--surface); box-shadow: var(--shadow-2); color: var(--fg); text-decoration: none; font-weight: 700; font-size: 13.5px;
}
.schnell .ico-flaeche { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.schnell .gelb .ico-flaeche { background: var(--stamp-soft); color: var(--stamp-ink); }
:root[data-theme="dunkel"] .schnell .gelb .ico-flaeche { color: var(--stamp); }
.schnell small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; margin-top: -6px; }

.abschnitt { display: flex; flex-direction: column; gap: 12px; }
.abschnitt-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.abschnitt-kopf h2 { font-size: 18px; }

/* Märkli-Karte */
.mkarte { gap: 14px; }
.mkarte .kopfzeile { display: flex; align-items: center; gap: 12px; }
.mkarte .kopfzeile > div:not(.stand) { flex: 1; min-width: 0; }
.mkarte h3 { font-size: 16px; font-weight: 800; }
.mkarte .unter { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkarte .stand { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mkarte .stand small { color: var(--muted); font-weight: 700; }
.stempel { display: grid; grid-template-columns: repeat(var(--n, 10), 1fr); gap: 6px; }
.stempel.dicht { gap: 4px; }
.stempel i {
  aspect-ratio: 1; max-width: 100%; border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line);
  display: grid; place-items: center;
}
.stempel i.voll { background: var(--stamp); box-shadow: none; }
.stempel i.voll::after { content: ""; width: 42%; height: 24%; border-left: 2.5px solid var(--stamp-ink); border-bottom: 2.5px solid var(--stamp-ink); transform: rotate(-45deg) translate(6%, -10%); opacity: 0.8; }
.stempel i.ziel { box-shadow: inset 0 0 0 1.5px var(--stamp); background: var(--stamp-soft); }
.fortschritt { height: 10px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.fortschritt b { display: block; height: 100%; background: linear-gradient(90deg, var(--stamp), color-mix(in srgb, var(--stamp) 70%, #ff9c00)); border-radius: 9px; }
.praemie-zeile { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; color: var(--fg-2); }
.praemie-zeile .ico { color: var(--muted); }
.praemie-zeile b { color: var(--fg); }

/* Gutscheine */
.gutschein {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); text-align: left; width: 100%; border: 0;
  background: var(--surface); box-shadow: var(--shadow-2); color: var(--fg); text-decoration: none; position: relative; overflow: hidden;
}
.gutschein::after { /* Abriss-Kante */
  content: ""; position: absolute; top: 0; bottom: 0; right: 64px; width: 0; border-left: 2px dashed var(--line);
}
.gutschein .ico-flaeche { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--stamp); color: var(--stamp-ink); flex: none; }
.gutschein > div { flex: 1; min-width: 0; }
.gutschein b { display: block; font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gutschein .rechts { width: 48px; flex: none; display: grid; place-items: center; color: var(--accent); }
.gutschein.vorbei { opacity: 0.55; box-shadow: none; background: var(--surface-2); }
.gutschein.vorbei .ico-flaeche { background: var(--surface-3); color: var(--muted); }
.gutschein.hervor { background: linear-gradient(135deg, var(--stamp-soft), var(--surface) 70%); }

.shop-eintrag { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.shop-eintrag:last-child { border-bottom: 0; padding-bottom: 0; }
.shop-eintrag:first-child { padding-top: 0; }
.shop-eintrag > div { flex: 1; min-width: 0; }
.shop-eintrag b { display: block; font-weight: 800; }

/* Glücksrad */
.rad { display: flex; align-items: center; gap: 16px; }
.rad .zahl {
  width: 76px; height: 76px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums;
  background: conic-gradient(var(--stamp) 0 12.5%, var(--accent) 0 25%, var(--stamp) 0 37.5%, var(--accent) 0 50%, var(--stamp) 0 62.5%, var(--accent) 0 75%, var(--stamp) 0 87.5%, var(--accent) 0);
}
.rad .zahl span { width: 56px; height: 56px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.rad.dreht .zahl { animation: drehen 0.5s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
.rad.dreht .zahl span { animation: drehen 0.5s linear infinite reverse; }

/* Album */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.album > div {
  aspect-ratio: 4 / 5; max-width: 100%; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; justify-content: space-between;
  font-size: 11.5px; font-weight: 800; line-height: 1.2; background: var(--surface-2); color: var(--muted); overflow: hidden;
  box-shadow: inset 0 0 0 1.5px var(--line); border: 0;
}
.album > div .ico { width: 18px; height: 18px; opacity: 0.6; }
.album > div.hat { background: linear-gradient(160deg, var(--ink-2), var(--ink)); color: #fff; box-shadow: none; }
.album > div.hat .ico { color: var(--stamp); opacity: 1; }
.album small { font-weight: 600; opacity: 0.75; display: block; }

/* Ergebnis nach dem Scan */
.ergebnis { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; }
.ergebnis .marke-gross {
  width: 128px; height: 128px; display: grid; place-items: center; background: var(--stamp); color: var(--stamp-ink); border-radius: 18px;
  font-weight: 800; font-size: 40px; letter-spacing: -0.04em; transform: rotate(-4deg);
  -webkit-mask: radial-gradient(circle at 50% 0, transparent 5px, #000 5.5px) top / 16px 51% repeat-x, radial-gradient(circle at 50% 100%, transparent 5px, #000 5.5px) bottom / 16px 51% repeat-x;
          mask: radial-gradient(circle at 50% 0, transparent 5px, #000 5.5px) top / 16px 51% repeat-x, radial-gradient(circle at 50% 100%, transparent 5px, #000 5.5px) bottom / 16px 51% repeat-x;
}
.ergebnis .details { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* QR zum Vorzeigen */
.qr-weiss { background: #fff; border-radius: var(--r-lg); padding: 16px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.qr-weiss img { width: min(64vw, 240px); height: auto; aspect-ratio: 1; display: block; }
.code-gross { font-size: 26px; font-weight: 700; letter-spacing: 0.14em; text-align: center; }

/* Kundenkarte (Ich) als echte Karte */
.kundenkarte { border-radius: var(--r-xl); padding: 20px; background: linear-gradient(160deg, var(--ink-2), var(--ink)); color: #fff; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 18px 40px -18px rgba(11, 18, 48, 0.7); }
.kundenkarte .qr-weiss { box-shadow: none; }
.kundenkarte .code-gross { color: #fff; }

.liste-menue { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.liste-menue > * { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; background: none; text-align: left; color: var(--fg); font-weight: 700; text-decoration: none; }
.liste-menue > * + * { border-top: 1px solid var(--line); }
.liste-menue .ico-flaeche { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--fg-2); }
.liste-menue .gefahr { color: var(--bad); }
.liste-menue .gefahr .ico-flaeche { background: var(--bad-soft); color: var(--bad); }

/* Anmeldung */
.anmeldung .vorteile { display: flex; flex-direction: column; gap: 10px; }
.anmeldung .vorteile div { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; color: var(--fg-2); font-size: 14.5px; }
.anmeldung .vorteile .ico-flaeche { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--stamp-soft); color: var(--stamp-ink); }
:root[data-theme="dunkel"] .anmeldung .vorteile .ico-flaeche { color: var(--stamp); }

/* Rechtliches und Konto löschen */
.rechtlich { font-size: 12.5px !important; }
.rechtlich a { font-weight: 700; }
.liste-menue.flach { box-shadow: none; background: var(--surface-2); margin-top: 4px; }
.liste-menue.flach .ico-flaeche { background: var(--surface); }
.anmeldung .liste-menue a { color: var(--fg); }
.loesch-avatar { background: var(--bad-soft) !important; color: var(--bad) !important; }

/* Neuigkeiten und Einstellungen */
.neuigkeit { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-2); }
.neuigkeit > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.neuigkeit b { font-size: 15.5px; }
.neuigkeit p { white-space: pre-line; }
.schalter-zeile { display: flex; gap: 14px; align-items: center; justify-content: space-between; cursor: pointer; }
.schalter-zeile > span { display: flex; flex-direction: column; gap: 3px; }
.schalter-zeile small { color: var(--muted); font-size: 13px; font-weight: 500; }
input[role="switch"] { appearance: none; flex: none; width: 48px; height: 28px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background 0.2s; margin: 0; }
input[role="switch"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
input[role="switch"]:checked { background: var(--good); }
input[role="switch"]:checked::after { transform: translateX(20px); }

/* Einladung, Belohnungen, Challenges, Abzeichen */
.einladung-hinweis { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-lg); background: var(--stamp-soft); color: var(--fg); font-size: 14px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--stamp) 55%, transparent); }
.einladung-hinweis .ico { color: var(--warn); }
.album-zaehler { margin: -4px 0 2px; }
.belohnung { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2), inset 0 0 0 1.5px color-mix(in srgb, var(--stamp) 60%, transparent); }
.belohnung > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.belohnung .ico-flaeche { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--stamp); color: var(--stamp-ink); flex: none; }
.fortschritt { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 6px 0 2px; }
.fortschritt b { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.challenges { display: flex; flex-direction: column; gap: 10px; }
.challenge { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); }
.challenge > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.challenge b { font-size: 14.5px; }
.challenge small { font-size: 12px; color: var(--muted); font-weight: 700; }
.challenge .ico-flaeche { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); color: var(--accent); flex: none; }
.challenge.fertig .ico-flaeche { background: var(--good-soft); color: var(--good); }
.challenge.fertig .fortschritt b { background: var(--good); }
.abzeichen { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.abz { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px 14px; border-radius: var(--r-lg); background: var(--surface-2); }
.abz b { font-size: 14px; } .abz small { font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.abz .fortschritt { width: 80%; }
.abz-medaille { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 4px; }
.abz.hat .abz-medaille { background: var(--stamp); color: var(--stamp-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--stamp) 30%, transparent); }
.abz:not(.hat) b { color: var(--fg-2); }
.einlade-code { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--stamp-soft); }
.einlade-code b { font-family: var(--mono); font-size: 24px; letter-spacing: 0.18em; color: var(--fg); }
.einlade-form { display: flex; gap: 10px; align-items: flex-end; }
.einlade-form .feld { flex: 1; }
.einlade-form .btn { width: auto; }
.einlade-form input { font-family: var(--mono); letter-spacing: 0.15em; text-transform: uppercase; }

/* Entdecken */
.geschaefte-liste { display: flex; flex-direction: column; gap: 10px; }
.geschaeft-zeile { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2); cursor: pointer; }
.geschaeft-zeile > div:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.geschaeft-zeile .rechts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.aktion-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--fg-2); }
.aktion-mini .ico { color: var(--warn); }
.karte-bild-knopf { background: rgba(255,255,255,.1) !important; color: #fff !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2) !important; }

/* Prämien-Shop: Art und Bedingung */
.shop-bedingung { display: block; font-size: 12.5px !important; margin-top: 2px; }
.gutschein-bedingung { text-align: center; font-weight: 800; padding: 10px 12px; border-radius: 12px; background: var(--stamp-soft); color: var(--fg); }
