:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --card-bg: rgba(26, 26, 26, 0.8);
    --input-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --accent-color: #ff3b3b;
    --accent-hover: #ff6b6b;
    --accent-pressed: #e62e2e;
    --accent-soft-text: #ff8a8a;
    --accent-rgb: 255, 59, 59;
    --hover-bg: rgba(255, 255, 255, 0.1);
    --error-color: #ff6b6b;
    --success-color: #51cf66;
    --border-radius: 16px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --content-max: 1200px;
    --surface-border: rgba(255, 255, 255, 0.1);
    --surface-border-soft: rgba(255, 255, 255, 0.06);
    --surface-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-blur: blur(10px);
    --tile-bg: rgba(255, 255, 255, 0.05);
    --tile-bg-hover: rgba(255, 255, 255, 0.1);
    --section-rule: 2px solid rgba(var(--accent-rgb), 0.2);
    --accent-glow: 0 4px 14px rgba(var(--accent-rgb), 0.28);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Shared page hero (profile-like) for catalog / stats / utility pages */
.page-hero {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    color: #fff;
}

.page-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 75% 65% at 12% 15%, rgba(var(--accent-rgb), 0.26), transparent 55%),
        radial-gradient(ellipse 55% 45% at 88% 85%, rgba(var(--accent-rgb), 0.1), transparent 50%),
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color) 14%, #0f0f0f) 0%, #0f0f0f 50%, #121018 100%);
}

.page-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(15, 15, 15, 0.2) 0%,
        rgba(15, 15, 15, 0.55) 50%,
        rgba(15, 15, 15, 0.95) 100%
    );
}

.page-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--content-max, 1200px);
    margin: 0 auto;
    padding: 3.25rem 1.5rem 1.6rem;
}

.page-hero-content h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.75rem, 3.2vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.page-hero-content h1 i {
    color: var(--accent-color);
}

.page-hero-lead {
    margin: 0 0 1rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
    max-width: 40rem;
    line-height: 1.5;
}

.page-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.page-hero-badges .meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.page-hero-badges .meta-badge i {
    color: var(--accent-color);
}

.page-shell {
    max-width: var(--content-max, 1200px);
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
}

/* Shared surface language (profile / anime detail) */
.surface-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
    backdrop-filter: var(--glass-blur);
}

.surface-tile {
    background: var(--tile-bg);
    border: 1px solid var(--surface-border-soft);
    border-radius: var(--radius-md);
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.surface-tile:hover {
    background: var(--tile-bg-hover);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

.table-scroll,
.table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Navigations-Links als Karten/Buttons: nie unterstreichen */
a.nav-logo,
a.nav-logo:link,
a.nav-logo:visited,
a.nav-logo:hover,
a.nav-logo:active,
a.nav-logo:focus,
a.nav-link,
a.nav-link:link,
a.nav-link:visited,
a.nav-link:hover,
a.nav-link:active,
a.nav-link:focus,
a.nav-tab,
a.nav-tab:link,
a.nav-tab:visited,
a.nav-tab:hover,
a.nav-tab:active,
a.nav-tab:focus,
a.view-all,
a.view-all:link,
a.view-all:visited,
a.view-all:hover,
a.view-all:active,
a.view-all:focus,
a.trending-anime-card,
a.trending-anime-card:link,
a.trending-anime-card:visited,
a.trending-anime-card:hover,
a.trending-anime-card:active,
a.trending-anime-card:focus,
a.anime-card,
a.anime-card:link,
a.anime-card:visited,
a.anime-card:hover,
a.anime-card:active,
a.anime-card:focus,
a.anime-list-item,
a.anime-list-item:link,
a.anime-list-item:visited,
a.anime-list-item:hover,
a.anime-list-item:active,
a.anime-list-item:focus,
a.score-item,
a.score-item:link,
a.score-item:visited,
a.score-item:hover,
a.score-item:active,
a.score-item:focus,
a.browse-card,
a.browse-card:link,
a.browse-card:visited,
a.browse-card:hover,
a.browse-card:active,
a.browse-card:focus,
a.admin-poster-media,
a.admin-poster-media:link,
a.admin-poster-media:visited,
a.admin-poster-media:hover,
a.admin-poster-media:active,
a.admin-poster-media:focus,
a.relation-card,
a.relation-card:link,
a.relation-card:visited,
a.relation-card:hover,
a.relation-card:active,
a.relation-card:focus,
a.search-result-item,
a.search-result-item:link,
a.search-result-item:visited,
a.search-result-item:hover,
a.search-result-item:active,
a.search-result-item:focus,
a.discover-cover,
a.discover-cover:link,
a.discover-cover:visited,
a.discover-cover:hover,
a.discover-cover:active,
a.discover-cover:focus,
a.btn-primary,
a.btn-primary:link,
a.btn-primary:visited,
a.btn-primary:hover,
a.btn-primary:active,
a.btn-primary:focus,
a.btn-secondary,
a.btn-secondary:link,
a.btn-secondary:visited,
a.btn-secondary:hover,
a.btn-secondary:active,
a.btn-secondary:focus,
.admin-poster-body h3 a,
.admin-poster-body h3 a:link,
.admin-poster-body h3 a:visited,
.admin-poster-body h3 a:hover,
.admin-poster-body h3 a:active,
.admin-poster-body h3 a:focus,
.admin-poster-actions a,
.admin-poster-actions a:link,
.admin-poster-actions a:visited,
.admin-poster-actions a:hover,
.admin-poster-actions a:active,
.admin-poster-actions a:focus,
.discover-actions a,
.discover-actions a:link,
.discover-actions a:visited,
.discover-actions a:hover,
.discover-actions a:active,
.discover-actions a:focus,
a.menu-item,
a.menu-item:link,
a.menu-item:visited,
a.menu-item:hover,
a.menu-item:active,
a.menu-item:focus {
    text-decoration: none !important;
    text-decoration-line: none !important;
}

a.trending-anime-card *,
a.anime-card *,
a.anime-list-item *,
a.score-item *,
a.browse-card *,
a.admin-poster-media *,
a.relation-card *,
a.search-result-item *,
a.discover-cover * {
    text-decoration: none !important;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
    color: #ffffff;
    position: relative;
    line-height: 1.6;
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(var(--accent-rgb), 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(var(--accent-rgb), 0.1) 0%, transparent 50%),
        linear-gradient(45deg, rgba(20, 20, 20, 0.95) 0%, rgba(10, 10, 10, 0.95) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 4px);
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), 0.05) 0%, transparent 50%),
        radial-gradient(circle at 0% 0%, rgba(var(--accent-rgb), 0.03) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(var(--accent-rgb), 0.03) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0;
    background: rgba(12, 12, 12, 0.82);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.7rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.nav-logo:hover {
    opacity: 0.9;
}

.nav-logo-mark {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 0.4rem;
    display: block;
    flex-shrink: 0;
}

.nav-logo i {
    font-size: 1.55rem;
}

.nav-search {
    flex: 1;
    max-width: 420px;
    min-width: 0;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    z-index: 2;
    font-size: 0.85rem;
    pointer-events: none;
}

#globalSearch,
#globalSearchMobile {
    width: 100%;
    padding: 0.65rem 0.9rem 0.65rem 2.35rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#globalSearch:focus,
#globalSearchMobile:focus {
    outline: none;
    border-color: rgba(var(--accent-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.search-results {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    width: 100%;
    max-width: min(100%, calc(100vw - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    transform: none;
    background: rgba(22, 22, 22, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    max-height: min(360px, 50dvh, calc(100dvh - 5rem - env(safe-area-inset-bottom, 0px)));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: none;
    z-index: 1000;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

.search-results.active {
    display: block;
}

/* Search Results Styling */
.search-loading,
.search-no-results,
.search-error {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.search-loading i {
    color: var(--accent-color);
}

.search-error i {
    color: var(--error-color);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.search-result-image {
    width: 40px;
    height: 56px;
    flex-shrink: 0;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    line-height: 1.35;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
}

.search-result-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.search-result-year {
    background: rgba(var(--accent-rgb), 0.2);
    color: var(--accent-color);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.search-result-genres {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.nav-drawer-search {
    display: none;
}

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

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    min-height: 40px;
    border-radius: 10px;
    color: #b8b8b8;
    text-decoration: none;
    font-weight: 560;
    font-size: 0.9rem;
    transition: color 0.2s ease, background 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link i {
    font-size: 0.8rem;
    opacity: 0.75;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: #fff;
    background: rgba(var(--accent-rgb), 0.14);
}

.nav-link.active i {
    color: var(--accent-color);
    opacity: 1;
}

.nav-link.active::after {
    display: none;
}

.user-menu {
    position: relative;
    margin-left: 0.35rem;
}

.user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-size: 0.88rem;
    font-weight: 600;
}

.user-btn:hover {
    border-color: rgba(var(--accent-rgb), 0.55);
    background: rgba(var(--accent-rgb), 0.12);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    margin-left: auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    border-radius: 2px;
    background: #fff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar.is-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navbar.is-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.navbar.is-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
    display: none;
}

.admin-badge {
    background: var(--accent-color);
    color: white;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.25rem;
    letter-spacing: 0.02em;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    left: auto;
    width: min(280px, calc(100vw - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: calc(100vw - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-height: min(70vh, calc(100dvh - 5rem - env(safe-area-inset-bottom, 0px)));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: rgba(22, 22, 22, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    z-index: 1001;
    animation: dropdownSlide 0.22s ease;
    box-sizing: border-box;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-info {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details .username,
.user-details .email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-details .username {
    display: block;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.2rem;
}

.user-details .email {
    display: block;
    font-size: 0.8rem;
    color: #ccc;
}

.user-actions {
    padding: 0.5rem;
}

.user-actions a {
    text-decoration: none;
}

.menu-item {
    width: 100%;
    padding: 0.8rem 1rem;
    background: none;
    border: none;
    color: #ccc;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    text-decoration: none;
    box-sizing: border-box;
}

a.menu-item,
a.menu-item:link,
a.menu-item:visited,
a.menu-item:hover,
a.menu-item:active,
a.menu-item:focus {
    text-decoration: none !important;
    color: #ccc;
}

a.menu-item:hover {
    color: #fff;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.menu-item i {
    width: 16px;
    text-align: center;
}

/* Notifications */
.notification {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    left: auto;
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    max-width: min(400px, calc(100vw - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    width: max-content;
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.notification-message {
    color: #fff;
    font-size: 0.9rem;
}

.notification-close {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.notification-success {
    border-left: 4px solid #4CAF50;
}

.notification-error {
    border-left: 4px solid #f44336;
}

.notification-info {
    border-left: 4px solid #2196F3;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty and Error States */
.empty-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem clamp(1rem, 4vw, 2rem);
    text-align: center;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.empty-state i,
.error-state i {
    font-size: 3rem;
    color: #666;
    margin-bottom: 1rem;
}

.empty-state h3,
.error-state h3 {
    color: #fff;
    font-size: clamp(1.15rem, 4vw, 1.5rem);
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.empty-state p,
.error-state p {
    color: #ccc;
    max-width: min(400px, 100%);
    line-height: 1.6;
}

/* Modal Overlay (global für alle Modals) */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100dvh;
    padding: max(0.75rem, env(safe-area-inset-top, 0px))
             max(0.75rem, env(safe-area-inset-right, 0px))
             max(0.75rem, env(safe-area-inset-bottom, 0px))
             max(0.75rem, env(safe-area-inset-left, 0px));
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
.modal-overlay.active {
    display: flex;
}

/* Modal Box */
.modal {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    max-width: min(500px, 100%);
    width: 100%;
    max-height: min(90vh, calc(100dvh - 1.5rem));
    margin: auto;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInModal 0.2s;
}
@keyframes fadeInModal {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 0.75rem;
    flex-shrink: 0;
}
.modal-header h2 {
    margin: 0;
    font-size: clamp(1.15rem, 4vw, 1.5rem);
    line-height: 1.3;
    min-width: 0;
    word-break: break-word;
}
.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.close-btn:hover {
    background: var(--hover-bg);
}
.modal-body {
    padding: 1.25rem 1.25rem 1.5rem;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
}

#modalTagSearch {
    width: 100%;
    padding: 0.5em;
    margin-bottom: 1em;
    border-radius: 4px;
    border: 1px solid #333;
    font-size: 1em;
    background: var(--input-bg);
    color: #fff;
}

/* Modal Styles */
#registerModal {
    display: none;
}

#registerModal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    margin: 10vh auto;
    padding: 2rem;
    border-radius: 8px;
    width: min(90%, 400px);
    max-width: 100%;
    max-height: min(85vh, calc(100dvh - 2rem));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

.modal-content h2 {
    margin-top: 0;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Form Styles */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    user-select: none;
    min-width: 0;
    max-width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    min-width: 0;
}

.form-group label {
    color: #ccc;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(26, 26, 26, 0.8);
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-body input,
.modal-body textarea,
.modal-body select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(26, 26, 26, 0.8);
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.modal-body textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    max-width: 100%;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary,
.modal-actions .btn-danger {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
}

.app-dialog-modal .app-dialog {
    max-width: min(420px, 100%);
}

.app-dialog-modal .modal-body {
    padding: 0 1.25rem 1rem;
}

.app-dialog-modal .app-dialog-message {
    margin: 0;
    color: var(--text-primary, #eee);
    line-height: 1.55;
    word-break: break-word;
}

.app-dialog-modal .modal-actions {
    padding: 0 1.25rem 1.25rem;
    margin-top: 0;
}

.register-link {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.register-link span {
    color: #ccc;
    font-size: 0.9rem;
}

.register-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 0.5rem;
}

.register-link a:hover {
    text-decoration: underline;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.8rem 1.5rem;
    min-height: 44px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    max-width: 100%;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-pressed);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Anime Grid Infinite Loop */
.anime-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    height: 400px;
    /* Höhe wie die Cards */
}

.anime-grid-inner {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    will-change: transform;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    animation: animeGridLoop 40s linear infinite;
}

.anime-card {
    min-width: 350px;
    max-width: 350px;
    flex: 0 0 350px;
    margin-right: 2rem;
    text-decoration: none;
    color: inherit;
    display: block;
}

@keyframes animeGridLoop {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

.anime-grid:hover .anime-grid-inner {
    animation-play-state: paused;
}

@media (max-width: 1200px) {
    .anime-card, .anime-grid {
        min-width: 280px;
        max-width: 280px;
        height: 380px;
    }
}

@media (max-width: 768px) {
    .anime-card, .anime-grid {
        min-width: 220px;
        max-width: 220px;
        height: 320px;
    }
}

/* Anime Cards */
.anime-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    height: 400px;
    text-decoration: none;
    color: inherit;
    display: block;
}

.anime-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.anime-card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.anime-cover {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.anime-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.anime-card:hover .anime-cover img {
    transform: scale(1.05);
}

.anime-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.anime-card:hover .anime-overlay {
    opacity: 1;
}

.anime-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    opacity: 0;
}

.anime-card:hover .anime-info {
    transform: translateY(0);
    opacity: 1;
}

.anime-title {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anime-description {
    margin: 0 0 12px 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anime-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.anime-meta span {
    font-size: 0.7rem;
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 6px;
    border-radius: 8px;
}

/* Admin Menu */
.anime-admin-menu {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.admin-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.admin-menu-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.admin-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.admin-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
    border-radius: 8px;
    margin: 4px;
    width: calc(100% - 8px);
}

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

.dropdown-item i {
    font-size: 0.9rem;
    width: 16px;
}

/* Close dropdown when clicking outside */
body {
    position: relative;
}

/* 18+ / Hentai Cover-Blur (Standard, außer Profil-Einstellung aktiv) */
body:not(.nsfw-allowed) img[data-nsfw="1"],
body:not(.nsfw-allowed) img.nsfw-blur,
body:not(.nsfw-allowed) img.nsfw-media,
body:not(.nsfw-allowed) .nsfw-blur-bg[data-nsfw="1"] {
    filter: blur(22px) brightness(0.42) !important;
    transform: scale(1.12);
}

body:not(.nsfw-allowed) .anime-cover-large:has(img[data-nsfw="1"])::after,
body:not(.nsfw-allowed) .browse-card-media:has(img[data-nsfw="1"])::after,
body:not(.nsfw-allowed) .anime-cover:has(img[data-nsfw="1"])::after,
body:not(.nsfw-allowed) .search-result-image:has(img[data-nsfw="1"])::after,
body:not(.nsfw-allowed) .relation-cover:has(img[data-nsfw="1"])::after,
body:not(.nsfw-allowed) .admin-poster-media:has(img[data-nsfw="1"])::after,
body:not(.nsfw-allowed) .anime-list-cover:has(img[data-nsfw="1"])::after {
    content: '18+';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.08em;
    background: rgba(0, 0, 0, 0.28);
    pointer-events: none;
    z-index: 2;
}

.anime-cover-large,
.browse-card-media,
.anime-cover,
.search-result-image,
.relation-cover,
.admin-poster-media,
.anime-list-cover {
    position: relative;
    overflow: hidden;
}

body:not(.nsfw-allowed) .anime-hero.nsfw-blur-hero,
body:not(.nsfw-allowed) .hero-background.nsfw-blur-bg,
body:not(.nsfw-allowed) .anime-card-background[data-nsfw="1"],
body:not(.nsfw-allowed) .score-anime-banner[data-nsfw="1"] {
    filter: blur(28px) brightness(0.35) !important;
}

.nsfw-blur-host {
    position: relative;
    overflow: hidden;
}

.form-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary, #aaa);
    line-height: 1.4;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    max-width: 100%;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    box-sizing: border-box;
    overflow-x: hidden;
}

.hero-section {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-section {
    background: rgba(26, 26, 26, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    display: none;
}

.filter-section.active {
    display: block;
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
}

.filter-container h3 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.filter-group label {
    display: block;
    color: #ccc;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(26, 26, 26, 0.8);
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.genre-chip {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    user-select: none;
}

.genre-chip.disabled {
    opacity: 0.5;
}

.genre-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.filter-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.anime-section {
    padding: 2rem;
}

.anime-container {
    max-width: 1200px;
    margin: 0 auto;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #ccc;
}

.loading-state.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-state p {
    color: #ccc;
    font-size: 1rem;
}

.anime-content {
    padding: 2rem;
}

.anime-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.anime-cover:hover img {
    transform: scale(1.05);
}

.anime-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.anime-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    color: #ccc;
    font-size: 0.9rem;
}

.anime-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.anime-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.score-stars {
    display: flex;
    gap: 0.125rem;
}

.score-stars i {
    color: #ffd700;
    font-size: 0.875rem;
}

.score-value {
    font-weight: 600;
    color: #374151;
}

.anime-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rating-stars {
    color: #ffd700;
    font-size: 1.2rem;
}

.rating-stars i {
    margin-right: 0.2rem;
}

.rating-score {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

.anime-genres,
.anime-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.anime-genres .genre-chip,
.anime-tags .tag {
    background: var(--accent-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.anime-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.anime-description {
    color: #ccc;
    line-height: 1.8;
    font-size: 1rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 1rem;
}

.anime-description::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.anime-description::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), 0.5);
    border-radius: 3px;
}

.anime-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    color: #ccc;
    font-weight: 500;
}

.stat-value {
    color: #fff;
    font-weight: 600;
}

.anime-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: #ccc;
}

.error-state.active {
    display: flex;
}

.error-state i {
    font-size: 3rem;
    color: #f44336;
    margin-bottom: 1rem;
}

.error-state h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-state p {
    color: #ccc;
    margin-bottom: 1rem;
}

.trending-section {
    padding: 2rem;
    background: rgba(26, 26, 26, 0.5);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 0 auto 1.25rem;
    padding-bottom: 0.85rem;
    max-width: var(--content-max);
    border-bottom: var(--section-rule);
}

.section-header h1,
.section-header h2,
.section-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.section-header h1 i,
.section-header h2 i,
.section-header h3 i,
.section-header > i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.view-all {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: var(--accent-hover);
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.activity-section {
    padding: 2rem;
}

.activity-feed {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer {
    background: rgba(10, 10, 10, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem max(1.25rem, env(safe-area-inset-right, 0px)) max(1.25rem, env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left, 0px));
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(200px, 1.4fr) repeat(3, minmax(140px, 1fr));
    gap: 2rem 1.75rem;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.footer-logo img {
    width: 28px;
    height: 28px;
}

.footer-brand p {
    margin: 0;
    max-width: 28ch;
}

.footer-section h3,
.footer-section h4 {
    color: #fff;
    margin: 0 0 0.9rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.footer-section p {
    color: #ccc;
    line-height: 1.6;
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.15rem;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.75rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #666;
    font-size: 0.85rem;
}

/* Responsive Design — Breakpoints: 1200 / 980 / 768 / 480 */
@media (max-width: 1200px) {
    .nav-container {
        padding: 0.7rem 1rem;
    }

    .hero-section {
        padding: 3.25rem 1.5rem;
    }

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

    .footer {
        padding: 2.75rem 1.5rem 1rem;
    }

    .section-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 980px) {
    .nav-search {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        right: 0;
        left: auto;
        width: min(320px, calc(100vw - 0.75rem));
        max-width: 100%;
        max-height: calc(100dvh - 64px - env(safe-area-inset-bottom, 0px));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom, 0px));
        background: rgba(14, 14, 14, 0.98);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
        transform: translateX(calc(100% + 1rem));
        transition: transform 0.25s ease;
        z-index: 1002;
        pointer-events: none;
    }

    .navbar.is-open .nav-menu {
        transform: translateX(0);
        pointer-events: auto;
    }

    .nav-drawer-search {
        display: block;
        margin-bottom: 0.25rem;
    }

    .nav-drawer-search #globalSearchMobile {
        min-height: 44px;
        font-size: 16px; /* verhindert iOS-Zoom */
    }

    .nav-drawer-search .search-results {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: none;
        max-height: min(280px, 40vh, calc(100dvh - 10rem));
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .nav-link {
        width: 100%;
        padding: 0.85rem 0.9rem;
        min-height: 44px;
        font-size: 0.95rem;
    }

    .nav-link i {
        width: 1.1rem;
        text-align: center;
    }

    .user-menu {
        margin-left: 0;
        margin-top: 0.35rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .user-btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 64px 0 0 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 1001;
        border: none;
        padding: 0;
        cursor: pointer;
    }

    .nav-backdrop[hidden] {
        display: none !important;
    }

    .user-dropdown {
        position: fixed;
        top: auto;
        bottom: max(1rem, env(safe-area-inset-bottom, 0px));
        left: max(1rem, env(safe-area-inset-left, 0px));
        right: max(1rem, env(safe-area-inset-right, 0px));
        width: auto;
        max-width: none;
        max-height: min(70vh, calc(100dvh - 6rem - env(safe-area-inset-bottom, 0px)));
        overflow-y: auto;
    }

    .menu-item {
        min-height: 44px;
    }

    .notification {
        left: max(1rem, env(safe-area-inset-left, 0px));
        right: max(1rem, env(safe-area-inset-right, 0px));
        max-width: none;
        top: 76px;
    }

    .footer-content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.55rem 0.9rem;
        min-height: 56px;
        gap: 0.75rem;
    }

    .nav-logo {
        font-size: 1.05rem;
    }

    .nav-logo-mark {
        width: 1.45rem;
        height: 1.45rem;
    }

    .nav-logo i {
        font-size: 1.35rem;
    }

    .nav-menu {
        top: 56px;
        max-height: calc(100dvh - 56px - env(safe-area-inset-bottom, 0px));
        width: min(300px, calc(100vw - 0.75rem));
    }

    .nav-backdrop {
        inset: 56px 0 0 0;
    }

    .main-content {
        margin-top: 56px;
        min-height: calc(100vh - 56px);
    }

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

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

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
    }

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

    .anime-cover {
        max-width: 300px;
        margin: 0 auto;
    }

    .anime-details {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

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

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

    .anime-details-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .anime-meta-detailed {
        grid-template-columns: 1fr;
    }

    .admin-actions {
        flex-direction: column;
    }

    .section-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .section-header h2 {
        font-size: 1.45rem;
    }

    .main-content,
    .browse-page,
    .site-stats-page,
    .user-profile-page .main-content {
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
    }

    .footer {
        padding: 2.25rem max(1.25rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left, 0px));
        margin-top: 2.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .empty-state,
    .error-state {
        padding: 2rem 1rem;
    }

    .empty-state i,
    .error-state i {
        font-size: 2.25rem;
    }

    .modal {
        width: min(500px, calc(100vw - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
        max-height: min(90vh, calc(100dvh - 1.5rem));
    }

    .modal-body input,
    .modal-body textarea,
    .modal-body select,
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* verhindert iOS-Zoom */
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-secondary,
    .modal-actions .btn-danger {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .notification {
        top: 68px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.5rem 0.75rem;
    }

    .nav-menu {
        width: min(100vw - 0.75rem, 300px);
        padding: 0.85rem 0.85rem max(0.85rem, env(safe-area-inset-bottom, 0px));
    }

    .hero-section {
        padding: 2rem 1rem;
    }

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

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

    .anime-section,
    .trending-section,
    .activity-section {
        padding: 1rem;
    }

    .anime-content {
        padding: 1rem;
    }

    .anime-title {
        font-size: 1.5rem;
    }

    .modal {
        width: 100%;
        max-width: calc(100vw - 1.25rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
        max-height: min(92vh, calc(100dvh - 1rem));
        margin: 0 auto;
        border-radius: 10px;
    }

    .modal-header {
        padding: 1rem 1rem 0.5rem;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .search-result-item {
        padding: 0.7rem;
        gap: 0.65rem;
    }

    .search-result-title {
        font-size: 0.85rem;
    }

    .nav-link span {
        font-size: 0.92rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .footer {
        padding: 2rem max(1rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
    }

    .view-all {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }
}

/* Anime Form Modal */
.anime-form-modal {
    max-width: min(1000px, 100%);
    width: 95%;
    max-height: min(85vh, calc(100dvh - 1.5rem));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.anime-form-modal .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Input Styles for Anime Form Modal */
.anime-form-modal input,
.anime-form-modal textarea,
.anime-form-modal select {
    background: rgba(26, 26, 26, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    padding: 0.8rem 1rem !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
}

.anime-form-modal input:focus,
.anime-form-modal textarea:focus,
.anime-form-modal select:focus {
    outline: none !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2) !important;
    background: rgba(26, 26, 26, 0.9) !important;
}

.anime-form-modal input::placeholder,
.anime-form-modal textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.anime-form-modal textarea {
    resize: vertical !important;
    min-height: 100px !important;
}

.anime-form-modal select option {
    background: rgba(26, 26, 26, 0.95) !important;
    color: #fff !important;
}

/* Form Sections */
.form-section {
    margin: 1.5rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.form-section:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.form-section h3 {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid rgba(var(--accent-rgb), 0.3);
    position: relative;
}

.form-section h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    border-radius: 1px;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    margin: 1rem 0;
}

.file-upload-wrapper input[type="file"] {
    padding: 2rem;
    border: 2px dashed rgba(var(--accent-rgb), 0.3);
    border-radius: 12px;
    background: rgba(26, 26, 26, 0.6);
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
}

.file-upload-wrapper input[type="file"]:hover {
    border-color: var(--accent-color);
    background: rgba(26, 26, 26, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.2);
}

.file-preview {
    margin-top: 1.5rem;
    text-align: center;
}

.file-preview img {
    max-width: 250px;
    max-height: 250px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.file-preview img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Episode Items */
.episode-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.episode-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.episode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.episode-header h4 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.btn-remove-episode,
.btn-remove-character,
.btn-remove-relation {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-remove-episode:hover,
.btn-remove-character:hover,
.btn-remove-relation:hover {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
}

/* Character Items */
.character-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.character-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.character-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.character-header h4 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Relation Items */
.relation-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.relation-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.relation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.relation-header h4 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Responsive Design for Form */
@media (max-width: 768px) {
    .anime-form-modal {
        width: 98%;
        margin: 0.5rem;
        max-width: none;
    }

    .form-section {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .episode-item,
    .character-item,
    .relation-item {
        padding: 0.8rem;
    }

    .file-preview img {
        max-width: 150px;
        max-height: 150px;
    }

    .language-selector {
        flex-direction: column;
        gap: 0.5rem;
    }

    .checkbox-label {
        width: 100%;
    }
}

/* Language Selector */
.language-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.checkbox-label:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent-color);
}

.checkbox-label span {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--accent-hover);
    font-weight: 600;
}

/* Voice Actors */
.voice-actors-container {
    margin-top: 1rem;
}

.voice-actor-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 0.8rem;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.voice-actor-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.voice-actor-item:last-child {
    margin-bottom: 0;
}

.voice-actor-item .btn-remove-voice-actor {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border: none;
    padding: 0.4rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(244, 67, 54, 0.3);
}

.voice-actor-item .btn-remove-voice-actor:hover {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* Small Buttons */
.btn-small {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.1));
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    color: var(--accent-soft-text);
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-small:hover {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-rgb), 0.2));
    border-color: rgba(var(--accent-rgb), 0.5);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

/* Loading States */
.loading-state {
    position: relative;
    min-height: 200px;
}

.loading-state .loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Skeleton Loader */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.skeleton-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.skeleton-image {
    width: 120px;
    height: 160px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-title {
    width: 70%;
    height: 20px;
}

.skeleton-text {
    width: 100%;
}

.skeleton-text.short {
    width: 60%;
}

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

/* Inline Loading for Buttons */
button.loading,
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

button.loading i.fa-spinner,
.btn.loading i.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Notifications bell */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    position: relative;
}

.nav-notify {
    position: relative;
}

.nav-notify[hidden] {
    display: none !important;
}

.nav-notify-btn {
    position: relative;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #fff);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-notify-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-notify-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-notify-badge[hidden] {
    display: none !important;
}

.nav-notify-panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    width: min(360px, calc(100vw - 1.5rem));
    max-height: min(420px, 70vh);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #151515;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    z-index: 80;
}

.nav-notify-panel[hidden] {
    display: none !important;
}

.nav-notify-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-notify-mark {
    border: 0;
    background: transparent;
    color: #7dd3fc;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.nav-notify-list {
    overflow: auto;
    flex: 1;
}

.nav-notify-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-notify-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.nav-notify-item.is-unread {
    background: rgba(var(--accent-rgb), 0.06);
}

.nav-notify-thumb {
    width: 42px;
    height: 58px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.nav-notify-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-notify-fallback {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #888;
}

.nav-notify-body {
    min-width: 0;
    flex: 1;
}

.nav-notify-body p {
    margin: 0 0 0.35rem;
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--text-primary, #eee);
}

.nav-notify-body time {
    font-size: 0.75rem;
    color: var(--text-secondary, #999);
}

.nav-notify-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-secondary, #999);
    font-size: 0.9rem;
}

.nav-notify-empty[hidden] {
    display: none !important;
}
.login-2fa-hint {
    margin: 0 0 0.85rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

#loginStep2fa[hidden],
#loginStepCredentials[hidden] {
    display: none !important;
}
