/* =========================================================
   POKÉFRIENDS MOBILE PWA - STYLESHEET
   Ultra-modern, touch-native glassmorphism UI for Smartphones
   ========================================================= */

:root {
  /* ================= PURE AMOLED BLACK THEME ================= */
  --bg-main: #000000;
  --bg-secondary: #000000;
  --bg-elevated: #050505;
  --card-bg: #070707;
  --card-border: rgba(255, 255, 255, 0.10);
  --card-border-subtle: rgba(255, 255, 255, 0.05);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: var(--color-text-dim);

  --accent-blue: var(--color-primary);
  --accent-green: var(--color-success);
  --accent-purple: var(--color-accent);
  --accent-gold: var(--color-warning);
  --accent-red: var(--color-danger);
  --accent-cyan: var(--color-info);

  /* Level Tiers */
  --lvl-80: var(--color-lvl-80);
  --lvl-70: var(--color-lvl-70);
  --lvl-60: var(--color-lvl-60);
  --lvl-50: var(--color-lvl-50);
  --lvl-40: var(--color-lvl-40);
  --lvl-30: var(--color-lvl-30);
  --lvl-sub30: var(--color-lvl-sub30);
  --lvl-unk: var(--color-lvl-unk);

  --nav-height: 64px;
  --header-height: 60px;
  --font-family: var(--font-family-base);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  overscroll-behavior-y: contain;
}

body {
  font-family: var(--font-family);
  background-color: #000000;
  background-image: none;
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  line-height: 1.4;
}

/* iOS Auto-Zoom Fix (nur auf Touch-Geräten nötig) */
@media (pointer: coarse) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Verhindert Textauswahl auf UI-Elementen, erlaubt es aber in Listen */
.bottom-nav, .mobile-header, .sheet-header, button, .fab, .tab-btn, .action-btn {
  user-select: none;
  -webkit-user-select: none;
}

/* ================= APP CONTAINER & HEADER ================= */

.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: calc(var(--safe-top) + 8px) 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ef4444 48%, #1e293b 49%, #1e293b 53%, #f8fafc 54%);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
  position: relative;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand-icon:hover, .brand-icon:active {
  transform: rotate(20deg) scale(1.08);
}
.brand-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #f8fafc;
  border: 2px solid #0f172a;
  border-radius: 50%;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(34, 211, 238, 0.3));
}

.account-selector-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.9) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  font-family: inherit;
  text-align: left;
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 175px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.account-selector-pill:active {
  transform: scale(0.95);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.3);
}

.account-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 10px currentColor;
  animation: dotPulse 2.5s infinite ease-in-out;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* ================= PULL TO REFRESH WITH HOLD DELAY ================= */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 90;
  transform: translateY(-100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.ptr-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ptr-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: ptrSpin 0.8s linear infinite;
  flex-shrink: 0;
  background: transparent;
  transition: border-top-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ptr-label {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.2s ease, font-weight 0.2s ease;
}

.ptr-indicator.ptr-holding .ptr-pill {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.25);
}

.ptr-indicator.ptr-holding .ptr-label {
  color: var(--accent-cyan);
  font-weight: 600;
}

.ptr-indicator.ptr-ready .ptr-pill {
  border-color: rgba(52, 211, 153, 0.7);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.45);
  transform: scale(1.04);
}

.ptr-indicator.ptr-ready .ptr-spinner {
  border-top-color: var(--color-success);
  border-right-color: var(--color-success);
  transform: scale(1.15);
}

.ptr-indicator.ptr-ready .ptr-label {
  color: var(--color-success);
  font-weight: 700;
}

.ptr-indicator.ptr-refreshing .ptr-pill {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.ptr-indicator.ptr-refreshing .ptr-spinner {
  border-top-color: var(--accent-cyan);
  animation: ptrSpin 0.6s linear infinite;
}

.ptr-indicator.ptr-refreshing .ptr-label {
  color: var(--accent-cyan);
  font-weight: 600;
}

@keyframes ptrSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================= PIN PROTECTION OVERLAY ================= */

.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.pin-box {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pin-shield {
  font-size: 3rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.4));
}

.pin-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.pin-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.pin-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  background: transparent;
  transition: all 0.2s ease;
}

.pin-dot.filled {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  transform: scale(1.15);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.pin-btn {
  height: 64px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--card-border-subtle);
  color: var(--text-main);
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.pin-btn:active {
  background: rgba(56, 189, 248, 0.25);
  transform: scale(0.94);
}

.pin-btn.action-btn {
  font-size: 1.1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
}

.pin-lock-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  animation: fadeIn 0.3s ease;
}

.pin-lock-icon {
  font-size: 1.5rem;
}

.pin-lock-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.pin-lock-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f87171;
}

.pin-lock-timer {
  font-size: 1rem;
  font-weight: 700;
  color: #fca5a5;
  font-variant-numeric: tabular-nums;
}

.pin-keypad.locked {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.8);
}

.pin-bio-btn {
  margin-top: 18px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-blue);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.pin-bio-btn:active {
  background: rgba(56, 189, 248, 0.25);
  transform: scale(0.97);
}

/* ================= VIEW CONTAINER & PAGES ================= */

.view-page {
  display: none;
  padding: 14px 16px;
  animation: fadeIn 0.25s ease-out;
}

.view-page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= SEARCH & FILTER CHIPS ================= */

.search-sticky-container {
  position: sticky;
  top: 56px;
  z-index: 30;
  background: rgba(7, 12, 24, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 0 6px 0;
  margin-bottom: 4px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  color: var(--text-dim);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid var(--card-border-subtle);
  border-radius: 22px;
  padding: 0 44px 0 40px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  -webkit-appearance: none;
}

.search-input:focus {
  background: rgba(30, 41, 59, 0.85);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.2), inset 0 1px 2px rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

.search-clear-btn {
  position: absolute;
  right: 4px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.recent-searches-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 2px 2px 2px;
  overflow-x: auto;
  scrollbar-width: none;
  animation: fadeIn 0.2s ease;
}
.recent-searches-box::-webkit-scrollbar {
  display: none;
}

.recent-search-pill {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.recent-search-pill:active {
  background: rgba(34, 211, 238, 0.2);
  color: #fff;
  transform: scale(0.96);
}

/* Floating Scroll-To-Top Button (M7) */
.scroll-to-top-btn {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  right: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.scroll-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-to-top-btn:active {
  transform: scale(0.92);
  filter: brightness(1.2);
}

/* Alphabet Quick Jump Bar (M7) */
.alphabet-quick-bar {
  position: fixed;
  right: 2px;
  top: 130px;
  bottom: calc(68px + env(safe-area-inset-bottom));
  display: none;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  z-index: 25;
  width: 20px;
  user-select: none;
  touch-action: none;
  background: rgba(7, 12, 24, 0.4);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 4px 0;
}
.alphabet-quick-bar.visible {
  display: flex;
}
.alphabet-letter {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dim);
  padding: 1px 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}
.alphabet-letter:active, .alphabet-letter.active {
  color: var(--accent-cyan);
  font-weight: 900;
  transform: scale(1.4);
}

/* M9: Unified :active micro-interactions and touch targets */
.friend-card:active,
.btn:active,
.filter-chip:active,
.nav-item:active,
.cleanup-btn:active,
.detail-action-btn:active {
  transform: scale(0.97) !important;
  filter: brightness(1.15);
  transition: transform 0.08s ease, filter 0.08s ease;
}

.filter-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 4px 8px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
}
.filter-chips-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 7px 15px;
  border-radius: 20px;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--card-border-subtle);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.filter-chip:active {
  transform: scale(0.93);
  background: rgba(56, 189, 248, 0.2);
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3) 0%, rgba(34, 211, 238, 0.18) 100%);
  border-color: var(--accent-cyan);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 14px rgba(34, 211, 238, 0.35);
  transform: translateY(-1px);
}

.view-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 100%;
}

.sort-select {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--card-border-subtle);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
  max-width: 145px;
  text-overflow: ellipsis;
}

.btn-subbar-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-subbar-action:active {
  background: rgba(56, 189, 248, 0.25);
  transform: scale(0.95);
}

.btn-subbar-icon-action {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--card-border-subtle);
  color: var(--text-dim);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-subbar-icon-action.active, .btn-subbar-icon-action:active {
  background: rgba(56, 189, 248, 0.2);
  color: var(--color-primary);
  border-color: rgba(56, 189, 248, 0.4);
}

.card-copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 4px;
  padding: 0;
  transition: all 0.18s ease;
}
.card-copy-btn:hover, .card-copy-btn:active {
  background: rgba(56, 189, 248, 0.2);
  color: var(--color-primary);
  border-color: rgba(56, 189, 248, 0.4);
  transform: scale(0.93);
}

.cleanup-chunks-header {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 10px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}
.cleanup-chunks-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.btn-cleanup-chunk {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.18s ease;
}
.btn-cleanup-chunk:hover, .btn-cleanup-chunk:active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ================= FRIEND CARDS (MOBILE TOUCH) ================= */

.friend-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-header {
  padding: 10px 4px 4px 4px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-header-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: normal;
}

.friend-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.85));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border-subtle);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Modern Web Guidance: Defer rendering strictly below initial viewport fold with auto intrinsic size */
.friend-card:nth-child(n + 10) {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 96px;
}

.friend-card:active {
  transform: scale(0.96);
  background: rgba(25, 36, 62, 0.95);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.friend-card.lucky {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(18, 26, 45, 0.9) 100%);
}

.friend-card.swipe-copy-ready {
  border-color: rgba(52, 211, 153, 0.6) !important;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.3) !important;
}

.friend-card.swipe-copied-flash {
  background: rgba(52, 211, 153, 0.2) !important;
  border-color: rgba(52, 211, 153, 0.8) !important;
  transition: background 0.35s ease, border-color 0.35s ease !important;
}

.friend-card.marked-delete {
  opacity: 0.65;
  border-color: rgba(239, 68, 68, 0.4);
}

/* ================= COMPACT FRIEND CARDS ================= */

.friend-card-compact {
  padding: 8px 12px;
  gap: 8px;
  min-height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
}

.friend-card-compact .compact-lvl-badge {
  font-size: 0.72rem;
  font-weight: 800;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-blue);
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.25);
}

.friend-card-compact .compact-trainer-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.friend-card-compact .compact-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.compact-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.compact-dot.lucky {
  background: var(--accent-gold);
  box-shadow: 0 0 6px var(--accent-gold);
}
.compact-dot.gift {
  background: #ec4899;
  box-shadow: 0 0 6px #ec4899;
}
.compact-nickname {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact-right-col {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.mobile-status-pill.compact {
  padding: 2px 6px;
  font-size: 0.65rem;
}
.compact-km {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-blue);
}
.card-copy-btn.compact {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}
.card-copy-btn.compact svg {
  width: 11px;
  height: 11px;
}

.card-lvl-col {
  flex-shrink: 0;
}

.mobile-level-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(30, 45, 78, 0.95), rgba(15, 23, 42, 0.98));
  border: 2px solid var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.98rem;
  color: #ffffff;
  letter-spacing: -0.02em;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.mobile-level-badge.lvl-max {
  position: relative;
  background: radial-gradient(circle at 35% 35%, #0369a1 0%, #0f172a 100%);
  animation: maxLevelAura 3s infinite alternate ease-in-out;
}

@keyframes maxLevelAura {
  0% { box-shadow: 0 0 10px rgba(56, 189, 248, 0.4), inset 0 0 8px rgba(56, 189, 248, 0.3); }
  100% { box-shadow: 0 0 16px rgba(56, 189, 248, 0.8), inset 0 0 12px rgba(56, 189, 248, 0.5); }
}

.card-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-top-line {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.card-flag-img {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.card-trainer-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-nickname {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-badges-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.mobile-mini-badge {
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--card-border-subtle);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.mobile-mini-badge.lucky {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.5);
  color: var(--accent-gold);
}
.mobile-mini-badge.gift {
  background: rgba(192, 132, 252, 0.2);
  border-color: rgba(192, 132, 252, 0.5);
  color: var(--accent-purple);
}
.mobile-mini-badge.linked {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--accent-blue);
}
.mobile-mini-badge.group {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.5);
  color: var(--accent-green);
}

.card-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.mobile-status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}
.mobile-status-pill.active {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.mobile-status-pill.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.mobile-status-pill.low {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}
.mobile-status-pill.paused {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.4);
}
.mobile-status-pill.first {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.mobile-sparkline {
  width: 44px;
  height: 16px;
}

.card-chevron {
  color: var(--text-dim);
  font-size: 1.2rem;
  margin-left: 2px;
}

/* ================= AUFRÄUMEN SCREEN ================= */

.cleanup-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border-subtle);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

.cleanup-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-red);
}

.cleanup-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.45;
}

.cleanup-filter-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.cleanup-days-select {
  height: 42px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.cleanup-switches {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cleanup-switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.cleanup-switch-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.searchstring-box {
  background: rgba(11, 17, 32, 0.9);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
}

.searchstring-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.searchstring-textarea {
  width: 100%;
  height: 72px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: monospace;
  font-size: 0.82rem;
  resize: none;
  outline: none;
  line-height: 1.35;
}

.btn-primary-mobile {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, #0284c7 100%);
  border: none;
  color: #070c18;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn-primary-mobile:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
}

.cleanup-candidate-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border-subtle);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s ease;
  content-visibility: auto;
  contain-intrinsic-size: auto 64px;
}

button.cleanup-candidate-item {
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.cleanup-candidate-item:active {
  transform: scale(0.985);
  background: rgba(30, 41, 59, 0.9);
}

.cleanup-candidate-item.selected {
  background: rgba(56, 189, 248, 0.05);
  border-color: rgba(56, 189, 248, 0.3);
}

.cleanup-candidate-item.marked-delete {
  border-left: 3.5px solid var(--accent-red);
  background: rgba(239, 68, 68, 0.06);
}

.group-icon-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}

.group-icon-avatar .lucide-icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}

/* Cleanup Selection Bar & Batch Buttons */
.cleanup-selection-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.cleanup-selection-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cleanup-master-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
}

.cleanup-badge-found {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--card-border-subtle);
}

.cleanup-batch-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-cleanup-batch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-cleanup-batch.mark {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}
.btn-cleanup-batch.mark:active {
  background: rgba(239, 68, 68, 0.3);
  transform: scale(0.96);
}

.btn-cleanup-batch.unmark {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.25);
}
.btn-cleanup-batch.unmark:active {
  background: rgba(148, 163, 184, 0.25);
  transform: scale(0.96);
}

.btn-cleanup-batch.delete {
  background: rgba(220, 38, 38, 0.22);
  color: #ef4444;
  border-color: rgba(220, 38, 38, 0.5);
}
.btn-cleanup-batch.delete:active {
  background: rgba(220, 38, 38, 0.4);
  transform: scale(0.96);
}

.cleanup-badge-delete {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-weight: 700;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.cleanup-badge-inactive {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-red);
}

.cleanup-rules-details {
  border-top: 1px solid var(--card-border-subtle);
  padding-top: 10px;
  margin-top: 4px;
}

.cleanup-rules-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  padding: 4px 2px;
}

.cleanup-rules-summary::-webkit-details-marker {
  display: none;
}

.cleanup-rules-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* ================= BERICHTE SCREEN ================= */

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border-subtle);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.donut-svg-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 16px 0;
  position: relative;
}

.donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--card-border-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.donut-legend-item:active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-blue);
}

.donut-legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.legend-count {
  font-weight: 700;
  color: var(--text-main);
}

.legend-pct {
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* ================= PERSONEN SCREEN ================= */

.cluster-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border-subtle);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.cluster-card.is-collapsed {
  padding: 12px 14px;
}

.cluster-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cluster-card.is-collapsed .cluster-avatars-grid {
  display: none !important;
}

.cluster-card.is-collapsed .cluster-title {
  margin-bottom: 0;
}

.cluster-title .cluster-chevron {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(90deg);
  flex-shrink: 0;
}

.cluster-card.is-collapsed .cluster-chevron {
  transform: rotate(0deg);
}

.cluster-avatars-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cluster-avatar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 10px;
  cursor: pointer;
}

/* ================= BOTTOM SHEET & DRILLDOWN ================= */

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  overscroll-behavior: none;
  touch-action: none;
}

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

html:has(body.modal-open),
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  background: #000000;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px 24px 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  padding-bottom: var(--safe-bottom);
  overscroll-behavior: contain;
  touch-action: pan-y;
}

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

.bottom-sheet.snap-half {
  transform: translateY(42vh) !important;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.15) !important;
}

.sheet-drag-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  margin: 12px auto 8px auto;
  cursor: grab;
  touch-action: none;
}

/* ================= FULLSCREEN DETAIL VIEW ================= */

.bottom-sheet.fullscreen-detail-sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  z-index: 600;
  background: #000000;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  transform: translateY(105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
  box-shadow: none;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) 0;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

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

.fullscreen-detail-sheet .sheet-header {
  padding: 10px 14px 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #000000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  min-height: 58px;
}

.fullscreen-detail-sheet .sheet-title-group {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-back-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--card-border-subtle);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.sheet-back-btn:active {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-blue);
  transform: scale(0.95);
}

.sheet-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sheet-nav-arrow-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--card-border-subtle);
  color: var(--text-dim);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sheet-nav-arrow-btn:active {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-blue);
  transform: scale(0.95);
}

.fullscreen-detail-sheet .sheet-tabs {
  display: flex;
  background: rgba(14, 22, 41, 0.98);
  border-bottom: 1px solid var(--card-border-subtle);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.fullscreen-detail-sheet .sheet-tab-btn {
  flex: 1;
  padding: 12px 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.fullscreen-detail-sheet .sheet-tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.05);
}

.fullscreen-detail-sheet .sheet-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 36px 16px;
}


.sheet-header {
  padding: 4px 18px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border-subtle);
}

.sheet-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet-close-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--card-border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sheet-tabs {
  display: flex;
  border-bottom: 1px solid var(--card-border-subtle);
  background: rgba(14, 22, 41, 0.8);
}

.sheet-tab-btn {
  flex: 1;
  padding: 10px 4px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.sheet-tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

.sheet-content {
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

/* ================= BOTTOM NAVIGATION BAR ================= */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.nav-tab-btn {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.nav-tab-btn::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 40%;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-tab-btn.active {
  color: var(--accent-blue);
}

.nav-tab-btn.active::after {
  transform: translateX(-50%) scaleX(1);
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.6);
}

.nav-tab-icon {
  font-size: 1.35rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-tab-btn.active .nav-tab-icon {
  transform: translateY(-2px) scale(1.15);
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.4));
}

.nav-tab-label {
  font-size: 0.75rem;
  font-weight: 700;
  transition: opacity 0.2s;
}

/* Toast notifications */
.mobile-toast {
  position: fixed;
  top: calc(var(--safe-top) + 70px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-blue);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.mobile-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   MOBILE SUB-NAV & HALL OF FAME STYLES
   ========================================================================== */
.mobile-subnav-bar {
  display: flex;
  background: rgba(13, 21, 39, 0.85);
  border: 1px solid var(--card-border-subtle);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 12px;
  gap: 4px;
}

.subnav-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.subnav-pill.active {
  background: rgba(56, 189, 248, 0.18);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.15);
}

.mega-stats-mobile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.mega-stat-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border-subtle);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.mega-stat-card:active {
  transform: scale(0.97);
}

.mega-stat-card:nth-child(1) {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  border-color: rgba(14, 165, 233, 0.3);
}
.mega-stat-card:nth-child(1)::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}
.mega-stat-card:nth-child(1) .mega-stat-icon {
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.45));
}

.mega-stat-card:nth-child(2) {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}
.mega-stat-card:nth-child(2)::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #f87171, #ef4444);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}
.mega-stat-card:nth-child(2) .mega-stat-icon {
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.45));
}

.mega-stat-card:nth-child(3) {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  border-color: rgba(139, 92, 246, 0.3);
}
.mega-stat-card:nth-child(3)::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #a855f7, #8b5cf6);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}
.mega-stat-card:nth-child(3) .mega-stat-icon {
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.45));
}

.mega-stat-card:nth-child(4) {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  border-color: rgba(245, 158, 11, 0.3);
}
.mega-stat-card:nth-child(4)::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}
.mega-stat-card:nth-child(4) .mega-stat-icon {
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.45));
}

.mega-stat-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.mega-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.mega-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.25;
}

.hof-mobile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border-subtle);
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, border-color 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  content-visibility: auto;
  contain-intrinsic-size: auto 62px;
}

.hof-mobile-row:active {
  transform: scale(0.97);
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--accent-cyan);
}

.hof-mobile-row:has(.rank-1) {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(18, 26, 45, 0.9) 100%);
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.15);
}

.hof-mobile-row:has(.rank-2) {
  border-color: rgba(226, 232, 240, 0.35);
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.06) 0%, rgba(18, 26, 45, 0.9) 100%);
}

.hof-mobile-row:has(.rank-3) {
  border-color: rgba(217, 119, 6, 0.35);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.06) 0%, rgba(18, 26, 45, 0.9) 100%);
}

.hof-mobile-rank {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  flex-shrink: 0;
}

.hof-mobile-rank.rank-1 {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #070c18;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}
.hof-mobile-rank.rank-2 {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  color: #070c18;
  box-shadow: 0 0 10px rgba(226, 232, 240, 0.5);
}
.hof-mobile-rank.rank-3 {
  background: linear-gradient(135deg, #d97706, #92400e);
  color: #fff;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.45);
}

.buddy-progress-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
}
.buddy-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9, #22d3ee);
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.5);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.buddy-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 999px;
}

/* ==========================================================================
   ORGANIGRAMM (RELATIONSHIP DIAGRAM)
   ========================================================================== */
.org-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: var(--bg-body);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.org-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.org-path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 4px currentColor);
  transition: opacity 0.25s ease;
}

.org-path.is-muted {
  opacity: 0 !important;
  pointer-events: none !important;
}

.org-nodes-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.org-node {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  min-width: 86px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease, filter 0.25s ease;
}

.org-node:active {
  transform: translate(-50%, -50%) scale(1.06);
}

.org-node.is-muted {
  opacity: 0.35 !important;
  filter: grayscale(1) !important;
  border-style: dashed !important;
  background: rgba(100, 116, 139, 0.08) !important;
  box-shadow: none !important;
  transform: translate(-50%, -50%) scale(0.96);
}

.org-node.is-muted:active {
  opacity: 0.65 !important;
  transform: translate(-50%, -50%) scale(1.0);
}

.org-node.person-node {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.18);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.org-node.person-node.has-muted {
  border-style: dashed;
}

.org-node.avatar-node {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.18);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35);
  padding-right: 1.7rem;
}

.org-node.account-node {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
}

.org-node-detail-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 5;
}

.org-node-detail-btn:active {
  background: var(--color-primary, #0ea5e9);
  color: #ffffff;
  transform: scale(0.92);
}

.org-node-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-node-sub {
  font-size: 0.65rem;
  color: #94a3b8;
  white-space: nowrap;
}

.org-container.compact .org-node {
  padding: 0.3rem 0.45rem;
  min-width: 74px;
}
.org-container.compact .org-node.avatar-node {
  padding-right: 1.45rem;
}
.org-container.compact .org-node-detail-btn {
  top: 2px;
  right: 2px;
  width: 17px;
  height: 17px;
}
.org-container.compact .org-node-title {
  font-size: 0.72rem;
  max-width: 85px;
}
.org-container.compact .org-node-sub {
  font-size: 0.58rem;
}

.btn-sm-mobile {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-sm-mobile:active {
  background: rgba(56, 189, 248, 0.25);
  transform: scale(0.95);
}

.btn-map-mobile {
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
  color: white !important;
  border: none;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-map-mobile:active {
  background: linear-gradient(135deg, #10b981 0%, #0369a1 100%);
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

/* ================= FRIEND DETAIL SHEET DASHBOARD (ÜBERSICHT) ================= */

.sheet-status-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.sheet-status-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sheet-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sheet-status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.sheet-status-badge.paused {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.sheet-status-badge.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.sheet-status-badge.first {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.sheet-status-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sheet-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.sheet-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.sheet-kpi-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--card-border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.sheet-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.sheet-kpi-icon {
  font-size: 1.1rem;
}

.sheet-kpi-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.sheet-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.sheet-kpi-sub {
  font-size: 0.75rem;
  margin-top: 4px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sheet-kpi-sub.positive {
  color: var(--color-success);
}
.sheet-kpi-sub.info {
  color: var(--accent-blue);
}
.sheet-kpi-sub.neutral {
  color: var(--text-dim);
}

.sheet-section-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.sheet-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sheet-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--card-border-subtle);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}
.sheet-account-chip.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-blue) !important;
}

.sheet-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--card-border-subtle);
}

.sheet-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--card-border-subtle);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sheet-action-btn:active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: scale(0.98);
}

.sheet-action-btn.delete-toggle {
  grid-column: 1 / -1;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--text-main);
}

.sheet-action-btn.delete-toggle.is-marked {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.sheet-action-btn.delete-toggle:active {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--accent-red);
  color: #fca5a5;
}


/* Accessibility */
:focus:not(:focus-visible) {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   M6: TABLET- & QUERFORMAT-LAYOUT
   ========================================================= */

/* Ab 700px: Tablets & breite Bildschirme */
@media (min-width: 700px) {
  .app-wrapper {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .mobile-header {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .bottom-nav {
    max-width: 1100px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--card-border-subtle);
    border-bottom: none;
  }

  .friend-list-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .group-header {
    grid-column: 1 / -1;
  }

  .cleanup-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .search-sticky-container,
  .filter-chips-scroll,
  .view-subbar {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .pin-box {
    max-width: 360px;
  }
}

/* Ab 1024px: Master-Detail Ansicht mit Seitenpanel rechts */
@media (min-width: 1024px) {
  .app-wrapper {
    max-width: 1200px;
  }

  .bottom-sheet,
  .bottom-sheet.fullscreen-detail-sheet {
    position: fixed;
    inset: 0 0 0 auto;
    width: 440px;
    max-width: 440px;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 20px 0 0 20px;
    border: none;
    border-left: 1px solid var(--card-border);
    box-shadow: -12px 0 36px rgba(0, 0, 0, 0.65);
    transform: translateX(105%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  }

  .bottom-sheet.open,
  .bottom-sheet.fullscreen-detail-sheet.open {
    transform: translateX(0);
  }

  .sheet-drag-handle {
    display: none;
  }
}

/* Smartphone Querformat: Bottom-Nav wird schmale Seitenleiste links */
@media (max-height: 520px) and (orientation: landscape) {
  .bottom-nav {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 72px;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 14px;
    padding-bottom: 14px;
    gap: 12px;
    border-top: none;
    border-right: 1px solid var(--card-border-subtle);
    border-radius: 0;
    transform: none;
  }

  .nav-tab-btn {
    flex: 0 0 auto;
    width: 100%;
    height: 52px;
  }

  .nav-tab-btn::after {
    top: 50%;
    left: 0;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
  }

  .nav-tab-btn.active::after {
    transform: translateY(-50%) scaleY(1);
  }

  .nav-tab-label {
    font-size: 0.6rem;
  }

  .app-wrapper {
    padding-left: 72px;
    padding-bottom: 20px;
  }

  .mobile-header {
    left: 72px;
    width: calc(100% - 72px);
  }
}

/* ================= VIEW TRANSITIONS (M9) ================= */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) {
    animation: 160ms cubic-bezier(0.4, 0, 1, 1) both fade-out;
  }
  ::view-transition-new(root) {
    animation: 200ms cubic-bezier(0, 0, 0.2, 1) both fade-in;
  }
  @keyframes fade-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.985); }
  }
  @keyframes fade-in {
    from { opacity: 0; transform: scale(1.01); }
    to { opacity: 1; transform: scale(1); }
  }
}

/* ================= SKELETON LOADERS ================= */

@keyframes skeletonShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite ease-in-out;
}

.skeleton-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--card-border-subtle);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 12px;
  border-radius: 4px;
}

.skeleton-title {
  width: 55%;
  height: 14px;
}

.skeleton-sub {
  width: 35%;
  height: 10px;
}

.skeleton-status {
  width: 48px;
  height: 20px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ================= TEAM-THEMED SHEET ACCENTS (SUBTLE & REFINED) ================= */

.bottom-sheet.team-mystic .sheet-header {
  border-top: 2px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 -2px 14px rgba(56, 189, 248, 0.12);
}
.bottom-sheet.team-mystic .sheet-drag-handle {
  background: rgba(56, 189, 248, 0.45);
}

.bottom-sheet.team-valor .sheet-header {
  border-top: 2px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 -2px 14px rgba(239, 68, 68, 0.12);
}
.bottom-sheet.team-valor .sheet-drag-handle {
  background: rgba(239, 68, 68, 0.45);
}

.bottom-sheet.team-instinct .sheet-header {
  border-top: 2px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 -2px 14px rgba(245, 158, 11, 0.12);
}
.bottom-sheet.team-instinct .sheet-drag-handle {
  background: rgba(245, 158, 11, 0.45);
}

/* Subtle Team Badges */
.mobile-team-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.70rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9999px;
  letter-spacing: 0.01em;
}
.mobile-team-pill .team-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mobile-team-pill.team-mystic {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}
.mobile-team-pill.team-mystic .team-dot {
  background: #38bdf8;
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.6);
}

.mobile-team-pill.team-valor {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.mobile-team-pill.team-valor .team-dot {
  background: #ef4444;
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.6);
}

.mobile-team-pill.team-instinct {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde047;
}
.mobile-team-pill.team-instinct .team-dot {
  background: #eab308;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.6);
}

/* ================= VIVILLON PATTERN GRID ================= */

.vivillon-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.vivillon-item {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--card-border-subtle);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vivillon-item:active {
  transform: scale(0.97);
}

.vivillon-item.collected {
  border-color: rgba(192, 132, 252, 0.35);
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.08) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.vivillon-item.missing {
  opacity: 0.45;
  border-style: dashed;
}

.vivillon-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vivillon-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.vivillon-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
}

.vivillon-count.has {
  background: rgba(192, 132, 252, 0.22);
  color: var(--color-accent);
}

.vivillon-count.zero {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

.vivillon-status-tag {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.vivillon-item.collected .vivillon-status-tag {
  color: var(--color-success);
}

/* =========================================================
   PWA UPGRADE V2.2: READ-ONLY ENHANCEMENTS & RICH DATA
   ========================================================= */

.mobile-sparkline {
  width: 50px;
  height: 18px;
  overflow: visible;
  flex-shrink: 0;
}

.card-pace-badge {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.mobile-mini-badge.fav {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.mobile-mini-badge.prot {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.mobile-mini-badge.renamed {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.mobile-mini-badge.wish {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-weight: 600;
}

.lucky-wish-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.08);
}

.former-names-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.former-name-pill {
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.78rem;
}

.sheet-metric-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sheet-metric-switcher::-webkit-scrollbar {
  display: none;
}

.sheet-metric-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border-subtle);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.sheet-metric-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-blue);
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.sheet-chart-scrub-display {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--card-border-subtle);
  border-radius: 8px;
  padding: 7px 11px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  min-height: 34px;
}

.btn-cleanup-chunk.chunk-done {
  background: rgba(34, 197, 94, 0.15) !important;
  border-color: rgba(34, 197, 94, 0.4) !important;
  color: #86efac !important;
}

.group-active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.82rem;
}

.group-active-banner button {
  background: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 2px 6px;
}

.digest-highlight-card {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--card-border-subtle);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.digest-highlight-card.gold-glow {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.digest-trainer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.digest-trainer-row:active {
  background: rgba(255, 255, 255, 0.05);
}

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


