@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap'); /* NEU: Outfit Font */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
* { scrollbar-width: thin; scrollbar-color: #333 transparent; }



body { 
    background-color: #1c1c1c; 
    color: #f5f5f5; 
    font-family: system-ui, sans-serif; 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    transition: background-color 0.3s, color 0.3s; 
    height: 100vh; 
    display: flex; 
    flex-direction: column; 
    /* NEU HINZUGEFÜGT: */
    overflow-x: hidden; /* Verhindert seitliches Scrollen komplett */
    max-width: 100vw; /* Zwingt die Seite, nie breiter als das Display zu sein */
    /* overflow: hidden; (Diese alte Zeile FALLS VORHANDEN entfernen, da wir nur x verstecken wollen, y übernimmt main) */
}

/* Schatten entfernt, border entfernt, damit es mit dem Banner verschmilzt */
/* Ersetze den .top-nav Block und füge die Element-Zuweisung darunter ein */
.top-nav { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 40px; 
    background-color: #242424; 
    transition: background-color 0.3s; 
    z-index: 50; 
    position: relative; 
    font-family: 'Outfit', sans-serif; /* Aktiviert Outfit für den Header */
}

/* Da Inputs und Buttons Schriftarten oft blockieren, überschreiben wir sie hier gezielt */
.local-search, .add-btn, .header-username {
    font-family: 'Outfit', sans-serif !important;
}
.logo-container { display: flex; align-items: center; gap: 15px; }
.top-logo-img { height: 36px; width: auto; object-fit: contain; } /* Hover Effekt Skalierung komplett entfernt */

.header-actions { display: flex; gap: 15px; align-items: center; margin-left: auto;}

.mobile-menu-btn { display: none; background: transparent; border: none; color: #f5f5f5; font-size: 1.8rem; cursor: pointer; transition: color 0.2s; }
.mobile-menu-btn:hover { color: #ff4757; }

.local-search { background: transparent; border: 1px solid #444; color: #fff; padding: 10px 15px; border-radius: 20px; outline: none; width: 220px; transition: border-color 0.3s, width 0.3s; font-family: inherit; font-size: 0.9rem; }
.local-search:focus { border-color: #ff4757; width: 260px; }

.add-btn { background: #f5f5f5; color: #121212; padding: 10px 20px; font-size: 0.9rem; font-weight: 600; border-radius: 20px; border: none; cursor: pointer; transition: all 0.2s; }
.add-btn:hover { background: #fff; }

/* Neue Klasse für die Piktogramm-Buttons im Header */
.icon-btn-header { background: transparent; border: none; color: #aaa; cursor: pointer; padding: 6px; display: flex; align-items: center; justify-content: center; transition: color 0.2s; }
.icon-btn-header:hover { color: #fff; }
.icon-sun, .icon-moon { width: 20px; height: 20px; }
body.light-mode .icon-sun { display: none; }
body:not(.light-mode) .icon-moon { display: none; }

.profile-section { display: flex; align-items: center; gap: 12px; border-left: 1px solid #444; padding-left: 15px; margin-left: 5px; transition: border-color 0.3s; cursor: pointer; }
.header-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #333; border: 1px solid #555; transition: border-color 0.2s; }
.profile-section:hover .header-avatar { border-color: #ff4757; }
.header-username { font-weight: bold; color: #fff; font-size: 0.9rem; }
.notification-bell { font-size: 1.2rem; position: relative; }
.notification-bell.has-news::after { content: ''; position: absolute; top: 0; right: -2px; width: 10px; height: 10px; background: #ff4757; border-radius: 50%; border: 2px solid #242424; }

/* Banner nun in Blau, mit Schatten unterhalb */
/* Suche die Klasse .challenge-banner und füge font-family hinzu */
.challenge-banner { 
    background: #7fb3d5; 
    padding: 8px 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 20px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    z-index: 40; 
    position: relative; 
    font-family: 'Outfit', sans-serif; /* Aktiviert Outfit für das Banner */
}
.challenge-label { font-size: 0.75rem; color: #121212; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; }
.challenge-bar-bg { flex-grow: 1; max-width: 400px; height: 6px; background: rgba(0,0,0,0.2); border-radius: 4px; overflow: hidden; position: relative; }
.challenge-bar-fill { height: 100%; background: #ffffff; width: 0%; transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1); }
.challenge-text { font-size: 0.8rem; font-weight: bold; color: #121212; }

.content-wrapper { 
    display: flex; 
    gap: 40px; 
    max-width: 1600px; 
    margin: 0 auto; 
    /* NEU: Oben auf 0 gesetzt (0px 40px 25px 40px) */
    padding: 0px 40px 25px 40px; 
    flex-grow: 1; 
    width: 100%; 
    box-sizing: border-box; 
    overflow: hidden; 
}

aside { 
    width: 180px; 
    flex-shrink: 0; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    overflow-y: auto; 
    transition: all 0.3s; 
    padding-bottom: 30px; 
    /* NEU: Abstand nach oben hier eingefügt */
    padding-top: 25px; 
}

.sidebar-logo { width: 100%; object-fit: contain; border-radius: 8px; margin-bottom: 15px; }

.nav-section { margin-bottom: 10px; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #333; padding-bottom: 2px; margin-bottom: 4px; transition: border-color 0.3s; }
aside h2 { font-size: 0.65rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin: 0; color: #555; transition: color 0.3s; }

.sort-arrows { display: flex; gap: 8px; }
.sort-arrows span { cursor: pointer; color: #444; font-size: 0.85rem; font-weight: bold; transition: color 0.2s; }
.sort-arrows span:hover { color: #aaa; }
.sort-arrows span.active { color: #f5f5f5; }

.filter-list { list-style: none; padding: 0; margin: 0; }
/* Suche diesen Navigations-Block in der Mitte der Datei und ersetze ihn */
.filter-list li { 
    padding: 1px 0; 
    color: #888; 
    cursor: pointer; 
    font-size: 0.8rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    transition: color 0.2s; 
    font-family: 'Outfit', sans-serif; /* Aktiviert Outfit für alle Listenpunkte */
    font-weight: 300;                  /* Macht alle Standardeinträge zu "Light" */
}

.filter-list li:hover { 
    color: #fff; 
}

.filter-list li.active { 
    color: #f5f5f5; 
    font-weight: 600;                  /* Ausgewählter Eintrag wird deutlich dicker */
}
.count { font-size: 0.65rem; color: #555; }

.import-btn { margin-top: auto; background: transparent; border: 1px solid #444; color: #888; padding: 6px; text-align: center; border-radius: 4px; cursor: pointer; font-size: 0.75rem; transition: all 0.2s; }
.import-btn:hover { border-color: #888; color: #fff; }

main { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    overflow-y: auto; 
    padding-right: 15px; 
    padding-bottom: 40px; 
    /* NEU: Abstand nach oben hier eingefügt */
    padding-top: 25px; 
}

#library-grid { display: grid; padding-bottom: 40px; }
#library-grid.size-normal { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 25px 15px; }
#library-grid.size-small { grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); gap: 15px 10px; }
#library-grid.size-small .title { font-size: 0.65rem; }
#library-grid.size-small .creator { display: none; }
#library-grid.size-small .card-bottom { display: none; }
#library-grid.size-wimmelbild { grid-template-columns: repeat(auto-fill, minmax(45px, 1fr)); gap: 4px; }
#library-grid.size-wimmelbild .title { display: none; }
#library-grid.size-wimmelbild .creator { display: none; }
#library-grid.size-wimmelbild .card-bottom { display: none; }
#library-grid.size-wimmelbild .cover-wrapper { margin-bottom: 0; box-shadow: none; border-radius: 2px; }

.month-divider { grid-column: 1 / -1; font-size: 0.75rem; font-weight: 700; letter-spacing: 2px; color: #777; text-transform: uppercase; border-bottom: 1px solid #333; padding-bottom: 8px; margin-top: 15px; margin-bottom: 5px; transition: border-color 0.3s, color 0.3s; }

.work-card { background: transparent; cursor: pointer; }
.cover-wrapper { position: relative; width: 100%; aspect-ratio: 2 / 3; background: #2a2a2a; border-radius: 6px; overflow: hidden; margin-bottom: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: transform 0.2s ease, box-shadow 0.3s, background 0.3s; }
.cover-wrapper:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0,0,0,0.5); }
.cover-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.3s; }

.private-cover img { opacity: 0.3; filter: grayscale(30%); }

.title { font-size: 0.75rem; font-weight: bold; color: #fff; margin: 0 0 2px 0; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.3s; }
.creator { font-size: 0.65rem; color: #aaa; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.3s; }

.card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; transition: color 0.3s; }
.stars-outer { font-size: 11px; color: #444; position: relative; display: inline-block; transition: color 0.3s; }
.stars-inner { position: absolute; top: 0; left: 0; white-space: nowrap; overflow: hidden; color: #ff4757; transition: width 0.3s; }

.grid-private-icon { color: #666; display: flex; align-items: center; }
.grid-private-icon svg { width: 12px; height: 12px; }

#feed-container { display: none; flex-direction: column; gap: 20px; max-width: 650px; margin: 0 auto; width: 100%; padding-bottom: 40px; }

.feed-post { background: #242424; border: 1px solid #333; border-radius: 8px; padding: 20px; transition: background 0.3s, border-color 0.3s; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }

.feed-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.feed-avatar { width: 36px; height: 36px; border-radius: 50%; background: #444; object-fit: cover; cursor: pointer; }
.feed-user-info { display: flex; flex-direction: column; }
.feed-username { font-size: 0.9rem; font-weight: bold; color: #f5f5f5; cursor: pointer; }
.feed-action-text { font-size: 0.75rem; color: #888; }

.feed-content { display: flex; gap: 15px; background: #1c1c1c; padding: 15px; border-radius: 6px; border: 1px solid #2a2a2a; }
.feed-cover { width: 70px; aspect-ratio: 2/3; border-radius: 4px; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.feed-details { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.feed-work-title { font-size: 1rem; font-weight: bold; color: #fff; margin: 0 0 5px 0; }
.feed-work-meta { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.feed-review { font-size: 0.85rem; color: #ccc; margin-top: 10px; line-height: 1.5; font-style: italic; border-left: 2px solid #444; padding-left: 10px; }

.feed-actions { display: flex; align-items: center; margin-top: 15px; padding-top: 15px; border-top: 1px solid #333; }
.feed-btn { background: transparent; border: none; color: #888; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 0.8rem; transition: color 0.2s; font-family: inherit; font-weight: 600; padding: 0; }
.feed-btn:hover { color: #f5f5f5; }
.feed-btn.liked { color: #ff4757; }
.feed-btn svg { width: 16px; height: 16px; }

.feed-empty-state { background: #242424; border: 1px solid #333; padding: 40px; border-radius: 12px; text-align: center; max-width: 500px; margin: 40px auto; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.feed-empty-state h3 { margin-top: 0; color: #fff; font-size: 1.4rem; font-weight: 300; letter-spacing: 1px; margin-bottom: 15px; }
.feed-empty-state p { color: #888; font-size: 0.95rem; line-height: 1.6; margin-bottom: 25px; }
.feed-empty-state button { background: #ff4757; color: #fff; border: none; padding: 12px 24px; font-size: 0.9rem; font-weight: bold; border-radius: 6px; cursor: pointer; transition: all 0.2s; text-transform: uppercase; letter-spacing: 1px; }
.feed-empty-state button:hover { background: #ff6b81; transform: translateY(-2px); }

@media (max-width: 768px) {
    .top-nav { padding: 15px 20px; }
    .mobile-menu-btn { display: block; }
    .icon-btn-header { display: none; }
    .profile-section { padding-left: 0; border-left: none; margin-left: 0; }
    #logout-btn { display: none; }
    .local-search { width: 130px; font-size: 0.8rem; padding: 8px 12px; }
    .local-search:focus { width: 160px; }
    .content-wrapper { flex-direction: column; padding: 20px; gap: 20px; overflow-y: auto; }
    aside { display: none; width: 100%; border-bottom: 1px solid #333; padding-bottom: 20px; height: auto; flex-shrink: unset; overflow: hidden; }
    aside.mobile-open { display: flex; }
    .sidebar-logo { display: none; }
    main { padding-right: 0; }
    .challenge-banner { padding: 8px 20px; }
}

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); z-index: 1000; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-content, .search-modal-content { background: #242424; width: 90%; max-width: 800px; border-radius: 8px; display: flex; gap: 30px; padding: 40px; position: relative; border: 1px solid #333; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.search-modal-content { max-width: 900px; height: 85vh; flex-direction: column; }
.close-btn { position: absolute; top: 20px; right: 25px; background: transparent; border: none; color: #888; font-size: 1.5rem; cursor: pointer; transition: color 0.2s; }
.close-btn:hover { color: #fff; }

.action-btn-group { position: absolute; top: 25px; right: 65px; display: flex; gap: 10px; }
.save-btn { background: #00ff66; border: none; color: #121212; font-size: 0.8rem; font-weight: bold; padding: 6px 15px; border-radius: 4px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; }
.delete-btn { background: transparent; border: 1px solid #442222; color: #ff5555; font-size: 0.8rem; padding: 5px 12px; border-radius: 4px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; }

.modal-left { width: 160px; flex-shrink: 0; display: flex; flex-direction: column; gap: 15px; }
.modal-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; }
.modal-left-actions { display: flex; flex-direction: column; align-items: center; gap: 15px; width: 100%; }

.interactive-stars-outer { font-size: 26px; color: #444; position: relative; display: inline-block; cursor: pointer; user-select: none; line-height: 1; }
.interactive-stars-inner { position: absolute; top: 0; left: 0; white-space: nowrap; overflow: hidden; color: #ff4757; pointer-events: none; }

.date-wrapper { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.date-wrapper label { font-size: 0.65rem; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.date-input { text-align: center; font-size: 0.85rem; color: #aaa; padding: 4px; border-radius: 4px; background: transparent; border: none; outline: none; border-bottom: 1px solid transparent; }
.date-input::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }

.modal-info { flex-grow: 1; display: flex; flex-direction: column; overflow-y: auto; max-height: 70vh; padding-right: 10px; }
.seamless-input { background: transparent; border: 1px solid transparent; color: #fff; font-family: inherit; width: 100%; outline: none; border-bottom: 1px solid rgba(255,255,255,0.1); box-sizing: border-box; }
.seamless-input:focus { border-bottom: 1px solid #ff4757; background: rgba(0,0,0,0.2); }

.seamless-input[readonly] { border-bottom: none; cursor: default; padding-left: 0; padding-right: 0; }
.seamless-input[readonly]:focus { background: transparent; border-bottom: none; }
.canonical-desc { font-size: 0.85rem; color: #aaa; margin-bottom: 20px; line-height: 1.6; font-style: italic; }

.title-input { font-size: 2.2rem; font-weight: 300; letter-spacing: 1px; margin-bottom: 2px; padding: 4px 0; }
.creator-input { font-size: 1.1rem; color: #aaa; margin-bottom: 15px; padding: 4px 0; }

.meta-row { display: flex; align-items: center; gap: 10px; color: #aaa; font-size: 0.9rem; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; flex-wrap: wrap; }
#modal-category { font-weight: bold; color: #ddd; }
.meta-input { font-size: 0.9rem; color: #aaa; width: 80px; text-align: center; padding: 2px; }

.icon-actions { display: flex; gap: 10px; align-items: center; margin-left: 10px; }
.icon-btn { background: transparent; border: none; cursor: pointer; color: #555; padding: 0; display: flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.active { color: #ff4757; }

.list-input { font-size: 0.85rem; color: #ff4757; padding: 8px 0; margin-bottom: 20px; border-bottom: 1px dashed #555; }
.desc-input { resize: vertical; min-height: 140px; font-size: 0.9rem; line-height: 1.6; color: #ddd; padding: 12px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; margin-bottom: 20px; background: rgba(0,0,0,0.1); }
.desc-input:focus { border-color: #ff4757; background: rgba(0,0,0,0.3); }

#cover-suggestions-container { display: none; margin-top: auto; border-top: 1px solid #333; padding-top: 15px; margin-bottom: 10px; }
.modal-notes-label { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
#cover-suggestions { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; min-height: 75px; align-items: center;}
#cover-suggestions img { height: 70px; width: auto; border-radius: 4px; cursor: pointer; transition: transform 0.2s, opacity 0.2s; opacity: 0.85; }
#cover-suggestions img:hover { transform: scale(1.1); opacity: 1; }

.loading-dots { display: flex; gap: 6px; padding: 10px 0; align-items: center; justify-content: flex-start; }
.loading-dots div { width: 8px; height: 8px; background: #555; border-radius: 50%; animation: bounce 0.5s infinite alternate; }
.loading-dots div:nth-child(2) { animation-delay: 0.15s; }
.loading-dots div:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { to { transform: translateY(-4px); background: #ff4757; } }

.custom-file-upload { margin-top: 15px; border-top: 1px dashed #444; padding-top: 15px; }
.custom-file-upload input[type="file"] { background: rgba(0,0,0,0.2); padding: 8px; border-radius: 4px; border: 1px dashed #555; width: 100%; box-sizing: border-box; color: #888; cursor: pointer; font-family: inherit; font-size: 0.85rem; }

.search-area-wrapper { display: flex; gap: 15px; margin-bottom: 30px; background: #1c1c1c; padding: 20px; border-radius: 8px; border: 1px solid #333; }
.search-area-wrapper select, .search-area-wrapper input { background: #151515; border: 1px solid #444; color: #fff; padding: 10px; border-radius: 4px; outline: none; }
.search-area-wrapper input { flex-grow: 1; font-size: 1rem; }

.search-results-list { display: flex; flex-direction: column; gap: 15px; overflow-y: auto; padding-right: 10px; flex-grow: 1; }
.search-result-card { display: flex; gap: 20px; background: #242424; border: 1px solid #333; padding: 15px; border-radius: 8px; transition: border-color 0.2s; align-items: center; }
.search-result-card:hover { border-color: #555; }
.search-result-cover { width: 60px; height: 90px; object-fit: cover; border-radius: 4px; box-shadow: 0 4px 8px rgba(0,0,0,0.4); flex-shrink: 0; }
.search-result-info { display: flex; flex-direction: column; justify-content: center; flex-grow: 1; text-align: left; }
.search-result-title { font-size: 1.2rem; font-weight: bold; color: #fff; margin-bottom: 4px; line-height: 1.2; }
.search-result-meta { font-size: 0.85rem; color: #aaa; margin-bottom: 8px; }
.search-result-desc { font-size: 0.85rem; color: #888; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; line-height: 1.4; }

.search-action-group { display: flex; gap: 10px; }
.search-action-btn { background: #151515; border: 1px solid #444; color: #ddd; padding: 6px 15px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; font-weight: bold; transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.5px; }
.search-action-btn:hover { background: #333; color: #fff; border-color: #666; }
.search-action-btn.primary { background: #ff4757; border-color: #ff4757; color: #fff; }
.search-action-btn.primary:hover { background: #ff6b81; border-color: #ff6b81; }

body.light-mode { background-color: #f7f7f7; color: #121212; }
body.light-mode .top-nav { background-color: #ffffff; }
body.light-mode .icon-btn-header { color: #666; }
body.light-mode .icon-btn-header:hover { color: #121212; }
body.light-mode .local-search { border-color: #ccc; color: #121212; }
body.light-mode aside h2 { color: #888; }
body.light-mode .section-header { border-bottom: 1px solid #e0e0e0; }
body.light-mode .filter-list li { color: #666; }
body.light-mode .filter-list li:hover { color: #121212; }
body.light-mode .filter-list li.active { color: #121212; }
body.light-mode .month-divider { color: #888; border-bottom: 1px solid #e0e0e0; }
body.light-mode .cover-wrapper { background: #e0e0e0; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
body.light-mode .title { color: #121212; }
body.light-mode .creator { color: #666; }
body.light-mode .modal-content, body.light-mode .search-modal-content { background: #ffffff; border: 1px solid #e0e0e0; box-shadow: 0 10px 40px rgba(0,0,0,0.15); }
body.light-mode .seamless-input { color: #121212; border-bottom: 1px solid rgba(0,0,0,0.1); }
body.light-mode .seamless-input[readonly] { border-bottom: none; }
body.light-mode .seamless-input[readonly]:focus { background: transparent; border-bottom: none; }
body.light-mode .canonical-desc { color: #666; }
body.light-mode .desc-input { border-color: rgba(0,0,0,0.1); color: #333; background: rgba(0,0,0,0.03); }
body.light-mode .desc-input:focus { background: rgba(0,0,0,0.08); }
body.light-mode .profile-section { border-color: #e0e0e0; }
body.light-mode .header-avatar { border-color: #ccc; background: #eee; }
body.light-mode .header-username { color: #121212; }
body.light-mode .notification-bell.has-news::after { border-color: #ffffff; }
body.light-mode #cover-suggestions-container { border-top: 1px solid #e0e0e0; }
body.light-mode .loading-dots div { background: #ccc; }
body.light-mode .custom-file-upload { border-color: #e0e0e0; }
body.light-mode .custom-file-upload input[type="file"] { background: rgba(0,0,0,0.03); border-color: #ccc; color: #555; }
body.light-mode .feed-post, body.light-mode .feed-empty-state { background: #ffffff; border-color: #e0e0e0; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
body.light-mode .feed-empty-state h3 { color: #121212; }
body.light-mode .feed-username { color: #121212; }
body.light-mode .feed-content { background: #f9f9f9; border-color: #eee; }
body.light-mode .feed-work-title { color: #121212; }
body.light-mode .feed-review { color: #555; border-color: #ccc; }
body.light-mode .feed-actions { border-color: #eee; }
body.light-mode .feed-btn { color: #888; }
body.light-mode .feed-btn:hover { color: #333; }
body.light-mode .feed-btn.liked { color: #e84118; }
body.light-mode .search-area-wrapper { background: #f9f9f9; border-color: #e0e0e0; }
body.light-mode .search-area-wrapper select, body.light-mode .search-area-wrapper input { background: #fff; border-color: #ccc; color: #121212; }
body.light-mode .search-result-card { background: #ffffff; border-color: #e0e0e0; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
body.light-mode .search-result-card:hover { border-color: #ccc; }
body.light-mode .search-result-title { color: #121212; }
body.light-mode .search-result-meta { color: #666; }
body.light-mode .search-result-desc { color: #555; }
body.light-mode .search-action-btn { background: #f5f5f5; border-color: #ccc; color: #333; }
body.light-mode .search-action-btn:hover { background: #eee; border-color: #aaa; color: #121212; }
body.light-mode .search-action-btn.primary { background: #ff4757; color: #fff; border-color: #ff4757; }
body.light-mode .search-action-btn.primary:hover { background: #ff6b81; border-color: #ff6b81; }
/* Such-Modal UI Refactoring */
.search-modal-content {
    padding: 30px;
    border-radius: 12px;
}
.search-modal-content .close-btn {
    font-size: 1.2rem;
    font-weight: 300;
    top: 15px;
    right: 20px;
    color: #888;
}
.search-area-wrapper {
    background: transparent;
    border: none;
    border-bottom: 1px solid #444;
    border-radius: 0;
    padding: 5px 0 10px 0;
    margin-bottom: 20px;
}
.search-area-wrapper select, .search-area-wrapper input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    font-family: inherit;
}
.search-area-wrapper input:focus { outline: none; }

/* Elegante Ergebnis-Liste statt klobiger Boxen */
.search-result-card {
    background: transparent;
    border: none;
    box-shadow: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    border-radius: 0;
    padding: 12px 0;
    gap: 15px;
}
.search-result-card:hover {
    background: rgba(255,255,255,0.02);
    transform: none;
}
.search-result-title { font-weight: 700; font-size: 1.05rem; }
.search-result-meta { color: #8c827f; font-size: 0.85rem; }

/* Neue, filigrane Buttons */
.search-action-btn {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.search-action-btn:hover { background: #fff; color: #121212; border-color: #fff; }
.search-action-btn.primary { border-color: #8c827f; color: #8c827f; }
.search-action-btn.primary:hover { background: #8c827f; color: #fff; }

/* --- READING CHALLENGE DASHBOARD LIGHT MODE FIX --- */
body.light-mode #challenge-view-container > div {
    background: #fff !important;
    border-color: #e0e0e0 !important;
}
body.light-mode #challenge-view-container span,
body.light-mode #challenge-view-container label,
body.light-mode #challenge-view-container div {
    color: #333 !important;
}
body.light-mode #challenge-view-container .challenge-label {
    color: #121212 !important;
}
body.light-mode #input-challenge-goal {
    background: #f5f5f5 !important;
    border-color: #ccc !important;
    color: #121212 !important;
}

/* --- FIX: KACHEL-RASTER FÜR DAS CHALLENGE DASHBOARD --- */
#challenge-books-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 15px !important;
    width: 100%;
}

/* Anpassung für Handybildschirme (Mobile) */
@media (max-width: 768px) {
    /* --- 1. HEADER & LOGO (Das perfekte Mittelding) --- */
    .top-nav { padding: 10px 15px; min-height: 55px; } 
    .top-logo-img { height: 28px; } /* Etwas größer als vorher, aber kompakt */
    
    .mobile-menu-btn { display: block; }
    .icon-btn-header { display: none; }
    .profile-section { padding-left: 0; border-left: none; margin-left: 0; }
    #logout-btn { display: none; }
    
    /* --- 2. DIE EINKLAPPBARE SUCHLEISTE (Magischer Trick) --- */
    .local-search { 
        width: 38px; /* Nur so breit wie ein Icon */
        height: 38px;
        padding: 8px; 
        color: transparent; /* Versteckt den Placeholder-Text */
        border-radius: 50%; /* Macht es zu einem runden Button */
        cursor: pointer; 
        background-color: transparent;
        /* Wir legen ein Lupe-Icon als Hintergrundbild rein */
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%23aaa" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
        background-repeat: no-repeat;
        background-position: center;
        transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }
    .local-search::placeholder { color: transparent; }
    
    /* Wenn man reinklickt (Fokus), entfaltet sie sich zur Leiste */
    .local-search:focus { 
        width: 170px; 
        border-radius: 20px; /* Wird wieder zu einer Pille */
        color: #fff; 
        background-image: none; /* Lupe verschwindet, Platz für Text */
        background-color: #151515;
        padding: 8px 15px; 
        cursor: text; 
    }
    .local-search:focus::placeholder { color: #888; }
    
    /* --- 3. CHALLENGE BANNER TEXT VERKLEINERN --- */
    .challenge-banner { padding: 6px 15px; } 
    .challenge-label { font-size: 0.65rem; } /* Etwas zierlicher */
    .challenge-text { font-size: 0.7rem; } /* Etwas zierlicher */
    
    /* --- 2. CHALLENGE BANNER STAUCHEN --- */
    .challenge-banner { padding: 4px 15px; } /* Innenabstand halbiert */
    
    /* --- 3. TOTE FLÄCHE (WEIßER BALKEN) ELIMINIEREN --- */
    /* Vorher war hier padding: 20px und gap: 20px, was den Balken erzeugt hat */
    .content-wrapper { 
        flex-direction: column; 
        padding: 0 15px 80px 15px; /* 0 oben killt den Balken, 80px unten macht Platz für die Bottom-Nav! */
        gap: 0; 
        overflow-y: auto; 
    }
    
    
    main { 
        padding-right: 0; 
        padding-top: 10px; /* Überschreibt die 25px vom Desktop */
    }

    /* --- 4. BOTTOM-NAVIGATION ERZEUGEN --- */
    /* Vorher stand hier display: none */
    /* Sidebar komplett killen auf Mobile */
    aside { display: none !important; }

    /* Versteckt Profil, Glocke und den alten Add-Button im Header auf dem Smartphone */
    .profile-section, .add-btn { display: none !important; }

    /* Echte Bottom Navigation aufbauen */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background-color: #242424;
        border-top: 1px solid #333;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom); /* iOS Swipe Bar Support */
    }

    .mobile-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #888;
        text-decoration: none;
        flex-grow: 1;
        height: 100%;
        gap: 4px;
        transition: color 0.2s;
    }

    .mobile-bottom-nav .nav-item.active { color: #ff4757; }
    .mobile-bottom-nav .nav-item svg { width: 22px; height: 22px; }
    .mobile-bottom-nav .nav-item span { font-size: 0.6rem; font-weight: 600; font-family: 'Outfit', sans-serif; text-transform: uppercase; letter-spacing: 0.5px;}
    
    /* Wir verstecken alles in der Aside, was keine Navigation ist */
    .sidebar-logo, aside h2, .section-header { display: none !important; }
    
    /* Wir biegen die Listen in eine horizontale Reihe um */
    aside .nav-section { display: flex; width: 100%; margin: 0; justify-content: space-around; }
    aside .filter-list { display: flex; flex-direction: row; width: 100%; justify-content: space-around; }
    
    /* Icons zentrieren, Text ausblenden */
    aside .filter-list li { 
        flex-direction: column; 
        justify-content: center; 
        padding: 10px; 
        flex: 1; 
    }
    /* Text und Zähler radikal verstecken, nur SVGs bleiben sichtbar */
    aside .filter-list li span, aside .filter-list li .count { display: none !important; }
}

/* Light Mode Anpassung für die mobile Bottom-Nav */
@media (max-width: 768px) {
    body.light-mode aside { 
        background-color: #ffffff; 
        border-top: 1px solid #e0e0e0; 
    }
}

/* Light Mode Fixes für das Import-Panel */
body.light-mode #import-view-container > div {
    background-color: #ffffff !important;
    border-color: #e0e0e0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

body.light-mode #import-view-container h2 {
    color: #121212 !important;
    border-color: #eeeeee !important;
}

body.light-mode #import-view-container p {
    color: #666666 !important;
}

body.light-mode #import-log-box {
    background-color: #f9f9f9 !important;
    border-color: #cccccc !important;
    color: #27ae60 !important;
}

body.light-mode .local-search { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%23444" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>'); }
body.light-mode .local-search:focus { background-image: none; color: #121212; background-color: #fff; }

.mobile-bottom-nav { display: none; } /* Stellt sicher, dass die Leiste am Desktop immer unsichtbar bleibt */

@media (max-width: 768px) {
    body.light-mode .mobile-bottom-nav { background-color: #ffffff; border-top-color: #e0e0e0; }
    body.light-mode .mobile-bottom-nav .nav-item { color: #888; }
    body.light-mode .mobile-bottom-nav .nav-item.active { color: #ff4757; }
}

/* --- BOTTOM SHEETS CSS --- */
.bottom-sheet-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7); z-index: 2000; opacity: 0; transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}
.bottom-sheet {
    position: fixed; bottom: -100%; left: 0; width: 100%;
    background: #242424; border-top-left-radius: 20px; border-top-right-radius: 20px;
    padding: 20px 20px 40px 20px; box-sizing: border-box; z-index: 2001;
    transition: bottom 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border-top: 1px solid #444; box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}
.bottom-sheet.open { bottom: 0; }
.sheet-handle {
    width: 40px; height: 5px; background: #555; border-radius: 5px;
    margin: 0 auto 20px auto;
}
.sheet-list { list-style: none; padding: 0; margin: 0; }
.sheet-list li {
    padding: 15px 0; color: #f5f5f5; font-size: 1.1rem; border-bottom: 1px solid #333;
    display: flex; align-items: center; gap: 15px; cursor: pointer;
}
.sheet-list li:last-child { border-bottom: none; }
.sheet-list li svg { color: #888; }

.grid-slider { width: 100%; accent-color: #ff4757; }
.sheet-chip {
    background: #151515; border: 1px solid #444; color: #aaa; border-radius: 20px;
    padding: 8px 16px; font-family: inherit; font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
}
.sheet-chip.active { background: #ff4757; border-color: #ff4757; color: #fff; }

/* Light Mode für Bottom Sheets */
body.light-mode .bottom-sheet { background: #ffffff; border-color: #e0e0e0; }
body.light-mode .sheet-handle { background: #ccc; }
body.light-mode .bottom-sheet h3 { color: #121212 !important; }
body.light-mode .sheet-list li { color: #121212; border-bottom-color: #eee; }
body.light-mode .sheet-chip { background: #f5f5f5; border-color: #ccc; color: #666; }
body.light-mode .sheet-chip.active { background: #ff4757; color: #fff; border-color: #ff4757; }

/* --- Symmetrische & flachere Bottom-Nav --- */
.mobile-bottom-nav {
    height: 55px !important; 
}
.mobile-bottom-nav .nav-item {
    flex: 1 1 0; 
    width: 20%;
}

/* --- Filter Icon auffällig machen --- */
#mobile-toggle svg {
    stroke: #ff4757 !important;
    stroke-width: 2.5px;
    transform: scale(1.1);
}

/* --- Neue Such-Chips (Radio Button Style) --- */
.search-category-chips { display: flex; gap: 8px; margin-bottom: 15px; overflow-x: auto; padding-bottom: 5px; }
.search-cat-chip { background: #151515; border: 1px solid #444; color: #aaa; border-radius: 20px; padding: 6px 14px; font-size: 0.85rem; cursor: pointer; white-space: nowrap; transition: all 0.2s; font-family: inherit; }
.search-cat-chip.active { background: #ff4757; color: #fff; border-color: #ff4757; font-weight: bold; }

/* Light Mode Anpassung für Chips */
body.light-mode .search-cat-chip { background: #eee; border-color: #ccc; color: #666; }
body.light-mode .search-cat-chip.active { background: #ff4757; color: #fff; border-color: #ff4757; }

/* --- Transparenter Overlay fürs Live-Feedback beim Filtern --- */
.bottom-sheet-overlay {
    background: rgba(0,0,0,0.15) !important; 
    backdrop-filter: none !important; 
}

/* --- UNIFIED GRID SYSTEM (Desktop & Mobile) --- */
#library-grid { display: grid; padding-bottom: 40px; }

/* Desktop-Fallback (Greift für alte UND neue Namen) */
#library-grid.size-3, #library-grid.size-normal { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 25px 15px; }
#library-grid.size-4, #library-grid.size-5, #library-grid.size-small { grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); gap: 15px 10px; }
#library-grid.size-6, #library-grid.size-7, #library-grid.size-wimmelbild { grid-template-columns: repeat(auto-fill, minmax(45px, 1fr)); gap: 4px; }

/* --- Mobile Grid: Die genialen 5 Abstufungen (3 bis 7 Spalten) --- */
@media (max-width: 768px) {
    /* minmax(0, 1fr) ist der magische Fix, der das Grid zwingt, auf den Screen zu passen! */
    #library-grid.size-3, #library-grid.size-normal { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px !important; }
    #library-grid.size-4, #library-grid.size-small { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px !important; }
    #library-grid.size-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 6px !important; }
    #library-grid.size-6, #library-grid.size-wimmelbild { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 4px !important; }
    #library-grid.size-7 { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; gap: 2px !important; }

    /* Stufe 4 & 5: Creator ausblenden, Titel verkleinern */
    #library-grid.size-4 .creator, #library-grid.size-5 .creator { display: none; }
    
    /* ZUM AUSBLENDEN DER STERNE AUF MOBILE (GRID 4 & 5) EINFACH DIE KOMMENTARE HIER ENTFERNEN: */
    /* #library-grid.size-4 .card-bottom, #library-grid.size-5 .card-bottom { display: none; } */
    
    #library-grid.size-4 .title { font-size: 0.65rem; margin-bottom: 0; }
    #library-grid.size-5 .title { font-size: 0.55rem; margin-bottom: 0; line-height: 1.1; }

    /* --- NEU: Fix für Lese-Challenge Kacheln auf Mobile (3 nebeneinander) --- */
    #challenge-books-grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px !important;
        width: 100%;
    }
    #challenge-books-grid .title { font-size: 0.65rem; margin-bottom: 0; line-height: 1.1; }
    #challenge-books-grid .creator { display: none; }
    
    /* Ab 6 Spalten (Wimmelbild): Nur noch pures Cover zeigen */
    #library-grid.size-6 .title, #library-grid.size-7 .title,
    #library-grid.size-6 .creator, #library-grid.size-7 .creator,
    #library-grid.size-6 .card-bottom, #library-grid.size-7 .card-bottom { display: none; }
    
    #library-grid.size-6 .cover-wrapper, #library-grid.size-7 .cover-wrapper { margin-bottom: 0; box-shadow: none; border-radius: 2px; }
}

/* Fallback für Desktop */
#library-grid.size-3, #library-grid.size-normal { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 25px 15px; }
#library-grid.size-4, #library-grid.size-small { grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); gap: 15px 10px; }
#library-grid.size-5 { grid-template-columns: repeat(auto-fill, minmax(55px, 1fr)); gap: 10px; }
#library-grid.size-6, #library-grid.size-wimmelbild { grid-template-columns: repeat(auto-fill, minmax(45px, 1fr)); gap: 4px; }
#library-grid.size-7 { grid-template-columns: repeat(auto-fill, minmax(35px, 1fr)); gap: 2px; }