/* === BierApp – Dark Mode, Mobile-First === */
:root {
  --bg: #1a1a1a;
  --bg-elevated: #252525;
  /** Deckfarbe der Kacheln (.week-summary-tile: rgba(255,255,255,0.04) auf --bg-elevated) – für partielles Bier-Overlay */
  --bg-tile: #2e2e2e;
  --text: #f5f5f5;
  --text-muted: #a0a0a0;
  --accent: #e8b923;
  /** Header-Höhe: Inhalt + Oberrand (schlank wie Footer – nur Safe Area oben) */
  --header-height: calc(3.5rem + max(0.75rem, var(--safe-top)));
  /* Filter für #e8b923 (--accent) – Icons im Slider/Einstellungen */
  --icon-accent-filter: brightness(0) saturate(100%) invert(83%) sepia(28%) saturate(3280%) hue-rotate(4deg) brightness(99%) contrast(91%);
  --bottle-inactive-opacity: 0.4;
  --bottle-inactive-filter: grayscale(80%);
  --radius: 12px;
  --touch-min: 44px;
  /** Safe Area (Notch, Dynamic Island, Home-Indicator): immer env() nutzen, damit iOS/Android die Insets liefern. viewport-fit=cover in index.html ist dafür nötig. */
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
  --safe-right: env(safe-area-inset-right, 0);
  --fab-size: 56px;
  /** Höhe der Tab-Leiste – iOS UITabBar: 49pt + Safe Area */
  --footer-height: calc(49px + env(safe-area-inset-bottom, 0px));
  /** Feste Höhe für Progress-Card auf der Startseite – kompakt, reicht noch für längste Texte (3–4 Zeilen) */
  --home-top-min-height: 8rem;
  /** Einheitlicher Abstand: Header ↔ Inhalt, Inhalt ↔ Wochenzusammenfassung, Wochenzusammenfassung ↔ Menüleiste */
  --home-section-gap: 1rem;
  /** Apple Activity Rings – exakte Farben */
  --ring-move: #FC3C44;
  --ring-exercise: #AAD753;
  --ring-stand: #638EFE;
  --ring-bg: rgba(255, 255, 255, 0.12);
  /** Onboarding: feste Höhe für die obere „Hero“-Zone (Emoji/Icon/Grafik), damit beim Slide-Wechsel nichts springt */
  --onboarding-hero-min-height: 18rem;
}

* {
  box-sizing: border-box;
}

/* Touch/Swipe: Browser + iOS WKWebView – Pan/Scroll erlauben, Doppel-Tap-Zoom aus */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: contain;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: contain;
}

/* Konfetti-Canvas (canvas-confetti) immer über allen Inhalten – auch über der Karte. */
body > canvas {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

/* Portal-Preview: App in iframe – iPhone 12 Mini (375×812 pt), skaliert über Wrapper */
html:has(body.portal-preview) {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body.portal-preview {
  --safe-top: 0.75rem;
  --safe-bottom: 0.75rem;
  --safe-left: 0px;
  --safe-right: 0px;
  --footer-height: calc(49px + var(--safe-bottom));
  --header-height: calc(3.5rem + var(--safe-top));
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body.portal-preview #portal-preview-root {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 375px;
  height: min(90vh, 900px);
  max-height: 900px;
  overflow: hidden;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(var(--portal-scale, 1));
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
/* Community-Map-Iframes: App füllt den Iframe (kein Phone-Mockup), Inhalte passen sich flexibler Breite an */
body.portal-preview.portal-preview-embed-fill {
  min-height: 100%;
}
body.portal-preview.portal-preview-embed-fill #portal-preview-root {
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  transform: none;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
body.portal-preview.portal-preview-embed-fill #portal-preview-root .splash {
  width: 100%;
  height: 100%;
  max-width: none;
}
body.portal-preview.portal-preview-embed-fill #portal-preview-root .app {
  width: 100%;
  max-width: min(100%, 420px);
  min-width: 0;
  flex: 1;
  margin: 0 auto;
  box-sizing: border-box;
}
body.portal-preview.portal-preview-embed-fill .main-scroll {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
body.portal-preview.portal-preview-embed-fill .app-header {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
body.portal-preview.portal-preview-embed-fill .footer {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
body.portal-preview.portal-preview-embed-fill .bottom-sheet,
body.portal-preview.portal-preview-embed-fill .bottom-sheet-backdrop {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
body.portal-preview #portal-preview-root .splash {
  position: absolute;
  inset: 0;
  width: 375px;
  height: 812px;
}
body.portal-preview #portal-preview-root .app {
  flex: 1;
  min-height: 0;
  width: 375px;
  max-width: 375px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.portal-preview #portal-preview-root.portal-preview-show-footer .app {
  flex: 1;
  min-height: 0;
}
body.portal-preview .main-scroll {
  overflow-x: hidden !important;
  overflow-y: auto;
  min-width: 0;
  max-width: 375px;
  overscroll-behavior: none;
  padding-bottom: var(--safe-bottom) !important;
}
body.portal-preview.portal-preview-show-footer .main-scroll {
  padding-bottom: var(--footer-height) !important;
}
body.portal-preview .app[data-page="home"] .main-scroll,
body.portal-preview .app[data-page="home2"] .main-scroll {
  overflow-y: auto !important;
}
body.portal-preview .aktivitaeten2-scroll {
  padding-bottom: 1.5rem;
}
body.portal-preview .page-home {
  padding-bottom: 1rem;
}
body.portal-preview .footer {
  display: none !important;
}
body.portal-preview .bottom-sheet-backdrop.open {
  z-index: 102;
  touch-action: manipulation;
  cursor: pointer;
}
body.portal-preview .bottom-sheet {
  z-index: 103;
}
body.portal-preview .activity-panel {
  z-index: 104;
}
body.portal-preview.portal-preview-show-footer .footer {
  display: flex !important;
}
/* Embed ohne Chrome (Community-Map iframe: kein Header, keine Tab-Bar) */
body.embed-no-chrome .app-header,
body.embed-no-chrome .footer {
  display: none !important;
}
body.embed-no-chrome .main-scroll {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
/* Footer liegt im #portal-preview-root: am unteren Rand ohne Abstand (flex statt absolute) */
body.portal-preview #portal-preview-root .footer {
  position: static;
  flex-shrink: 0;
  height: 49px;
  min-height: 49px;
  padding-bottom: 0 !important;
  bottom: auto;
  left: auto;
  right: auto;
}
/* Footer ist im Root unter der App (Flex), kein Overlay – nur minimales Abstandspadding */
body.portal-preview.portal-preview-show-footer .main-scroll,
body.portal-preview.portal-preview-show-footer .app[data-page="home"] .main-scroll,
body.portal-preview.portal-preview-show-footer .app[data-page="home2"] .main-scroll {
  padding-bottom: 0.5rem !important;
}
body.portal-preview.portal-preview-show-footer .app[data-page="grid"] .main-scroll {
  padding-bottom: 0.5rem !important;
}
body.portal-preview.portal-preview-show-footer .app[data-page="grid"] .bottle-section .bottle-grid {
  padding-bottom: 0.5rem !important;
}
/* Demo-Modus (Community/Portal iframe mit simulate=1): Login-UI ausblenden, Bier verdienen anzeigen */
body.portal-preview.portal-demo-no-login #btn-global-login,
body.portal-preview.portal-demo-no-login #page-grid-login-hint,
body.portal-preview.portal-demo-no-login #btn-grid-login,
body.portal-preview.portal-demo-no-login #settings-community-login-wrap {
  display: none !important;
}
body.portal-preview.portal-demo-no-login #btn-global-earn {
  display: inline-flex !important;
}

/* Header: Vollständiger Titel „SPORTBIER“ sichtbar, nicht abgeschnitten */
body.portal-preview .app-header-title-block {
  min-width: 0;
  overflow: visible;
  flex-shrink: 1;
}
body.portal-preview .app-title {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Portal-Simulation: Touch-Pointer */
.portal-touch-pointer {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(232, 185, 35, 0.28);
  border: 2px solid rgba(232, 185, 35, 0.8);
  box-shadow: 0 0 14px rgba(232, 185, 35, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  opacity: 0.7;
  transition: transform 0.8s ease, opacity 0.3s ease;
}
.portal-touch-pointer::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(232, 185, 35, 0.55);
  opacity: 0;
  transform: scale(0.8);
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.portal-touch-pointer.is-hidden {
  opacity: 0;
}
.portal-touch-pointer.is-tap {
  transform: translate(-50%, -50%) scale(0.92);
  box-shadow: 0 0 22px rgba(232, 185, 35, 0.55);
  opacity: 0.95;
}
.portal-touch-pointer.is-tap::after {
  opacity: 1;
  transform: scale(1.1);
}
body.portal-preview .app-header-subtitle {
  font-size: 0.65rem;
}
body.portal-preview .app-header {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
body.portal-preview .app-cta-bar .btn-earn-first {
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
}
/* Tab-Bar: Labels kompakter, damit nichts abgeschnitten wird */
body.portal-preview .tab-item {
  min-width: 56px;
  padding: 4px 1px 2px;
}
body.portal-preview .tab-label {
  font-size: 9px;
}

/* Eingabefelder: Auswahl für Bearbeitung erlauben */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* === Layout === */
html, body {
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  overflow: hidden;
}

/* === Splash (Ladebildschirm) – schwarz, zentriert SPORTBIER + Untertitel === */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.splash-inner {
  text-align: center;
  transform: translateY(-24px);
}

.splash-inner .app-title {
  text-align: center;
  margin-bottom: 0.35rem;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  letter-spacing: 0.22em;
}

.splash-inner .app-header-subtitle {
  text-align: center;
  margin: 0;
  visibility: visible;
}

.splash.splash-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Sponsor-Logos (Splash, Onboarding) – kompakt, dezent */
.sponsor-logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.sponsor-logos-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.sponsor-logos-splash {
  margin-top: 2.1rem;
}

.sponsor-logos-onboarding {
  margin-top: 2rem;
}
@media (min-height: 600px) {
  .sponsor-logos-onboarding {
    margin-top: 3rem;
  }
}
@media (min-height: 700px) {
  .sponsor-logos-onboarding {
    margin-top: 5rem;
  }
}

.sponsor-label {
  margin: 0 0 0.5rem;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.sponsor-logos[hidden],
.sponsor-logos:empty {
  display: none !important;
}

.sponsor-logo {
  height: 110px;
  max-width: 240px;
  object-fit: contain;
  opacity: 0.7;
}

.sponsor-logos-onboarding .sponsor-logo {
  height: 72px;
  max-width: 160px;
}

/* Werbe-Platzhalter (Ad-Slots) – werden per JS befüllt */
.ad-slot {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--bg-tile);
  min-height: 60px;
}

.ad-slot[hidden],
.ad-slot:empty {
  display: none !important;
}

.ad-slot-stats {
  margin-top: 1rem;
}

.ad-slot-streaks {
  margin-top: 1.5rem;
}

.ad-slot-settings {
  margin-bottom: 1rem;
}

.bier-gallery-sponsor-slot {
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.bier-gallery-sponsor-slot[hidden] {
  display: none !important;
}

.bier-gallery-sponsor-label {
  grid-column: 1 / -1;
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === App-Header (SCHWIMMBIER) – fixiert, Content scrollt darunter; Blur transparent === */
.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  /* Oberrand: nur Safe Area; links und rechts gleicher Abstand (Titel / Bier verdienen) */
  padding: max(0.75rem, var(--safe-top)) max(1rem, var(--safe-right)) 0.75rem max(1rem, var(--safe-left));
  background: rgba(26, 26, 26, 0.65);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.header-back {
  position: absolute;
  left: max(0.5rem, var(--safe-left));
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}
.header-back:hover,
.header-back:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.header-back svg {
  width: 24px;
  height: 24px;
}
.header-back[hidden] {
  display: none;
}

.header-settings {
  position: absolute;
  right: max(0.5rem, var(--safe-right));
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}
.header-settings:hover,
.header-settings:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.header-settings svg {
  width: 22px;
  height: 22px;
}

.header-spacer {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  pointer-events: none;
}
/* Links und rechts gleicher Abstand wie Header-Padding – Titel und Button bündig zum Rand */
.header-spacer-left,
.header-spacer-right {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
}
.header-spacer-left {
  margin-right: 0;
}
.header-spacer:not(.header-spacer-left):not(.header-spacer-right) {
  margin-left: 0.5rem;
}

.app-header-title-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
  min-height: 2.6em; /* Platz für Titel + Unterschrift, damit Position beim Wechsel stabil bleibt */
}

.app-header-subtitle {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0.85;
  line-height: 1;
  min-height: 1.2em;
}

.app-header-subtitle[aria-hidden="true"] {
  visibility: hidden;
  /* Platz bleibt reserviert, damit der Titel nicht springt */
}

.app-title {
  margin: 0;
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: left;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Erster Blick: SCHWIMMBI – kräftig in Akzentfarbe */
.app-title-main {
  color: var(--accent);
}

/* Zweiter Blick: ER – zurückhaltend in Grau, leicht kleiner/leichter */
.app-title-er {
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.15em;
  opacity: 0.85;
}

.app-title-muted {
  color: var(--text-muted);
  opacity: 0.9;
}

/* App-Titel überall: Prefix grau, BIER gelb */
.app-title-prefix {
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.2em;
  opacity: 0.9;
}

.app-title-bier {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.2em;
}

/* Zeit/Strecke-Werte: gleicher Font wie SPORTBIER (font-weight, letter-spacing) */
.value-sport-font {
  font-weight: 700;
  letter-spacing: 0.2em;
}

/* Community: Username rechts oben dezent (gleiche Position wie „Bier verdienen“ / Einlösen auf anderen Seiten) */
.header-community-username {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
  margin-right: 0.25rem;
}

.app-cta-bar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.app-cta-bar .btn-earn-first {
  white-space: nowrap;
  padding: 0.5rem 1rem;
  animation: btn-earn-subtle-pulse 14s ease-in-out infinite;
}
@keyframes btn-earn-subtle-pulse {
  0%, 88% { box-shadow: 0 0 0 0 rgba(232, 185, 35, 0); }
  92% { box-shadow: 0 0 12px 3px rgba(232, 185, 35, 0.25); }
  96%, 100% { box-shadow: 0 0 0 0 rgba(232, 185, 35, 0); }
}
.app[data-page="settings"] .app-cta-bar {
  display: none;
}

.main-scroll {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: var(--header-height, 4.5rem);
  padding-bottom: var(--footer-height);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: manipulation;
}

.app[data-page="grid"] .main-scroll {
  padding-bottom: var(--footer-height);
  overscroll-behavior-y: none;
}

/* Einstellungsseite: Scroll in main-scroll, Inhalt scrollt unter dem Header durch; unten genug Platz */
.app[data-page="settings"] .main-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--footer-height) + 3rem);
}
.app[data-page="settings"] .page-settings {
  padding-bottom: 2rem;
}
.app[data-page="settings"] .page-settings[hidden] {
  display: none !important;
}

/* Apple Health Test-Seite: wie Einstellungen scrollbar, feste Höhe */
.app[data-page="apple-test"] .main-scroll {
  overflow: hidden !important;
}
.app[data-page="apple-test"] .page-apple-test {
  position: fixed;
  top: var(--header-height, 4.5rem);
  left: 0;
  right: 0;
  bottom: var(--footer-height);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 0 0 1rem;
  background: transparent;
}
.app[data-page="apple-test"] .page-apple-test[hidden] {
  display: none !important;
}

/* Celebration-Effekte Demo-Seite */
.app[data-page="celebrations"] .main-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--footer-height) + 5rem);
}
.app[data-page="celebrations"] .page-celebrations[hidden] {
  display: none !important;
}

.page-celebrations {
  padding: 0 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  margin-bottom: 2rem;
}
.celebrations-page-section {
  max-width: 28rem;
  margin: 0 auto;
}
.btn-celebrations-back {
  display: inline-flex;
  align-items: center;
  margin: 0.5rem 0 1rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  color: var(--accent);
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-celebrations-back:hover,
.btn-celebrations-back:focus {
  text-decoration: underline;
  outline: none;
}
.celebrations-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.25rem;
}
.celebrations-page-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}
.celebrations-demo-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.celebration-demo-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.25s ease-out, box-shadow 0.25s ease-out;
  position: relative;
  overflow: hidden;
}
.celebration-demo-card:hover,
.celebration-demo-card:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(232, 185, 35, 0.35);
  outline: none;
}
.celebration-demo-card:active {
  background: rgba(255, 255, 255, 0.04);
}
.celebration-demo-icon {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
  line-height: 1;
}
.celebration-demo-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.celebration-demo-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Effekt: Pop (Bounce auf der Karte) */
.celebration-demo-card.effect-pop {
  animation: celebration-demo-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes celebration-demo-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  70% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

/* Effekt: Leuchtender Rand */
.celebration-demo-card.effect-glow {
  animation: celebration-demo-glow 2s ease-in-out;
  box-shadow: 0 0 0 2px var(--accent), 0 0 24px rgba(232, 185, 35, 0.5);
}
@keyframes celebration-demo-glow {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent), 0 0 24px rgba(232, 185, 35, 0.5); }
  50% { box-shadow: 0 0 0 3px var(--accent), 0 0 36px rgba(232, 185, 35, 0.7); }
}

/* Shimmer-Overlay (wird per JS über Karte positioniert) */
.celebration-effect-shimmer {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 35%,
    rgba(255, 255, 255, 0.25) 48%,
    rgba(232, 185, 35, 0.35) 50%,
    rgba(255, 255, 255, 0.25) 52%,
    transparent 65%,
    transparent 100%
  );
  background-size: 200% 100%;
  background-position: 200% 0;
  animation: celebration-shimmer-run 1s ease-out forwards;
}
@keyframes celebration-shimmer-run {
  0% { background-position: 200% 0; opacity: 1; }
  100% { background-position: -100% 0; opacity: 0.95; }
}

/* Bubbles-Container (Fullscreen, Blasen steigen) */
.celebration-effect-bubbles {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  pointer-events: none;
  z-index: 99;
  overflow: hidden;
}
.celebration-effect-bubbles .bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  animation: celebration-bubble-rise linear forwards;
}
@keyframes celebration-bubble-rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-120vh) scale(0.6);
    opacity: 0;
  }
}

.celebration-effect-container {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.apple-test-status {
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  white-space: pre-wrap;
}
.apple-test-output {
  font-size: 0.8rem;
  color: var(--text);
  max-height: 12rem;
  overflow-y: auto;
  padding: 0.5rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.apple-test-enum-ref {
  max-height: 20rem;
}

/* Feste Aktionsleiste über dem Tab-Menü (nur auf Grid-Seite), Glas-Blur; Abstand wie Header (1rem) */
.grid-action-bar {
  display: flex;
  position: fixed;
  left: 0;
  right: 12px;
  bottom: var(--footer-height);
  z-index: 91;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  align-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  min-height: 3rem;
  background: rgba(26, 26, 26, 0.65);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  pointer-events: none;
  touch-action: manipulation;
}

.grid-action-bar .btn-grid-action {
  pointer-events: auto;
  align-self: center;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  touch-action: manipulation;
  position: relative;
  z-index: 1;
}

.grid-action-bar[hidden] {
  display: none !important;
}

.page {
  margin: 0;
  min-height: 100%;
  padding: 0 0 1rem;
}
.page[hidden] {
  display: none !important;
}

/* === Community (Feed, Bier-Trails, Gruppen, Profil) === */
.page-community {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.community-page-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0 var(--home-section-gap, 1rem) 1rem;
}
.app-community-tabs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.12));
  flex-shrink: 0;
}
/* Mindesthöhe 44px für Touch (Best Practice), konsistent mit Tab-Bar */
.app-community-tab {
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 6px;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  color: var(--text, #fff);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-community-tab:hover { opacity: 0.9; }
.app-community-tab.is-active {
  background: var(--accent, #e8b923);
  border-color: var(--accent, #e8b923);
  color: #111;
}
.app-community-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 0;
  -webkit-overflow-scrolling: touch;
}
.app-community-panel[hidden] { display: none !important; }
.app-community-panel-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}
.app-community-hint {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted, rgba(255,255,255,0.6));
}
.app-community-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* Community- und Map-Feed: gleiche Kacheln wie Aktivitäten-Tab (ul > li.week-summary-tile) */
.app-community-list .week-summary-tiles,
.app-map-feed-list .week-summary-tiles {
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 0.5rem;
}
.app-community-feed-tile,
.app-map-feed-tile {
  cursor: pointer;
}
.app-community-feed-tile:hover,
.app-community-feed-tile:focus,
.app-map-feed-tile:hover,
.app-map-feed-tile:focus {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}
/* Konsistent mit Aktivitäten-Cards (aktivitaeten2-card): 12px radius, gleiche Elevation */
.app-community-list .app-community-card {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
}
.app-community-group-card {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-community-group-card:hover,
.app-community-group-card:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

/* Gruppen-Visitenkarte (analog Profil) */
.app-community-group-visitenkarte {
  margin-bottom: 1rem;
  padding: 1.25rem;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.app-community-group-visitenkarte:hover,
.app-community-group-visitenkarte:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.app-community-group-visitenkarte-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.app-community-group-visitenkarte-avatar-wrap {
  flex-shrink: 0;
}
.app-community-group-visitenkarte-avatar,
.app-community-group-visitenkarte-avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border: 2px solid rgba(255,255,255,0.12);
}
.app-community-group-visitenkarte-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}
.app-community-group-visitenkarte-content {
  flex: 1;
  min-width: 0;
}
.app-community-group-visitenkarte-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.app-community-group-visitenkarte-region {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.app-group-detail-panel .app-group-detail-body {
  padding: 0 1rem 1.5rem;
}
.app-group-detail-card {
  margin-bottom: 0.75rem;
}
.app-group-detail-panel #app-group-detail-open-community {
  display: inline-block;
  margin-top: 0.75rem;
}
.app-group-detail-avatar-wrap {
  margin: 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.app-group-detail-avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
}
.app-group-detail-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted, rgba(255,255,255,0.5));
}
.app-group-detail-avatar-upload-wrap {
  margin-bottom: 0.5rem;
}
.app-group-detail-avatar-upload-wrap .btn-training-share { margin-bottom: 0; }
.app-group-detail-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.app-group-detail-actions .btn-training-share { margin-bottom: 0.5rem; }
.app-group-members-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}
.app-group-member-card {
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.app-group-member-meta {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-muted, rgba(255,255,255,0.6));
}
.app-group-member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.app-group-member-actions .btn-training-share {
  margin-bottom: 0;
}
.app-group-members-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.app-group-members-actions .btn-training-share {
  flex: 1;
  margin-bottom: 0;
}
.app-group-edit-wrap {
  margin: 0.75rem 0 1rem;
  padding: 1rem;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border-radius: 10px;
}
.app-group-edit-label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted, rgba(255,255,255,0.7));
}
.app-group-edit-label input,
.app-group-edit-label textarea {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.6rem;
  box-sizing: border-box;
  font-size: 1rem;
  background: var(--bg, rgba(0,0,0,0.2));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text);
}
.app-group-edit-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}
.app-group-edit-buttons .btn-earn-first { flex: 1; }
.app-group-detail-subtitle {
  margin: 1rem 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted, rgba(255,255,255,0.75));
}

/* Profil-Bottom-Sheet (Community) */
.app-profile-panel .app-profile-panel-body {
  padding: 0 1rem 1.5rem;
}
.app-profile-panel .app-trails-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.app-profile-panel .app-trail-card {
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.app-profile-panel .app-trail-card .week-summary-tile-meta {
  font-size: 0.8rem;
  color: var(--text-muted, rgba(255,255,255,0.55));
}

.app-group-invite-textarea {
  display: block;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.6rem;
  box-sizing: border-box;
  font-size: 0.95rem;
  background: var(--bg, rgba(0,0,0,0.2));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text);
  resize: vertical;
  min-height: 4rem;
}
.app-community-profile-body label { display: block; margin-top: 0.5rem; }
.app-community-profile-body input[type="text"],
.app-community-profile-body input[type="password"] { width: 100%; max-width: 280px; box-sizing: border-box; padding: 0.4rem 0.5rem; margin-top: 0.25rem; }
/* Profil-Rows: Override global label/input, keep layout consistent */
.app-community-profile-row .app-community-profile-label { margin-top: 0; }
.app-community-profile-row input[type="text"].app-community-profile-input,
.app-community-profile-row select.app-community-profile-input { width: auto; max-width: 180px; margin-top: 0; box-sizing: border-box; }
.app-community-profile-section {
  margin-bottom: 1.25rem;
}
.app-community-profile-section-title {
  margin: 0 0 0.5rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, rgba(255,255,255,0.55));
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.app-community-profile-section:first-child .app-community-profile-section-title { margin-top: 0; }
.app-community-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom: none;
  font-size: 0.9rem;
}
.app-community-profile-row:first-of-type { border-radius: 10px 10px 0 0; }
.app-community-profile-row:last-of-type { border-bottom: 1px solid rgba(255,255,255,0.06); border-radius: 0 0 10px 10px; }
.app-community-profile-row:only-child { border-radius: 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.app-community-profile-row + .app-community-profile-row { margin-top: 0; }
.app-community-profile-label {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 500;
}
.app-community-profile-value {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.app-community-profile-input {
  flex: 1;
  min-width: 0;
  max-width: 180px;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  background: var(--bg, #1a1a1a);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 8px;
  color: var(--text);
}
.app-community-profile-row--readonly { cursor: default; }
.app-community-profile-row--checkbox .app-community-profile-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
}
.app-community-profile-row--checkbox input[type="checkbox"] { flex-shrink: 0; }
.app-community-profile-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}
/* Profilkarte (Visitenkarte) */
.app-community-profile-card {
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.app-community-profile-card-inner {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.app-community-profile-card-avatar-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.app-community-profile-avatar-img,
.app-community-profile-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border: 2px solid rgba(255,255,255,0.12);
}
.app-community-profile-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}
.app-community-profile-avatar-container {
  position: relative;
  width: 80px;
  height: 80px;
}
.app-community-profile-avatar-actions {
  position: absolute;
  bottom: -2px;
  right: -6px;
  display: flex;
  gap: 4px;
}
.app-community-profile-avatar-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-elevated, #2a2a2a);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  transition: all 0.15s;
}
.app-community-profile-avatar-action-btn:hover,
.app-community-profile-avatar-action-btn:focus {
  background: var(--bg-active, #333);
  color: var(--text);
  transform: scale(1.05);
  border-color: rgba(255,255,255,0.3);
}
.app-community-profile-avatar-action-btn--delete {
  color: #ff4d4f;
  background: rgba(40, 10, 10, 0.9);
  border-color: rgba(255, 77, 79, 0.3);
}
.app-community-profile-avatar-action-btn--delete:hover {
  background: #ff4d4f;
  color: #fff;
  border-color: #ff4d4f;
}
.app-community-profile-avatar-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-community-profile-avatar-btn:hover,
.app-community-profile-avatar-btn:focus {
  background: rgba(232, 185, 35, 0.15);
  outline: none;
}
.app-community-profile-card-content {
  flex: 1;
  min-width: 0;
}
.app-community-profile-card-name-row {
  margin-bottom: 0.25rem;
}
.app-community-profile-card-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.app-community-profile-card-name-row .app-community-profile-displayname-cell {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.app-community-profile-card-email {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.app-community-profile-card-motto-row {
  margin-top: 0.35rem;
}
.app-community-profile-card-motto {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text);
  opacity: 0.9;
}
.app-community-profile-motto-cell {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.app-community-profile-card-input,
.app-community-profile-motto-input {
  flex: 1;
  min-width: 120px;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  background: var(--bg, #1a1a1a);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 8px;
  color: var(--text);
}
.app-community-profile-card-name-row .app-community-profile-displayname-actions,
.app-community-profile-motto-cell .app-community-profile-displayname-actions {
  margin-top: 0.25rem;
}
.app-community-profile-avatar-section .app-community-profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.app-community-profile-avatar-section #app-community-profile-avatar-btn {
  min-height: 44px;
}
.app-community-profile-displayname-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
/* Dezentes Edit-Affordance (Ghost-Pattern): kleines Stift-Icon, muted */
.app-community-profile-action-link {
  background: none;
  border: none;
  padding: 0.15rem 0.25rem;
  margin: 0 -0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted, rgba(255,255,255,0.5));
  opacity: 0.6;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s, color 0.15s;
}
.app-community-profile-action-link:hover,
.app-community-profile-action-link:focus {
  opacity: 1;
  color: var(--accent);
  outline: none;
}
/* Wenn Text (z.B. "Motto hinzufügen"): noch dezenter */
.app-community-profile-action-link--text {
  font-size: 0.8rem;
  font-style: italic;
}
.app-community-profile-displayname-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.app-community-profile-btn-save,
.app-community-profile-btn-cancel {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-community-profile-btn-save {
  background: var(--accent);
  color: var(--bg);
  border: none;
}
.app-community-profile-btn-save:hover,
.app-community-profile-btn-save:focus {
  opacity: 0.95;
  outline: none;
}
.app-community-profile-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.app-community-profile-btn-cancel {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
}
.app-community-profile-btn-cancel:hover,
.app-community-profile-btn-cancel:focus {
  color: var(--text);
  outline: none;
}
.app-community-profile-displayname-cell #app-community-profile-displayname-input {
  flex: 1;
  min-width: 0;
  max-width: 180px;
}

/* === Home / Landing Page === */
.app[data-page="home"] .main-scroll {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Aktivitäten-Seite: kein doppeltes Padding unten (Abstand nur über home-section) */
.app[data-page="home"] .page.page-home {
  padding-bottom: 0;
}
.app[data-page="home"] .page-home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Statistik-Seite: main-scroll als Flex-Container, damit page + week-summary volle Resthöhe nutzen */
.app[data-page="statistik"] .main-scroll {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Karte-Seite: map füllt Resthöhe */
.app[data-page="map"] .main-scroll {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app[data-page="map"] .page-map {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Community-Seite: wie Aktivitäten – main-scroll flex, page füllt Resthöhe */
.app[data-page="community"] .main-scroll {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app[data-page="community"] .page-community {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app[data-page="home"] .main-scroll,
.app[data-page="home2"] .main-scroll {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app[data-page="home"] .page-aktivitaeten2,
.app[data-page="home2"] .page-aktivitaeten2 {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.home-section {
  margin: 0;
  padding: var(--home-section-gap, 1rem);
  display: flex;
  flex-direction: column;
  gap: var(--home-section-gap, 1rem);
  min-height: 0;
  flex: 1;
}

/* Aktivitäten-Seite: nur minimaler Abstand zur Tab-Bar, kein doppelter Abstand (Margin + Padding) */
.app[data-page="home"] .home-section {
  gap: 1.25rem;
  padding-bottom: 0.25rem;
}
/* Lila-Bereich: Padding der äußeren Wrapper-Section (Direktkind von .page-home) auf 0 – das ist die echte Quelle des Abstands */
.app[data-page="home"] .page-home > .home-section {
  padding-bottom: 0 !important;
}
/* Lila-Bereich (Margin) der pending-workouts-section komplett entfernen; ID für max. Spezifität */
.app[data-page="home"] #pending-workouts-section,
.app[data-page="home"] section.pending-workouts-section {
  margin: 0 !important;
  margin-top: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  padding-bottom: 0 !important;
}
.app[data-page="home"] #pending-workouts-section .pending-workouts-card,
.app[data-page="home"] #pending-workouts-section .pending-workouts-list,
.app[data-page="home"] #pending-workouts-section .pending-workouts-empty {
  margin: 0 !important;
  margin-bottom: 0 !important;
}
.app[data-page="home"] #pending-workouts-section .week-summary-tiles {
  margin-bottom: 0 !important;
}
.app[data-page="home"] #pending-workouts-section .pending-workouts-list .week-summary-tiles:last-child {
  margin-bottom: 0 !important;
}

.home-section .progress-card {
  margin: 0;
  flex-shrink: 0;
}

/* === Dein-Bier-Seite: Progress-Card oben, Grid darunter === */
.app[data-page="grid"] .main-scroll {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.app[data-page="grid"] .page-grid {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}
.app[data-page="grid"] .bottle-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-top: var(--home-section-gap, 1rem);
  padding-left: var(--home-section-gap, 1rem);
  padding-right: var(--home-section-gap, 1rem);
  gap: 0.75rem;
}
.app[data-page="grid"] .bottle-section .progress-card {
  margin: 0;
  flex-shrink: 0;
}
.app[data-page="grid"] .bottle-section .bottle-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Rubber-Band: Rückstellung nach Loslassen (JS setzt transform beim Dragg) */
  touch-action: pan-y;
  /* Unterste Reihe bleibt über der Tab-Bar sichtbar */
  padding-bottom: calc(0.75rem + var(--footer-height));
}
.app[data-page="grid"] .bottle-section .bottle-grid.bottle-grid-rubber-snap {
  transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1);
}

/* === Aktivitäten-Seite: Pending-Summary-Card (Sliding, ohne Bier rechts) === */
.home-section .pending-summary-card {
  margin: 0;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.pending-summary-card[aria-hidden="true"] {
  display: none;
}
.pending-summary-strip {
  display: flex;
  flex-direction: row;
  width: 200%;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.pending-summary-strip.slide-to-next {
  transform: translateX(-50%);
}
.pending-summary-slide {
  width: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  min-height: var(--home-top-min-height);
  box-sizing: border-box;
}
.pending-summary-content {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--text);
}
.pending-summary-content strong {
  font-weight: 700;
}
.pending-summary-list {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.pending-summary-list li {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Top-3-Karte: 3 Bilder nebeneinander, darunter kumulierte Summe */
.pending-summary-top3-icons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.pending-summary-top-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.pending-summary-top3-icons .pending-summary-top-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: var(--icon-accent-filter);
  object-fit: contain;
}
.pending-summary-top3-icons .sport-img-native {
  filter: none;
}
.pending-summary-top3-sum {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/** Hinweis auf Startseite, wenn keine Health-Bridge (z. B. im Browser): manuell eintragen */
.home-no-bridge-hint {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* === Apple-Aktivitäten: Kacheln nutzen volle Resthöhe unter der Pending-Summary-Card === */
/* Kein zusätzliches padding-top – Abstand kommt nur von .home-section gap (wie Header ↔ Box) */
.pending-workouts-section {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
/* Margin unten weg (Lila in DevTools) – Section hat auch .home-section, daher explizit */
#pending-workouts-section {
  margin-bottom: 0 !important;
}
.pending-workouts-card {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
/* Gleiche Bedienung/Layout wie Wochenzusammenfassung: Header + Scroll + Footer */
.pending-workouts-card.week-summary-card.week-summary-slide {
  flex: 1;
  flex-basis: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  scroll-snap-align: none; /* kein Snap, nur eine Karte */
}
.pending-workouts-card.week-summary-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.pending-workouts-card .week-summary-scroll {
  flex: 1;
  min-height: 6rem; /* Immer sichtbarer Bereich, auch bei leerer Liste */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.75rem; /* Scrollbar mit Abstand zu den Kachelkanten */
}
.pending-workouts-card .week-summary-scroll .pending-workouts-list {
  overflow: visible;
  min-height: 0;
}
.pending-workouts-list .week-summary-tiles {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pending-workouts-list .week-summary-tiles:last-child {
  margin-bottom: 0;
}
.pending-workouts-empty {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pending-workouts-empty-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}
.pending-workouts-empty-link {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.pending-workouts-empty-link:hover,
.pending-workouts-empty-link:focus {
  text-decoration: underline;
  outline: none;
}
/* === Statistik-Seite: Section und Wochenzusammenfassung füllen verbleibende Höhe === */
/* Kein horizontales Padding: Viewport/Strip kann bis zum Bildschirmrand scrollen */
/* Karte + Feed Seite */
.page-map {
  display: flex;
  flex-direction: column;
  padding: 0;
}
.app[data-page="map"] .main-scroll {
  overflow: hidden !important;
  touch-action: none;
}
.app[data-page="map"] .page-map {
  position: fixed;
  top: var(--header-height, 4.5rem);
  left: 0;
  right: 0;
  bottom: var(--footer-height);
  overflow: hidden;
  touch-action: none;
}
.map-section {
  flex: 1;
  min-height: 0;
}
.app-map-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
}
.app-map {
  width: 100%;
  height: 100%;
  min-height: 300px;
  touch-action: none;
}
.app[data-page="map"] .leaflet-container,
.app[data-page="map"] .leaflet-pane,
.app[data-page="map"] .leaflet-map-pane {
  touch-action: none;
}
.app-map-feed-ui {
  position: absolute;
  inset: 0;
  z-index: 500;
  pointer-events: none;
}
.app-map-branding {
  position: absolute;
  left: max(0.75rem, env(safe-area-inset-left));
  top: max(0.75rem, env(safe-area-inset-top));
  z-index: 450;
  background: transparent;
  padding: 0;
}
.app-map-branding-title {
  margin: 0;
  font-size: clamp(1rem, 4.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.app-map-branding-title .app-title-muted { color: var(--text-muted); opacity: 0.9; }
.app-map-branding-title .app-title-main { color: var(--accent, #e8b923); }
.app-map-branding-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0.9;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.app-map-feed-fab {
  position: absolute;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  min-height: 2.35rem;
  padding: 0.45rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.9);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}
.app-map-feed-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px 16px 0 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  transform: translateY(calc(100% - 3rem));
  transition: transform 0.22s ease;
  pointer-events: auto;
  box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.25);
}
.app-map-container.map-feed-open .app-map-feed-sheet {
  transform: translateY(0);
}
.app-map-container.map-feed-open .app-map-feed-fab {
  opacity: 0;
  pointer-events: none;
}
.app-map-feed-handle {
  width: 100%;
  border: 0;
  padding: 0.45rem 0.9rem 0.55rem;
  border-radius: 16px 16px 0 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
}
.app-map-feed-handle-bar {
  width: 2.6rem;
  height: 0.26rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}
.app-map-feed-handle-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.app-map-beer-badge {
  position: absolute;
  left: max(0.75rem, env(safe-area-inset-left));
  top: 3.5rem;
  z-index: 400;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.75);
  border-radius: var(--radius, 10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 12rem;
}
.app-map-beer-count {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent, #e8b923);
}
.app-map-beer-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.25;
}
.app-map-beer-progress .value-sport-font { color: var(--text, #f5f5f5); }
.app-map-feed-overlay {
  padding: 0.4rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  max-height: min(48vh, 22rem);
  overflow: auto;
  touch-action: pan-y;
}
.app-map-feed-overlay h3 { margin: 0 0 0.25rem; font-size: 0.9rem; }
.app-map-feed-hint {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.app-map-feed-list {
  display: block;
  padding-bottom: 0.25rem;
}
.app-map-feed-list .week-summary-tiles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.app-map-feed-community-link-wrap {
  margin: 0.75rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border, rgba(255,255,255,0.12));
}
.app-map-feed-open-community-btn {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent, #e8b923);
  background: none;
  border: none;
  padding: 0.35rem 0;
  cursor: pointer;
  text-decoration: none;
}
.app-map-feed-open-community-btn:hover { opacity: 0.9; }
.app-map-feed-open-community-btn:active { opacity: 0.8; }
.app-map-feed-item {
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}
.app-map-feed-item:hover { background: rgba(255, 255, 255, 0.1); }
.app-map-feed-item strong { font-size: 0.85rem; }
.app-map-feed-profile-link {
  color: var(--accent, #e8b923);
  text-decoration: underline;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-map-feed-profile-link:active { opacity: 0.85; }
.app-community-feed-profile-link {
  color: var(--accent, #e8b923);
  text-decoration: underline;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-community-feed-profile-link:active { opacity: 0.85; }
.app-map-feed-loading,
.app-map-feed-empty {
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
@media (min-width: 769px) {
  .app-map-feed-ui {
    top: 0.75rem;
    right: 0.75rem;
    left: auto;
    bottom: auto;
    width: min(300px, calc(100% - 1.5rem));
    max-height: 55%;
    pointer-events: auto;
  }
  .app-map-feed-fab,
  .app-map-feed-handle {
    display: none;
  }
  .app-map-feed-sheet {
    position: static;
    transform: none !important;
    border-radius: var(--radius);
    box-shadow: none;
  }
  .app-map-feed-overlay {
    max-height: 100%;
    background: rgba(0, 0, 0, 0.85);
    border-radius: var(--radius);
    padding: 0.75rem;
  }
}

/* Grid: Login-Hinweis wenn nicht angemeldet */
.page-grid-login-hint {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}
.page-grid-login-hint p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  max-width: 280px;
}
.page-grid-login-hint .btn-earn-first { margin-top: 0.5rem; }

/* Login-Panel (Bottom Sheet) */
.login-panel .bottom-sheet-header { margin-bottom: 0.5rem; }
.login-panel-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 1rem 1.5rem;
}
.login-panel-block-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.login-panel-hint {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.login-panel-footer {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.login-panel-footer a { color: var(--accent); }
.login-panel-form input {
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
.login-panel-toggle { margin: 0.75rem 0 0; font-size: 0.9rem; }
.login-panel-toggle a { color: var(--accent); }
.login-panel-status {
  padding: 0.5rem 1rem;
  margin: 0 1rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.login-panel-status.login-panel-status--error { background: rgba(220, 53, 69, 0.2); color: #f18a94; }
.login-panel-status.login-panel-status--success { background: rgba(40, 167, 69, 0.2); color: #7dd99e; }

.page-statistik .statistik-section {
  padding: var(--home-section-gap, 1rem) 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

/* Kein Abstand unten: Wochenzusammenfassung reicht bis zur Tab-Bar */
.app[data-page="statistik"] .statistik-section {
  padding-bottom: 0;
}
.app[data-page="statistik"] .page-statistik > .statistik-section {
  padding-bottom: 0 !important;
}
.app[data-page="map"] .page-map .map-section {
  flex: 1;
  min-height: 0;
}

.page-statistik .statistik-section .week-summary {
  flex: 1;
  min-height: 0;
}
.aktivitaeten2-section {
  padding: var(--home-section-gap, 1rem) 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.app[data-page="home"] .aktivitaeten2-section,
.app[data-page="home2"] .aktivitaeten2-section {
  padding-bottom: 0;
}
.app[data-page="home"] .page-aktivitaeten2 > .aktivitaeten2-section,
.app[data-page="home2"] .page-aktivitaeten2 > .aktivitaeten2-section {
  padding-bottom: 0 !important;
}

/* Aktivitäten2: nur Apple-Aktivitäten, zwei Kacheln (Einlösbar / Nicht einlösbar), monatlich gruppiert */
.aktivitaeten2-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--home-section-gap, 1rem);
  padding-bottom: 0.5rem;
}
.aktivitaeten2-sync-hint {
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 0.7rem;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.4));
  line-height: 1.3;
}
.aktivitaeten2-empty {
  margin: 1rem 0;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
  font-size: 0.95rem;
}
.aktivitaeten2-load-more-sentinel {
  height: 1px;
  margin: 0;
  padding: 0;
  visibility: hidden;
  pointer-events: none;
}
.aktivitaeten2-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* Status-Tag Health-Zugriff (analog Karten-Nutzung: OK / Kritisch) */
.health-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.5rem 1rem 0.6rem;
  font-size: 0.8125rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}
.health-status-row .status-badge {
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.health-status-row .status-badge.status-ok {
  background: rgba(48, 209, 88, 0.25);
  color: #34c759;
}
.health-status-row .status-badge.status-critical {
  background: rgba(255, 59, 48, 0.25);
  color: #ff3b30;
}

.aktivitaeten2-card-header {
  flex-shrink: 0;
  padding: 0.85rem 1rem 0;
}
.aktivitaeten2-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
}
.aktivitaeten2-card-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 1rem 1rem;
}
.aktivitaeten2-section-title {
  margin: 1rem 0 0.5rem;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  text-transform: none;
}
.aktivitaeten2-section-title:first-child {
  margin-top: 0.5rem;
}
.aktivitaeten2-tiles {
  margin: 0;
  padding: 0;
  list-style: none;
}
.aktivitaeten2-tiles + .aktivitaeten2-section-title {
  margin-top: 1.25rem;
}

.shared-activities-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.shared-activities-title {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.shared-activities-list {
  margin-top: 0.5rem;
}

.shared-activities-tiles .week-summary-tile {
  cursor: pointer;
}

/* Nicht einlösbare Kacheln: normal darstellen (nicht abgedunkelt), nur nicht klickbar zum Einlösen */
.aktivitaeten2-tile-not-redeemable {
  /* bewusst kein opacity/filter – gleiche Lesbarkeit wie einlösbar */
}

/* === Wochenübersicht (Statistik-Seite) === */
.week-summary {
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.week-summary[aria-hidden="true"] {
  display: none;
}

/* Aktivitäten-Seite: Vergangenheit (wochenweise) – nur Inhaltshöhe, Rest für Aktivitäten-Karte */
.app[data-page="home"] .home-section #home-past-weeks.week-summary {
  flex: 0 0 auto;
  min-height: 0;
}
.home-past-weeks {
  margin-top: 1rem;
}
.home-past-weeks .home-past-title {
  flex-shrink: 0;
  margin: 0 0 0.75rem;
  padding: 0;
}
.app[data-page="home"] .home-past-weeks .week-summary-viewport {
  min-height: 9rem; /* Karten in der horizontalen Strip sichtbar */
}

/* Native horizontal scroll + CSS Scroll Snap – keine eigenen Touch-Handler nötig */
/* scroll-padding damit erste/letzte Karte nicht abgeschnitten werden */
.week-summary-viewport {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 1rem;
  scroll-padding-right: 1rem;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 0;
  box-sizing: border-box;
}

.week-summary-strip {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  min-height: 100%;
  height: 100%;
  padding: 0 1.5rem; /* Abstand für erste/letzte Karte */
  box-sizing: border-box;
}

.week-summary-slide.week-summary-card {
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  flex: 0 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  scroll-snap-align: start; /* Start ausgerichtet, damit nichts abgeschnitten wird */
  scroll-snap-stop: always;
}

.week-summary-slide {
  min-height: 0;
}

.week-summary-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.week-summary-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.week-summary-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
  text-align: center;
}

.week-summary-slide {
  font-size: 0.9rem;
  color: var(--text);
}

.week-summary-tiles {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.week-summary-tile {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
}

.week-summary-tile-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.week-summary-tile-icon img {
  width: 37px;
  height: 37px;
  object-fit: contain;
  filter: var(--icon-accent-filter);
  opacity: 0.9;
}
.week-summary-tile-icon .sport-img-native {
  width: 37px !important;
  height: 37px !important;
  filter: none;
}

.week-summary-tile-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-right: 2rem;
}

.week-summary-tile-main {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Distanz/Leistung (wie Dauer) – eigene Zeile unter der Überschrift */
.week-summary-tile-value {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.week-summary-tile-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.week-summary-tile-source {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.week-summary-tile-beers {
  position: absolute;
  right: 0.5rem;
  bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.week-summary-tile-beers img,
.week-summary-tile-beers .beer-icon-full {
  width: 12px;
  height: 12px;
  filter: var(--icon-accent-filter);
  opacity: 0.85;
}

/* Partielles Bier-Icon in 10%-Stufen: gelb unten, grau oben – unterer Bereich des grauen Icons transparent, Füllgrad = sichtbarer Gelb-Anteil */
.week-summary-tile-beers .beer-icon-partial {
  position: relative;
  display: inline-flex;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  align-self: flex-end;
  box-sizing: border-box;
}

/* Gleiches Gelb wie „Bier verdienen“-Button (--accent / --icon-accent-filter) */
.week-summary-tile-beers .beer-icon-partial .beer-icon-partial-base {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  display: block;
  filter: var(--icon-accent-filter);
  opacity: 0.85;
}

.week-summary-tile-beers .beer-icon-partial .beer-icon-partial-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  display: block;
  filter: grayscale(100%) brightness(1.4);
  opacity: 0.9;
  clip-path: inset(0 0 calc((1 - var(--partial-height, 0.5)) * 100%) 0);
  pointer-events: none;
}

.week-summary-tile-details {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.week-summary-tile-details .week-summary-tile-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Alte Aktivitäten (nur Heute/Gestern einlösbar): abgedunkelt, kein Bier-Icon, Hinweis statt „Einlösen“ */
.pending-workout-tile-old {
  opacity: 0.65;
}
.pending-workout-tile-old .week-summary-tile-icon img,
.pending-workout-tile-old .week-summary-tile-main {
  filter: grayscale(0.4);
}
.week-summary-tile-details-old {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.training-detail-old-hint {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.week-summary-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.week-summary-footer:not(.week-summary-has-tiles) {
  margin-top: 0;
}

.week-summary-summary {
  list-style: none;
  margin: 0;
  padding: 0;
}

.week-summary-empty {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.week-summary-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

.week-summary-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.week-summary-value {
  font-weight: 600;
  color: var(--accent);
}
.home-section .landing-stats {
  margin-top: 0.5rem;
}

/* Leergut: unten rechts, Recycling-Symbol + Text */
.leergut-corner {
  position: fixed;
  right: 0.75rem;
  bottom: calc(0.75rem + var(--safe-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.4rem 0.5rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s, opacity 0.2s;
  z-index: 9;
}
.leergut-corner:hover,
.leergut-corner:focus {
  color: var(--accent);
  outline: none;
}
.leergut-corner:active {
  opacity: 0.85;
}
.leergut-corner-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.leergut-corner-label {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.9;
  white-space: nowrap;
}

/* === Bottom Sheet (Slider von unten) – oberhalb der Tab-Leiste === */
.bottom-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  z-index: 92;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bottom-sheet-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.sheet-open {
  overflow: hidden;
  overflow-x: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* Bis zum oberen Rand erlaubt (Design-Pattern Bottom-Sheet); Safe Area oben für Handle/Header */
  max-height: 100vh;
  padding: 0 max(1rem, var(--safe-right)) 1.5rem max(1rem, var(--safe-left));
  padding-top: max(0.5rem, var(--safe-top));
  padding-bottom: calc(var(--footer-height) + max(2.25rem, var(--safe-bottom)));
  background: rgba(37, 37, 37, 0.82);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 93;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.35s;
  visibility: hidden;
  pointer-events: none;
}

.bottom-sheet.open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.activity-panel {
  z-index: 94;
}

.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 1rem;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: grab;
}

.bottom-sheet-handle:active {
  cursor: grabbing;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.5rem 0;
  background: transparent;
}

.bottom-sheet-header h3 {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.bottom-sheet-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: -0.25rem -0.25rem -0.25rem 0.5rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.bottom-sheet-close:hover,
.bottom-sheet-close:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.earn-choice-header-spacer {
  flex: 1;
}

.bier-gallery-header .bier-gallery-header-text {
  flex: 1;
  min-width: 0;
}

.bier-gallery-remaining {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

.bier-gallery-remaining[hidden] {
  display: none;
}

.bier-gallery-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  max-height: min(88vh, 700px);
  padding-bottom: 0; /* Übernehmen-Zeile direkt über Menüleiste */
  overflow-y: hidden; /* Nur Inhalt scrollt, Zeile bleibt unten */
}

.bier-gallery-panel .bottom-sheet-handle,
.bier-gallery-panel .bottom-sheet-header,
.bier-gallery-panel .bottle-toggle-row {
  flex-shrink: 0;
}

/* === Bottom-Slider mit Bier-Grid + Übernehmen (einheitlich) === */
/* Scroll-Höhe für Flaschenauswahl – überall in den Bottom-Slidern (Bier-Galerie, Vormerken, Einlösen) */
:root {
  --sheet-beer-scroll-height: 24rem;
  --sheet-uebernehmen-row-padding: 0.75rem 1rem;
  /* Abstand unten so, dass die Übernehmen-Zeile über der Tab-Bar endet (nicht verdeckt) */
  --sheet-uebernehmen-row-padding-bottom: calc(1.25rem + var(--footer-height));
}

/* Gemeinsame Übernehmen-Zeile: fix unten, gleiche Abstände in allen Slidern */
.bier-gallery-uebernehmen-row,
.add-bottles-uebernehmen-row {
  flex-shrink: 0;
  margin-top: auto;
  padding: var(--sheet-uebernehmen-row-padding);
  padding-bottom: var(--sheet-uebernehmen-row-padding-bottom);
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--bg);
}

/* === Bier-Galerie === */
.bier-gallery-grid-scroll {
  flex: 0 0 var(--sheet-beer-scroll-height);
  height: var(--sheet-beer-scroll-height);
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
  touch-action: pan-y;
}

.bier-gallery-panel .bier-gallery-grid-scroll {
  flex: 0 0 var(--sheet-beer-scroll-height);
}

.bier-gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.bier-gallery-item {
  position: relative;
  aspect-ratio: 1 / 2.2;
  padding: 0.25rem;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
}

.bier-gallery-item img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  max-width: none;
  height: calc(100% * var(--img-scale, 1));
  object-fit: contain;
  transform: translate(-50%, -50%) translate(var(--img-tx, 0%), var(--img-ty, 0%));
}

.bier-gallery-item:hover,
.bier-gallery-item:focus {
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.bier-gallery-item.selected {
  border-color: var(--accent);
}

.bier-gallery-item-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem;
}

.bier-gallery-item-clear:hover,
.bier-gallery-item-clear:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.bottle-toggle-row {
  padding: 0 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}


.bier-gallery-uebernehmen-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.bier-gallery-uebernehmen-btn:hover:not(:disabled),
.bier-gallery-uebernehmen-btn:focus:not(:disabled) {
  filter: brightness(1.08);
  outline: none;
}

.bier-gallery-uebernehmen-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-bottle-toggle {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(232, 185, 35, 0.15);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-bottle-toggle:hover,
.btn-bottle-toggle:focus {
  background: rgba(232, 185, 35, 0.25);
  outline: none;
}

/* Wort „getrunken“ im Button: gleiche Optik wie Stempel auf der Flasche, ohne Rotation */
.btn-bottle-toggle .btn-bottle-toggle-stamp {
  color: #c62828;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.8);
  background: rgba(198, 40, 40, 0.28);
  border: 1px solid rgba(198, 40, 40, 0.65);
  padding: 0.25em 0.6em;
  border-radius: 4px;
  white-space: nowrap;
}

.btn-earned-change-beer {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-earned-change-beer:hover,
.btn-earned-change-beer:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  outline: none;
}

/* === Training-Detail (Wochenübersicht) === */
.training-detail-body {
  padding: 0.5rem 0;
}

.training-detail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 1rem 0 1.25rem;
}

.training-detail-icon img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: var(--icon-accent-filter);
  opacity: 0.95;
}

.training-detail-icon img.sport-img-native {
  filter: none;
}

.training-detail-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.training-detail-dl dt {
  color: var(--text-muted);
  font-weight: 500;
}

.training-detail-dl dd {
  margin: 0;
  color: var(--text);
}

.training-detail-beers-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.training-detail-beers-wrap .week-summary-tile-beers {
  position: static;
  right: auto;
  bottom: auto;
}

.training-detail-beers-text {
  color: var(--text);
}

.training-detail-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  grid-column: 1 / -1;
}

.training-detail-row-calories[data-empty="true"] {
  display: none;
}

.training-detail-row-route[data-empty="true"],
.training-detail-row-route[hidden] {
  display: none;
}

.training-detail-route-preview {
  height: 8rem;
  min-height: 100px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
}

.training-detail-route-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.route-preview-loading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
}

.training-detail-route-preview svg {
  width: 100%;
  height: 100%;
  display: block;
}

.training-detail-route-preview svg path {
  fill: none;
  stroke: var(--accent, #e8b923);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.training-detail-actions {
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-training-edit {
  width: 100%;
  margin-top: 0.5rem;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-training-edit:hover,
.btn-training-edit:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text);
  outline: none;
}

.btn-training-delete,
.btn-clear-grid.btn-training-delete {
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #e06666;
  background: rgba(224, 102, 102, 0.12);
  border: 1px solid rgba(224, 102, 102, 0.5);
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-training-delete:hover,
.btn-training-delete:focus,
.btn-clear-grid.btn-training-delete:hover,
.btn-clear-grid.btn-training-delete:focus {
  color: #e06666;
  background: rgba(224, 102, 102, 0.2);
  border-color: #e06666;
  outline: none;
}

.btn-training-share {
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  transition: background 0.2s, border-color 0.2s;
}

.btn-training-share:hover,
.btn-training-share:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--text);
  outline: none;
}

.training-detail-share-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.training-detail-share-preview-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.training-detail-share-preview-content {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 12rem;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.training-detail-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn-training-share-community {
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bg, #0d0d0d);
  background: var(--accent, #f5c542);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-training-share-community:hover,
.btn-training-share-community:focus {
  opacity: 0.95;
  outline: none;
}

.btn-training-share-community:active {
  transform: scale(0.98);
}

.btn-training-share-now {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bg, #0d0d0d);
  background: var(--accent, #f5c542);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-training-share-now .btn-training-share-icon {
  flex-shrink: 0;
}

.btn-training-share-now:hover,
.btn-training-share-now:focus {
  opacity: 0.95;
  outline: none;
}

.btn-training-share-now:active {
  transform: scale(0.98);
}

/* Share-Preview als gestapeltes Bottom-Sheet (über Training-Detail) */
.share-preview-panel {
  z-index: 95;
  max-height: 85vh;
  /* Teilen-Buttons klar über der Tab-Bar: ausreichend Abstand nach unten */
  padding-bottom: calc(var(--footer-height) + max(2rem, var(--safe-bottom)));
}

.share-preview-body {
  padding: 0 0 1rem 0;
}

.share-preview-content {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 12rem;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.share-preview-route-wrap {
  margin-bottom: 1rem;
}

.share-preview-route-label {
  margin: 0 0 0.35rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.share-preview-route {
  height: 10rem;
  min-height: 120px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-preview-route img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.share-preview-route svg {
  width: 100%;
  height: 100%;
  display: block;
}

.share-preview-route svg path {
  fill: none;
  stroke: var(--accent, #f5c542);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.share-preview-panel .training-detail-share-actions {
  margin-top: 0.5rem;
}

/* === Legal Text Panel (Datenschutz, Impressum, Über SPORTBIER) === */
.legal-text-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  max-height: 60vh;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.legal-text-content p {
  margin: 0 0 0.75rem;
}

.legal-text-content p:last-child {
  margin-bottom: 0;
}

.legal-text-content a {
  color: var(--accent);
  text-decoration: underline;
}

.legal-text-content a:hover,
.legal-text-content a:focus {
  text-decoration: none;
}

.legal-about-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin-bottom: 0.25rem !important;
}

.legal-about-name .app-title-prefix,
.legal-about-name .app-title-bier {
  font-size: inherit;
}

.legal-about-version {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem !important;
}

.legal-about-desc {
  margin-top: 0.5rem;
}

.week-summary-tile[role="button"] {
  cursor: pointer;
}

.week-summary-tile[role="button"]:hover,
.week-summary-tile[role="button"]:focus {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.btn-remove-from-grid {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #e06666;
  background: rgba(224, 102, 102, 0.12);
  border: 1px solid rgba(224, 102, 102, 0.5);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-remove-from-grid:hover,
.btn-remove-from-grid:focus {
  color: #e06666;
  background: rgba(224, 102, 102, 0.2);
  border-color: #e06666;
  outline: none;
}

/* Kontextmenü Flasche (Web-Fallback im iFrame / ohne native Bridge) */
.bottle-context-menu-web {
  position: fixed;
  z-index: 10000;
  min-width: 180px;
  padding: 0.35rem 0;
  background: var(--bg-elevated, #2e2e2e);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.bottle-context-menu-web-btn {
  display: block;
  width: 100%;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text, #f5f5f5);
  background: none;
  border: none;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bottle-context-menu-web-btn:hover,
.bottle-context-menu-web-btn:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.bottle-context-menu-web-btn--separator {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 0.25rem;
  padding-top: 0.5rem;
}

/* === Add-Bottles Panel === */
.add-bottles-header .add-bottles-header-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.add-bottles-header-title {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0;
}

.add-bottles-header-title .app-title-prefix,
.add-bottles-header-title .app-title-bier {
  font-weight: 600;
  letter-spacing: 0;
}

.add-bottles-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0; /* Übernehmen-Zeile direkt über Menüleiste */
  overflow-y: hidden; /* Nur Inhalt scrollt, Zeile bleibt unten */
  /* Vormerken-Panel: genügend Platz für Bier-Galerie auch auf kleinen Screens */
  --sheet-beer-scroll-height: 16rem;
  max-height: min(88vh, 700px);
}

.add-bottles-panel .bottom-sheet-handle,
.add-bottles-panel .bottom-sheet-header {
  flex-shrink: 0;
}

.add-bottles-body {
  position: relative;
  text-align: left;
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.btn-info-text {
  flex-shrink: 0;
  padding: 0.35rem 0.6rem;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-info-text:hover,
.btn-info-text:focus {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  outline: none;
}

.btn-vormerken-info {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.btn-vormerken-info--corner {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
}

.btn-info-corner {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
}

.btn-vormerken-info .btn-vormerken-info-icon {
  display: block;
  flex-shrink: 0;
}

.btn-vormerken-info:hover,
.btn-vormerken-info:focus {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  outline: none;
}

/* Vormerken-Erklärungs-Modal (zentral, nur beim ersten Mal oder per Info-Icon) */
.vormerken-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 94;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.52);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.vormerken-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Einmaliger Onboarding-Hinweis („So funktioniert’s“ + Verstanden) */
.onboarding-hint-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  padding: 1rem;
}
.onboarding-hint-overlay[hidden] {
  display: none !important;
}
.onboarding-hint-card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 20rem;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.onboarding-hint-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.onboarding-hint-text {
  margin: 0 0 1rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.onboarding-hint-ok {
  width: 100%;
}

.vormerken-modal-box {
  max-width: 20rem;
  width: 100%;
  padding: 1.25rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.vormerken-modal-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.vormerken-modal-text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.vormerken-modal-ok {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #111;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.vormerken-modal-ok:hover,
.vormerken-modal-ok:focus {
  filter: brightness(1.1);
  outline: none;
}

.add-bottles-intro {
  margin: 0 0 0.4rem;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted);
  flex-shrink: 0;
}

.add-bottles-quantity-label {
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.add-bottles-quantity {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0 0.5rem;
  justify-content: flex-start;
  flex-shrink: 0;
}

.add-bottles-qty-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.add-bottles-qty-btn:hover,
.add-bottles-qty-btn:focus {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  outline: none;
}

.add-bottles-qty-btn.is-selected,
.add-bottles-qty-btn[aria-pressed="true"] {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.add-bottles-grid-scroll {
  flex: 1 1 0;
  min-height: 10rem;
  max-height: 18rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  margin: 0 -0.25rem 0.75rem;
  padding: 0 0.25rem 0.75rem;
  touch-action: pan-y;
}

.add-bottles-panel .bier-gallery-grid {
  grid-template-columns: repeat(5, 1fr);
  padding: 0 0 0.5rem;
}

.add-bottles-uebernehmen-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.add-bottles-uebernehmen-btn:hover:not(:disabled),
.add-bottles-uebernehmen-btn:focus:not(:disabled) {
  filter: brightness(1.08);
  outline: none;
}

.add-bottles-uebernehmen-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Sport-Auswahl (im Earn-Choice-Panel) === */
.sport-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.earn-choice-sport-grid {
  padding: 0;
}

.earn-choice-sport-grid .sport-choice-item {
  padding: 0.4rem 0.35rem;
  gap: 0.25rem;
}

.earn-choice-sport-grid .sport-choice-label {
  font-size: 0.8rem;
}

.earn-choice-sport-grid .sport-choice-subtitle {
  font-size: 0.65rem;
}

.earn-choice-sport-grid .sport-choice-icon {
  width: 36px;
  height: 36px;
}

.earn-choice-sport-grid .sport-choice-icon img {
  width: 24px;
  height: 24px;
}

.sport-choice-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.4rem;
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.sport-choice-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.sport-choice-subtitle {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.9;
  text-align: center;
  line-height: 1.2;
}

.sport-choice-item:hover,
.sport-choice-item:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  outline: none;
}

.sport-choice-item:active {
  transform: scale(0.98);
}

/* Kompaktere Icons in den Kacheln */
.sport-choice-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sport-choice-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: var(--icon-accent-filter);
  opacity: 0.95;
  transition: opacity 0.2s, filter 0.2s;
}

.sport-choice-item:hover .sport-choice-icon img:not(.sport-img-native),
.sport-choice-item:focus .sport-choice-icon img:not(.sport-img-native) {
  filter: var(--icon-accent-filter);
  opacity: 1;
}

/* Sport-Bilder (Einstellung „Bilder“): etwas kleiner als früher, passend zu kompakteren Kacheln */
.sport-choice-icon .sport-img-native {
  width: 56px !important;
  height: 56px !important;
}
.sport-choice-icon:has(.sport-img-native) {
  width: 56px;
  height: 56px;
}

/* Klick auf Icon/Bild wechselt Bild (zyklisch); nur bei Einstellung „Bilder“ */
.sport-icon-cycle {
  cursor: pointer;
}

/* Sport-Bilder (Einstellung „Bilder“): unverfälscht, kein Gelb-Filter */
.sport-img-native {
  filter: none !important;
  opacity: 1;
  object-fit: contain;
}
.progress-card-icon .sport-img-native {
  width: 100% !important;
  height: 100% !important;
  max-width: 96px;
  max-height: 96px;
  display: block;
  object-fit: contain;
  object-position: center;
}
.progress-card-icon img:not(.sport-img-native) {
  filter: var(--icon-accent-filter);
  opacity: 0.95;
}
/* Sobald ein img im Icon-Container liegt (Bild oder Lucide-Fallback): Mask/Background aus, nur img sichtbar – verhindert doppeltes/überlagertes Icon bei Celebration */
.progress-card-icon:has(img) {
  width: 96px;
  height: 96px;
  -webkit-mask-image: none;
  mask-image: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Activity Panel (Meter / Zeit) === */
.activity-panel-sport-display {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0 1.25rem;
}
.activity-panel-sport-display img {
  width: 160px;
  height: 160px;
  object-fit: contain;
}
.activity-panel-sport-display img.sport-img-native {
  width: 200px;
  height: 200px;
}
.activity-panel-sport-display img:not(.sport-img-native) {
  filter: var(--icon-accent-filter);
  opacity: 0.95;
}

.activity-panel-carousel {
  width: 100%;
  overflow: hidden;
  touch-action: pan-y;
}
.activity-panel-carousel-strip {
  display: flex;
  width: 100%;
  transition: transform 0.25s ease-out;
}
.activity-panel-carousel-dragging .activity-panel-carousel-strip {
  transition: none;
}
.activity-panel-carousel-slide {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.activity-panel-carousel-slide img {
  width: 200px;
  height: 200px;
  object-fit: contain;
}
.activity-panel-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0;
}
.activity-panel-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.activity-panel-carousel-dot:hover,
.activity-panel-carousel-dot:focus {
  background: rgba(255, 255, 255, 0.5);
  outline: none;
}
.activity-panel-carousel-dot.is-active {
  background: var(--accent);
}

.activity-panel-body {
  padding: 0 1rem 1rem;
}

.activity-time-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.activity-time-field {
  flex: 1;
}

.activity-time-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.activity-time-field input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.activity-time-field input:focus {
  outline: none;
  border-color: var(--accent);
}

/* === Earn-Choice Panel (Bier verdienen – Aktivität wählen) === */
.earn-choice-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(var(--footer-height) + max(1rem, var(--safe-bottom)));
}
.earn-choice-panel .bottom-sheet-handle,
.earn-choice-panel .bottom-sheet-header {
  flex-shrink: 0;
}
.earn-choice-panel .bottom-sheet-handle {
  margin-bottom: 0.5rem;
}
.earn-choice-header {
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}
.earn-choice-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.4rem max(0.75rem, var(--safe-right)) 1rem max(0.75rem, var(--safe-left));
  padding-top: calc(0.4rem + 10px); /* Platz für Badge am Apple-Aktivitäten-Button */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.earn-choice-vormerken-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.9rem;
  text-align: left;
  background: rgba(232, 185, 35, 0.1);
  border: 1px solid rgba(232, 185, 35, 0.35);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: visible;
}

.earn-choice-btn-badge {
  position: absolute;
  top: -9px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.earn-choice-btn-badge[hidden] {
  display: none !important;
}

.earn-choice-vormerken-btn:hover,
.earn-choice-vormerken-btn:focus {
  background: rgba(232, 185, 35, 0.18);
  border-color: var(--accent);
  outline: none;
}

.earn-choice-vormerken-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.earn-choice-vormerken-icon img {
  display: block;
  filter: var(--icon-accent-filter);
  opacity: 0.95;
}

.earn-choice-vormerken-text {
  flex: 1;
  min-width: 0;
}

.earn-choice-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  padding: 0.6rem 0.9rem;
  text-align: left;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.earn-choice-option-with-icon {
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
}

.earn-choice-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border-radius: var(--radius);
}

.earn-choice-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.earn-choice-option:hover,
.earn-choice-option:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  outline: none;
}

.earn-choice-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.earn-choice-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === Swim Panel === */
.swim-panel-body {
  padding: 0 1rem 1rem;
}

.swim-quick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.swim-quick-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.swim-quick-chip {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.swim-quick-chip:hover,
.swim-quick-chip:focus {
  opacity: 0.9;
  outline: none;
}

.swim-quick-chip:active {
  opacity: 0.8;
}

#activity-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.swim-input-row {
  margin-bottom: 0.75rem;
}

.swim-input-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.swim-input-row input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.swim-input-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-redeem {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-redeem:hover,
.btn-redeem:focus {
  opacity: 0.9;
  outline: none;
}

.swim-add-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.swim-add-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

/* === Settings Page === */
.settings-page-section {
  padding: 1rem;
  padding-bottom: 1.5rem;
}

.settings-page-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

/* === Settings Section (shared) === */
.settings-section {
  margin-bottom: 1rem;
}

.settings-section:first-child {
  margin-top: 0;
}

.settings-section:last-of-type {
  margin-bottom: 0;
}

/* Box-Styling für Einstellungs-Sektionen (wie Wochenzusammenfassung) */
.settings-page-section .settings-section-card {
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.settings-page-section .settings-section-card:last-of-type {
  margin-bottom: 0;
}

.settings-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#settings-community-login-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.settings-community-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  box-sizing: border-box;
}
/* Community-Konto (eingeloggt): mehr Abstand zwischen den Elementen */
#settings-community-logged-in {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.75rem;
}
.settings-community-logged-in-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.settings-community-email-change {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0 !important;
}
.settings-community-email-change .settings-label {
  margin-bottom: 0;
}
#btn-settings-community-request-email-change {
  margin-top: 0;
}
#btn-settings-community-logout {
  margin-top: 0.25rem;
}
.settings-community-status {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
}
.settings-community-status--success { color: #7dd99e; }
.settings-community-status--error { color: #f18a94; }

/* Community-Profil & Sichtbarkeit: größeres Textfeld, klareres Layout, Dropdown angepasst */
#settings-community-profile-section .settings-row-stacked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
#settings-community-profile-section .settings-row-stacked:last-of-type {
  margin-bottom: 0;
}
#settings-community-profile-section .settings-row-stacked .settings-label {
  flex: none;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0;
}
#settings-community-profile-section .settings-row-stacked .settings-community-input,
#settings-community-profile-section .settings-row-stacked .settings-select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.85rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
#settings-community-profile-section .settings-row-stacked .settings-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2rem;
}
#settings-community-profile-section .settings-row-stacked .settings-community-input:hover,
#settings-community-profile-section .settings-row-stacked .settings-community-input:focus,
#settings-community-profile-section .settings-row-stacked .settings-select:hover,
#settings-community-profile-section .settings-row-stacked .settings-select:focus {
  border-color: rgba(255, 255, 255, 0.25);
  outline: none;
}
#settings-community-profile-section .settings-row-checkbox {
  margin-bottom: 0.75rem;
}
#settings-community-profile-section .settings-row-checkbox .settings-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.4rem 0;
  width: 100%;
}
#settings-community-profile-section .settings-row-checkbox .settings-checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--accent);
}
#settings-community-profile-section .settings-row-checkbox .settings-checkbox-label {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
}

/* Streaks-Seite – Redesign mit Apple-Aktivitätsringen */
.streaks-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: var(--home-section-gap, 1rem);
  padding-bottom: calc(var(--footer-height) + 1rem);
}
.streaks-header {
  flex-shrink: 0;
  width: 100%;
}
.streaks-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.streaks-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.streaks-hint .app-title-prefix,
.streaks-hint .app-title-bier {
  letter-spacing: 0.2em;
}
.streaks-reward-bottle-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(80px * var(--bottle-size, 0.8) * 2.2);
  padding: 0.5rem 0;
  --bottle-size: 0.8;
}
.streaks-reward-bottle-wrap .streaks-reward-bottle {
  position: relative;
  width: calc(80px * var(--bottle-size, 1));
  height: calc(80px * var(--bottle-size, 1) * 2.2);
  min-height: 0;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}
.streaks-reward-bottle-wrap .streaks-reward-bottle .streaks-reward-bottle-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.streaks-redeem-wrap {
  margin-top: 1rem;
  flex-shrink: 0;
}
.streaks-redeem-wrap .streaks-redeem-btn {
  min-width: 10rem;
}
.streaks-progress {
  width: 100%;
}
.streaks-progress-text {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}
.streaks-days {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.streaks-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 2.8rem;
}
.streaks-day.is-met {
  border-color: var(--ring-exercise);
  background: rgba(170, 215, 83, 0.15);
}
.streaks-day.is-today {
  outline: 2px solid var(--ring-stand);
  outline-offset: 1px;
}
.streaks-day-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.streaks-day-rings {
  width: 2rem;
  height: 2rem;
  margin: 0.35rem 0;
  flex-shrink: 0;
}
.streaks-day-rings svg {
  width: 100%;
  height: 100%;
  display: block;
}
.streaks-day-rings .streaks-day-ring-bg {
  fill: none;
  stroke: var(--ring-bg);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.streaks-day-rings .streaks-day-ring-fill {
  fill: none;
  stroke-linecap: round;
  stroke-width: 2.5;
  transition: stroke-dashoffset 0.2s ease-out;
}
.streaks-day-rings .streaks-day-ring-fill.ring-move { stroke: var(--ring-move); }
.streaks-day-rings .streaks-day-ring-fill.ring-exercise { stroke: var(--ring-exercise); }
.streaks-day-rings .streaks-day-ring-fill.ring-stand { stroke: var(--ring-stand); }
.streaks-day-value {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-top: 0.2rem;
}
.streaks-status {
  font-size: 0.95rem;
  color: var(--text-muted);
  min-height: 1.5em;
  text-align: center;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.settings-row:last-child {
  margin-bottom: 0;
}

.settings-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-bottom: 0;
}
.settings-checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent, #e8b923);
}
.settings-checkbox-label {
  font-size: 0.95rem;
  color: var(--text);
}

/* Sport-Darstellung: Symbole vs. Bilder (zwei Kacheln mit Label + Beispiel) */
.settings-sport-icon-style-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.settings-sport-icon-style-option {
  flex: 1;
  margin: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius);
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.settings-sport-icon-style-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.settings-sport-icon-style-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.settings-sport-icon-style-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(232, 185, 35, 0.12);
}
.settings-sport-icon-style-option input:checked ~ .settings-sport-icon-style-label {
  color: var(--accent);
  font-weight: 600;
}
/* Einlöszeitraum: 2 / 7 / 14 Tage */
.settings-redeemable-days-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.settings-redeemable-days-option {
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, background 0.2s;
}
.settings-redeemable-days-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.settings-redeemable-days-option input {
  margin: 0;
  flex-shrink: 0;
}
.settings-redeemable-days-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(232, 185, 35, 0.12);
}
.settings-redeemable-days-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.settings-redeemable-days-option input:checked ~ .settings-redeemable-days-label {
  color: var(--text);
  font-weight: 600;
}

.settings-sport-icon-style-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  order: 1;
}
.settings-sport-display-example-preview {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  order: 2;
}
.settings-sport-display-example-preview img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.settings-sport-display-example-preview img:not(.sport-img-native) {
  filter: var(--icon-accent-filter);
  opacity: 0.95;
}
.settings-sport-display-example-preview img.sport-img-native {
  filter: none;
}

.settings-sport-thresholds {
  margin-top: 0.25rem;
  min-width: 0;
  max-width: 100%;
}

/* Aktivierte Sportarten (immer sichtbar) */
.settings-sport-thresholds-active {
  margin-bottom: 0;
}

/* Einklappbare Sektion „Weitere Sportarten“ */
.settings-sport-thresholds-inactive-wrap {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-sport-thresholds-inactive-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
}

.settings-sport-thresholds-inactive-btn:hover,
.settings-sport-thresholds-inactive-btn:focus {
  color: var(--text);
  outline: none;
}

.settings-sport-thresholds-chevron {
  flex-shrink: 0;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.35rem;
  transition: transform 0.2s ease;
}

.settings-sport-thresholds-inactive-wrap.is-expanded .settings-sport-thresholds-chevron {
  transform: rotate(-135deg);
}

.settings-sport-thresholds-inactive-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
}

.settings-sport-thresholds-inactive-wrap.is-expanded .settings-sport-thresholds-inactive-content {
  max-height: 2000px;
}

.settings-sport-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.settings-sport-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Toggle: Sport an/aus */
.settings-sport-toggle {
  flex-shrink: 0;
  width: 2.5rem;
  height: 1.35rem;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
.settings-sport-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.35rem - 4px);
  height: calc(1.35rem - 4px);
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s;
}
.settings-sport-toggle[aria-pressed="true"] {
  background: var(--accent);
}
.settings-sport-toggle[aria-pressed="true"]::after {
  transform: translateX(calc(2.5rem - 1.35rem));
}
.settings-sport-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Ausgeschaltete Sportart: Zeile ausgegraut, Eingabe deaktiviert */
.settings-sport-row--disabled {
  opacity: 0.5;
  pointer-events: none;
}
.settings-sport-row--disabled .settings-sport-toggle {
  pointer-events: auto;
  opacity: 1;
}
.settings-sport-row--disabled .settings-sport-toggle[aria-pressed="false"] {
  opacity: 0.8;
}

.settings-sport-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-sport-icon img {
  width: 37px;
  height: 37px;
  object-fit: contain;
  filter: var(--icon-accent-filter);
  opacity: 0.95;
}
.settings-sport-icon .sport-img-native {
  width: 37px !important;
  height: 37px !important;
  filter: none;
}

.settings-sport-label {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-sport-row input[type="number"] {
  flex-shrink: 0;
  width: 4rem;
  min-width: 3rem;
  padding: 0.35rem 0.5rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.settings-sport-row .settings-unit {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 2rem;
}

.settings-row-button {
  margin-top: 0.75rem;
}

.btn-clear-grid {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-clear-grid:hover,
.btn-clear-grid:focus {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.settings-row label,
.settings-label {
  flex: 0 0 120px;
  font-size: 0.875rem;
}

/* Checkbox-Zeilen: Label nutzt die volle Breite, Text bricht nicht zu früh um */
.settings-row .settings-checkbox-row {
  flex: 1 1 0%;
  min-width: 0;
}
.settings-checkbox-row .settings-checkbox-label {
  flex: 1;
  min-width: 0;
}

.settings-select {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.settings-select:hover,
.settings-select:focus {
  border-color: rgba(255, 255, 255, 0.25);
  outline: none;
}

.settings-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Lieblings-Bier: Flasche links in voller Höhe der Box, rechts Text + Button */
.settings-default-bottle-row {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  margin-top: 0.75rem;
  min-height: 7rem;
}

.settings-default-bottle-preview {
  width: 4.5rem;
  min-width: 4.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
}

.settings-default-bottle-preview:has(.settings-default-bottle-img) {
  padding-bottom: 0.25rem;
}

.settings-default-bottle-img {
  display: block;
  height: 100%;
  max-height: 7rem;
  width: auto;
  max-width: 4rem;
  object-fit: contain;
  object-position: center bottom;
}

.settings-default-bottle-preview:has(.settings-default-bottle-label) {
  width: auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
}

.settings-default-bottle-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-settings-choose-bottle {
  flex-shrink: 0;
  align-self: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-settings-choose-bottle:hover,
.btn-settings-choose-bottle:focus {
  filter: brightness(1.08);
  outline: none;
}

.settings-row input[type="number"] {
  width: 4rem;
  padding: 0.35rem 0.5rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.settings-row input[type="range"] {
  flex: 1;
  max-width: 140px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.settings-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.settings-row input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

#bottle-size-value {
  min-width: 2.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* === Stats Panel === */
.stats-summary {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stats-summary span {
  color: var(--accent);
  font-weight: 600;
}

.stats-section {
  margin-bottom: 1.25rem;
}

.stats-section:last-child {
  margin-bottom: 0;
}

.stats-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stats-list {
  font-size: 0.9rem;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-row:last-child {
  border-bottom: none;
}

.stats-row span:last-child {
  color: var(--accent);
}

.stats-empty {
  margin: 0;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stats {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === Bottle Section === */
.bottle-section {
  position: relative;
  min-height: 30vh;
  padding-top: 0.75rem;
  overflow-x: hidden;
  min-width: 0;
}

.btn-grid-action {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s, background 0.2s;
}

.btn-grid-action:hover,
.btn-grid-action:focus {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.btn-grid-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.btn-grid-action-icon img {
  display: block;
  filter: invert(1);
  opacity: 0.7;
}

.btn-grid-action:hover .btn-grid-action-icon img,
.btn-grid-action:focus .btn-grid-action-icon img {
  filter: var(--icon-accent-filter);
  opacity: 1;
}

/* Auf schmalen Displays (z. B. iPhone 12 Mini): kurze Button-Labels, einzeilig */
.btn-grid-action-text-short {
  display: none;
}

@media (max-width: 420px) {
  .grid-action-bar .btn-grid-action {
    white-space: nowrap;
  }
  .btn-grid-action .btn-grid-action-text-full {
    display: none;
  }
  .btn-grid-action .btn-grid-action-text-short {
    display: inline;
  }
}


.grid-add-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  padding: 0 1rem 1rem;
  flex-shrink: 0;
}

.grid-add-cta .btn-add-outline {
  width: 100%;
  max-width: min(360px, 92vw);
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 2px solid rgba(232, 185, 35, 0.7);
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.grid-add-cta .btn-add-outline:hover,
.grid-add-cta .btn-add-outline:focus {
  background: rgba(232, 185, 35, 0.12);
  opacity: 0.95;
  outline: none;
}

.progress-card {
  margin: 0 1rem 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid transparent;
  box-shadow: none;
}

.progress-card[aria-hidden="true"] {
  display: none;
}

.progress-card-wrap {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  border: none;
  padding: 0;
}

/* Strip: [aktuell | nächster] – neue Kachel schiebt immer von rechts rein */
.progress-card-strip {
  display: flex;
  flex-direction: row;
  width: 200%;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Nach links schieben → nächste Kachel (rechts) fährt von rechts rein */
.progress-card-strip.slide-to-next {
  transform: translateX(-50%);
}

.progress-card-slide {
  width: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  height: var(--home-top-min-height);
  min-height: var(--home-top-min-height);
}

/* Flasche + Prozent (Prozent als Overlay mittig auf der Flasche) */
.progress-card-bottle-block {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  align-self: center;
}

.progress-card-wrap:hover .progress-card-slide,
.progress-card-wrap:focus .progress-card-slide {
  background: rgba(255, 255, 255, 0.06);
}

.progress-card-wrap:focus {
  outline: none;
}

.progress-card-icon {
  flex-shrink: 0;
  align-self: center;
  width: 52px;
  height: 52px;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  background: var(--accent);
}

.progress-card-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}

.progress-card-label {
  display: block;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--text);
  flex-shrink: 0;
}

/* Progress-Leiste in der Progress-Card ausgeblendet (JS aktualisiert weiterhin den Fill) */
.progress-card-slide .progress-bar {
  display: none;
}

/* Zahl/Entfernung/Zeit und Sportname in der Progress-Card fett */
.progress-card-label .value-sport-font {
  font-weight: 700;
  letter-spacing: normal;
}
.progress-card-label .progress-card-sport-name {
  font-weight: 700;
}

/* Progress-Card nutzt .app-title-prefix und .app-title-bier via getAppTitleHtml() */

/* Prozent-Zahl mittig auf der Flasche (Overlay), Box an Inhalt angepasst */
.progress-card-pct {
  position: absolute;
  top: 65%;
  left: 50%;
  right: auto;
  width: auto;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.95), 0 1px 4px rgba(0, 0, 0, 0.85);
  background: rgba(0, 0, 0, 0.45);
  padding: 0.2em 0.5em;
  border-radius: 4px;
}

.progress-card-bottle {
  flex-shrink: 0;
  width: 64px;
  position: relative;
  --bottle-size: 0.8;
}

.progress-card-bottle-inner {
  width: 100%;
  height: 100px;
  position: relative;
  display: block;
}

.progress-card-bottle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-card-bottle-inner.bottle {
  width: 100%;
  aspect-ratio: unset;
  margin: 0;
}

/* Partielle Flasche in der Progress-Card: feste Skalierung, nur Clip wächst – kein Wackeln */
.progress-card-bottle .progress-card-bottle-inner.bottle-partial .bottle-fill {
  height: 100%;
  clip-path: inset(calc(100% - var(--fill-percent, 0%)) 0 0 0);
}

.progress-card-bottle .progress-card-bottle-inner.bottle-partial .bottle-fill img {
  height: calc(100% * var(--img-scale, 1));
  bottom: calc(50% - (100% * var(--img-scale, 1) * (0.5 + var(--img-ty-num, 0))));
}

.progress-bar {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent) 70%,
    rgba(255, 255, 255, 0.25) 85%,
    var(--accent) 100%
  );
  background-size: 200% 100%;
  background-position: 100% 0;
  border-radius: 3px;
  transition: width 2.5s linear;
  animation: progress-bar-shine 6s ease-in-out infinite;
}

@keyframes progress-bar-shine {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0 0; }
}

/* Progress-Card im Celebration-Modus (Belohnung beim Verdienen) */
.progress-card.is-celebrating {
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, rgba(232, 185, 35, 0.15), rgba(26, 26, 26, 0.95));
  transition: background 0.3s ease;
}

/* Pop beim Erreichen der Position + leuchtender Rand (wie Beispielcelebrations) */
.progress-card.is-celebrating.celebration-landed {
  animation: celebration-card-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             celebration-card-glow 2s ease-in-out 0.6s infinite;
}
@keyframes celebration-card-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  70%  { transform: scale(0.98); }
  100% { transform: scale(1.02); }
}
@keyframes celebration-card-glow {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent), 0 0 24px rgba(232, 185, 35, 0.5); }
  50%      { box-shadow: 0 0 0 3px var(--accent), 0 0 36px rgba(232, 185, 35, 0.7); }
}

/* Ruhiger Zustand: nur Leucht-Rand, kein Pop */
.progress-card.is-celebrating.celebration-calm {
  transform: scale(1.02);
  animation: celebration-card-glow 2s ease-in-out infinite;
}

/* Nach Ende der Celebration: Rahmen und Glow explizit zurücksetzen (kein Nachglühen) */
.progress-card:not(.is-celebrating) {
  border-color: transparent;
  box-shadow: none;
}

.progress-card.is-celebrating .progress-card-icon img {
  animation: celebration-pulse 1.5s infinite;
  filter: var(--icon-accent-filter) drop-shadow(0 0 8px rgba(232, 185, 35, 0.6));
}

/* Nach CELEBRATION_CALM_MS: Puls/Rotation stoppen, Karte bleibt ruhig stehen */
.progress-card.is-celebrating.celebration-calm .progress-card-icon img {
  animation: none;
  transform: scale(1);
  filter: var(--icon-accent-filter) drop-shadow(0 0 6px rgba(232, 185, 35, 0.4));
}

.progress-card.is-celebrating .celebration-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.progress-card.is-celebrating .celebration-quote {
  display: block;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #fff;
  font-style: italic;
}

.celebration-inline-prefix {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  font-style: normal;
}

.celebration-inline-suffix {
  font-weight: 800;
  color: var(--accent);
  font-style: normal;
}

/* Verstecke Elemente im Celebration-Modus, die stören */
.progress-card.is-celebrating .progress-bar,
.progress-card.is-celebrating .progress-card-pct,
.progress-card.is-celebrating .progress-card-bottle-block {
  display: none !important;
}

/* Damit Icon und Text mehr Platz haben */
.progress-card.is-celebrating .progress-card-content {
  align-items: center;
  text-align: center;
}

@keyframes celebration-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1); }
}

.landing-stats {
  margin: 0 1rem 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}

.landing-stats[aria-hidden="true"] {
  display: none;
}

.landing-stats-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.landing-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.landing-stat {
  text-align: center;
}

.landing-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.landing-stat-label {
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* 4 Spalten auf kleinen Screens (z. B. iPhone 12 Mini), 5 ab mittlerer Breite; enge Abstände */
.bottle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 0.5rem;
  row-gap: 0.45rem;
  padding: 0.2rem 0.75rem 0.75rem;
  align-content: start;
  align-items: start;
  grid-auto-rows: min-content;
  max-width: 100%;
  min-width: 0;
}
@media (min-width: 480px) {
  .bottle-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Bier-Galerie (Portal-Preview #galerie): ein Exemplar pro Sorte, 3 Spalten */
.bottle-grid.bottle-grid-galerie {
  grid-template-columns: repeat(3, 1fr);
}

/* === Bottle Cell (Flasche + Label-Platzhalter für stabiles Layout) === */
.bottle-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  min-width: 0;
}

.bottle-label {
  min-height: 1.2em;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.85;
  line-height: 1.2;
  text-align: center;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.bottle-label-earned {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.bottle-label-earned-text {
  white-space: nowrap;
}

.bottle-label-sport-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.9;
  vertical-align: middle;
}

/* Platzhalter „Bier verdienen“: gleichberechtigt zum + (44x44), vertikal zentriert */
.bottle-cell-placeholder-earn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  align-self: stretch;
}

.bottle-placeholder-earn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.bottle-placeholder-earn svg {
  width: 22px;
  height: 22px;
}

.bottle-placeholder-earn:hover,
.bottle-placeholder-earn:focus {
  background: rgba(232, 185, 35, 0.15);
  outline: none;
}

.bottle-placeholder-earn:active {
  opacity: 0.9;
}

/* Platzhalter mit + : gleiche Größe wie Tab-Button (44x44), vertikal zentriert */
.bottle-cell-placeholder-add {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  align-self: stretch;
}

.bottle-placeholder-add {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.bottle-placeholder-add:hover,
.bottle-placeholder-add:focus {
  opacity: 0.95;
  outline: none;
}

.bottle-placeholder-add:active {
  opacity: 0.85;
}

/* Leere Platzhalter: gleiche Höhe wie Flaschen-Zellen (Flasche + Label), unsichtbar */
.bottle-cell-placeholder-empty {
  min-height: calc(80px * var(--bottle-size, 1) * 2.2 + 1.2em + 0.15rem);
  visibility: hidden;
  pointer-events: none;
}

/* Slot ohne Benutzer-Bild: Benutzer muss Bier auswählen (niemals automatisch) */
.bottle-cell-pending-selection {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(80px * var(--bottle-size, 1) * 2.2 + 1.2em + 0.15rem);
}

.bottle-pending-selection {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(232, 185, 35, 0.15);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottle-pending-selection:hover,
.bottle-pending-selection:focus {
  background: rgba(232, 185, 35, 0.25);
  outline: none;
}

/* Leeres Grid: nur Bier verdienen (öffnet Auswahl-Panel) */
.bottle-cell-empty-grid-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20vh;
  grid-column: 1 / -1;
}

/* Nur zentrierender Container – kein Rahmen, damit der + Button normal wirkt */
.empty-grid-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottle-placeholder-add-central {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
}

.placeholder-actions-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.btn-add-second {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 2px solid rgba(232, 185, 35, 0.65);
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-add-second:hover,
.btn-add-second:focus {
  background: rgba(232, 185, 35, 0.12);
  outline: none;
}

.bottle-cell-placeholder-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  align-self: stretch;
}

.btn-earn-first {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}

.btn-earn-first:hover,
.btn-earn-first:focus {
  opacity: 0.95;
  outline: none;
}

.bottle-placeholder-add-large {
  width: 44px;
  height: 44px;
  font-size: 1.5rem !important;
}


/* === Bottle Item === */
.bottle {
  position: relative;
  width: calc(80px * var(--bottle-size, 1));
  max-width: 100%;
  aspect-ratio: 1 / 2.2;
  flex-shrink: 1;
  margin: 0 auto;
  cursor: pointer;
  transition: filter 0.25s ease, opacity 0.25s ease, transform 0.4s ease;
  contain: layout;
  overflow: hidden;
}

.bottle.bottle-disposing {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

/* Vertikaler Swipe auf Flasche soll Grid scrollen; pan-y erlaubt Scroll, DnD weiter per Pointer-Events */
.bottle-cell .bottle {
  touch-action: pan-y;
}

.bottle-cell {
  transition: transform 0.35s ease, opacity 0.35s ease;
}

/* Explicit inactive/consumed styles to ensure visual correctness */
.bottle.bottle-inactive-slot .bottle-inactive,
.bottle.bottle-consumed .bottle-inactive {
  opacity: var(--bottle-inactive-opacity) !important;
  filter: var(--bottle-inactive-filter) !important;
}

.bottle.bottle-inactive-slot .bottle-fill,
.bottle.bottle-consumed .bottle-fill {
  display: none !important;
}

/* Getrunken-Stempel nicht abschneiden (overflow + contain) */
.bottle.bottle-consumed {
  overflow: visible;
  contain: none;
}

.bottle.bottle-partial {
  overflow: visible;
}

/* Prozent-Label auf partiell befüllten Flaschen im Grid (gleiche Höhe wie getrunken-Stempel) */
.bottle .bottle-pct {
  position: absolute;
  top: 58%;
  left: 50%;
  width: auto;
  right: auto;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.95), 0 1px 4px rgba(0, 0, 0, 0.85);
  background: rgba(0, 0, 0, 0.45);
  padding: 0.2em 0.5em;
  border-radius: 4px;
}

/* „getrunken“-Stempel: mittig, etwas unter Mitte, rot, 45° gedreht – Kontrast für Lesbarkeit auf iPhone */
.bottle .bottle-pct-getrunken {
  top: 58%;
  left: 50%;
  width: auto;
  right: auto;
  transform: translate(-50%, -50%) rotate(-45deg);
  color: #e53935;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 2px #000, 0 0 4px rgba(0, 0, 0, 0.8), 0 1px 3px #000, 0 1px 1px rgba(255, 255, 255, 0.15);
  background: rgba(180, 30, 30, 0.5);
  border: 1px solid rgba(180, 30, 30, 0.85);
  padding: 0.25em 0.6em;
  border-radius: 4px;
  white-space: nowrap;
}

/* Klicks/Events auf .bottle, nicht auf Bild oder Füll-Div */
.bottle img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.bottle .bottle-inactive,
.bottle .bottle-fill {
  pointer-events: none;
}

.bottle-cell.bottle-cell-celebrating {
  animation: bottle-celebrate 1.5s ease-out;
}

.bottle-cell.bottle-cell-celebrating .bottle {
  animation: bottle-celebrate-scale 1.5s ease-out;
}

@keyframes bottle-celebrate {
  0%, 100% { filter: none; }
  15% { filter: drop-shadow(0 0 8px rgba(232, 185, 35, 0.8)); }
  50% { filter: drop-shadow(0 0 12px rgba(232, 185, 35, 0.6)); }
  100% { filter: none; }
}

@keyframes bottle-celebrate-scale {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.08); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Basis: identische Höhe für alle – Transparenz-basierte Skalierung (--img-scale aus getBottleImageStyle) */
.bottle-inactive {
  position: absolute;
  inset: 0;
  opacity: var(--bottle-inactive-opacity);
  filter: var(--bottle-inactive-filter);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bottle-inactive img {
  display: block;
  width: auto;
  max-width: none;
  height: calc(100% * var(--img-scale, 1));
  object-fit: contain;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translate(var(--img-tx, 0%), var(--img-ty, 0%));
}

/* Active fill: Overlay, gleiche Breite wie bottle */
.bottle-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--fill-percent, 0%);
  overflow: hidden;
  transition: height 0.25s ease-out;
  pointer-events: none;
}

.bottle-fill img {
  display: block;
  position: absolute;
  bottom: calc(50% - (100% * var(--img-scale, 1) * (0.5 + var(--img-ty-num, 0))));
  left: 50%;
  width: auto;
  max-width: none;
  height: calc(100% * var(--img-scale, 1));
  object-fit: contain;
  transform: translateX(-50%) translateX(var(--img-tx, 0%));
}

/* Voll aktiv: fill = volle Höhe, inactive versteckt */
.bottle.bottle-full .bottle-inactive {
  opacity: 0;
}

.bottle.bottle-full .bottle-fill {
  height: 100%;
  opacity: 1;
  filter: none;
}

/* Voll aktiv: exakt gleiche Positionierung wie bottle-inactive, damit Größe 1:1 übereinstimmt */
.bottle.bottle-full .bottle-fill img {
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -50%) translate(var(--img-tx, 0%), var(--img-ty, 0%));
}

/* Reste-Flasche: clip-path für exakte Ausrichtung mit inactive; zu Beginn schneller (ease-out) */
.bottle.bottle-partial .bottle-fill {
  height: 100%;
  opacity: 1;
  filter: none;
  clip-path: inset(calc(100% - var(--fill-percent, 0%)) 0 0 0);
  transition: clip-path 0.5s ease-out;
}

.bottle.bottle-partial .bottle-fill img {
  /* Exakt wie bottle-inactive img positioniert */
  bottom: auto;
  top: 50%;
  height: calc(100% * var(--img-scale, 1));
  transform: translate(-50%, -50%) translate(var(--img-tx, 0%), var(--img-ty, 0%));
}

/* Langsame Entleerung bei Streak-Verlust */
.bottle.bottle-draining .bottle-fill {
  transition: height 3s ease-in-out, clip-path 3s ease-in-out !important;
}

/* "Kaputte" Flasche (Anti-Celebration): Grau / Shake / Traurig */
.bottle.bottle-broken .bottle-inactive,
.bottle.bottle-broken .bottle-fill {
  filter: grayscale(100%) sepia(50%) hue-rotate(-50deg) !important; /* Bräunlich/Dreckig */
  animation: bottle-sad-shake 0.5s ease-in-out;
}

@keyframes bottle-sad-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px) rotate(-5deg); }
  75% { transform: translateX(5px) rotate(5deg); }
}


/* === Footer / Tab-Bar (iPhone-Style, eine Zeile) === */
.native-tab-bar-active .footer {
  display: none !important;
}
/* Inhalt darf bis hinter die native Tab-Bar scrollen – kein Abstand nach unten */
.native-tab-bar-active .main-scroll {
  padding-bottom: 0 !important;
}
.native-tab-bar-active .app[data-page="grid"] .main-scroll {
  padding-bottom: 0 !important;
}
/* Karte & Home: Inhalte sollen OBERHALB der nativen Tab-Bar enden */
.native-tab-bar-active .app[data-page="map"] .main-scroll,
.native-tab-bar-active .app[data-page="home"] .main-scroll {
  padding-bottom: var(--footer-height) !important;
}
.native-tab-bar-active .app[data-page="settings"] .main-scroll {
  padding-bottom: max(1rem, var(--safe-bottom)) !important;
}
/* Tab Bar – an iOS UITabBar angelehnt (transluzent, Blur, Safe Area) */
.footer {
  margin: 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: var(--footer-height);
  padding: 0 0 env(safe-area-inset-bottom, 0px);
  background: rgba(28, 28, 30, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  -webkit-touch-callout: none;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
  z-index: 90;
}

.tab-bar {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-around;
  width: 100%;
  max-width: 500px;
  flex: 1;
}
#tab-home { order: 1; }
#tab-streaks { order: 2; }
#tab-grid { order: 3; }
#tab-map { order: 4; }
#tab-settings { order: 5; }

.tab-add-bottle {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.tab-add-bottle:hover,
.tab-add-bottle:focus {
  opacity: 0.95;
  outline: none;
}

.tab-add-bottle:active {
  opacity: 0.85;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 64px;
  min-height: 49px;
  padding: 4px 2px 2px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  border-radius: 0;
  transition: color 0.2s, background 0.2s;
  position: relative;
}

.tab-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
}
.tab-badge[hidden] {
  display: none !important;
}

.meter-input {
  display: flex;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  max-width: 140px;
}

.tab-item:hover,
.tab-item:focus {
  color: rgba(255, 255, 255, 0.85);
  outline: none;
}

.tab-item:active {
  background: rgba(255, 255, 255, 0.06);
}

.tab-item[aria-selected="true"] {
  color: var(--accent);
}

.tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  overflow: visible;
}

.tab-icon svg {
  width: 25px;
  height: 25px;
  overflow: visible;
  flex-shrink: 0;
  stroke-width: 2;
}

.tab-item[aria-selected="true"] .tab-icon svg {
  stroke-width: 2.5;
}

.tab-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-input input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0 0.5rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.meter-input input::placeholder {
  color: var(--text-muted);
}

.meter-input input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-add {
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-add:active {
  opacity: 0.85;
}

/* === Snackbar (Undo) === */
.snackbar {
  position: fixed;
  bottom: calc(7.5rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(90vw, 360px);
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 100;
  animation: snackbar-in 0.25s ease;
}

.snackbar[hidden] {
  display: none;
}

@keyframes snackbar-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.snackbar-undo {
  padding: 0.35rem 0.6rem;
  font-size: 0.875rem;
  color: var(--accent);
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.snackbar-undo:active {
  opacity: 0.8;
}

.snackbar-action {
  padding: 0.35rem 0.6rem;
  font-size: 0.875rem;
  color: var(--accent);
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.snackbar-action:active {
  opacity: 0.8;
}

/* === Onboarding Overlay === */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.onboarding-overlay[hidden] {
  display: none !important;
}

.onboarding-slides-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Onboarding: scrollbar auf allen Geräten, Safe Area unten sicher einhalten – Button nie abgeschnitten */
.onboarding-slide {
  position: absolute;
  inset: 0;
  padding: calc(2rem + var(--safe-top)) max(1.5rem, var(--safe-right)) calc(1.5rem + var(--safe-bottom)) max(1.5rem, var(--safe-left));
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  background: var(--bg);
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

/* ... existing styles ... */

.onboarding-detected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1rem 0;
  max-width: 100%;
  max-height: 42vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}

.onboarding-detected-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 72px;
  flex-shrink: 0;
}

.onboarding-detected-icon {
  width: 56px;
  height: 56px;
  background: var(--bg-elevated);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--accent);
}

.onboarding-detected-icon img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  filter: var(--icon-accent-filter);
}

.onboarding-detected-name {
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.2;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Onboarding: eigene Bier-Auswahlseite – gleiche obere Position wie andere Slides (kein extra padding-top) */
.onboarding-slide--beer {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}

/* Willkommens-Slide: Sponsor + Button unten, mit Abstand und Safe Area */
.onboarding-welcome-footer {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding-top: 1.5rem;
}

.onboarding-slide--beer .onboarding-actions {
  flex-shrink: 0;
}

.onboarding-slide--beer .onboarding-beer-slide-inner {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

.onboarding-slide--beer .onboarding-beer-slide-inner .onboarding-title,
.onboarding-slide--beer .onboarding-beer-slide-inner .onboarding-beer-intro {
  flex-shrink: 0;
}

.onboarding-slide--beer .onboarding-beer-intro {
  margin-bottom: 0.75rem;
}

.onboarding-slide--beer .onboarding-beer-preview {
  width: 100px;
  height: 200px;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

/* Nur die Galerie scrollt; Höhe nur per Flex (kein max-height), damit auf iPad nichts abgeschnitten wird */
.onboarding-beer-grid-scroll {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 0.5rem;
  align-self: stretch;
}

/* Galerie: kompakte Items, responsiv für alle Bildschirmgrößen */
.onboarding-beer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0.5rem 0 1.5rem;
  max-width: 100%;
}

.onboarding-beer-grid .bier-gallery-item {
  aspect-ratio: 1 / 2.2;
  min-height: 0;
  padding: 0.1rem;
  background: var(--bg-elevated);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.onboarding-beer-grid .bier-gallery-item img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  max-width: none;
  height: calc(100% * var(--img-scale, 1));
  object-fit: contain;
  transform: translate(-50%, -50%) translate(var(--img-tx, 0%), var(--img-ty, 0%));
}

/* Tablet: mehr Spalten = kleinere Items, Breite begrenzt */
@media (min-width: 768px) {
  .onboarding-beer-grid-scroll {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  .onboarding-beer-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
  }
}

/* iPad / große Tablets: noch kompakter */
@media (min-width: 1024px) {
  .onboarding-beer-grid-scroll {
    max-width: 480px;
  }
  .onboarding-beer-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 0.4rem;
  }
}

.onboarding-beer-grid .bier-gallery-item.selected {
  border-width: 3px;
  border-color: var(--accent);
  background: rgba(232, 185, 35, 0.12);
  box-shadow: 0 0 0 1px var(--accent);
}

.onboarding-beer-preview {
  width: 120px;
  height: 240px;
  margin-bottom: 2rem;
  position: relative;
}

.onboarding-beer-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.onboarding-slide[hidden] {
  display: none;
}

/* Inhalt oben ausgerichtet, damit Emoji/Icon/Grafik immer an derselben Position ist (ruhiges Layout beim Wechsel) */
.onboarding-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

/* Hero-Zone: auf kleinen Geräten kompakter, damit Platz für Button bleibt */
.onboarding-content > *:first-child,
.onboarding-hero {
  min-height: clamp(8rem, 22vh, var(--onboarding-hero-min-height));
  display: flex;
  align-items: center; /* Icon vertikal zentriert statt oben klebend */
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  padding-top: 1rem; /* Leichtes Padding für optische Balance */
}

.onboarding-icon-large {
  font-size: 5rem;
  margin-bottom: 1.5rem;
}

/* Notifications slide: Glocke und Flasche exakt übereinander */
.onboarding-notify-visual {
  position: relative;
  height: calc(130px * 2.2 + 0.5rem);
  width: 100%;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

/* Beide Elemente exakt zentriert übereinander. */
#onboarding-notify-bell,
#onboarding-notify-bottle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#onboarding-notify-bell {
  /* SVG-Glocke */
  width: auto;
  height: auto;
}

/* Celebration-Flasche: etwas kleiner als zuvor, weiter nach oben */
#onboarding-notify-bottle {
  width: 130px;
  height: calc(130px * 2.2);
  top: 40%;
  transform: translate(-50%, -50%);
}

#onboarding-notify-bell svg {
  width: 100px;
  height: 100px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.onboarding-bell {
  animation: onboarding-bell-ring 0.4s ease-in-out infinite;
  transform-origin: center center;
}

#onboarding-notify-bell.onboarding-bell {
  transform: translate(-50%, -50%); /* Basis-Zentrierung bleibt, Animation nur Rotation */
}

@keyframes onboarding-bell-ring {
  0%, 100% { transform: translate(-50%, -50%) rotate(-12deg); }
  50% { transform: translate(-50%, -50%) rotate(12deg); }
}

.onboarding-notify-bottle {
  transition: filter 0.5s ease, opacity 0.4s ease;
}

.onboarding-notify-bottle.bottle-inactive {
  opacity: var(--bottle-inactive-opacity, 0.5);
  filter: var(--bottle-inactive-filter, grayscale(80%));
}

.onboarding-notify-bottle.active {
  opacity: 1;
  filter: none;
}

.onboarding-notify-bottle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Sichtbarkeit umschalten ohne Layout-Sprung (beide behalten Platz) */
#onboarding-notify-bell.onboarding-notify-hidden,
#onboarding-notify-bottle.onboarding-notify-hidden {
  visibility: hidden;
  pointer-events: none;
}

.onboarding-title {
  font-size: 2rem;
  margin: 0 0 1rem;
  line-height: 1.2;
}

/* SPORT/BIER im Onboarding: gleiche Typografie wie im Rest der App (font-weight, letter-spacing) */
.onboarding-title .app-title-muted,
.onboarding-title .app-title-main,
.onboarding-text .app-title-muted,
.onboarding-text .app-title-main {
  font-weight: 700;
  letter-spacing: 0.2em;
}

.onboarding-subtitle {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 600;
}

.onboarding-text {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}

.onboarding-text-small {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
  max-width: 280px;
}

.onboarding-link-like {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.onboarding-password-block {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.onboarding-password-block .onboarding-name-row.onboarding-password-row {
  margin-top: 0;
}

.onboarding-password-block .onboarding-name-row.onboarding-password-row + .onboarding-name-row {
  margin-top: 1rem;
}

.onboarding-password-block .onboarding-password-row input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  min-height: 2.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.onboarding-password-block .onboarding-password-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.onboarding-password-block .onboarding-password-actions .btn-onboarding-primary {
  margin-top: 0;
}

.onboarding-password-block .onboarding-password-back-link {
  margin: 0;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.onboarding-name-row {
  margin-top: 1.25rem;
  width: 100%;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}
.onboarding-name-row .onboarding-input-name,
.onboarding-input-name,
.onboarding-input-email {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.onboarding-slide-email .login-panel-status {
  margin: 0.5rem 0 0;
}

/* Buttons unten mit Safe Area – auf allen iOS-Geräten lesbar und tippbar */
.onboarding-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  margin-top: auto;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0));
  flex-shrink: 0;
  min-height: 4rem;
}

.btn-onboarding-primary {
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  font-weight: 700;
  padding: 1rem 1.25rem;
  min-height: 3rem;
  border-radius: var(--radius);
  font-size: 1.1rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-onboarding-secondary {
  width: 100%;
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.8rem;
  font-size: 1rem;
}

/* Slide „Aktivitäten anpassen“: kompakte Kopfzeile auf kleinen Geräten */
.onboarding-header-small {
  min-height: clamp(4rem, 12vh, 10rem);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

.onboarding-header-small h3 {
  margin: 0;
  font-size: 1.5rem;
}

/* Sports-Edit-Slide: Header und Weiter-Button fix, nur die Liste scrollt (wichtig für iPad/lange Listen) */
.onboarding-slide--sports-edit {
  justify-content: stretch;
}
.onboarding-slide--sports-edit .onboarding-header-small,
.onboarding-slide--sports-edit .onboarding-actions {
  flex-shrink: 0;
}
.onboarding-slide--sports-edit .onboarding-scroll-content {
  flex: 1 1 0;
}

.onboarding-scroll-content {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 0 2rem 0; /* unten mehr Platz, damit letzte Zeile nicht unter dem Weiter-Button verschwindet */
  display: flex;
  flex-direction: column;
  gap: 2rem;
  -webkit-overflow-scrolling: touch;
}

.onboarding-scroll-content .onboarding-section {
  min-width: 0;
  max-width: 100%;
}

.onboarding-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--text);
}

.onboarding-section-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.onboarding-sports-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

/* Sport Row in Onboarding */
.onboarding-sport-row {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  padding: 0.75rem;
  border-radius: var(--radius);
  gap: 0.75rem;
}

.onboarding-sport-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tile);
  border-radius: 8px;
  font-size: 1.5rem;
}

.onboarding-sport-info {
  flex: 1;
}

.onboarding-sport-name {
  display: block;
  font-weight: 600;
  font-size: 1rem;
}

.onboarding-sport-input {
  width: 80px;
  background: transparent;
  border: 1px solid var(--bg-tile);
  color: var(--accent);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  text-align: right;
  font-weight: 600;
}

.onboarding-sport-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 30px;
  text-align: right;
}
