:root {
    /* === Warme Gemeinschafts-Palette === */
    --primary: #C96A0C;
    --primary-light: #E08428;
    --primary-dark: #7A3800;
    --on-primary: #FFFFFF;
    --secondary: #4A7A50;
    --secondary-light: #6FA876;
    --secondary-dark: #2D5232;
    --accent: #E8A830;
    --text-dark: #2A1E0E;
    --text-primary: #2A1E0E;
    --text-secondary: #6A5440;
    --text-light: #FFFFFF;
    --bg-light: #FAF6EE;
    --bg-secondary: #FFF0D6;
    --bg-card: #FFFDF7;
    --bg-wheat: #FFF8EE;
    --navbar-bg: rgba(250, 246, 238, 0.94);
    --glass: rgba(255, 249, 236, 0.96);
    --glass-border: rgba(201, 106, 12, 0.15);
    --shadow: 0 2px 14px rgba(100, 50, 0, 0.08);
    --shadow-strong: 0 8px 30px rgba(100, 50, 0, 0.13);
    --transition: cubic-bezier(0.16, 1, 0.3, 1);
    --radius-card: 18px;
    --radius-lg: 28px;
}

/* === Lokale Schriften === */
@font-face {
    font-display: swap;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
    font-display: swap;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    src: url('fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
    font-display: swap;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    src: url('fonts/inter-v20-latin-800.woff2') format('woff2');
}
@font-face {
    font-display: swap;
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/outfit-v15-latin-regular.woff2') format('woff2');
}
@font-face {
    font-display: swap;
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 700;
    src: url('fonts/outfit-v15-latin-700.woff2') format('woff2');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Animationen === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.animate-fade {
    animation: fadeIn 0.7s ease forwards;
}

/* === Notfall-Banner === */
.emergency-banner {
    background: #C62828;
    color: #fff;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1100;
    font-weight: 600;
    font-size: 0.9rem;
}

body.emergency-active .main-nav {
    top: 50px;
}

/* === Navigation === */
.main-nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0 2.5rem;
    height: 68px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.4s var(--transition);
    background: var(--navbar-bg);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 1px 8px rgba(100, 50, 0, 0.06);
}

.main-nav.scrolled {
    background: rgba(250, 246, 238, 0.98);
    box-shadow: 0 2px 16px rgba(100, 50, 0, 0.1);
}

.main-nav .logo {
    font-size: 1.35rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.main-nav .logo i {
    color: var(--primary);
    font-size: 1.15rem;
}

.main-nav .logo span {
    color: var(--secondary);
}

.main-nav .nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.main-nav .nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.25s;
    position: relative;
    padding: 0.4rem 0;
}

.main-nav .nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
    border-radius: 2px;
}

.main-nav .nav-links a:hover::after {
    width: 100%;
}

/* === Layout === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* === Hero / Header === */
header {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    filter: brightness(0.68) saturate(1.05);
}

.hero-content {
    text-align: center;
    color: #FFFBF0;
    z-index: 1;
    max-width: 800px;
    padding: 0 1.5rem;
}

.hero-content h1 {
    font-size: 3.6rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #FFFBF0;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    font-weight: 500;
    color: rgba(255, 251, 240, 0.92);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* === Buttons === */
.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    display: inline-block;
    font-size: 0.92rem;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(201, 106, 12, 0.3);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 106, 12, 0.4);
}

.btn-glass {
    background: var(--glass);
    color: var(--text-dark) !important;
    border: 1.5px solid var(--glass-border);
    backdrop-filter: blur(12px);
}

.btn-glass:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* === Abschnittstitel === */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
    margin-bottom: 0.7rem;
    font-family: 'Outfit', sans-serif;
}

.section-title p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.65;
}

/* === Features-Bereich === */
.features {
    padding: 6rem 0;
    background: var(--bg-light);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.4rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 2.2rem 1.8rem;
    border-radius: var(--radius-card);
    transition: all 0.3s var(--transition);
    text-align: center;
    position: relative;
    box-shadow: var(--shadow);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-strong);
    border-color: var(--primary-light);
}

.feature-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.4rem;
}

.feature-card h3 {
    margin-bottom: 0.7rem;
    font-size: 1.2rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    font-weight: 700;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
}

/* === Gemeinschafts-Bereich === */
#community-section {
    padding: 6rem 0;
    background: linear-gradient(160deg, #E8EDE8 0%, #D8E2D8 100%);
    border-radius: 36px 36px 0 0;
    margin-top: -50px;
    position: relative;
    z-index: 10;
    box-shadow: 0 -18px 45px rgba(0, 0, 0, 0.04);
}

/* === Statistik-Dashboard === */
.status-dashboard {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #FFF8E8 100%);
    color: var(--text-dark);
    padding: 4rem 3rem;
    border-radius: var(--radius-card);
    margin: 5rem 0;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 3rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.status-item {
    text-align: center;
}

.status-item .count {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
    font-family: 'Outfit', sans-serif;
}

.status-item .label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    display: block;
}

/* === Marktplatz === */
.marketplace {
    padding: 6rem 0;
    background: var(--bg-light);
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.market-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
    font-family: 'Outfit', sans-serif;
}

.market-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

/* === Artikel-Grid & Karten === */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 1.4rem;
}

.item-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    overflow: hidden;
    transition: all 0.3s var(--transition);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
    border-color: var(--primary-light);
}

.item-img {
    width: 100%;
    height: 185px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.item-content {
    padding: 1.2rem 1.4rem;
    flex-grow: 1;
}

.item-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.item-category {
    display: inline-block;
    padding: 0.22rem 0.7rem;
    background: var(--bg-secondary);
    color: var(--primary-dark);
    border-radius: 50px;
    font-size: 0.74rem;
    font-weight: 700;
    margin-bottom: 0.55rem;
    border: 1px solid var(--glass-border);
}

.item-footer {
    padding: 0.85rem 1.4rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

/* === Karten-Bereich === */
#map-section {
    padding: 4rem 0;
}

.map-container-wrapper {
    margin: 3rem 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 480px;
    position: relative;
    border: 1px solid var(--glass-border);
}

#communityMap {
    height: 100%;
    width: 100%;
    z-index: 1;
}

/* Karte: Einwilligungs-Overlay */
.map-consent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #EDE8DE, #DDD4C4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    text-align: center;
    padding: 2rem;
}

.map-consent-overlay i {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.map-consent-overlay h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.map-consent-overlay p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    max-width: 360px;
    line-height: 1.6;
}

/* === Karten-Legende (Extern) === */
.map-legend-external {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-secondary);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dark);
    border: 1px solid rgba(0,0,0,0.04);
    white-space: nowrap;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.leaflet-control-custom:hover {
    background-color: #f4f4f4 !important;
}

.leaflet-control-custom i {
    transition: transform 0.2s ease;
}

.leaflet-control-custom:hover i {
    transform: scale(1.15);
}

/* === Modals === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 15, 0, 0.72);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-content {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 22px;
    width: 90%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 60px rgba(100, 50, 0, 0.2);
}

/* === Formulare === */
.form-group {
    margin-bottom: 1.3rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--glass-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.92rem;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: border-color 0.25s, background 0.25s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: white;
}

.img-preview {
    width: 100%;
    height: 140px;
    border: 2px dashed var(--glass-border);
    border-radius: 10px;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.img-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Kleiner Karten-Picker im Formular */
#mapPickerSmall {
    height: 200px;
    border-radius: 10px;
    margin-top: 0.5rem;
    border: 1.5px solid var(--glass-border);
    overflow: hidden;
    position: relative;
}

/* === Mobiles Item-Detail-Modal === */
@media (max-width: 600px) {
    #itemDetailModal .modal-content {
        flex-direction: column !important;
        height: auto !important;
        max-height: 95vh;
    }
    #itemDetailModal .modal-content div:first-child {
        height: 220px !important;
    }
}

/* === Chat-System === */
.chat-fab {
    position: fixed;
    bottom: 1.8rem;
    right: 1.8rem;
    width: 58px;
    height: 58px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 20px rgba(201, 106, 12, 0.4);
    cursor: pointer;
    z-index: 1500;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(201, 106, 12, 0.5);
}

.sos-fab {
    position: fixed;
    bottom: 1.8rem;
    right: 6.8rem;
    width: 58px;
    height: 58px;
    background: #D32F2F;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.45);
    cursor: pointer;
    z-index: 1500;
    transition: all 0.3s var(--transition);
    border: 3px solid white;
}

.sos-fab:hover {
    transform: scale(1.08);
    background: #B71C1C;
    box-shadow: 0 10px 30px rgba(211, 47, 47, 0.6);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    z-index: 10;
}

.chat-sidebar {
    position: fixed;
    top: 0;
    right: -110%;
    width: 380px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 1600;
    box-shadow: -8px 0 28px rgba(100, 50, 0, 0.12);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--glass-border);
}

.chat-sidebar.open {
    right: 0;
}

.chat-header {
    background: var(--primary-dark);
    color: white;
    padding: 1.1rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.chat-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    flex-grow: 1;
}

.chat-tabs {
    display: flex;
    background: var(--bg-secondary);
    padding: 0.45rem;
    gap: 0.3rem;
}

.chat-tab {
    flex: 1;
    padding: 0.6rem;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: 8px;
    transition: all 0.25s;
    color: var(--text-secondary);
}

.chat-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.message-area {
    flex-grow: 1;
    padding: 1.2rem;
    background: #EDE6DC;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.message {
    max-width: 82%;
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
    position: relative;
    font-size: 0.88rem;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-top-right-radius: 3px;
}

.message.received {
    align-self: flex-start;
    background: #FFFDF7;
    color: var(--text-dark);
    border-top-left-radius: 3px;
    border-left: 3px solid var(--secondary);
}

.message-meta {
    font-size: 0.67rem;
    opacity: 0.65;
    margin-top: 4px;
    text-align: right;
}

.message.sent .message-meta {
    color: rgba(255, 255, 255, 0.8);
}

.chat-input {
    padding: 0.75rem;
    background: var(--bg-secondary);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    border-top: 1px solid var(--glass-border);
}

.chat-input input {
    flex-grow: 1;
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--glass-border);
    border-radius: 22px;
    outline: none;
    font-family: inherit;
    font-size: 0.88rem;
    background: white;
    transition: border-color 0.25s;
}

.chat-input input:focus {
    border-color: var(--primary);
}

/* === Nav-Toggle (Hamburger) === */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
    line-height: 1;
}

.nav-toggle:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

/* === Mobiles Menü === */
@media (max-width: 768px) {
    .main-nav {
        padding: 0 1.2rem;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav .nav-links {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: rgba(250, 246, 238, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        flex-direction: column;
        padding: 1rem 1.5rem 1.5rem;
        gap: 0;
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 10px 24px rgba(100, 50, 0, 0.1);
    }

    .main-nav .nav-links.mobile-open {
        display: flex;
    }

    .main-nav .nav-links a {
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--glass-border);
        font-size: 1rem;
        width: 100%;
    }

    .main-nav .nav-links a::after {
        display: none;
    }

    .main-nav .nav-links .btn {
        width: 100%;
        text-align: center;
        margin-top: 0.8rem;
        padding: 0.85rem;
    }

    .container {
        padding: 0 1.2rem;
    }

    header {
        height: 100vh;
    }

    .hero-content h1 {
        font-size: 2.4rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-btns {
        gap: 0.7rem;
    }

    .section-title {
        margin-bottom: 2.5rem;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .section-title p {
        font-size: 0.92rem;
    }

    .features {
        padding: 4rem 0;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.8rem 1.4rem;
    }

    .feature-card h3 {
        font-size: 1.05rem;
    }

    #community-section {
        border-radius: 24px 24px 0 0;
        padding: 4rem 0;
        margin-top: -24px;
    }

    .marketplace {
        padding: 4rem 0;
    }

    .market-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
        margin-bottom: 2rem;
    }

    .market-header h2 {
        font-size: 1.75rem;
    }

    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 1rem;
    }

    .status-dashboard {
        flex-direction: column;
        gap: 2rem;
        padding: 2.5rem 1.5rem;
        margin: 3rem 0;
    }

    .status-item .count {
        font-size: 2.5rem;
    }

    .map-container-wrapper {
        height: 300px;
        margin: 2rem 0;
    }

    /* === Chat-Sidebar: Mobile === */
    .chat-sidebar {
        width: 100%;
        height: 100vh;         /* Fallback */
        height: 100dvh;        /* Modern: passt sich dem Viewport an */
        top: 0;
        border-left: none;
        border-radius: 0;
    }

    .chat-header {
        /* Safe area für Notch-Phones (iPhone) */
        padding-top: max(1.1rem, calc(env(safe-area-inset-top) + 0.8rem));
        flex-shrink: 0;
    }

    /* Tabs: größere Touch-Ziele (min. 44px Apple-Standard) */
    .chat-tab {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.73rem;
        padding: 0.4rem 0.15rem;
    }

    .group-subtab {
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Smooth iOS-Scroll in allen Scroll-Bereichen */
    .message-area,
    #chatListView,
    #groupListView,
    #groupCalendarView,
    #groupMembersView,
    #groupChatMessages {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* Eingabefeld: mindestens 16px verhindert iOS-Autozoom */
    .chat-input input {
        font-size: 16px;
        padding: 0.7rem 1rem;
    }

    /* Safe area unten (iPhone Home-Indicator) */
    .chat-input {
        padding-bottom: max(0.75rem, calc(env(safe-area-inset-bottom) + 0.5rem));
        flex-shrink: 0;
    }

    /* Deal-Bereich: volle Breite auf Mobile */
    #dealActionArea {
        padding: 0.6rem 1rem;
    }
    .btn-deal {
        width: 100%;
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    .btn-deal:disabled {
        width: 100%;
    }

    /* Group-Section-Header: leichter lesbar auf Mobile */
    .group-section-header {
        font-size: 0.75rem;
        padding: 0.6rem 1rem;
    }

    /* Inbox-Items: Touch-freundlicher */
    .inbox-item {
        padding: 1rem;
        min-height: 56px;
    }

    /* Chat-FAB: besser greifbar, kein Überlappen */
    .chat-fab {
        bottom: 1.2rem;
        right: 1.2rem;
        width: 60px;
        height: 60px;
    }
    .sos-fab {
        bottom: 1.2rem;
        right: 6rem;
        width: 58px;
        height: 58px;
    }

    /* Filter-Chips: horizontales Scrollen */
    .filter-chips {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.2rem;
        scrollbar-width: none;
    }
    .filter-chips::-webkit-scrollbar { display: none; }

    .support-section {
        padding: 4rem 0;
    }

    .support-card {
        padding: 2.5rem 1.5rem;
        border-radius: 18px;
    }

    .support-card h2 {
        font-size: 1.6rem !important;
    }

    .btn-donate {
        padding: 0.9rem 2rem;
        font-size: 0.95rem;
    }

    .privacy-banner {
        left: 1rem;
        right: 1rem;
        max-width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.9rem;
    }

    .hero-content p {
        font-size: 0.92rem;
    }

    .hero-btns {
        flex-direction: column;
        align-items: center;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 260px;
        text-align: center;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 1.5rem 1.2rem;
    }

    .item-grid {
        grid-template-columns: 1fr;
    }

    .status-dashboard {
        padding: 2rem 1.2rem;
    }

    .status-item .count {
        font-size: 2.2rem;
    }

    .support-card {
        padding: 2rem 1.2rem;
    }

    .modal-content {
        padding: 1.8rem 1.4rem;
        border-radius: 16px;
        max-height: 92dvh;
        overflow-y: auto;
    }

    /* Login-Modal auf kleinen Screens scrollbar */
    #loginModal > div {
        max-height: 96dvh;
        overflow-y: auto;
        margin: 0.5rem;
        padding: 2rem 1.4rem;
    }

    /* Kalender: volle Breite */
    #addEventModal .modal-content div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }

    /* Filter-Bar: kompakter */
    .filter-bar {
        padding: 0.8rem;
        gap: 0.6rem;
    }
}

/* === Inbox & Nachbarn === */
.inbox-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: background 0.2s;
}

.inbox-item:hover {
    background: var(--bg-secondary);
}

.inbox-avatar {
    width: 42px;
    height: 42px;
    background: var(--primary-light);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.92rem;
    flex-shrink: 0;
}

.inbox-info {
    flex-grow: 1;
    min-width: 0;
}

.inbox-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.inbox-last-msg {
    font-size: 0.77rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* === Deal-Nachrichten === */
.message.deal {
    align-self: center;
    background: #E8F4EA;
    border: 2px dashed var(--secondary-dark);
    text-align: center;
    border-radius: 14px;
    max-width: 90%;
    padding: 1rem;
    color: var(--secondary-dark);
    font-weight: 600;
}

.message.deal strong {
    color: var(--secondary-dark);
    display: block;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.message.deal-rejected {
    align-self: center;
    background: #FDECEA;
    border: 2px dashed #C62828;
    text-align: center;
    border-radius: 14px;
    max-width: 90%;
    padding: 1rem;
    color: #B71C1C;
    font-weight: 600;
}

.btn-deal:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.deal-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary);
    color: white;
    padding: 0.22rem 0.7rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.7rem;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.item-card.reserved {
    filter: grayscale(0.4);
    opacity: 0.82;
}

.item-card.projekt-card {
    border: 2px solid var(--primary);
}

.help-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.3rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 50px;
    border: 1px solid var(--primary);
}

.help-date-badge.help-date-open {
    background: #fff8e1;
    border-color: #ffc107;
    color: #7a5a00;
}

.btn-deal {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}

/* === Datenschutz-Banner === */
.privacy-banner {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    right: auto;
    max-width: 490px;
    background: var(--bg-card);
    padding: 1.3rem 1.5rem;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(100, 50, 0, 0.14);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-left: 4px solid var(--primary);
    animation: fadeIn 0.5s ease-out;
}

/* === Unterstützungs-Bereich === */
.support-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, var(--bg-light), var(--bg-secondary));
    text-align: center;
}

.support-card {
    max-width: 650px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 3.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.support-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary), var(--accent));
}

.btn-donate {
    background: var(--secondary);
    color: white;
    padding: 1rem 2.4rem;
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s var(--transition);
    box-shadow: 0 4px 16px rgba(74, 122, 80, 0.25);
    margin-top: 1.5rem;
}

.btn-donate:hover {
    background: var(--secondary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(74, 122, 80, 0.35);
}

.heart-icon {
    color: #E53935;
    animation: heartbeat 1.6s infinite;
}

@keyframes heartbeat {
    0%  { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.12); }
    60% { transform: scale(1); }
}

/* === Footer === */
footer {
    padding: 3rem 0;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.84rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.footer-legal {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 0.8rem;
}

.footer-legal a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.84rem;
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: var(--primary);
}

/* === Autocomplete === */
.autocomplete-list {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 2000;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    display: none;
}

.autocomplete-item {
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark);
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item:hover, .autocomplete-item.selected {
    background: var(--bg-secondary);
    color: var(--primary);
}

/* === Sidebar: 4 Tabs brauchen mehr Platz (nur auf größeren Bildschirmen) === */
@media (min-width: 769px) {
    .chat-sidebar { width: 420px; }
}
.chat-tab { font-size: 0.74rem; padding: 0.5rem 0.3rem; }

/* === Filter-Bar (Marktplatz & Nachbarn) === */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
    padding: 1rem 1.3rem;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 0.55rem 1rem;
    flex: 1;
    min-width: 180px;
}

.filter-search i { color: var(--text-secondary); }

.filter-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-dark);
    width: 100%;
}

.filter-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chip {
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: var(--bg-light);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}

.chip:hover { background: var(--bg-secondary); border-color: var(--primary); color: var(--primary); }

.chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.load-more-btn {
    display: block;
    margin: 2rem auto 0;
    padding: 0.7rem 2.5rem;
}

/* === Gruppen-Liste === */
#groupListView { display: none; flex-direction: column; flex-grow: 1; overflow-y: auto; }

.group-section-header {
    padding: 0.7rem 1rem;
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === Gruppen-Detail-View === */
#groupDetailView { display: none; flex-direction: column; flex-grow: 1; height: 0; }

.group-subtabs {
    display: flex;
    background: var(--bg-secondary);
    padding: 0.4rem;
    gap: 0.3rem;
    flex-shrink: 0;
}

.group-subtab {
    flex: 1;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.78rem;
    border-radius: 8px;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.group-subtab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

/* === Kalender-Events === */
#groupCalendarView { display: none; flex-grow: 1; overflow-y: auto; padding: 0.8rem; flex-direction: column; }

.event-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.7rem;
    border-left: 4px solid var(--secondary);
    box-shadow: var(--shadow);
}

.event-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-dark);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.event-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.event-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.event-creator {
    font-size: 0.72rem;
    color: #aaa;
}

/* === Gruppen-Mitglieder === */
#groupMembersView { display: none; flex-grow: 1; overflow-y: auto; }

/* === Responsive: schmaler Sidebar === */
@media (max-width: 480px) {
    .chat-sidebar { width: 100%; }
    .filter-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.3rem; }
}
