
    /* Grundstyles */
    * { box-sizing: border-box; }
    body {
      font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
      margin: 0;
      padding: 0;
      background: #f2ede3;
      color: #4a3c2e;
      line-height: 1.5;
      display: flex;
      min-height: 100vh;
      flex-direction: column;
    }

    :root {
      --logo-bg: #f2ede3;
      --header-bg: #BCBABE;
      --nav-bg: #F1F1F2;
      --content-bg: #F1F1F2;
      --primary-color: #20948B;
      --accent-color: #20948B;
      --button-bg: transparent;
      --button-hover-bg: #20948B;
      --button-text-color: #000000;
    }

    header {
      background-color: var(--header-bg);
      color: black;
      display: flex;
      align-items: center;
      padding: 10px 20px;
      gap: 15px;
      flex-shrink: 0;
      position: relative;
    }

    header img { height: 80px; width: auto; flex-shrink: 0; }

    header h1 {
      margin: 0;
      font-size: 2.2rem;
      font-weight: 700;
      color: black;
      flex-grow: 1;
      text-align: center;
      user-select: none;
      font-family: 'Pacifico', cursive;
    }

    #logoutButton {
      background: var(--button-bg);
      border: none;
      padding: 8px 14px;
      color: black;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 600;
      flex-shrink: 0;
      width: auto;
      height: 36px;
      transition: background-color 0.3s ease;
    }
    #logoutButton:hover { background: var(--button-hover-bg); color: white; }

    #mainContainer {
      display: flex;
      flex-grow: 1;
      background: var(--content-bg);
      min-height: calc(100vh - 100px);
    }

    nav {
      background: var(--nav-bg);
      width: 200px;
      padding-top: 20px;
      border-radius: 12px 0 0 12px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      box-shadow: 2px 0 5px rgba(0,0,0,0.1);
      flex-shrink: 0;
      margin: 10px 0 10px 10px;
      user-select: none;
    }

    nav button {
      background: var(--button-bg);
      border: none;
      padding: 12px 10px;
      color: black;
      font-weight: 600;
      cursor: pointer;
      border-radius: 25px;
      text-align: left;
      transition: background-color 0.3s, color 0.3s;
      font-size: 1.0rem;
      position: relative;
    }
    nav button:hover,
    nav button.active {
      background-color: var(--accent-color);
      color: white;
      padding-right: 24px;
      margin-right: 4px;
      box-sizing: border-box;
    }

    /* Ungelesene Nachrichten werden weiter unten als Zahlenbadge dargestellt. */

    main {
      flex-grow: 1;
      padding: 20px 40px;
      overflow-y: auto;
      min-width: 0;
      max-width: 100%;
    }

    section { display: none; }
    section[style*="display: block"] { display: block; }

    input, textarea, button[type="submit"] {
      font-size: 1rem;
      padding: 10px;
      margin: 6px 0;
      width: 100%;
      max-width: 400px;
      border: 1px solid #ccc;
      border-radius: 8px;
      font-family: inherit;
    }
    textarea { resize: vertical; }

    .message {
      margin-top: 8px;
      font-size: 0.9rem;
    }
    .message.error { color: #b00020; }
    .message.success { color: #0c7c3c; }

    /* Profile Liste */
    #profileList {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 0.5cm;
      justify-items: center;
    }

    .profile {
      background: white;
      padding: 6px 6px 10px 6px;
      border-radius: 12px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      box-shadow: 0 2px 6px rgba(0,0,0,0.1);
      transition: box-shadow 0.3s ease, transform 0.2s ease;
      text-align: center;
      user-select: none;
      width: 120px;
      box-sizing: border-box;
      font-family: 'Pacifico', cursive;
    }
    .profile:hover {
      box-shadow: 0 4px 14px rgba(0,0,0,0.15);
      transform: translateY(-2px);
    }
    .profile img {
      width: 120px;
      height: 120px;
      object-fit: cover;
      border-radius: 12px;
      margin-bottom: 6px;
      border: 3px solid var(--primary-color);
    }
    .profile-info strong {
      font-size: 1.0rem;
      color: black;
      word-break: break-word;
    }

    /* Profilbild Detail */
    #profileImage {
      width: 180px;
      height: 180px;
      border-radius: 15px;
      object-fit: cover;
      border: 4px solid var(--primary-color);
      margin-bottom: 15px;
      cursor: pointer;
      box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    }
    #profile-detail p { max-width: 600px; margin: 6px 0; }

    .gallery-image-container { position: relative; display: inline-block; margin: 8px; }
    .gallery-image-container img {
      max-width: 160px;
      height: auto;
      border-radius: 10px;
      box-shadow: 0 2px 6px rgba(0,0,0,0.1);
      cursor: pointer;
      transition: transform 0.3s ease;
    }
    .gallery-image-container img:hover { transform: scale(1.05); }

    .delete-btn {
      position: absolute;
      top: 6px;
      right: 6px;
      background: rgba(255,0,0,0.7);
      border: none;
      color: white;
      font-weight: bold;
      border-radius: 50%;
      width: 26px;
      height: 26px;
      cursor: pointer;
      box-shadow: 0 1px 3px rgba(0,0,0,0.3);
      transition: background-color 0.3s ease;
    }
    .delete-btn:hover { background: rgba(200,0,0,0.9); }

    #lightboxOverlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0,0,0,0.85);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 2000;
    }
    #lightboxImage {
      max-width: 90%;
      max-height: 90%;
      border-radius: 12px;
      box-shadow: 0 0 25px rgba(255,255,255,0.9);
    }

    /* Matching Profil Einzelansicht */
    #matchingProfileSection { text-align: center; }
    #matching-profile-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
    }
    #matchingProfileImage {
      max-width: 90vw;
      max-height: 70vh;
      border-radius: 15px;
      object-fit: cover;
      border: 4px solid var(--primary-color);
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    #matching-buttons-container {
      display: flex;
      gap: 20px;
      justify-content: center;
    }
    #matching-buttons-container button {
      background-color: var(--primary-color);
      color: white;
      border: none;
      padding: 12px 30px;
      font-size: 1.5rem;
      border-radius: 50px;
      cursor: pointer;
      font-weight: 700;
      transition: background-color 0.3s ease, transform 0.1s ease;
    }
    #matching-buttons-container button:hover {
      background-color: var(--accent-color);
      transform: translateY(-1px);
    }
    #view-profile-btn {
      background-color: var(--primary-color);
      color: white;
      border: none;
      padding: 10px 25px;
      font-size: 1.1rem;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 700;
      box-shadow: 0 3px 8px rgba(0,0,0,0.15);
      margin-top: 10px;
    }
    #view-profile-btn:hover { background-color: var(--accent-color); }

    /* Matches Liste – optisch etwas moderner */
    #myMatchesList {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 0.7cm;
      justify-items: center;
    }
    .match-profile {
      background: white;
      padding: 8px 8px 12px 8px;
      border-radius: 16px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      box-shadow: 0 2px 6px rgba(0,0,0,0.12);
      transition: box-shadow 0.3s ease, transform 0.2s ease;
      text-align: center;
      user-select: none;
      width: 140px;
      box-sizing: border-box;
      position: relative;
    }
    .match-profile:hover {
      box-shadow: 0 6px 16px rgba(0,0,0,0.18);
      transform: translateY(-2px);
    }
    .match-profile img {
      width: 120px;
      height: 120px;
      object-fit: cover;
      border-radius: 50%;
      margin-bottom: 6px;
      border: 3px solid var(--primary-color);
    }
    .match-profile strong {
      font-size: 1.0rem;
      color: black;
      word-break: break-word;
    }
    .match-badge {
      position: absolute;
      top: 6px;
      right: 6px;
      background: #ff3366;
      color: #fff;
      font-size: 0.7rem;
      padding: 2px 6px;
      border-radius: 999px;
      font-weight: 700;
    }

    /* Buttons für Like/Dislike */
    .btn-like, .btn-dislike {
      background-color: var(--primary-color);
      border: none;
      color: white;
      font-size: 1.5rem;
      padding: 10px 25px;
      border-radius: 50px;
      cursor: pointer;
      font-weight: 700;
      margin: 0 5px;
      transition: background-color 0.3s ease, transform 0.1s ease;
    }
    .btn-like:hover {
      background-color: var(--accent-color);
      transform: translateY(-1px);
    }
    .btn-dislike:hover {
      background-color: #cc0000;
      transform: translateY(-1px);
    }

    /* Chat Section – moderner Look */
    #chat-section { display: none; max-width: 700px; margin: 0 auto; }
    #chat-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      font-weight: 600;
    }
    #chat-partner-name {
      color: var(--primary-color);
    }

    #chat-matches-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
      max-height: 150px;
      overflow-y: auto;
    }
    .chat-match {
      cursor: pointer;
      padding: 6px 12px;
      background: #e0f2f1;
      color: #004d40;
      border-radius: 20px;
      user-select: none;
      font-weight: 600;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: 1px solid transparent;
      transition: background-color 0.2s ease, border-color 0.2s ease;
      font-size: 0.9rem;
    }
    .chat-match.active {
      background: var(--primary-color);
      color: white;
      border-color: #00695c;
    }
    .chat-match .chat-unread-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #ff1744;
    }

    #chat-messages {
      border: 1px solid #ccc;
      height: 340px;
      overflow-y: auto;
      padding: 10px;
      background: #fafafa;
      border-radius: 14px;
      margin-bottom: 6px;
      font-size: 0.95rem;
      line-height: 1.3;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .chat-message-wrapper {
      display: flex;
      flex-direction: column;
      max-width: 80%;
    }
    .chat-message-wrapper.me {
      align-self: flex-end;
      align-items: flex-end;
    }
    .chat-message-wrapper.them {
      align-self: flex-start;
      align-items: flex-start;
    }
    .chat-message-bubble {
      padding: 8px 12px;
      border-radius: 16px;
      background: white;
      box-shadow: 0 1px 3px rgba(0,0,0,0.12);
      word-wrap: break-word;
    }
    .chat-message-wrapper.me .chat-message-bubble {
      background: #c8e6c9;
    }
    .chat-message-meta {
      font-size: 0.7rem;
      color: #777;
      margin-top: 2px;
    }

    #chat-typing-indicator {
      font-size: 0.85rem;
      color: #666;
      min-height: 18px;
      margin-bottom: 8px;
    }

    #chat-input-container {
      display: flex;
      gap: 10px;
      margin-top: 4px;
    }
    #chat-input {
      flex-grow: 1;
      font-size: 1rem;
      padding: 10px;
      border-radius: 8px;
      border: 1px solid #ccc;
      background: white;
    }
    #chat-send-btn {
      background: var(--primary-color);
      color: white;
      border: none;
      padding: 10px 25px;
      border-radius: 8px;
      font-weight: 700;
      cursor: pointer;
      transition: background-color 0.3s ease, transform 0.1s ease;
      white-space: nowrap;
    }
    #chat-send-btn:hover {
      background: var(--accent-color);
      transform: translateY(-1px);
    }

    /* Hilfsbuttons */
    #editOwnProfileBtn, #backToProfilesBtn {
      background: var(--primary-color);
      color: #fff;
      border: none;
      padding: 10px 16px;
      border-radius: 8px;
      font-weight: 700;
      cursor: pointer;
      margin-top: 10px;
      box-shadow: 0 3px 8px rgba(0,0,0,.15);
    }
    #editOwnProfileBtn:hover,
    #backToProfilesBtn:hover {
      background: var(--accent-color);
    }
  
[hidden] { display:none !important; }
.profile strong,.match-profile strong { overflow-wrap:anywhere; max-width:100%; }
.profile img { width:100%; height:auto; aspect-ratio:1; }
.message { overflow-wrap:anywhere; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline:3px solid #00695c; outline-offset:3px; }
.profile,.match-profile { border:0; font-family:inherit; }
.image-button { border:0; padding:0; background:transparent; cursor:pointer; }
.pagination { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:20px; }
.pagination button { padding:10px 16px; }
button:disabled { opacity:.55; cursor:wait; }
form label { display:block; margin-top:12px; font-weight:600; }
#lightbox-close { position:absolute; top:20px; right:20px; padding:12px 18px; font-size:1.2rem; }
#matching-empty { text-align:center; padding:30px; }
#chat-error { min-height:1.5em; }
#delete-account-details { margin-top:32px; max-width:500px; }
#chat-input { max-width:none; min-width:0; }
.chat-match .chat-unread-dot { width:auto; height:auto; padding:2px 6px; color:white; font-size:.75rem; }
@media (max-width:700px) { header { padding:10px; gap:8px; } header img { height:50px; } header h1 { font-size:1.5rem; } #mainContainer { flex-direction:column; min-height:0; } nav { width:auto; flex-direction:row !important; flex-wrap:wrap; gap:4px; padding:8px; margin:0; border-radius:0; } nav button { font-size:.9rem; padding:9px; } main { padding:16px 12px; } #chat-messages { height:48vh; } #chat-send-btn { padding:10px; } .chat-message-wrapper { max-width:90%; } input, textarea, button[type=submit] { max-width:100%; } #matchingProfileImage { max-height:50vh; max-width:100%; } #profileList,#myMatchesList { gap:12px; } }


/* unread-count-badge */
nav button.has-unread::after {
  content: attr(data-unread);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  color: #fff;
  background: #dc2638;
  white-space: nowrap;
}

nav button {
  position: relative;
}


/* mobile-live-unread-badge */

/*
 * Numeric unread badges for the primary navigation.
 * Works on desktop and on the fixed iPhone/mobile navigation.
 */
#primary-navigation button.has-unread {
  position: relative;
}

#primary-navigation button.has-unread::after {
  content: attr(data-unread) !important;
  position: absolute !important;
  top: 2px;
  right: 4px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 4px !important;
  margin: 0 !important;
  box-sizing: border-box;
  border-radius: 999px;
  background: #dc2638 !important;
  color: #fff !important;
  font-size: 11px !important;
  line-height: 18px !important;
  font-weight: 700;
  z-index: 5;
  white-space: nowrap;
}

@media (max-width:700px) {
  #primary-navigation button.has-unread::after {
    top: 1px;
    right: 1px;
    min-width: 17px !important;
    height: 17px !important;
    padding: 0 3px !important;
    font-size: 10px !important;
    line-height: 17px !important;
  }
}


/* real-navigation-unread-badge */
#primary-navigation button {
  position: relative;
}

#primary-navigation .nav-unread-count {
  position: absolute;
  top: 2px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #dc2638;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  font-weight: 700;
  font-family: Arial, sans-serif;
  z-index: 20;
  white-space: nowrap;
  pointer-events: none;
}

/*
 * Das sichtbare Badge ist jetzt ein echtes span.
 * Das alte ::after Badge wird deaktiviert.
 */
#primary-navigation button.has-unread::after {
  content: none !important;
  display: none !important;
}

@media (max-width:700px) {
  #primary-navigation .nav-unread-count {
    top: 1px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    font-size: 10px;
    line-height: 18px;
  }
}

/* A verification restriction retains the recovery flow and logout. */
body.photo-restricted #primary-navigation,
body.photo-restricted #navLoggedIn > :not(#navSafety) { display: none !important; }
#photo-verification-reminder[hidden] { display: none; }
#photo-verification-reminder { margin: 12px 0; }
#photo-verification-reminder button { margin: 4px; }
body.private-chat-active:not(.photo-restricted) #photo-verification-reminder,
body.community-active:not(.photo-restricted) #photo-verification-reminder { display: none; }

.privacy-footer{padding:1rem;text-align:center;margin-bottom:calc(5rem + env(safe-area-inset-bottom));}.privacy-footer a{color:inherit;}
