:root {
    --red: #D93025;
    --red-light: #F04436;
    --red-dark: #B01E15;
    --red-muted: rgba(217,48,37,0.10);
    --red-glow: rgba(217,48,37,0.22);
    --cream: #ffefe0;
    --cream2: #fff4e9;
    --warm-white: #FFFAF7;
    --surface: #FFFFFF;
    --surface2: #FEF3EE;
    --border: #F0E4DC;
    --border2: #E8D5CB;
    --text: #1A1008;
    --text2: #5A3F35;
    --text3: #9E7B70;
    --text-inv: #FFFFFF;
    --green: #2E9E5B;
    --blue: #2563EB;
    --amber: #D97706;
    --shadow-sm: 0 1px 4px rgba(80,20,10,0.06);
    --shadow: 0 4px 16px rgba(80,20,10,0.10);
    --shadow-lg: 0 12px 40px rgba(80,20,10,0.14);
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar: 240px;
    --transition: all 0.22s cubic-bezier(.4,0,.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* –––––––––––– NO HOOD ––––––––––– */
.no-hood-wrapper {
    position: fixed; z-index: 500;
    height: 100dvh; width: 100dvw;
    overflow-y: auto;
    background: var(--cream);
    display: none;
    justify-content: center;
    padding: 25px auto;
    -webkit-overflow-scrolling: touch; /* Falls es auf Handy ruckelt */
}
.no-hood-wrapper.active { display: flex }
.layout {
    display: flex;
    flex-direction: column;
    padding: 25px;
    height: max-content;
    width: 60dvw;
}
/* Layout Header */
.layout .header {
    margin-bottom: 25px;
}
.layout .header .header-topbar {
    display: flex; flex-direction: row;
    justify-content: space-between; align-items: center;
    margin-bottom: 30dvh;
}
.layout .header .header-topbar .header-account img {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--red-light), var(--red-dark));
    color: white; font-weight: 700; font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 2px solid var(--border);
    flex-shrink: 0; transition: var(--transition);
}
.layout .header h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.35rem;
    color: var(--red);
    letter-spacing: -0.5px;
    margin-bottom: .5rem;
}
.layout .header h1 {
    font-family: 'DM Serif Display', serif;
    text-align: center;
    font-size: 3rem;
}
.layout .header p {
    font-family: 'DM Serif Display', serif;
    font-size: 1.35rem;
    color: var(--text2);
    text-align: center;
}
.layout .action-bar {
    display: flex; flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
}
/* Info Container */
.info-container {
    margin-top: 20dvh;
    padding: 10px 30px;
    border: 2px solid var(--border2);
    border-radius: var(--radius);
    background: var(--cream2);
}
.info-container .info-top {
    display: flex; flex-direction: row;
    justify-content: space-between;
    align-items: center;
}
.info-container .info-top h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.2rem;
    color: var(--red-light);
}
.info-container .info-top button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: none;
    font-size: 1.3rem;
    transition: all .3s ease;
}
.info-container .info-top button:hover { background: var(--cream); }
.info-container .info-top button:hover i { scale: 1.1; }
.info-container .info-main p {
    font-size: .9rem;
    line-height: 1.6;
    color: var(--text);
}
.info-container .info-main {
    display: none; opacity: 0;
    transition: opacity 0.35s ease, border 0.35 ease;
    padding-top: 10px;
}
.info-container .info-main.expand { display: block; opacity: 1; border-top: 2px solid var(--border); }

/* ──────────── TOPBAR ──────────── */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 58px;
    background: var(--surface);
    border-bottom: 1.5px solid var(--border);
    display: flex; align-items: center; gap: 0;
    padding: 0 24px 0 0;
    box-shadow: var(--shadow-sm);
}
.topbar-logo {
    width: var(--sidebar);
    display: flex; align-items: center; gap: 10px;
    padding: 0 20px;
    flex-shrink: 0;
}
.logo-mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--red-light), var(--red-dark));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px var(--red-glow);
}
.logo-mark svg { width: 18px; height: 18px; fill: white; }
.logo-text {
    font-family: 'DM Serif Display', serif;
    font-size: 1.35rem; color: var(--red);
    letter-spacing: -0.5px;
}
.topbar-search {
    flex: 1; max-width: 360px;
    background: var(--cream);
    border: 1.5px solid var(--border2);
    border-radius: 50px;
    display: flex; align-items: center; gap: 8px;
    padding: 0 16px; height: 36px;
    transition: var(--transition);
}
.topbar-search:focus-within {
    border-color: var(--red); background: white;
    box-shadow: 0 0 0 3px var(--red-muted);
}
.topbar-search i { color: var(--text3); font-size: .85rem; }
.topbar-search input {
    border: none; background: transparent; outline: none;
    font-family: 'DM Sans', sans-serif; font-size: .9rem;
    color: var(--text); width: 100%;
}
.topbar-search input::placeholder { color: var(--text3); }
.topbar-actions {
    margin-left: auto;
    display: flex; align-items: center; gap: 6px;
}
.topbar-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--cream); border: 1.5px solid var(--border);
    color: var(--text2); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; transition: var(--transition); position: relative;
}
.topbar-btn:hover { background: var(--surface2); color: var(--red); border-color: var(--red); }
.badge {
    position: absolute; top: -3px; right: -3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--red); color: white;
    font-size: .6rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid white;
}
.avatar-sm {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--red-light), var(--red-dark));
    color: white; font-weight: 700; font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 2px solid var(--border);
    flex-shrink: 0; transition: var(--transition);
}
.avatar-sm:hover { border-color: var(--red); }

/* ──────────── LAYOUT ──────────── */
.app-layout {
    display: flex;
    padding-top: 58px;
    min-height: 100vh;
}

/* ──────────── SIDEBAR ──────────── */
.sidebar {
  width: var(--sidebar); flex-shrink: 0;
  position: fixed; top: 58px; left: 0; bottom: 0;
  background: var(--surface);
  border-right: 1.5px solid var(--border);
  display: flex; flex-direction: column;
  padding: 12px 10px 16px;
  overflow-y: auto; z-index: 50;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1),
              width 0.28s cubic-bezier(.4,0,.2,1);
}
.sidebar-logo {
    width: var(--sidebar);
    display: none; align-items: center; gap: 10px; flex-direction: row; /* @media setzt auf flex */
    padding: 10px 12px;
    flex-shrink: 0;
}
.sidebar-section-label {
    font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text3); padding: 14px 10px 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
    color: var(--text2); font-size: .9rem; font-weight: 500;
    position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--red); }
.nav-item.active {
    background: var(--red-muted); color: var(--red);
    font-weight: 600;
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--red);
}
.nav-item i { width: 20px; text-align: center; font-size: .95rem; }
.nav-badge {
    margin-left: auto; min-width: 20px; height: 18px;
    background: var(--red); color: white;
    border-radius: 9px; font-size: .65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
}
.sidebar-divider {
    height: 1px; background: var(--border);
    margin: 10px 6px;
}
.sidebar-footer {
    margin-top: auto;
    padding: 10px 6px 0;
}
.sidebar-footer button {
    border: none;
    background: none;
    padding: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.neighborhood-card {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    border-radius: var(--radius-sm); padding: 14px;
    color: white; position: relative; overflow: hidden;
}
.neighborhood-card::after {
    content: ''; position: absolute;
    top: -20px; right: -20px;
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.neighborhood-card h4 {
    font-family: 'DM Serif Display', serif;
    font-size: 1rem; margin-bottom: 3px;
}
.neighborhood-card p { font-size: .75rem; opacity: .8; }
.neighborhood-card .member-count {
    margin-top: 10px; font-size: .72rem;
    opacity: .9; display: flex; align-items: center; gap: 5px;
}

/* ──────────── BOTTOM NAV (nur Mobile sichtbar) ──────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 62px;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  z-index: 100;
  align-items: center;
  padding: 0 4px;
  box-shadow: 0 -4px 20px rgba(80,20,10,0.08);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; cursor: pointer; padding: 6px 4px;
  border-radius: var(--radius-sm);
  color: var(--text3); font-size: .62rem; font-weight: 500;
  transition: var(--transition); position: relative;
}
.bottom-nav-item i { font-size: 1.2rem; transition: var(--transition); }
.bottom-nav-item.active { color: var(--red); }
.bottom-nav-item.active i { transform: scale(1.15); }
.bottom-nav-item .bottom-badge {
  position: absolute; top: 4px;
  right: calc(50% - 18px);
  min-width: 16px; height: 16px;
  background: var(--red); color: white;
  border-radius: 8px; font-size: .58rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid white;
}

/* ──────────── MAIN CONTENT ──────────── */
.main-content {
    margin-left: var(--sidebar);
    flex: 1; min-width: 0;
    display: flex; justify-content: center;
    padding: 24px 16px;
}

.page { display: none; width: 100%; max-width: 620px; }
.page.active { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
body:has(.no-hood-wrapper.active) .main-content {
    display: none;
}

/* ──────────── RIGHT PANEL ──────────── */
.right-panel {
    width: 260px; flex-shrink: 0;
    padding: 24px 16px 24px 0;
    display: flex; flex-direction: column; gap: 16px;
}
@media (max-width: 1100px) { .right-panel { display: none; } }

/* ──────────── CARDS ──────────── */
.card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.card-header h3 { font-size: .95rem; font-weight: 600; }
.card-header i { color: var(--red); font-size: .95rem; }
.card-body { padding: 14px 18px; }

/* ──────────── COMPOSE BOX ──────────── */
.compose-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.compose-top { display: flex; gap: 12px; align-items: flex-start; }
.avatar-lg {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--red-light), var(--red-dark));
    color: white; font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--border);
}
.compose-input {
    flex: 1; background: var(--cream);
    border: 1.5px solid var(--border2);
    border-radius: 24px; padding: 11px 18px;
    font-family: 'DM Sans', sans-serif; font-size: .9rem;
    color: var(--text2); cursor: pointer;
    transition: var(--transition);
    min-height: 44px; outline: none;
}
.compose-input:hover { border-color: var(--red); background: white; }
.compose-actions {
    display: flex; gap: 6px; margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--border);
}
.compose-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: transparent;
    color: var(--text2); font-family: 'DM Sans', sans-serif;
    font-size: .82rem; font-weight: 500; cursor: pointer;
    transition: var(--transition);
}
.compose-btn:hover { background: var(--surface2); border-color: var(--red); color: var(--red); }
.compose-btn i { font-size: .85rem; }
.compose-btn.photo i { color: #2E9E5B; }
.compose-btn.video i { color: #2563EB; }
.compose-btn.event i { color: var(--amber); }

/* ──────────── FEED POSTS ──────────── */
.post-card {
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius); margin-bottom: 16px;
    box-shadow: var(--shadow-sm); overflow: hidden;
    transition: var(--transition);
}
.post-card:hover { box-shadow: var(--shadow); }
.post-header { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.post-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .95rem; color: white; flex-shrink: 0;
    border: 2px solid var(--border);
}
.post-meta { flex: 1; min-width: 0; }
.post-author { font-weight: 600; font-size: .9rem; }
.post-info { font-size: .77rem; color: var(--text3); display: flex; gap: 5px; align-items: center; }
.post-info span { display: flex; gap: 4px; align-items: center; }
.post-options { width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent; color: var(--text3); cursor: pointer; font-size: .95rem; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.post-options:hover { background: var(--cream); color: var(--text); }
.post-body { padding: 0 18px 14px; font-size: .9rem; line-height: 1.6; color: var(--text); }
.post-image {
    width: 100%; max-height: 380px; object-fit: cover;
    display: block; margin-bottom: 0;
    background: linear-gradient(135deg, var(--cream) 0%, var(--surface2) 100%);
}
.post-image-placeholder {
    width: 100%; height: 220px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; color: var(--text3); font-size: .85rem;
    background: linear-gradient(135deg, var(--cream) 0%, var(--surface2) 100%);
}
.post-image-placeholder i { font-size: 2.5rem; opacity: .3; }
.post-reactions {
    display: flex; align-items: center; gap: 0;
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: .78rem; color: var(--text3);
    justify-content: space-between;
}
.reaction-emojis { display: flex; align-items: center; gap: 4px; }
.reaction-emojis .emoji-stack { display: flex; }
.reaction-emojis .emoji-stack span { font-size: 1rem; }
.post-actions { display: flex; padding: 4px 10px; }
.post-action-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 8px; border-radius: var(--radius-sm);
    border: none; background: transparent;
    color: var(--text2); font-family: 'DM Sans', sans-serif;
    font-size: .84rem; font-weight: 500; cursor: pointer;
    transition: var(--transition);
}
.post-action-btn:hover { background: var(--cream); color: var(--red); }
.post-action-btn.liked { color: var(--red); }

/* ──────────── MARKETPLACE ──────────── */
.marketplace-header {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    border-radius: var(--radius); padding: 24px;
    color: white; margin-bottom: 20px;
    position: relative; overflow: hidden;
}
.marketplace-header::before {
    content: ''; position: absolute; top: -30px; right: -30px;
    width: 140px; height: 140px; border-radius: 50%;
    background: rgba(255,255,255,.07);
}
.marketplace-header h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem; margin-bottom: 5px;
}
.marketplace-header p { opacity: .85; font-size: .88rem; }
.marketplace-search {
    margin-top: 16px;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.3);
    border-radius: 50px; display: flex; align-items: center; gap: 8px;
    padding: 0 16px; height: 40px; backdrop-filter: blur(4px);
}
.marketplace-search input {
    border: none; background: transparent; outline: none;
    color: white; font-family: 'DM Sans', sans-serif; font-size: .9rem; width: 100%;
}
.marketplace-search input::placeholder { color: rgba(255,255,255,.7); }
.marketplace-search i { color: rgba(255,255,255,.8); }
.marketplace-cats {
    display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap;
}
.cat-chip {
    padding: 7px 16px; border-radius: 50px;
    border: 1.5px solid var(--border2); background: var(--surface);
    font-size: .82rem; font-weight: 500; color: var(--text2); cursor: pointer;
    transition: var(--transition);
}
.cat-chip:hover, .cat-chip.active { background: var(--red); border-color: var(--red); color: white; }
.listings-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.listing-card {
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden;
    cursor: pointer; transition: var(--transition);
}
.listing-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.listing-img {
    width: 100%; height: 140px; object-fit: cover;
    background: linear-gradient(135deg, var(--surface2), var(--cream));
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--text3);
}
.listing-body { padding: 12px; }
.listing-price { font-size: 1.05rem; font-weight: 700; color: var(--red); }
.listing-title { font-size: .85rem; font-weight: 500; color: var(--text); margin: 3px 0; }
.listing-meta { font-size: .75rem; color: var(--text3); display: flex; gap: 5px; align-items: center; }

/* ──────────── CHAT ──────────── */
.chat-layout { display: flex; gap: 0; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; height: calc(100vh - 110px); max-height: 720px; }
.chat-sidebar { width: 240px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.chat-sidebar-header { padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.chat-sidebar-header-text { display: flex; align-items: center; justify-content: space-between; }
.chat-sidebar-header-text h3 { font-size: .95rem; font-weight: 600; margin-bottom: 10px; }
.chat-sidebar-header-text h3 button { border: none; background: none; font-size: inherit; font-family: inherit; font-weight: inherit; }
.chat-sidebar-header-text h3 button:hover { text-decoration: underline; cursor: pointer; }
.chat-search { background: var(--cream); border: 1.5px solid var(--border); border-radius: 50px; display: flex; align-items: center; gap: 6px; padding: 0 12px; height: 32px; }
.chat-search input { border: none; background: transparent; outline: none; font-size: .82rem; color: var(--text); width: 100%; font-family: 'DM Sans', sans-serif; }
.chat-search i { color: var(--text3); font-size: .75rem; }
.chat-tabs { display: flex; padding: 8px 10px 0; gap: 4px; }
.chat-tab {
    flex: 1; padding: 6px 4px; border-radius: var(--radius-sm);
    border: none; background: transparent;
    font-size: .75rem; font-weight: 500; color: var(--text3);
    cursor: pointer; transition: var(--transition); text-align: center;
}
.hidden { display: none; }
.chat-tab.active { background: var(--red-muted); color: var(--red); font-weight: 600; }
.chat-list { flex: 1; overflow-y: auto; padding: 6px 6px; }
.chat-list::-webkit-scrollbar { width: 4px; }
.chat-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.chat-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 8px; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition); position: relative;
}
.chat-item:hover { background: var(--cream); }
.chat-item.active { background: var(--red-muted); }
.chat-item-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem; color: white; flex-shrink: 0;
    position: relative;
}
.online-dot {
    position: absolute; bottom: 1px; right: 1px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--green); border: 2px solid white;
}
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-size: .85rem; font-weight: 600; }
.chat-item-name-mobile { display: none; }
.chat-item-preview { font-size: .75rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-time { font-size: .7rem; color: var(--text3); }
.chat-unread { width: 17px; height: 17px; border-radius: 50%; background: var(--red); color: white; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%; }
.chat-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-header-info { flex: 1; }
.chat-header-info h4 { font-size: .92rem; font-weight: 600; }
.chat-header-info span { font-size: .75rem; color: var(--green); }
.chat-header-actions { display: flex; gap: 6px; }
.chat-action-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border); background: transparent; color: var(--text2); cursor: pointer; font-size: .85rem; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.chat-action-btn:hover { background: var(--surface2); color: var(--red); border-color: var(--red); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--cream); }
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.msg-group { display: flex; flex-direction: column; gap: 4px; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.me { flex-direction: row-reverse; }
.msg-avatar-xs { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .7rem; color: white; }
.bubble {
    max-width: 68%; padding: 10px 14px; border-radius: 18px;
    font-size: .87rem; line-height: 1.5;
    background: var(--surface); border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.bubble.me { background: var(--red); color: white; border-color: var(--red); border-bottom-right-radius: 5px; }
.bubble.them { border-bottom-left-radius: 5px; }
.msg-time { font-size: .67rem; color: var(--text3); padding: 0 6px; }
.chat-input-area { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; align-items: flex-end; gap: 8px; }
.chat-input-wrap {
    flex: 1; display: flex; align-items: center; gap: 6px;
    background: var(--cream); border: 1.5px solid var(--border2);
    border-radius: 24px; padding: 8px 14px;
    transition: var(--transition);
}
.chat-input-wrap:focus-within { border-color: var(--red); background: white; box-shadow: 0 0 0 3px var(--red-muted); }
.chat-input { flex: 1; border: none; background: transparent; outline: none; font-family: 'DM Sans', sans-serif; font-size: .88rem; color: var(--text); resize: none; max-height: 80px; }
.chat-input::placeholder { color: var(--text3); }
.chat-input-icon { color: var(--text3); font-size: .9rem; cursor: pointer; transition: var(--transition); padding: 2px; }
.chat-input-icon:hover { color: var(--red); }
.send-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--red); border: none; color: white;
    font-size: .9rem; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px var(--red-glow);
    transition: var(--transition);
}
.send-btn:hover { background: var(--red-dark); transform: scale(1.07); }
.back-btn {
    color: var(--text); border: none; background: none;
    font-size: 1.5rem; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    display: none;
}

/* ──────────── PROFILE ──────────── */
.profile-cover {
    height: 180px; border-radius: var(--radius) var(--radius) 0 0;
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--red) 0%, #8B0000 50%, #C00000 100%);
}
.profile-cover-pattern {
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,.07) 0%, transparent 50%),
                        radial-gradient(circle at 80% 20%, rgba(255,255,255,.05) 0%, transparent 40%);
}
.cover-edit-btn {
    position: absolute; bottom: 12px; right: 12px;
    padding: 7px 14px; border-radius: var(--radius-sm);
    background: rgba(0,0,0,.35); backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.2); color: white;
    font-size: .8rem; font-weight: 500; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: var(--transition);
}
.cover-edit-btn:hover { background: rgba(0,0,0,.5); }
.profile-info-card {
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0 24px 20px;
    margin-bottom: 16px;
}
.profile-avatar-wrap {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-top: -44px; margin-bottom: 14px;
}
.profile-avatar-lg {
    width: 88px; height: 88px; border-radius: 50%;
    background: linear-gradient(135deg, var(--red-light), var(--red-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 2rem; color: white;
    border: 4px solid var(--surface);
    box-shadow: var(--shadow);
    position: relative; cursor: pointer;
}
.avatar-edit { position: absolute; bottom: 0; right: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: white; font-size: .7rem; display: flex; align-items: center; justify-content: center; border: 2px solid white; }
.profile-actions { display: flex; gap: 8px; padding-bottom: 4px; }
.btn-primary { padding: 9px 20px; border-radius: var(--radius-sm); background: var(--red); color: white; border: none; font-family: 'DM Sans', sans-serif; font-size: .88rem; font-weight: 600; cursor: pointer; transition: var(--transition); box-shadow: 0 2px 8px var(--red-glow); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-outline { padding: 9px 18px; border-radius: var(--radius-sm); background: transparent; color: var(--text2); border: 1.5px solid var(--border2); font-family: 'DM Sans', sans-serif; font-size: .88rem; font-weight: 500; cursor: pointer; transition: var(--transition); }
.btn-outline:hover { border-color: var(--red); color: var(--red); background: var(--red-muted); }
.btn-outline:disabled, .btn-primary:disabled { opacity: 0.6; }
.profile-name { font-family: 'DM Serif Display', serif; font-size: 1.4rem; }
.profile-name i { color: var(--blue); }
.profile-handle { color: var(--text3); font-size: .85rem; margin: 2px 0 8px; }
.profile-bio { font-size: .88rem; color: var(--text2); line-height: 1.6; margin-bottom: 14px; }
.profile-stats { display: flex; gap: 20px; }
.profile-stat { text-align: center; cursor: pointer; }
.profile-stat strong { display: block; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.profile-stat span { font-size: .75rem; color: var(--text3); }
.profile-stat i { color: var(--amber); }
.profile-tabs { display: flex; gap: 0; border-bottom: 1.5px solid var(--border); margin-bottom: 16px; }
.profile-tab { flex: 1; padding: 12px 6px; text-align: center; font-size: .84rem; font-weight: 500; color: var(--text2); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; transition: var(--transition); }
.profile-tab.active { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }
.photos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.photo-thumb { aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: var(--transition); background: var(--cream); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--text3); }
.photo-thumb:hover { transform: scale(1.03); box-shadow: var(--shadow); }

/* ──────────── RIGHT PANEL WIDGETS ──────────── */
.widget-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.widget-header { padding: 13px 16px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.widget-header h4 { font-size: .88rem; font-weight: 600; }
.widget-link { font-size: .78rem; color: var(--red); text-decoration: none; cursor: pointer; font-weight: 500; }
.widget-header i { color: var(--red); margin-right: 6px; font-size: .85rem; }
.widget-body { padding: 10px 14px; }
.member-row { display: flex; align-items: center; gap: 9px; padding: 6px 2px; }
.member-row .member-info { flex: 1; }
.member-row .member-name { font-size: .84rem; font-weight: 500; }
.member-row .member-detail { font-size: .73rem; color: var(--text3); }
.follow-btn { padding: 5px 13px; border-radius: 50px; border: 1.5px solid var(--border2); background: transparent; font-size: .75rem; font-weight: 600; color: var(--red); cursor: pointer; transition: var(--transition); }
.follow-btn:hover { background: var(--red); color: white; border-color: var(--red); }
.event-row { display: flex; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.event-row:last-child { border-bottom: none; }
.event-date-box { width: 40px; flex-shrink: 0; background: var(--red-muted); border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 0; }
.event-date-box .month { font-size: .6rem; font-weight: 700; color: var(--red); text-transform: uppercase; }
.event-date-box .day { font-size: 1.1rem; font-weight: 700; color: var(--red); line-height: 1; }
.event-info .event-name { font-size: .84rem; font-weight: 600; }
.event-info .event-detail { font-size: .73rem; color: var(--text3); margin-top: 2px; }

/* ──────────── MODAL / OVERLAY ──────────── */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
    align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: var(--surface); border-radius: var(--radius);
    width: 92%; max-width: 520px; max-height: 90vh;
    box-shadow: var(--shadow-lg); overflow: hidden;
    animation: modalIn .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.92); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--cream); color: var(--text2); cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { background: var(--red-muted); color: var(--red); }
.modal-body { padding: 20px; overflow-y: auto; max-height: calc(90vh - 70px); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .83rem; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-input {
    width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border2); background: var(--cream);
    font-family: 'DM Sans', sans-serif; font-size: .9rem; color: var(--text);
    outline: none; transition: var(--transition);
}
.form-input:focus { border-color: var(--red); background: white; box-shadow: 0 0 0 3px var(--red-muted); }
.form-textarea { min-height: 90px; resize: vertical; }
.post-type-selector { display: flex; gap: 8px; margin-bottom: 14px; }
.type-btn { flex: 1; padding: 10px 8px; border-radius: var(--radius-sm); border: 1.5px solid var(--border2); background: var(--cream); cursor: pointer; text-align: center; font-size: .8rem; font-weight: 500; color: var(--text2); transition: var(--transition); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.type-btn i { font-size: 1.2rem; }
.type-btn.active, .type-btn:hover { border-color: var(--red); background: var(--red-muted); color: var(--red); }
.upload-zone { border: 2px dashed var(--border2); border-radius: var(--radius-sm); padding: 30px 16px; text-align: center; cursor: pointer; transition: var(--transition); background: var(--cream); }
.upload-zone:hover { border-color: var(--red); background: var(--red-muted); }
.upload-zone i { font-size: 2rem; color: var(--text3); margin-bottom: 8px; display: block; }
.upload-zone p { font-size: .83rem; color: var(--text3); }
.upload-zone span { font-size: .78rem; color: var(--red); font-weight: 500; }

/* ──────────── CALL SCREEN OVERLAY ──────────── */
.call-overlay {
    display: none; position: fixed; inset: 0; z-index: 300;
    background: #0D0505;
    align-items: center; justify-content: center;
    flex-direction: column;
}
.call-overlay.show { display: flex; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.call-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at center, #2D0A0A 0%, #0D0505 70%); }
.call-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.call-avatar { width: 110px; height: 110px; border-radius: 50%; background: linear-gradient(135deg, var(--red-light), var(--red-dark)); display: flex; align-items: center; justify-content: center; font-size: 2.8rem; font-weight: 700; color: white; box-shadow: 0 0 40px var(--red-glow), 0 0 80px rgba(217,48,37,.1); animation: callPulse 2s ease-in-out infinite; }
@keyframes callPulse { 0%, 100% { box-shadow: 0 0 40px var(--red-glow), 0 0 80px rgba(217,48,37,.1); } 50% { box-shadow: 0 0 60px var(--red-glow), 0 0 120px rgba(217,48,37,.2); } }
.call-name { color: white; font-family: 'DM Serif Display', serif; font-size: 1.6rem; }
.call-status { color: rgba(255,255,255,.6); font-size: .9rem; }
.video-placeholder { width: 300px; height: 220px; border-radius: var(--radius); background: #1A0808; border: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: rgba(255,255,255,.3); font-size: .9rem; margin: 10px 0; }
.video-placeholder i { font-size: 3rem; }
.call-actions { display: flex; gap: 16px; margin-top: 20px; }
.call-btn { width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.call-btn:hover { transform: scale(1.1); }
.call-btn.mute { background: rgba(255,255,255,.15); color: white; }
.call-btn.video-toggle { background: rgba(255,255,255,.15); color: white; }
.call-btn.hangup { background: #E53935; color: white; box-shadow: 0 4px 16px rgba(229,57,53,.4); }
.call-btn.hangup:hover { background: #C62828; }
.call-btn.speaker { background: rgba(255,255,255,.15); color: white; }

/* ──────────── SCROLLBAR ──────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ──────────── TOAST ──────────── */
.toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 500;
    background: var(--text); color: white;
    padding: 12px 20px; border-radius: var(--radius-sm);
    font-size: .88rem; font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(80px); opacity: 0;
    transition: var(--transition);
    display: flex; align-items: center; gap: 8px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast i { color: var(--red); }

/* ── TABLET: Icon-only Sidebar ── */
@media (max-width: 1200px) and (min-width: 769px) {
  :root { --sidebar: 64px; }

  .layout { width: 80dvw; }
  .layout .header h1 { font-size: 2rem; }
  .layout .action-bar { margin-top: 4rem; }

  .sidebar {
    width: 64px;
    padding: 12px 6px 16px;
    overflow: visible;
  }

  /* Texte & Labels ausblenden */
  .nav-item span:not(.nav-badge),
  .sidebar-section-label,
  .sidebar-footer,
  .logo-text {
    display: none;
  }

  /* Items zentrieren */
  .nav-item {
    justify-content: center;
    padding: 12px 0;
    border-radius: var(--radius-sm);
    position: relative;
  }

  .nav-item i {
    width: auto;
    font-size: 1.1rem;
  }

  /* Badge neu positionieren */
  .nav-badge {
    position: absolute;
    top: 6px; right: 6px;
    margin-left: 0;
  }

  /* Active-Indicator bleibt */
  .nav-item.active::before {
    top: 20%; bottom: 20%;
  }

  /* Tooltip on hover */
  .nav-item::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%; transform: translateY(-50%);
    background: var(--text);
    color: white;
    font-size: .78rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: var(--shadow);
    z-index: 200;
  }
  .nav-item::before {
    /* Pfeilchen für Tooltip */
    content: '';
    position: absolute;
    left: calc(100% + 6px);
    top: 50%; transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--text);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 200;
  }
  .nav-item.active::before {
    /* active-Indicator überschreibt Tooltip-Pfeil – daher eigene Klasse */
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    border: none;
    border-radius: 0 3px 3px 0;
    background: var(--red);
    opacity: 1;
  }
  .nav-item:hover::after { opacity: 1; }

  .main-content { margin-left: 64px; }
}

/* ── MOBILE: Bottom Nav + Drawer ── */
@media (max-width: 768px) {
  :root { --sidebar: 0px; }

  .layout { width: 90dvw; }
  .layout .header h1 { font-size: 1.35rem; margin-bottom: 10px; }
  .layout .header p { font-size: 1rem; }

  /* Sidebar als Slide-in Drawer */
  .sidebar {
    width: 280px;
    top: 0; /* Überdeckt auch die Topbar */
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 150;
    padding-top: 12px;
  }
  .sidebar.drawer-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-logo {
    display: flex;
  }

  /* Overlay-Hintergrund beim offenen Drawer */
  .drawer-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 140;
  }
  .drawer-backdrop.show { display: block; animation: fadeIn .2s ease; }

  /* Main Content ohne Sidebar-Margin */
  .main-content {
    margin-left: 0 !important;
    padding: 16px 12px 80px !important; /* Platz für Bottom Nav */
  }

  /* Topbar-Logo text trotzdem sichtbar */
  .logo-text { display: block !important; }

  /* Topbar-Search kleiner */
  .topbar-search { max-width: none; flex: 1; margin: 0 8px; }

  /* ── BOTTOM NAVIGATION BAR ── */
  .bottom-nav {
    display: flex !important;
  }

  /* Right Panel komplett ausblenden */
  .right-panel { display: none !important; }

  /* Chat-Layout auf Mobile stapeln */
  .chat-main {
    display: none;
  }
  .chat-layout {
    flex-direction: column;
    height: calc(100vh - 140px);
  }
  .chat-sidebar {
    width: 100%;
    height: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  /*.chat-list { flex-direction: row; display: flex; overflow-x: auto; overflow-y: hidden; padding: 4px 8px; gap: 4px; }
  .chat-list::-webkit-scrollbar { height: 3px; }
  .chat-item { flex-direction: column; align-items: center; min-width: 70px; text-align: center; padding: 8px 6px; gap: 4px; }
  .chat-item-info { display: none; }
  .chat-item-meta { display: none; }
  .chat-item-avatar { width: 46px; height: 46px; font-size: 1rem; }
  .chat-item-name-mobile {
    display: block;
    font-size: .65rem; font-weight: 500; color: var(--text2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 68px;
  }*/
  .back-btn {
    display: inline;
  }

  /* Listings Grid 1-spaltig */
  .listings-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Profile Cover kleiner */
  .profile-cover { height: 130px; }

  /* Modal volle Breite */
  .modal-box { width: 100%; max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; position: absolute; bottom: 0; }
  .modal-overlay { align-items: flex-end; }
}